:root {
  --bg: #f5f7fb;
  --panel: #fff;
  --text: #162033;
  --muted: #69758a;
  --line: #dfe5ef;
  --blue: #2468d8;
  --red: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: grid; grid-template-rows: auto 1fr auto; gap: 18px; padding: 18px 14px; color: #e7eefc; background: #0f172a; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--blue); font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 3px; color: #9fb1d1; }
.nav { display: grid; align-content: start; gap: 8px; }
.nav button { min-height: 40px; border: 0; border-radius: 8px; color: #c6d3ea; background: transparent; text-align: left; padding: 0 12px; cursor: pointer; }
.nav button.active, .nav button:hover { color: #fff; background: rgba(255,255,255,.12); }
.session { display: grid; gap: 8px; padding: 12px; border-radius: 8px; color: #b8c7e2; background: rgba(255,255,255,.08); font-size: 13px; }
.session button { min-height: 32px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: #fff; background: transparent; cursor: pointer; }
.main { padding: 24px; min-width: 0; }
.login-panel { display: grid; place-items: center; min-height: calc(100vh - 48px); }
.login-card, .card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 8px 24px rgba(31,46,76,.08); }
.login-card { width: min(420px, 100%); padding: 24px; }
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.entry-grid { display: grid; gap: 10px; margin: 0 0 18px; }
.entry-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
}
.entry-card:hover { border-color: #b7c8e6; background: #eef5ff; }
.entry-card strong { font-size: 14px; }
.entry-card span { color: var(--muted); font-size: 12px; line-height: 1.5; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff; }
textarea { min-height: 76px; resize: vertical; }
.form { display: grid; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; }
.btn.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.btn.danger { color: var(--red); border-color: #f0bbb5; background: #fff0ee; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 24px; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { padding: 18px; }
.card h2 { margin: 0 0 14px; font-size: 16px; }
.card p { color: var(--muted); line-height: 1.7; }
.card span { color: var(--muted); }
.card strong { display: block; margin-top: 8px; font-size: 30px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1.35fr .9fr; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f8fafc; }
.tag { display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eaf1ff; color: var(--blue); }
.tag.red { color: var(--red); background: #fff0ee; }
.tag.green { color: #14885f; background: #e7f7f0; }
.notice { margin-bottom: 14px; padding: 12px; border: 1px solid #f1d89a; border-radius: 8px; color: #6d4b00; background: #fff8df; line-height: 1.6; }
.error { min-height: 20px; margin-top: 10px; color: var(--red); font-size: 13px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 14px; border-radius: 8px; color: #fff; background: #172033; box-shadow: 0 8px 24px rgba(31,46,76,.18); }
@media (max-width: 980px) {
  .app-shell, .grid.two, .stats { grid-template-columns: 1fr; }
}
