/* ============================== tokens ============================== */
:root {
  --bg: #f4f1e9;
  --bg-deep: #ebe5d8;
  --card: #fffdf8;
  --card-2: #faf7f0;
  --ink: #1c1a16;
  --ink-2: #47423a;
  --muted: #857d6f;
  --line: #e3dccd;
  --line-strong: #d3c9b6;
  --accent: #bf5230;
  --accent-hover: #a84426;
  --accent-soft: #f7e5dc;
  --teal: #2f6b5f;
  --teal-soft: #e0ece8;
  --gold: #a97f33;
  --gold-soft: #f6edd9;
  --danger: #a33a2c;
  --sidebar: #1a1815;
  --sidebar-2: #24211c;
  --sidebar-ink: #efe9dc;
  --sidebar-muted: #9b9284;
  --shadow-sm: 0 1px 2px rgba(43, 35, 22, .05), 0 4px 14px rgba(43, 35, 22, .04);
  --shadow-md: 0 2px 6px rgba(43, 35, 22, .06), 0 16px 40px rgba(43, 35, 22, .08);
  --shadow-lg: 0 24px 70px rgba(30, 24, 15, .22);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #121110;
  --bg-deep: #0c0b0a;
  --card: #1b1a17;
  --card-2: #232119;
  --ink: #f1ebdd;
  --ink-2: #cec5b5;
  --muted: #9a9182;
  --line: #2e2b25;
  --line-strong: #423e35;
  --accent: #de7a55;
  --accent-hover: #ee8b63;
  --accent-soft: #3a241c;
  --teal: #6fb3a3;
  --teal-soft: #1c2f2b;
  --gold: #d9b169;
  --gold-soft: #322a1b;
  --danger: #e07a6b;
  --sidebar: #0d0c0b;
  --sidebar-2: #1a1815;
  --sidebar-ink: #eee7d9;
  --sidebar-muted: #8d8577;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(191, 82, 48, .055), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(47, 107, 95, .05), transparent 60%);
}
::selection { background: var(--accent-soft); color: var(--accent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ============================== shell ============================== */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }

[hidden] { display: none !important; }

/* ------------------------------- auth gate ------------------------------- */
.auth-root {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 24px; background:
    radial-gradient(900px 520px at 76% -8%, var(--accent-soft), transparent 62%),
    radial-gradient(720px 460px at 8% 108%, var(--teal-soft), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(380px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 30px 28px 24px;
}
.auth-sub { color: var(--muted); font-size: 12px; margin: 6px 0 22px; letter-spacing: .04em; }
.auth-tabs { display: flex; gap: 4px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 18px; }
.auth-tabs button {
  flex: 1; appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 7px; cursor: pointer;
}
.auth-tabs button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-msg { min-height: 18px; font-size: 12.5px; margin-top: 12px; line-height: 1.6; }
.auth-msg.error { color: var(--danger); }
.auth-msg.ok { color: var(--teal); }
.auth-foot { color: var(--muted); font-size: 11.5px; line-height: 1.7; margin: 10px 0 0; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; display: flex; flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 26px 18px 20px;
  overflow-y: auto;
}
.brand { padding: 0 8px 26px; }
.brand-mark {
  font-family: var(--serif); font-size: 25px; letter-spacing: .04em; line-height: 1.1;
  display: flex; align-items: baseline; gap: 8px;
}
.brand-mark span { color: var(--accent); }
.brand-sub {
  margin-top: 7px; font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--sidebar-muted); font-family: var(--mono);
}
.nav-group { margin-bottom: 22px; }
.nav-label {
  padding: 0 10px 8px; font-size: 10px; letter-spacing: .18em;
  color: var(--sidebar-muted); text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 2px;
  border-radius: 9px; color: var(--sidebar-muted);
  font-size: 13.5px; border: 1px solid transparent;
  transition: background .16s, color .16s;
  text-decoration: none;
}
.nav-item:hover { background: var(--sidebar-2); color: var(--sidebar-ink); text-decoration: none; }
.nav-item.active { background: var(--sidebar-2); color: var(--sidebar-ink); border-color: rgba(255,255,255,.06); }
.nav-item.active .nav-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(191,82,48,.18); }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: #4a453c; flex: none; }
.nav-item svg { width: 16px; height: 16px; opacity: .8; flex: none; }
.nav-item .nav-count { margin-left: auto; font-size: 11px; font-family: var(--mono); color: var(--sidebar-muted); }
.side-foot { margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid rgba(255,255,255,.07); }
.side-foot p { margin: 0; font-size: 11px; color: var(--sidebar-muted); line-height: 1.7; }
.side-foot .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); margin-right: 6px; }

.main { min-width: 0; padding: 0 40px 90px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0 14px; margin-bottom: 8px;
  background: linear-gradient(to bottom, var(--bg) 72%, color-mix(in srgb, var(--bg) 0%, transparent));
  backdrop-filter: blur(6px);
}
.crumb { font-size: 12px; color: var(--muted); letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.crumb b { color: var(--ink); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.view { max-width: 1120px; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================== type ============================== */
.page-head { margin: 16px 0 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head h1 {
  font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.2;
  margin: 0 0 8px; letter-spacing: .01em;
}
.page-head .lede { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 62ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); opacity: .6; }
h2.sec-title { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0; letter-spacing: .01em; }
.sec-sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ============================== buttons ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  padding: 8px 15px; border-radius: 999px; font-size: 13px; line-height: 1.3;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #2e2a23; border-color: #2e2a23; }
html[data-theme="dark"] .btn-primary { background: var(--accent); border-color: var(--accent); color: #1a0e09; }
html[data-theme="dark"] .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff8f4; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-soft:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 7px 10px; }
.btn-ghost:hover { background: var(--card-2); color: var(--ink); border-color: var(--line); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger:hover { background: rgba(163, 58, 44, .08); border-color: rgba(163, 58, 44, .25); }
.btn svg { width: 15px; height: 15px; }

/* ============================== cards ============================== */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.card-flat { box-shadow: none; }
.card-pad-lg { padding: 26px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }

/* ============================== forms ============================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label {
  font-size: 11.5px; letter-spacing: .06em; color: var(--muted); font-weight: 500;
}
.input, .textarea, .select {
  width: 100%; background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 12px; font-size: 13.5px; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .75; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }

/* ============================== badges / tags ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.badge-teal { background: var(--teal-soft); border-color: transparent; color: var(--teal); }
.badge-gold { background: var(--gold-soft); border-color: transparent; color: var(--gold); }
.badge-danger { background: rgba(163,58,44,.1); border-color: transparent; color: var(--danger); }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: var(--card-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 11px; margin: 2px 4px 2px 0;
}
.tag::before { content: "#"; opacity: .45; margin-right: 1px; }

/* ============================== stats ============================== */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -22px; bottom: -30px;
  width: 70px; height: 70px; border-radius: 50%; background: var(--accent-soft); opacity: .55;
}
.stat .k { font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.stat .v { font-family: var(--serif); font-size: 27px; line-height: 1.25; margin-top: 2px; font-weight: 600; }
.stat .v small { font-family: var(--sans); font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.stat .n { font-size: 11px; color: var(--muted); position: relative; z-index: 1; }

/* ============================== home ============================== */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line); border-radius: 22px;
  padding: 30px 32px; box-shadow: var(--shadow-sm);
}
.hero::before {
  content: ""; position: absolute; right: -90px; top: -120px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 68%);
}
.hero::after {
  content: ""; position: absolute; right: 60px; bottom: -130px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, var(--teal-soft), transparent 70%);
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 { font-family: var(--serif); font-size: 32px; margin: 0 0 6px; font-weight: 600; }
.hero .date-line { color: var(--muted); font-size: 12.5px; letter-spacing: .04em; }
.quick-capture { margin-top: 22px; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.quick-capture .textarea { min-height: 52px; background: var(--card); }
.quick-input { flex: 1; min-width: 260px; }
.mood-row { display: flex; gap: 4px; }
.mood-btn {
  border: 1px solid transparent; background: transparent; border-radius: 10px;
  width: 38px; height: 38px; font-size: 19px; line-height: 1; opacity: .45;
  transition: transform .12s, opacity .12s, background .12s, border-color .12s;
}
.mood-btn:hover { opacity: .9; transform: translateY(-2px); }
.mood-btn.active { opacity: 1; background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--card); border: 1.5px solid var(--line-strong);
}
.tl-item.mood::before { border-color: var(--accent); }
.tl-item.interview::before { border-color: var(--teal); }
.tl-item.xhs::before { border-color: var(--gold); }
.tl-item.cat::before { border-color: #8a6bb1; }
.tl-item.skill::before { border-color: #4a7fa8; }
.tl-time { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.tl-title { font-size: 13.5px; margin: 2px 0 2px; font-weight: 500; }
.tl-text { font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.mini-item:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-item:first-child { padding-top: 0; }
.mini-body { min-width: 0; flex: 1; }
.mini-title { font-size: 13px; font-weight: 500; }
.mini-sub { font-size: 11.5px; color: var(--muted); }

/* ============================== lists / records ============================== */
.record-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 17px; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.record-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.record-head { display: flex; align-items: flex-start; gap: 10px; }
.record-title { font-size: 14px; font-weight: 600; line-height: 1.5; }
.record-title a { color: inherit; }
.record-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.record-body { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.record-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.record-card:hover .record-actions { opacity: 1; }
.day-group { margin-bottom: 26px; }
.day-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.day-head .d { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.day-head .line { flex: 1; height: 1px; background: var(--line); }

.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--r);
  padding: 34px 20px; text-align: center; color: var(--muted); background: var(--card-2);
}
.empty strong { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; font-size: 14px; }
.empty p { margin: 0 0 14px; font-size: 12.5px; }

/* ============================== tabs / segmented ============================== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; padding: 9px 14px 11px; font-size: 13px;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.tab .c { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-left: 5px; }
.segmented { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; padding: 5px 13px; border-radius: 999px;
  font-size: 12.5px; color: var(--muted);
}
.segmented button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }

/* ============================== AI panel ============================== */
.ai-shell {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.ai-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, var(--accent-soft), transparent 60%);
}
.ai-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ai-spark {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 11px;
}
.ai-body { padding: 16px; }
.ai-output {
  white-space: pre-wrap; word-break: break-word;
  font-size: 13.5px; line-height: 1.78; color: var(--ink-2);
  min-height: 40px; max-height: 52vh; overflow-y: auto;
  padding: 2px 2px 8px;
}
.ai-output:empty::before { content: "选择上面的动作，AI 会基于当前记录开始工作。"; color: var(--muted); }
.ai-output strong { color: var(--ink); }
.ai-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.ai-chip {
  border: 1px solid var(--line); background: var(--card-2); color: var(--ink-2);
  border-radius: 999px; padding: 5px 12px; font-size: 12px;
  transition: all .15s;
}
.ai-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ai-chip:disabled { opacity: .45; }
.ai-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 10px 16px; background: var(--card-2); }
.ai-hint { font-size: 11px; color: var(--muted); }
.ai-cursor::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============================== mood journal ============================== */
.mood-scale { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-option {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 54px; padding: 7px 0 5px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card-2); font-size: 18px;
  color: var(--muted); transition: all .15s;
}
.mood-option span { font-size: 10px; }
.mood-option:hover { border-color: var(--line-strong); }
.mood-option.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.mood-option.active span { color: var(--accent); }
.journal-card { border-left: 3px solid var(--line); }
.journal-card[data-level="low"] { border-left-color: #a35b4a; }
.journal-card[data-level="mid"] { border-left-color: var(--gold); }
.journal-card[data-level="high"] { border-left-color: var(--teal); }
.mood-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }

/* ============================== skills ============================== */
.skill-card { display: flex; flex-direction: column; gap: 10px; }
.skill-top { display: flex; align-items: flex-start; gap: 12px; }
.skill-score {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 19px; flex: none;
  background: var(--teal-soft); color: var(--teal); border: 1px solid transparent;
}
.skill-score.warn { background: var(--gold-soft); color: var(--gold); }
.skill-score.bad { background: rgba(163,58,44,.1); color: var(--danger); }
.skill-name { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.skill-path { font-size: 11px; color: var(--muted); font-family: var(--mono); word-break: break-all; }
.criteria { display: grid; gap: 10px; }
.criterion { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); }
.criterion .idx { font-family: var(--mono); font-size: 10px; color: var(--accent); padding-top: 3px; }
.criterion b { display: block; font-size: 12.5px; margin-bottom: 1px; }
.criterion p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.accordion { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: transparent; border: 0; padding: 13px 16px; font-size: 13px; text-align: left;
}
.acc-btn:hover { background: var(--card-2); }
.acc-btn .chev { transition: transform .2s; color: var(--muted); }
.acc-item.open .chev { transform: rotate(90deg); }
.acc-body { display: none; padding: 0 16px 16px; font-size: 12.5px; color: var(--ink-2); line-height: 1.8; }
.acc-item.open .acc-body { display: block; }
.acc-body ul { margin: 4px 0; padding-left: 18px; }
.acc-body code { font-family: var(--mono); font-size: 11.5px; background: var(--card-2); padding: 1px 5px; border-radius: 4px; }

/* ============================== xhs ============================== */
.content-card { display: flex; flex-direction: column; gap: 8px; }
.content-card .title { font-size: 14px; font-weight: 600; line-height: 1.5; }
.content-card .preview { font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 5px; background: var(--muted); }
.status-dot.draft { background: var(--gold); }
.status-dot.ready { background: var(--teal); }
.status-dot.published { background: var(--accent); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--card-2); }
.num { font-family: var(--mono); }

/* ============================== cats ============================== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.cat-photo { height: 140px; background: var(--card-2); position: relative; overflow: hidden; }
.cat-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-photo .ph { display: grid; place-items: center; height: 100%; font-size: 34px; opacity: .5; }
.cat-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-name { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.3; }
.cat-loc { font-size: 11.5px; color: var(--muted); }
.cat-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.cat-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--line); }
.alert-bar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: var(--r); background: var(--gold-soft); color: var(--gold); font-size: 12.5px; border: 1px solid transparent; }
.alert-bar.bad { background: rgba(163,58,44,.09); color: var(--danger); }

/* ============================== modal ============================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(20, 17, 12, .42);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 22px;
  animation: fade .15s ease;
}
.modal {
  width: min(720px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); animation: pop .18s ease;
}
.modal.wide { width: min(900px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-head h3 { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); }
.close-x { border: 0; background: var(--card-2); width: 30px; height: 30px; border-radius: 50%; color: var(--muted); font-size: 16px; line-height: 1; }
.close-x:hover { background: var(--line); color: var(--ink); }

.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: var(--bg); font-size: 12.5px;
  padding: 9px 16px; border-radius: 999px; box-shadow: var(--shadow-md);
  animation: toastIn .2s ease;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ============================== misc ============================== */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-2); }
.note-box { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.spin { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spin.dark { border-color: var(--line-strong); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 1080px) {
  .main { padding: 0 26px 80px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row;
    align-items: center; padding: 10px 14px; gap: 10px; overflow-x: auto;
  }
  .brand { padding: 0 10px 0 0; flex: none; }
  .brand-mark { font-size: 18px; }
  .brand-sub { display: none; }
  .nav-group { display: flex; gap: 2px; margin: 0; }
  .nav-label, .nav-count, .side-foot { display: none; }
  .nav-item { padding: 7px 10px; font-size: 12.5px; white-space: nowrap; }
  .main { padding: 0 16px 70px; }
  .topbar { padding: 14px 0 10px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 26px; }
  .page-head h1 { font-size: 27px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-actions { opacity: 1; }
}
