:root {
  --bg: #060a08;
  --bg-2: #0a100d;
  --panel: #0d1511;
  --panel-2: #111b16;
  --panel-3: #16231c;
  --line: rgba(198, 168, 98, 0.16);
  --line-strong: rgba(198, 168, 98, 0.32);
  --gold: #c6a862;
  --gold-2: #e6d09a;
  --gold-dim: rgba(198, 168, 98, 0.12);
  --green: #1d3d2e;
  --green-2: #2e6249;
  --text: #e9e5d9;
  --muted: #8e9b91;
  --faint: #5e6b62;
  --danger: #cf7667;
  --danger-dim: rgba(207, 118, 103, 0.12);
  --ok: #6fbf9a;
  --ok-dim: rgba(111, 191, 154, 0.12);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --mono: "Cascadia Code", "Consolas", "SFMono-Regular", monospace;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 75% -10%, rgba(48, 103, 77, 0.20), transparent 65%),
    radial-gradient(ellipse 55% 45% at 10% 105%, rgba(198, 168, 98, 0.06), transparent 70%),
    linear-gradient(rgba(198, 168, 98, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 168, 98, 0.028) 1px, transparent 1px);
  background-size: auto, auto, 52px 52px, 52px 52px;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 100%);
}
::selection { background: rgba(198, 168, 98, 0.25); color: #fff; }
a { color: var(--gold-2); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}
.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(198, 168, 98, 0.18); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(198, 168, 98, 0.32); }

/* ---------- Boot ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(ellipse at center, #0d1712 0%, #050806 70%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.boot.hidden { opacity: 0; visibility: hidden; }
.boot-emblem {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 38px;
  box-shadow: 0 0 40px rgba(198, 168, 98, 0.16), inset 0 0 24px rgba(198, 168, 98, 0.06);
  animation: breathe 2.4s ease-in-out infinite;
}
.boot-title {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.36em;
  color: var(--gold-2);
  padding-left: 0.36em;
}
.boot-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 34px rgba(198, 168, 98, 0.12), inset 0 0 22px rgba(198, 168, 98, 0.05); }
  50% { box-shadow: 0 0 54px rgba(198, 168, 98, 0.24), inset 0 0 30px rgba(198, 168, 98, 0.10); }
}

/* ---------- Auth ---------- */

.auth {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.88fr);
  overflow: hidden;
}

/* 世界树画布：铺满整屏，作为登录页背景 */
.auth-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.auth-canvas {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.auth-has-tree .auth-canvas { opacity: 1; }

/* 左侧压暗，保证标题可读；右侧留亮给出画的树冠 */
.auth-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(96deg, rgba(4, 8, 6, 0.92) 0%, rgba(4, 8, 6, 0.66) 22%, rgba(4, 8, 6, 0.10) 48%, rgba(4, 8, 6, 0.28) 72%, rgba(4, 8, 6, 0.72) 100%),
    radial-gradient(ellipse 60% 50% at 50% 108%, rgba(198, 168, 98, 0.10), transparent 70%);
}

.auth-brand {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px clamp(26px, 4.6vw, 68px) 38px;
}
.auth-top { display: flex; align-items: center; gap: 14px; }
.auth-emblem {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 25px;
  box-shadow: inset 0 0 18px rgba(198, 168, 98, 0.06);
  background: rgba(6, 10, 8, 0.5);
}
.auth-top-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
}
.auth-top-label.dim { color: var(--faint); letter-spacing: 0.12em; }
.auth-center { max-width: 520px; position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; }
.auth-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 18px;
}
.auth-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 78px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: 0.13em;
  color: var(--text);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.auth-title span { color: var(--gold-2); }
.auth-desc {
  margin: 24px 0 0;
  max-width: 420px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.auth-quote {
  margin-top: 38px;
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.8;
}
.auth-quote small {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--faint);
}
.auth-bottom {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--faint);
}
.auth-bottom .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.auth-tree-status { transition: color 0.6s ease; }
.auth-blooming .auth-tree-status { color: var(--gold-2); }

.auth-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 44px clamp(24px, 4.4vw, 72px);
}
.auth-card {
  position: relative;
  width: min(412px, 100%);
  padding: 34px 32px 28px;
  border: 1px solid rgba(198, 168, 98, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 23, 19, 0.82), rgba(6, 10, 8, 0.9));
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(230, 208, 154, 0.07);
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 208, 154, 0.5), transparent);
}
.auth-card h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.auth-card .sub { margin: 0 0 30px; color: var(--muted); font-size: 13px; }
.auth-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(207, 118, 103, 0.25);
  border-radius: 8px;
  background: var(--danger-dim);
  color: #e7a79b;
  font-size: 12px;
}
.auth-note {
  margin-top: 20px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.8;
  text-wrap: pretty;
}
.auth-switch { margin-top: 18px; color: var(--muted); font-size: 12px; }
.auth-switch button {
  border: 0;
  background: none;
  color: var(--gold-2);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 登录成功：卡片退场 + 金光闪 */
.auth-card-leaving {
  animation: authCardLeave 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes authCardLeave {
  to { opacity: 0; transform: translateY(-12px) scale(0.985); filter: blur(3px); }
}
.auth-flash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: radial-gradient(circle at 33% 60%, rgba(255, 243, 214, 0.85), rgba(255, 226, 168, 0.3) 42%, transparent 72%);
  animation: authFlash 0.42s ease-out forwards;
}
@keyframes authFlash {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Shell ---------- */

.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(20, 34, 26, 0.55), rgba(7, 11, 9, 0.92) 42%),
    var(--bg-2);
  backdrop-filter: blur(16px);
  transition: transform 0.25s ease;
}
.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px 24px; }
.brand-emblem {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 22px;
  box-shadow: inset 0 0 18px rgba(198, 168, 98, 0.05);
}
.brand-name {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.22em;
  color: var(--text);
  line-height: 1.2;
}
.brand-sub {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--faint);
  white-space: nowrap;
}
.nav-label {
  padding: 0 12px 10px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--faint);
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: 0.16s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.8; }
.nav-item:hover { color: var(--text); background: rgba(198, 168, 98, 0.05); }
.nav-item.active {
  color: var(--gold-2);
  background: linear-gradient(90deg, rgba(198, 168, 98, 0.12), rgba(198, 168, 98, 0.035));
  border-color: rgba(198, 168, 98, 0.16);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  width: 2px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--gold);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(198, 168, 98, 0.5);
}
.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: rgba(198, 168, 98, 0.12);
  color: var(--gold-2);
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
}
.nav-badge {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.sidebar-foot { margin-top: auto; padding-top: 22px; }
.system-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}
.system-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 9px; color: var(--faint); }
.system-line + .system-line { margin-top: 7px; }
.system-line strong { color: var(--muted); font-weight: 400; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(111, 191, 154, 0.7); display: inline-block; }
.status-dot.offline { background: var(--gold); box-shadow: 0 0 8px rgba(198, 168, 98, 0.5); }
.sidebar-version { margin-top: 12px; text-align: center; font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em; color: var(--faint); }

.main {
  margin-left: 252px;
  width: calc(100% - 252px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 8, 0.78);
  backdrop-filter: blur(18px);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--faint); font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; }
.breadcrumb b { color: var(--muted); font-weight: 400; }
.breadcrumb .sep { opacity: 0.5; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.status-pill.online { border-color: rgba(111, 191, 154, 0.22); color: var(--ok); background: var(--ok-dim); }
.status-pill.offline { border-color: rgba(198, 168, 98, 0.22); color: var(--gold); background: var(--gold-dim); }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.user-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 14px;
}
.user-name { font-size: 12px; color: var(--text); line-height: 1.2; }
.user-role { font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; color: var(--faint); }
.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.16s ease;
}
.icon-btn:hover { color: var(--gold-2); border-color: var(--line-strong); background: var(--gold-dim); }
.icon-btn svg { width: 15px; height: 15px; }
.mobile-toggle { display: none; }

.content { width: 100%; max-width: 1340px; margin: 0 auto; padding: 30px 32px 64px; }

/* ---------- Shared ---------- */

.eyebrow {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.24em;
  color: var(--gold);
}
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(22, 35, 28, 0.72), rgba(10, 16, 13, 0.86));
  box-shadow: var(--shadow);
}
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(198, 168, 98, 0.28), transparent);
  pointer-events: none;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 0; }
.card-head h2, .card-head h3 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: 0.04em; }
.card-head h2 { font-size: 20px; }
.card-head h3 { font-size: 16px; }
.card-body { padding: 16px 22px 22px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-head h1 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: 0.04em; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--gold-2);
  font-size: 12px;
  cursor: pointer;
  transition: 0.16s ease;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: var(--gold-dim); border-color: var(--gold); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #16130b; font-weight: 600; }
.btn-primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--gold-2); }
.btn-danger { border-color: rgba(207, 118, 103, 0.25); color: var(--danger); }
.btn-danger:hover { background: var(--danger-dim); border-color: var(--danger); }
.btn-sm { min-height: 28px; padding: 4px 10px; font-size: 11px; }
.btn-block { width: 100%; }
.empty {
  padding: 26px 8px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
  line-height: 1.9;
}
.link-btn { border: 0; background: none; color: var(--gold); font-size: 11px; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- Forms ---------- */

.field { margin-bottom: 15px; }
.field label, .form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 8, 6, 0.55);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input::placeholder, .textarea::placeholder { color: #58645b; }
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(198, 168, 98, 0.55);
  box-shadow: 0 0 0 3px rgba(198, 168, 98, 0.07);
  outline: none;
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.7; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.form-hint { margin-top: 8px; color: var(--faint); font-size: 10px; line-height: 1.7; }
.form-card { padding: 24px; }
.form-section + .form-section { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.form-section-title { margin: 0 0 4px; font-family: var(--serif); font-size: 17px; font-weight: 500; }
.form-section-desc { margin: 0 0 16px; color: var(--faint); font-size: 11px; }

/* ---------- Dashboard ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 36px 38px 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 70% 90% at 90% 10%, rgba(45, 98, 73, 0.18), transparent 65%),
    linear-gradient(135deg, rgba(198, 168, 98, 0.055), rgba(10, 16, 13, 0.5) 45%, rgba(10, 16, 13, 0.9));
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 20% 0%, rgba(198, 168, 98, 0.08), transparent 55%);
}
.hero-watermark {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: 240px;
  line-height: 1;
  color: rgba(198, 168, 98, 0.035);
  pointer-events: none;
  user-select: none;
}
.hero-kicker { position: relative; font-family: var(--mono); font-size: 9px; letter-spacing: 0.28em; color: var(--gold); }
.hero h1 { position: relative; margin: 16px 0 10px; font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); font-weight: 500; line-height: 1.25; letter-spacing: 0.035em; }
.hero-copy { position: relative; margin: 0; max-width: 560px; color: var(--muted); font-size: 13px; }
.hero-meta { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 24px; color: var(--faint); font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.stat {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 21, 17, 0.55);
}
.stat-label { font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em; color: var(--faint); }
.stat-value { margin-top: 5px; font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--gold-2); }
.stat-value small { margin-left: 5px; font-family: var(--sans); font-size: 10px; color: var(--faint); }
.usage-card { margin-top: 0; }
.usage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 4px 20px 18px; }
.usage-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 12, 9, 0.25); }
.usage-item span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--faint); }
.usage-item strong { display: block; margin-top: 6px; font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--gold-2); }
.usage-item small { display: block; margin-top: 4px; font-family: var(--mono); font-size: 8px; color: var(--faint); }

.usage-summary-card, .usage-price-card, .usage-recent-card { margin-top: 18px; }
.usage-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 4px 20px 8px; }
.usage-summary-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 12, 9, 0.25); }
.usage-summary-item span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--faint); }
.usage-summary-item strong { display: block; margin-top: 6px; font-family: var(--serif); font-size: 24px; font-weight: 500; color: var(--gold-2); }
.usage-summary-item strong small { font-family: var(--mono); font-size: 9px; color: var(--faint); }
.usage-summary-item em { display: block; margin-top: 4px; font-family: var(--mono); font-size: 9px; font-style: normal; color: var(--muted); }
.usage-period { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; color: var(--green); border: 1px solid rgba(105, 190, 144, 0.35); border-radius: 999px; padding: 4px 8px; }
.usage-period.peak { color: var(--gold-2); border-color: rgba(201, 166, 100, 0.35); }
.usage-note { padding: 8px 20px 18px; font-family: var(--mono); font-size: 9px; line-height: 1.7; color: var(--faint); }
.price-table { padding: 4px 20px 8px; }
.price-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.price-row:last-child { border-bottom: 0; }
.price-row strong { font-weight: 500; color: var(--gold-2); }
.price-head { font-size: 8px; letter-spacing: 0.12em; color: var(--faint); text-transform: uppercase; }
.usage-table-wrap { overflow-x: auto; padding: 0 20px 18px; }
.usage-table { width: 100%; border-collapse: collapse; min-width: 680px; font-family: var(--mono); font-size: 10px; }
.usage-table th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; font-size: 8px; letter-spacing: 0.1em; color: var(--faint); }
.usage-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.usage-table tr:last-child td { border-bottom: 0; }
.dash-grid { display: grid; grid-template-columns: 1.18fr 0.82fr; gap: 14px; margin-top: 14px; }
.dash-grid.lower { grid-template-columns: 1fr 1fr; }
.brief-card .card-body { padding-top: 14px; }
.brief-content { color: #d9d4c7; font-size: 13px; line-height: 1.9; }
.brief-content strong { color: var(--gold-2); font-weight: 500; }
.brief-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; }
.mini-list { display: flex; flex-direction: column; gap: 2px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(198, 168, 98, 0.07); }
.mini-row:last-child { border-bottom: 0; }
.mini-row .check { flex: 0 0 auto; }
.mini-main { min-width: 0; flex: 1; }
.mini-title { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta { margin-top: 2px; color: var(--faint); font-family: var(--mono); font-size: 8px; }
.due { font-family: var(--mono); font-size: 9px; color: var(--muted); white-space: nowrap; }
.due.today { color: var(--gold); }
.due.overdue { color: var(--danger); }
.card-link { margin-top: 12px; display: flex; justify-content: flex-end; }
.note-row { padding: 10px 0; border-bottom: 1px solid rgba(198, 168, 98, 0.07); cursor: pointer; }
.note-row:last-child { border-bottom: 0; }
.note-row:hover .note-row-title { color: var(--gold-2); }
.note-row-title { color: var(--text); font-size: 12px; transition: 0.16s ease; }
.note-row-meta { margin-top: 3px; color: var(--faint); font-family: var(--mono); font-size: 8px; }
.memory-quote { padding: 10px 0 10px 14px; border-left: 1px solid var(--line-strong); color: #cfc9ba; font-family: var(--serif); font-size: 12px; line-height: 1.8; }
.memory-quote + .memory-quote { margin-top: 6px; }

/* ---------- Chat ---------- */

.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 14px; height: calc(100vh - 158px); min-height: 540px; }
.chat-panel { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: rgba(7, 12, 9, 0.35); }
.chat-head .brand-emblem { width: 34px; height: 34px; flex-basis: 34px; font-size: 18px; }
.chat-head-title { font-family: var(--serif); font-size: 15px; letter-spacing: 0.06em; }
.chat-head-sub { margin-top: 2px; color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; }
.chat-head .status-pill { margin-left: auto; }
.messages { flex: 1; overflow-y: auto; padding: 22px 22px 8px; scroll-behavior: smooth; }
.chat-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; text-align: center; padding: 20px 0 30px; }
.chat-welcome .brand-emblem { width: 58px; height: 58px; flex-basis: 58px; font-size: 28px; margin-bottom: 14px; }
.chat-welcome h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: 0.08em; }
.chat-welcome p { margin: 8px 0 20px; color: var(--muted); font-size: 12px; }
.prompt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; max-width: 460px; }
.prompt-chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 99px; background: rgba(198, 168, 98, 0.03); color: var(--muted); font-size: 11px; cursor: pointer; transition: 0.16s ease; }
.prompt-chip:hover { color: var(--gold-2); border-color: var(--line-strong); background: var(--gold-dim); }
.msg { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; animation: msg-in 0.25s ease both; }
.msg.user { justify-content: flex-end; }
.msg .avatar { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-2); font-family: var(--serif); font-size: 12px; background: var(--gold-dim); }
.msg.user .avatar { order: 2; color: var(--text); background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.12); }
.msg-body { max-width: min(78%, 680px); }
.msg.user .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.bubble { padding: 11px 14px; border: 1px solid var(--line); border-radius: 3px 12px 12px 12px; background: rgba(18, 30, 24, 0.72); color: #ded9cc; font-size: 13px; line-height: 1.8; word-break: break-word; }
.msg.user .bubble { border-color: rgba(198, 168, 98, 0.22); border-radius: 12px 3px 12px 12px; background: linear-gradient(135deg, rgba(198, 168, 98, 0.13), rgba(198, 168, 98, 0.05)); color: #eee6d2; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble code { padding: 1px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.28); color: var(--gold-2); font-family: var(--mono); font-size: 0.9em; }
.bubble pre { margin: 8px 0; padding: 10px 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.28); }
.bubble pre code { padding: 0; background: none; color: #d9d4c7; font-size: 11px; line-height: 1.6; }
.bubble .li { display: block; padding-left: 4px; }
.bubble strong { color: var(--gold-2); font-weight: 500; }
.msg-meta { margin-top: 5px; color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.04em; }
.mode-tag { margin-left: 6px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font-size: 7px; }
.typing { display: inline-flex; gap: 4px; padding: 13px 15px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: 0.5; animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.chat-form { display: flex; align-items: flex-end; gap: 9px; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(7, 12, 9, 0.45); }
.chat-input { flex: 1; min-height: 40px; max-height: 150px; resize: none; border: 1px solid var(--line); border-radius: 10px; background: rgba(4, 8, 6, 0.55); color: var(--text); padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.chat-input:focus { border-color: rgba(198, 168, 98, 0.5); outline: none; box-shadow: 0 0 0 3px rgba(198, 168, 98, 0.06); }
.send-btn { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 10px; background: var(--gold); color: #17130b; cursor: pointer; transition: 0.16s ease; }
.send-btn:hover { background: var(--gold-2); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-btn svg { width: 17px; height: 17px; }
.chat-hint { padding: 0 16px 10px; color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.04em; background: rgba(7, 12, 9, 0.45); }
.chat-side { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.side-card { padding: 17px; }
.side-card h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 14px; font-weight: 500; color: var(--gold-2); letter-spacing: 0.06em; }
.side-memory { padding: 7px 0 7px 10px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; line-height: 1.7; }
.side-memory + .side-memory { margin-top: 3px; }
.side-task { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(198, 168, 98, 0.07); font-size: 11px; }
.side-task:last-child { border-bottom: 0; }
.side-task .due { margin-left: auto; font-size: 8px; }
.side-subhead { margin: 12px 0 2px; padding-top: 9px; border-top: 1px solid rgba(198, 168, 98, 0.12); color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- Voice ---------- */

.voice-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--faint); font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; cursor: pointer; transition: 0.16s ease; }
.voice-chip:hover { color: var(--gold-2); border-color: var(--line-strong); }
.voice-chip.on { color: var(--gold); border-color: rgba(198, 168, 98, 0.35); background: var(--gold-dim); }
.voice-chip svg { width: 13px; height: 13px; }
.chat-head .voice-chip { margin-left: auto; }
.chat-head .voice-chip + .status-pill { margin-left: 8px; }

.mic-btn { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(4, 8, 6, 0.4); color: var(--gold-2); cursor: pointer; transition: 0.16s ease; }
.mic-btn:hover { border-color: rgba(198, 168, 98, 0.5); background: var(--gold-dim); }
.mic-btn svg { width: 18px; height: 18px; }
.mic-btn.listening { border-color: rgba(207, 118, 103, 0.75); color: var(--danger); background: rgba(207, 118, 103, 0.12); animation: mic-pulse 1.5s ease-out infinite; }
@keyframes mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(207, 118, 103, 0.34); }
  70% { box-shadow: 0 0 0 9px rgba(207, 118, 103, 0); }
  100% { box-shadow: 0 0 0 0 rgba(207, 118, 103, 0); }
}

.voice-bar { display: flex; align-items: center; gap: 9px; padding: 8px 16px; border-top: 1px solid var(--line); background: rgba(198, 168, 98, 0.06); color: var(--muted); font-size: 11px; }
.voice-bar[hidden] { display: none; }
.voice-bar .voice-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--gold); animation: voice-blink 1.4s ease-in-out infinite; }
.voice-bar.listening .voice-dot { background: var(--danger); }
.voice-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-stop { flex: 0 0 auto; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 99px; background: transparent; color: var(--muted); font-family: var(--sans); font-size: 10px; cursor: pointer; transition: 0.16s ease; }
.voice-stop:hover { color: var(--gold-2); border-color: rgba(198, 168, 98, 0.45); }
@keyframes voice-blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.speak-btn { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; padding: 0; border: 0; background: none; color: var(--faint); cursor: pointer; vertical-align: -3px; transition: 0.16s ease; }
.speak-btn:hover { color: var(--gold-2); }
.speak-btn svg { width: 12px; height: 12px; }
.msg.speaking .bubble { border-color: rgba(198, 168, 98, 0.5); box-shadow: 0 0 0 1px rgba(198, 168, 98, 0.12), 0 0 24px rgba(198, 168, 98, 0.08); }
.msg.speaking .speak-btn { color: var(--gold); }

.switch-list { margin: 4px 0 16px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(198, 168, 98, 0.07); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-row strong { color: var(--text); font-size: 12px; font-weight: 500; }
.switch-row em { font-style: normal; color: var(--faint); font-size: 10px; line-height: 1.6; }
.switch-row input[type="checkbox"] { position: relative; flex: 0 0 38px; width: 38px; height: 20px; margin: 0; appearance: none; -webkit-appearance: none; border: 1px solid var(--line-strong); border-radius: 99px; background: rgba(4, 8, 6, 0.6); cursor: pointer; transition: 0.18s ease; }
.switch-row input[type="checkbox"]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--faint); transition: 0.18s ease; }
.switch-row input[type="checkbox"]:checked { border-color: rgba(198, 168, 98, 0.55); background: var(--gold-dim); }
.switch-row input[type="checkbox"]:checked::after { left: 20px; background: var(--gold-2); }

.preset-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.preset-chip { padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; background: rgba(198, 168, 98, 0.03); color: var(--muted); font-size: 10px; cursor: pointer; transition: 0.16s ease; }
.preset-chip:hover { color: var(--gold-2); border-color: var(--line-strong); }
.preset-chip.active { color: var(--gold-2); border-color: rgba(198, 168, 98, 0.45); background: var(--gold-dim); }

.engine-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 6px; }
.engine-chip { padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px; background: rgba(198, 168, 98, 0.03); color: var(--muted); font-family: var(--sans); font-size: 11px; letter-spacing: 0.02em; cursor: pointer; transition: 0.16s ease; }
.engine-chip:hover { color: var(--gold-2); border-color: var(--line-strong); }
.engine-chip.active { color: #10130f; border-color: rgba(198, 168, 98, 0.7); background: linear-gradient(180deg, var(--gold-2), var(--gold)); font-weight: 600; }
#tts-status { display: block; margin: 2px 0 10px; line-height: 1.6; }
#tts-status:empty { display: none; }

.field-note { color: var(--faint); font-family: var(--mono); font-size: 9px; font-weight: 400; letter-spacing: 0.04em; }
.range-value { color: var(--gold-2); font-family: var(--mono); font-size: 9px; font-weight: 400; }
#voice-card input[type="range"] { width: 100%; height: 22px; margin: 2px 0 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
#voice-card input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 99px; background: linear-gradient(90deg, rgba(198, 168, 98, 0.55), rgba(198, 168, 98, 0.12)); }
#voice-card input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5px; border: 1px solid rgba(0, 0, 0, 0.45); border-radius: 50%; background: var(--gold-2); }
#voice-card input[type="range"]::-moz-range-track { height: 3px; border-radius: 99px; background: rgba(198, 168, 98, 0.3); }
#voice-card input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 1px solid rgba(0, 0, 0, 0.45); border-radius: 50%; background: var(--gold-2); }

/* ---------- Tasks ---------- */

.task-groups { display: flex; flex-direction: column; gap: 18px; }
.task-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.task-group-head h2 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 500; letter-spacing: 0.05em; }
.task-group-head .count { color: var(--faint); font-family: var(--mono); font-size: 9px; }
.task-group-head .line { flex: 1; height: 1px; background: var(--line); }
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 21, 17, 0.45);
  transition: 0.16s ease;
}
.task-row + .task-row { margin-top: 7px; }
.task-row:hover { border-color: rgba(198, 168, 98, 0.26); background: rgba(18, 30, 24, 0.55); }
.task-row.done { opacity: 0.5; }
.task-row.done .task-title { text-decoration: line-through; }
.check {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(198, 168, 98, 0.42);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition: 0.16s ease;
}
.check:hover { background: var(--gold-dim); border-color: var(--gold); }
.check svg { width: 11px; height: 11px; }
.task-row.done .check { background: var(--gold); border-color: var(--gold); color: #17130b; }
.task-main { min-width: 0; flex: 1; }
.task-title { color: var(--text); font-size: 13px; }
.task-detail { margin-top: 2px; overflow: hidden; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-side { display: flex; align-items: center; gap: 8px; }
.priority { padding: 2px 6px; border-radius: 99px; border: 1px solid var(--line); color: var(--faint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.06em; }
.priority.high { border-color: rgba(207, 118, 103, 0.3); color: var(--danger); background: var(--danger-dim); }
.priority.low { opacity: 0.65; }
.task-actions { display: flex; gap: 3px; opacity: 0; transition: 0.16s ease; }
.task-row:hover .task-actions { opacity: 1; }
.task-actions .icon-btn { width: 26px; height: 26px; border-color: transparent; }
.task-actions .icon-btn:hover { border-color: var(--line); }
.task-actions .icon-btn svg { width: 13px; height: 13px; }
.completed-block { margin-top: 26px; }
.completed-block summary { cursor: pointer; color: var(--faint); font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; }
.completed-block .task-row { margin-top: 7px; }

/* ---------- Library ---------- */

.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.note-card { display: flex; flex-direction: column; min-height: 150px; padding: 18px; cursor: pointer; transition: 0.18s ease; }
.note-card:hover { transform: translateY(-2px); border-color: rgba(198, 168, 98, 0.3); }
.note-card-top { display: flex; align-items: flex-start; gap: 8px; }
.note-card h3 { margin: 0; flex: 1; font-family: var(--serif); font-size: 15px; font-weight: 500; line-height: 1.45; }
.note-card .note-del { opacity: 0; }
.note-card:hover .note-del { opacity: 1; }
.note-card p { display: -webkit-box; margin: 9px 0 12px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.75; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.note-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.tag { padding: 2px 6px; border: 1px solid var(--line); border-radius: 99px; color: var(--faint); font-family: var(--mono); font-size: 7px; }
.note-date { margin-top: 10px; color: var(--faint); font-family: var(--mono); font-size: 8px; }
.note-empty { grid-column: 1 / -1; padding: 48px 20px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--faint); font-size: 12px; }

/* ---------- Memory ---------- */

.memory-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.memory-intro { padding: 22px; }
.memory-intro h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.memory-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.memory-add { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.memory-add .input { flex: 1 1 240px; }
.memory-pin-choice { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.memory-pin-choice input { accent-color: var(--gold-2); }
.memory-group { margin-top: 18px; }
.memory-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line); color: var(--gold-2); font-family: var(--serif); font-size: 13px; }
.memory-group-count { color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: .04em; }
.memory-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.memory-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(13, 21, 17, 0.45); }
.memory-item.is-pinned { border-color: rgba(197, 168, 106, 0.34); background: rgba(197, 168, 106, 0.055); }
.memory-index { padding-top: 1px; color: var(--faint); font-family: var(--mono); font-size: 8px; }
.memory-item.is-pinned .memory-index { color: var(--gold-2); font-size: 12px; }
.memory-text { flex: 1; color: #d8d3c6; font-size: 12px; line-height: 1.75; }
.memory-meta { margin-top: 4px; color: var(--faint); font-family: var(--mono); font-size: 8px; }
.memory-item .icon-btn { width: 24px; height: 24px; border-color: transparent; opacity: 0; }
.memory-item:hover .icon-btn { opacity: 1; }
.memory-item .memory-pin { opacity: .55; }
.memory-item .memory-pin.is-pinned { color: var(--gold-2); opacity: 1; }
.memory-item .memory-pin.is-pinned svg { fill: currentColor; }
.memory-note { padding: 18px; }
.memory-note h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 15px; font-weight: 500; color: var(--gold-2); }
.memory-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.85; }

/* ---------- Profile ---------- */

.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.student-card {
  position: sticky;
  top: 88px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(198, 168, 98, 0.12), transparent 55%),
    linear-gradient(150deg, #14231b, #0a100d);
  box-shadow: var(--shadow);
}
.student-card::after { content: "N"; position: absolute; right: -18px; bottom: -44px; font-family: var(--serif); font-size: 150px; color: rgba(198, 168, 98, 0.04); pointer-events: none; }
.student-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--gold); font-family: var(--mono); font-size: 8px; letter-spacing: 0.18em; }
.student-card-top .status-dot { margin-right: 4px; }
.student-emblem { width: 58px; height: 58px; display: grid; place-items: center; margin: 24px 0 14px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-2); font-family: var(--serif); font-size: 28px; }
.student-card-name { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: 0.08em; }
.student-card-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.student-card-rows { margin: 22px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.student-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 11px; }
.student-row span:first-child { color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; }
.student-row span:last-child { color: var(--text); text-align: right; }
.student-quote { color: var(--gold-2); font-family: var(--serif); font-size: 13px; line-height: 1.85; }
.student-quote::before { content: "“"; color: var(--faint); }
.student-quote::after { content: "”"; color: var(--faint); }
.student-card-foot { margin-top: 22px; color: var(--faint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.12em; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--gold); }
.range-value { min-width: 54px; color: var(--gold-2); font-family: var(--mono); font-size: 10px; text-align: right; }

/* ---------- Settings / Bridge ---------- */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-card { padding: 22px; }
.settings-card h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 19px; font-weight: 500; }
.settings-card .desc { margin: 0 0 18px; color: var(--faint); font-size: 11px; line-height: 1.8; }
.settings-card.full { grid-column: 1 / -1; }
.status-line { display: flex; align-items: center; gap: 7px; margin-bottom: 16px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.token-box { display: flex; align-items: center; gap: 8px; }
.token-box code { flex: 1; overflow: hidden; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0, 0, 0, 0.25); color: var(--gold-2); font-family: var(--mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.bridge-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.bridge-step { display: flex; gap: 11px; }
.bridge-step-num { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font-family: var(--mono); font-size: 8px; }
.bridge-step-body { color: var(--muted); font-size: 11px; line-height: 1.7; }
.bridge-step-body strong { color: var(--text); font-weight: 400; }
.bridge-event { padding: 11px 0; border-bottom: 1px solid var(--line); }
.bridge-event:last-child { border-bottom: 0; }
.bridge-event-top { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.bridge-event-top b { color: var(--gold-2); font-weight: 400; }
.bridge-event-top span { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 8px; }
.bridge-event-content { margin-top: 4px; color: var(--muted); font-size: 11px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.danger-zone:first-of-type { border-top: 0; }
.danger-zone p { margin: 0; color: var(--muted); font-size: 11px; }
.danger-zone small { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 5, 3, 0.72);
  backdrop-filter: blur(8px);
  animation: fade-in 0.18s ease;
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(160deg, #15241c, #090f0c);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
  animation: modal-in 0.22s ease;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 500; }
.modal-head p { margin: 4px 0 0; color: var(--faint); font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(16, 27, 21, 0.96);
  color: var(--gold-2);
  font-size: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: 0.22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(207, 118, 103, 0.35); color: #e7a79b; }

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .dash-grid, .dash-grid.lower { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .chat-side { display: none; }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-layout, .memory-layout { grid-template-columns: 1fr; }
  .student-card { position: relative; top: 0; }
  .settings-grid { grid-template-columns: 1fr; }
  .usage-grid { grid-template-columns: repeat(2, 1fr); }
  .usage-summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 20px 22px 0; justify-content: flex-start; }
  .auth-center, .auth-bottom { display: none; }
  .auth-panel { min-height: 0; padding: 18px 20px 5vh; align-items: flex-end; justify-content: center; }
  .auth-card { padding: 26px 22px 22px; border-radius: 16px; }
  .auth-scrim {
    background:
      linear-gradient(180deg, rgba(4, 8, 6, 0.12) 0%, rgba(4, 8, 6, 0.28) 34%, rgba(4, 8, 6, 0.86) 72%, rgba(4, 8, 6, 0.96) 100%);
  }
  .sidebar { transform: translateX(-102%); box-shadow: 30px 0 80px rgba(0, 0, 0, 0.4); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; width: 100%; }
  .mobile-toggle { display: inline-grid; }
  .topbar { padding: 0 18px; height: 58px; }
  .breadcrumb { display: none; }
  .content { padding: 20px 18px 50px; }
  .hero { padding: 26px 22px; }
  .hero-watermark { font-size: 150px; opacity: 0.7; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .notes-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .chat-layout { height: calc(100vh - 138px); min-height: 480px; }
  .messages { padding: 16px 14px 6px; }
  .msg-body { max-width: 86%; }
  .chat-hint { display: none; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .task-actions { opacity: 1; }
  .task-side .due { display: none; }
}

@media (max-width: 520px) {
  .topbar-right .status-pill { display: none; }
  .user-role { display: none; }
  .user-chip { padding-left: 8px; }
  .hero h1 { font-size: 27px; }
  .hero-copy { font-size: 12px; }
  .hero-meta { flex-wrap: wrap; gap: 7px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px 18px; }
  .chat-head { padding: 11px 14px; }
  .chat-head .status-pill { display: none; }
  .chat-head .voice-chip span { display: none; }
  .chat-head .voice-chip { padding: 5px 8px; }
  .mic-btn { width: 38px; height: 38px; flex-basis: 38px; }
  .chat-form { padding: 10px 12px; gap: 7px; }
  .voice-bar { padding: 7px 12px; font-size: 10px; }
  .switch-row em { font-size: 9px; }
  .task-row { padding: 10px 11px; gap: 9px; }
  .task-actions .icon-btn { width: 24px; height: 24px; }
  .task-side .priority { display: none; }
  .memory-add { flex-direction: column; }
  .modal { padding: 18px; }
  .auth-card h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.summary-text { white-space: pre-wrap; line-height: 1.85; font-size: 14.5px; color: var(--text); background: rgba(0,0,0,.18); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-top: 10px; }
.radar-list { margin-top: 14px; display: grid; gap: 10px; }
.radar-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: rgba(0,0,0,.14); }
.radar-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.radar-top b { color: var(--gold-2); font-weight: 500; }
.radar-top span { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 8px; }
.radar-sender { margin-top: 8px; color: var(--muted); font-size: 11px; }
.radar-message { margin-top: 5px; color: var(--text); font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.radar-why { margin-top: 9px; padding: 8px 10px; border-left: 2px solid var(--gold-2); background: rgba(212,175,55,.06); color: var(--muted); font-size: 11px; line-height: 1.7; }
.radar-why b { color: var(--gold-2); font-weight: 400; }
.radar-reply { margin-top: 10px; display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid rgba(212,175,55,.35); border-radius: 10px; color: var(--text); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.radar-reply > div { flex: 1; }


/* ---------- Presence / access state ---------- */

.presence-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  margin-bottom: 16px;
  background:
    radial-gradient(ellipse 60% 140% at 0% 0%, rgba(111, 191, 154, 0.10), transparent 70%),
    var(--panel);
}
.presence-summary-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.presence-big {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1;
  color: var(--gold-2);
  letter-spacing: 0.02em;
}
.presence-big span { font-size: 17px; color: var(--muted); letter-spacing: 0; }
.presence-summary-title { font-weight: 600; letter-spacing: 0.03em; }
.presence-summary-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.presence-summary-note {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.presence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.presence-card {
  position: relative;
  padding: 20px 20px 18px;
  overflow: hidden;
}
.presence-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--faint);
}
.presence-card.tone-ok::before { background: var(--ok); }
.presence-card.tone-warn::before { background: var(--gold); }
.presence-card.tone-bad::before { background: var(--danger); }
.presence-card.tone-muted::before { background: var(--faint); }
.presence-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.presence-name { font-family: var(--serif); font-size: 18px; color: var(--text); }
.presence-mode { color: var(--faint); font-size: 11px; letter-spacing: 0.04em; margin-top: 3px; }
.presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
}
.presence-pill .presence-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.presence-pill.tone-ok { color: var(--ok); border-color: rgba(111, 191, 154, 0.28); background: var(--ok-dim); }
.presence-pill.tone-warn { color: var(--gold); border-color: var(--line-strong); background: var(--gold-dim); }
.presence-pill.tone-bad { color: var(--danger); border-color: rgba(207, 118, 103, 0.28); background: var(--danger-dim); }
.presence-pill.tone-muted { color: var(--faint); }
.presence-detail { margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.75; min-height: 42px; }
.presence-cover { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--faint); font-size: 11px; }
.presence-source { margin-top: 8px; color: var(--gold); font-size: 11px; letter-spacing: 0.03em; }
.presence-weather { margin: 0 0 16px; }
.presence-card-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.resume-card { padding: 22px 24px; margin-bottom: 16px; border-color: var(--line-strong); }
.resume-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.resume-head h2 { font-family: var(--serif); font-size: 19px; font-weight: 500; margin: 4px 0 0; }
.resume-meta { color: var(--faint); font-size: 11px; margin-top: 8px; letter-spacing: 0.03em; }
.resume-report {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 13px;
  line-height: 1.85;
}
.resume-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.resume-done { color: var(--faint); font-size: 12px; }

.resume-banner {
  display: flex;
  gap: 12px;
  margin: 12px 16px 0;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background:
    linear-gradient(90deg, rgba(198, 168, 98, 0.12), transparent 60%),
    var(--panel-2);
}
.resume-banner-mark {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  background: var(--gold-dim);
}
.resume-banner-body { min-width: 0; }
.resume-banner-title { font-family: var(--serif); font-size: 14px; color: var(--gold-2); }
.resume-banner-text { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.resume-banner-actions { display: flex; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.presence-note { color: var(--faint); font-size: 11px; line-height: 1.8; margin: 6px 2px 0; }

@media (max-width: 900px) {
  .presence-summary { align-items: flex-start; flex-direction: column; }
  .presence-summary-note { border-left: 0; padding-left: 0; max-width: none; }
  .presence-grid { grid-template-columns: 1fr; }
}

/* 聊天侧栏：有用消息 */
.side-radar { padding-bottom: 12px; }
.side-radar-state { margin-left: 6px; font-size: 10px; letter-spacing: .08em; color: var(--faint); font-weight: 400; }
.side-radar-item { padding: 10px 0; border-top: 1px solid var(--line); }
.side-radar-item:first-of-type { border-top: 0; }
.side-radar-top { font-size: 11px; color: var(--gold); margin-bottom: 4px; }
.side-radar-text { font-size: 12px; line-height: 1.65; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.side-radar-why { margin-top: 5px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.side-radar-reply { margin-top: 5px; padding: 6px 8px; border-radius: 6px; background: rgba(200, 168, 105, .08); font-size: 11px; line-height: 1.6; color: var(--ink-2); }
.side-radar-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.side-radar-empty { font-size: 11px; line-height: 1.7; color: var(--faint); padding: 6px 0; }
