:root {
  --ink: #17201d;
  --ink-soft: #34403c;
  --paper: #f4f1e9;
  --paper-deep: #e8e4da;
  --surface: #fffdf7;
  --line: #d7d2c6;
  --muted: #727a75;
  --coral: #ec6b4f;
  --coral-dark: #c84f37;
  --lime: #dce86b;
  --blue: #a7c8d7;
  --danger: #b83c2e;
  --success: #237354;
  --shadow: 0 24px 70px rgba(23, 32, 29, 0.12);
  --radius: 18px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--coral) 70%, white); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; transform: translateY(-160%); padding: 10px 16px; background: var(--ink); color: white; }
.skip-link:focus { transform: translateY(0); }

.eyebrow { margin: 0 0 10px; color: var(--coral-dark); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow.light { color: var(--lime); }
.muted { color: var(--muted); line-height: 1.65; }

.login-view { min-height: 100vh; padding: 32px clamp(24px, 5vw, 80px) 48px; background:
  radial-gradient(circle at 72% 21%, rgba(220, 232, 107, .22), transparent 22%),
  linear-gradient(135deg, var(--paper) 0 54%, #e9e5da 54% 100%); }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 850; letter-spacing: .18em; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--lime); font-family: Georgia, serif; font-size: 24px; font-style: italic; }
.brand-mark.compact { width: 38px; height: 38px; font-size: 21px; background: var(--lime); color: var(--ink); }
.login-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .72fr); gap: clamp(48px, 8vw, 140px); align-items: center; min-height: calc(100vh - 110px); max-width: 1320px; margin: 0 auto; }
.login-intro h1 { max-width: 760px; margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(46px, 6vw, 82px); font-weight: 500; line-height: 1.06; letter-spacing: -.045em; }
.intro-copy { max-width: 600px; margin: 28px 0 34px; color: var(--ink-soft); font-size: 17px; line-height: 1.8; }
.security-note { display: flex; gap: 14px; max-width: 520px; padding-top: 22px; border-top: 1px solid var(--line); }
.security-note strong { font-size: 14px; }
.security-note p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.pulse-dot, .status-indicator { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(35, 115, 84, .12); }
.login-card { display: grid; gap: 24px; padding: clamp(28px, 4vw, 48px); border: 1px solid rgba(23, 32, 29, .12); border-radius: 28px; background: rgba(255, 253, 247, .9); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.login-card h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 34px; font-weight: 500; }
.login-card .muted { margin: 8px 0 0; font-size: 14px; }
.step-label { margin: 0 0 16px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.field { display: grid; gap: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea, .filter-bar select { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field input, .field select { height: 50px; padding: 0 14px; }
.field textarea { padding: 13px 14px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-bar select:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(236, 107, 79, .12); outline: 0; }
.code-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.text-button { min-width: 104px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); font-size: 13px; font-weight: 750; }
.text-button:disabled { cursor: wait; color: var(--muted); }
.form-error { margin: -8px 0 0; color: var(--danger); font-size: 13px; line-height: 1.5; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 44px; padding: 0 18px; border-radius: 11px; font-weight: 780; transition: transform .15s, background .15s; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; }
.primary-button:hover { background: #2b3834; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.secondary-button { border: 1px solid var(--line); background: var(--surface); }
.secondary-button:hover { border-color: var(--ink); }
.full { width: 100%; justify-content: space-between; padding-inline: 20px; }
.login-footnote { margin: -8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; text-align: center; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 242px; flex-direction: column; padding: 28px 18px 22px; background: var(--ink); color: white; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; border-bottom: 1px solid rgba(255,255,255,.13); }
.sidebar-brand div { display: grid; gap: 2px; }
.sidebar-brand strong { letter-spacing: .18em; }
.sidebar-brand small { color: rgba(255,255,255,.5); font-size: 9px; letter-spacing: .15em; }
.main-nav { display: grid; gap: 7px; margin-top: 30px; }
.nav-item { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; min-height: 50px; padding: 0 13px; border: 0; border-radius: 10px; background: transparent; color: rgba(255,255,255,.65); text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: var(--lime); color: var(--ink); font-weight: 800; }
.nav-item:disabled { display: none; }
.nav-index { font-family: Georgia, serif; font-size: 11px; font-style: italic; opacity: .62; }
.nav-count { min-width: 26px; padding: 3px 7px; border-radius: 20px; background: rgba(255,255,255,.1); font-size: 10px; text-align: center; }
.nav-item.active .nav-count { background: rgba(23,32,29,.12); }
.sidebar-footer { display: flex; align-items: flex-start; gap: 12px; margin-top: auto; padding: 20px 10px 0; border-top: 1px solid rgba(255,255,255,.13); }
.sidebar-footer div { display: grid; gap: 3px; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer small { color: rgba(255,255,255,.48); font-size: 10px; }
.sidebar-footer .status-indicator { background: var(--lime); box-shadow: 0 0 0 5px rgba(220,232,107,.12); }

.workspace { min-height: 100vh; margin-left: 242px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 105px; padding: 20px clamp(24px, 4vw, 58px); border-bottom: 1px solid var(--line); background: rgba(244, 241, 233, .92); backdrop-filter: blur(10px); }
.topbar h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 28px; font-weight: 500; }
.topbar .eyebrow { margin-bottom: 5px; font-size: 9px; }
.operator-block { display: flex; align-items: center; gap: 12px; }
.operator-copy { display: grid; gap: 3px; text-align: right; }
.operator-copy strong { font-size: 13px; }
.operator-copy small { color: var(--muted); font-size: 10px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--blue); font-family: Georgia, serif; font-size: 15px; font-weight: 800; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.icon-button:hover { background: var(--surface); }
.mobile-only { display: none; }

main { padding: clamp(28p