/* ==========================================================================
   theme.css — visual layer (v0.4.6)

   Palette: the school theme. Warm off-white canvas, white surfaces, PKU cardinal
   as the single accent. This does NOT change.

   What is borrowed from the Codex client is structure and type, not colour:
     · tighter chrome — 52px top bar, 206px rail, 34px rows
     · hairlines instead of shadows and glows
     · monospace for anything that is data (numbers, IDs) and for micro labels,
       set in small caps with letter-spacing
     · one accent, used only for the active marker and the primary action

   Loaded after styles.css and overrides it; tokens first.
   ========================================================================== */

:root{
  color-scheme:light;

  /* school palette — unchanged */
  --pku:#8c1515;
  --pku-dark:#6d1012;
  --pku-soft:#f8ecec;

  --ink:#15171b;
  --ink-2:#3a3f45;
  --muted:#6c7178;
  --line:#eae6e3;
  --line-2:#ded8d4;
  --surface:#ffffff;
  --canvas:#f7f6f5;

  --radius:10px;
  --shadow:none;

  --font-ui:"Inter",-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  --font-mono:"JetBrains Mono","SFMono-Regular","Cascadia Code","Consolas","Liberation Mono",monospace;
}

/* ------------------------------------------------------------------ base */

html,body{
  background:var(--canvas);
  color:var(--ink);
  font-family:var(--font-ui);
  font-size:13px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
a{color:inherit}
::selection{background:#f1dedd;color:var(--ink)}

/* Every number, ID and machine-facing string is set in mono: it is data, and it
   lines up. */
.mono,.code{font-family:var(--font-mono);font-variant-numeric:tabular-nums;letter-spacing:-.01em}

/* Micro label — the Codex trait that survives in a light theme. */
.eyebrow{
  font-family:var(--font-mono);
  font-size:9.5px;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--muted);
}

/* ----------------------------------------------------------------- shell */

.app-shell{grid-template-columns:206px minmax(0,1fr)}
.sidebar{width:206px;background:#fbfaf9;border-right:1px solid var(--line)}

.brand{height:52px;padding:0 14px;border-bottom:1px solid var(--line);gap:9px}
.brand img{width:24px;height:24px;border-radius:3px;object-fit:contain}
.brand-copy{margin-left:0}
.brand-cn{font-family:var(--font-ui);font-size:12.5px;font-weight:600;color:var(--ink);line-height:1.15}
.brand-en{font-family:var(--font-mono);font-size:7px;letter-spacing:.14em;color:#9a938e;margin-top:2px}

.nav{padding:8px 6px;gap:0}
.nav a{
  position:relative;
  padding:6px 8px;
  border-radius:5px;
  font-size:12.5px;
  font-weight:450;
  color:var(--ink-2);
  gap:9px;
  line-height:1.3;
}
.nav a svg{width:14px;height:14px;color:#8a8f96}
.nav a:hover{background:#f2efed;color:var(--ink)}
.nav a.active{background:var(--pku-soft);color:var(--pku);font-weight:550;box-shadow:none}
.nav a.active svg{color:var(--pku)}
.nav a.active::before{
  content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;
  border-radius:0 2px 2px 0;background:var(--pku);
}
.nav .badge{
  margin-left:auto;background:#efeae6;color:#7a6f68;
  border-radius:4px;min-width:17px;height:17px;font-size:10px;
  font-family:var(--font-mono);
}

.sidebar-footer{padding:10px 14px 14px;border-top:1px solid var(--line);color:var(--muted)}
.sidebar-footer .hall{
  height:auto;margin:0 0 6px;padding:0;border:0;background:none;
  justify-content:flex-start;
  font-family:var(--font-mono);font-size:9px;letter-spacing:.08em;
  text-transform:uppercase;color:#9a938e;
}
.sidebar-footer .cn{font-family:var(--font-ui);font-size:11.5px;font-weight:500;color:var(--ink-2)}
.sidebar-footer .en{font-family:var(--font-mono);font-size:8.5px;letter-spacing:.1em;color:#a8a29c;margin-top:2px}

/* ----------------------------------------------------------------- topbar */

.topbar{
  height:52px;
  padding:0 18px;
  gap:12px;
  background:var(--surface);
  border-bottom:1px solid var(--line);
}
.product-title{
  font-family:var(--font-ui);
  font-size:12.5px;
  font-weight:500;
  letter-spacing:.005em;
  color:var(--ink-2);
}
.product-title span{color:var(--ink);font-weight:600}

.global-search{
  width:min(300px,24vw);height:30px;padding:0 9px;gap:7px;
  border-radius:6px;border:1px solid var(--line);background:#faf9f8;color:#9aa0a7;
}
.global-search:focus-within{border-color:var(--line-2);background:#fff}
.global-search input{font-size:12px;color:var(--ink);background:transparent}
.global-search input::placeholder{color:#a6a09a}
.global-search svg{width:13px;height:13px}

.notes-trigger{
  width:30px;height:30px;border-radius:6px;
  border:1px solid var(--line);background:var(--surface);color:var(--ink-2);
}
.notes-trigger:hover{background:#faf9f8;border-color:var(--line-2)}
.notes-badge{background:var(--pku);color:#fff;font-family:var(--font-mono)}

.user-menu-trigger{padding:3px 6px;border-radius:6px;gap:8px}
.user-menu-trigger:hover,.user-menu-trigger[aria-expanded="true"]{background:#f2efed}
.avatar{width:24px;height:24px;border-radius:5px;background:var(--pku);color:#fff;font-size:10.5px;font-family:var(--font-mono)}
.user-menu-copy .name{font-size:12px;font-weight:550;color:var(--ink)}
.user-menu-copy .position{font-size:10px;color:#95999f;margin-top:0}
.user-dropdown{background:#fff;border:1px solid var(--line-2);border-radius:8px;box-shadow:0 12px 32px rgba(18,20,24,.1);padding:6px}
.user-dropdown a,.user-dropdown button{font-size:12px;color:var(--ink-2)}
.user-dropdown a:hover,.user-dropdown button:hover{background:#f4f1ef;color:var(--ink)}

/* ------------------------------------------------------------ page + card */

.page-head{margin-bottom:14px;align-items:center}
.page-title{
  font-family:var(--font-ui);
  font-size:19px;font-weight:600;letter-spacing:-.012em;line-height:1.3;
  margin:0;color:var(--ink);
}
.page-sub{color:var(--muted);font-size:12px;margin-top:3px}

.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:none}

.section-title{
  font-family:var(--font-mono);
  font-size:10px;font-weight:500;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted);margin:0 0 10px;gap:8px;
}
.section-title::before{width:2px;height:9px;border-radius:1px;background:var(--pku)}

/* --------------------------------------------------------------- controls */

.btn{border-radius:6px;padding:6px 11px;font-size:12px;font-weight:500;letter-spacing:.005em}
.btn-primary{background:var(--pku);color:#fff;box-shadow:none}
.btn-primary:hover{background:var(--pku-dark)}
.btn-secondary{background:#fff;border:1px solid var(--line-2);color:var(--ink-2)}
.btn-secondary:hover{background:#faf8f7}
.btn-ghost{color:var(--muted);background:transparent}
.btn-ghost:hover{background:#f4f1ef;color:var(--ink)}
.btn:disabled{opacity:.45;cursor:not-allowed}

.input,.select,.textarea{
  background:#fff;
  border:1px solid var(--line-2);
  border-radius:6px;
  color:var(--ink);
  font-size:12.5px;
  padding:7px 9px;
}
.input::placeholder,.textarea::placeholder{color:#a8a29c}
.input:focus,.select:focus,.textarea:focus{border-color:#c4a9a6;box-shadow:0 0 0 3px rgba(140,21,21,.07)}
.input[readonly]{background:#f7f5f3;color:var(--muted)}
.helper{color:var(--muted);font-size:10.5px}

/* ---------------------------------------------------------- record panel */

.side-summary{padding:14px 16px;top:64px}
.side-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:4px}
.side-head .section-title{margin:0}

.summary-row{
  display:grid;grid-template-columns:72px minmax(0,1fr);gap:10px;align-items:baseline;
  padding:8px 0;font-size:12px;border-bottom:1px solid #f3f0ed;
}
.summary-row:last-of-type{border-bottom:0}
.summary-row>span:first-child{
  color:var(--muted);font-size:10px;letter-spacing:.02em;font-family:var(--font-mono);
}
.summary-row b{
  text-align:right;font-weight:500;font-size:12px;color:var(--ink);
  overflow-wrap:anywhere;font-family:var(--font-mono);
}
.summary-row.dirty b,.summary-row b.dirty{color:#a4622a}

.status{
  padding:1px 6px;border-radius:4px;font-size:9.5px;font-weight:500;
  font-family:var(--font-mono);letter-spacing:.03em;gap:5px;border:1px solid transparent;
}
.status::before{width:4px;height:4px}
.status-draft{background:#fdf3e2;color:#8a5a12;border-color:#f2e2c4}
.status-pending_review{background:#eef4ff;color:#33598f;border-color:#dbe6f8}
.status-need_clarification{background:#fdeeed;color:#9c2f2c;border-color:#f3d6d4}
.status-published{background:#eaf5ee;color:#1f6a43;border-color:#d6eadd}
.status-archived{background:#f2f0ee;color:#6c7178;border-color:#e6e2df}

.side-note{
  margin:10px 0 0;padding-top:10px;border-top:1px solid #f3f0ed;
  font-size:10.5px;line-height:1.55;color:var(--muted);
}
.side-note a{color:var(--pku);font-weight:500;text-decoration:none;border-bottom:1px solid #e3c9c7}
.side-note a:hover{border-bottom-color:var(--pku)}

/* ------------------------------------------------------------ dashboard */

.stats{gap:10px;margin:12px 0 16px}
.stat{padding:12px 14px}
.stat .label{
  font-family:var(--font-mono);font-size:9px;font-weight:500;
  letter-spacing:.09em;text-transform:uppercase;color:#8a8f96;
}
.stat .value{
  font-family:var(--font-mono);font-size:22px;font-weight:500;
  letter-spacing:-.02em;margin-top:3px;color:var(--ink);
}
.stat .hint{font-size:10.5px;line-height:1.45;color:#9a9fa6;margin-top:5px}

.dashboard-grid{grid-template-columns:minmax(0,1fr) 288px;gap:12px;align-items:start}
.section-card{padding:14px 16px}
.empty{padding:20px 16px;font-size:12px;color:var(--muted)}
.quick-list{gap:6px}
.quick-item{padding:10px 12px;border:1px solid var(--line);border-radius:6px;background:#fdfcfb}
.quick-item:hover{border-color:var(--line-2);background:#faf8f7}
.quick-item strong{font-size:12px;font-weight:500;color:var(--ink)}
.quick-item span{font-size:10.5px;color:var(--muted)}

/* --------------------------------------------------------------- stepper */

.stepper{margin:4px 0 16px;padding:0 2px}
.stepper::before{top:11px;background:#e3ded9}
.step-item{font-size:11px;color:#8f959c}
.step-circle{
  width:22px;height:22px;margin-bottom:6px;
  font-family:var(--font-mono);font-size:10px;font-weight:500;
  background:#fff;border:1px solid var(--line-2);color:#7b8188;
}
.step-item.active{color:var(--pku);font-weight:550}
.step-item.active .step-circle{background:var(--pku);border-color:var(--pku);color:#fff;box-shadow:none}
.step-item.done .step-circle{background:var(--pku-soft);border-color:#edd8d7;color:var(--pku)}

/* ------------------------------------------------------------ form cards */

.form-card{padding:16px;margin-bottom:12px}
.form-grid{gap:12px 14px}
.field{gap:5px}
.field label{font-size:11.5px;font-weight:500;color:var(--ink-2)}
.req{color:var(--pku)}
.choice{background:#fff;border:1px solid var(--line-2);border-radius:8px;padding:14px}
.choice:hover{border-color:#cda6a4}
.choice.selected{border-color:#d9b6b4;background:#fdfafa;box-shadow:none}
.choice h4{font-size:12.5px;font-weight:550}
.choice p{font-size:11px;color:var(--muted);line-height:1.5}
.choice-radio{width:15px;height:15px;border-width:1px}

/* ------------------------------------------------------- growth form bits */

.growth-panel{background:#f8fafc;border:1px solid #e4ebf3;border-radius:8px;padding:10px 10px 6px}
.growth-panel-title{
  font-family:var(--font-mono);font-size:10px;font-weight:500;
  letter-spacing:.09em;text-transform:uppercase;color:#33506e;line-height:1.6;
}
.growth-panel-hint{font-family:var(--font-mono);font-size:9.5px;color:#8b9db0}

.field-block-title{
  border-bottom:1px solid #efe8e4;color:var(--ink-2);
  font-family:var(--font-mono);font-size:10px;font-weight:500;
  letter-spacing:.09em;text-transform:uppercase;
}
.field-block-zh{color:#a08b85;font-family:var(--font-ui);font-size:10.5px;letter-spacing:0;text-transform:none}
.field-unit{color:#96a0ab;font-family:var(--font-mono);font-size:10px}

.timeline-strip{background:#fbf8f6;border:1px solid #efe8e4;border-radius:8px}
.tl-item{border-left:1px solid #efe8e4}
.tl-value{font-family:var(--font-mono);font-size:14px;font-weight:500;color:var(--ink)}
.tl-label{font-size:9.5px;color:#a08b85}
.tl-label i{color:#c0afa9}
.auto-tag{
  background:#fdf0e4;color:#b4622a;border:1px solid #f3ddc5;
  font-family:var(--font-mono);font-size:9px;font-weight:500;letter-spacing:.04em;
}

/* -------------------------------------------------------------- lists */

.data-table{font-size:12px}
.data-table th{
  font-family:var(--font-mono);font-size:9px;letter-spacing:.09em;
  text-transform:uppercase;color:#8a8f96;border-bottom:1px solid var(--line);padding:8px 10px;
}
.data-table td{padding:9px 10px;border-bottom:1px solid #f3f0ed;color:var(--ink-2)}
.sample-link{color:var(--ink);font-weight:500;font-family:var(--font-mono);font-size:11.5px}

.kv{background:#fdfcfb;border:1px solid var(--line);border-radius:6px}
.kv .k{font-family:var(--font-mono);font-size:8.5px;letter-spacing:.09em;color:#8a8f96}
.kv .v{font-size:12px;color:var(--ink);font-weight:500}

/* --------------------------------------------------------------- login */

.login-page{background:#f8f5f2}
.login-brand .name{font-family:var(--font-ui);font-size:20px;font-weight:600;color:var(--pku)}
.login-copy h1{font-family:var(--font-ui);font-size:34px;font-weight:600;letter-spacing:-.02em}
.login-copy p{color:var(--muted);font-size:13px}
.login-tag{background:#fff;border:1px solid var(--line);color:var(--ink-2);font-family:var(--font-mono);font-size:10px}
.login-card{border:1px solid var(--line);border-radius:12px;box-shadow:none;padding:24px}
.login-card h2{font-family:var(--font-ui);font-size:18px;font-weight:600}
.demo-box{background:#faf7f5;border:1px solid var(--line);color:var(--muted);font-family:var(--font-mono);font-size:10px}

@media(max-width:1180px){
  .app-shell,.wizard-shell,.dashboard-grid{grid-template-columns:minmax(0,1fr)}
  .sidebar{position:static;width:auto;height:auto}
  .side-summary{position:static}
}

/* ==========================================================================
   v0.4.7 — one rail holds the whole chrome
   Top bar gone, right-hand Record panel gone: brand, search, navigation, the
   page's record summary and the account all live in the left rail. The content
   gets the full width back.
   ========================================================================== */

.app-shell{grid-template-columns:244px minmax(0,1fr)}
.sidebar{
  width:244px;
  background:#fbfaf9;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  gap:0;
}
.content{padding:22px 26px 40px;max-width:1600px;margin:0 auto}

/* search sits at the top of the rail, under the brand */
.rail-search{
  display:flex;align-items:center;gap:7px;
  margin:10px 10px 4px;padding:0 8px;height:30px;
  border:1px solid var(--line);border-radius:6px;background:#fff;color:#a8a29c;
}
.rail-search:focus-within{border-color:var(--line-2)}
.rail-search svg{width:13px;height:13px;flex:0 0 auto}
.rail-search input{
  border:0;outline:none;background:transparent;width:100%;
  font-size:12px;color:var(--ink);font-family:var(--font-ui);
}
.rail-search input::placeholder{color:#a8a29c}

/* record summary: a quiet block inside the rail, not a card */
.rail-record{
  margin:14px 6px 0;padding:12px 10px 10px;
  border-top:1px solid var(--line);
  display:flex;flex-direction:column;gap:7px;
}
.rail-record-head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:2px}
.rail-record-title{
  font-family:var(--font-mono);font-size:9.5px;letter-spacing:.09em;
  text-transform:uppercase;color:#8a8f96;
}
.rail-field{display:flex;flex-direction:column;gap:1px;min-width:0}
.rail-field span{font-family:var(--font-mono);font-size:8.5px;letter-spacing:.08em;text-transform:uppercase;color:#a09b96}
.rail-field b{
  font-family:var(--font-mono);font-size:11.5px;font-weight:500;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.rail-field b.dirty{color:#a4622a}
.rail-note{
  margin-top:4px;font-size:10.5px;color:var(--muted);text-decoration:none;
}
.rail-note:hover{color:var(--pku)}

/* account block at the foot of the rail */
.rail-foot{
  margin-top:auto;
  padding:10px 8px 12px;
  border-top:1px solid var(--line);
  display:flex;align-items:center;gap:4px;
}
.rail-foot .notes-wrap{flex:0 0 auto}
.rail-foot .user-menu-wrap{flex:1;min-width:0}
.rail-foot .user-menu-trigger{width:100%;justify-content:flex-start}
.rail-foot .user-menu-chevron{margin-left:auto}

/* dropdowns open sideways: a downward menu would run off the bottom of the rail */
.notes-dropdown{
  left:calc(100% + 8px);right:auto;top:auto;bottom:0;width:300px;
}
.user-dropdown{
  left:calc(100% + 8px);right:auto;top:auto;bottom:0;width:236px;
}

/* the wizard is a single column now that the summary moved out */
.wizard-shell{grid-template-columns:minmax(0,1fr)}

@media(max-width:1180px){
  .app-shell{grid-template-columns:minmax(0,1fr)}
  .sidebar{position:static;width:auto;height:auto;flex-direction:row;align-items:center;flex-wrap:wrap;overflow:visible}
  .rail-search{margin:8px;width:200px}
  .nav{flex-direction:row;overflow:auto;padding:6px}
  .rail-record{border-top:0;border-left:1px solid var(--line);margin:0 6px;padding:8px 10px;flex-direction:row;gap:14px}
  .rail-record .rail-note{display:none}
  .rail-foot{margin:0;border-top:0;border-left:1px solid var(--line);padding:8px}
}

/* the stepper stops stretching once the content column gets wide */
.stepper{max-width:860px}

/* ==========================================================================
   v0.4.8 — the rail collapses, and stops scrolling
   overflow:visible (no scrollbars inside chrome), a toggle in the brand row, and a
   floating reveal button while collapsed. The dashboard stacks its left column.
   ========================================================================== */

.sidebar{overflow:visible}
.brand{position:relative}
.rail-toggle{
  margin-left:auto;
  width:22px;height:22px;flex:0 0 auto;
  display:grid;place-items:center;
  border:1px solid transparent;border-radius:5px;
  background:transparent;color:#a8a29c;cursor:pointer;
}
.rail-toggle:hover{background:#f1eeec;border-color:var(--line);color:var(--ink-2)}
.rail-toggle svg{width:13px;height:13px}

.rail-reveal{
  display:none;
  position:fixed;left:10px;top:10px;z-index:30;
  width:26px;height:26px;
  place-items:center;
  border:1px solid var(--line-2);border-radius:6px;
  background:#fff;color:var(--ink-2);cursor:pointer;
}
.rail-reveal:hover{background:#faf8f7}

body.rail-hidden .sidebar{display:none}
body.rail-hidden .app-shell{grid-template-columns:minmax(0,1fr)}
body.rail-hidden .main{grid-column:1}
body.rail-hidden .rail-reveal{display:grid}
body.rail-hidden .content{padding-left:48px}

/* dashboard: the two cards stack in the wide column instead of stretching */
.dashboard-main{display:flex;flex-direction:column;gap:12px;min-width:0}

@media(max-width:1180px){
  .rail-toggle{display:none}
}

/* Local icons: inline SVG replaces the old CDN font. */
.icon{display:inline-block;vertical-align:middle;flex:0 0 auto}
.btn .icon,.rail-search .icon{margin-right:2px}
.nav a .icon{width:14px;height:14px}

/* ==========================================================================
   v0.4.9a — popovers open upward
   The account and notification triggers sit at the foot of the rail, so their
   panels belong above them, not to the side: a sideways panel ignored the
   chevron and floated over the content.
   ========================================================================== */

.rail-foot .user-menu-wrap{position:relative}
.user-dropdown{
  left:0;
  right:auto;
  top:auto;
  bottom:calc(100% + 8px);
  width:224px;
}
.notes-dropdown{
  left:0;
  right:auto;
  top:auto;
  bottom:calc(100% + 8px);
  width:302px;
}
/* the chevron points at where the panel opens: up when closed, down when open */
.user-menu-chevron{transform:none}
.user-menu-trigger[aria-expanded="true"] .user-menu-chevron{transform:rotate(180deg)}

/* ==========================================================================
   v0.4.11 — brand as a masthead, popovers inside the rail
   The account menu and the notification panel used to float in a narrower card
   that did not line up with anything. They now span the rail's inner width, so
   they read as a section of the rail rather than a card dropped on top of it.
   ========================================================================== */

/* brand: a link home, larger, and the tallest thing in the rail */
.brand{height:64px;padding:0 8px 0 12px;gap:4px}
.brand-link{display:flex;align-items:center;gap:10px;flex:1;min-width:0;text-decoration:none}
.brand-link:hover .brand-cn{color:var(--pku)}
.brand img{width:32px;height:32px;border-radius:4px}
.brand-copy{display:flex;flex-direction:column;min-width:0}
.brand-cn{font-size:15px;font-weight:600;letter-spacing:.01em;line-height:1.2}
.brand-en{font-size:7.5px;letter-spacing:.13em;color:#9a938e;margin-top:3px}

/* popovers anchor to the rail foot, not to the trigger, so they align with it */
.rail-foot{position:relative}
.rail-foot .user-menu-wrap,
.rail-foot .notes-wrap{position:static}

.user-dropdown,
.notes-dropdown{
  left:8px;
  right:8px;
  width:auto;
  bottom:calc(100% + 6px);
  top:auto;
  border-radius:8px;
  border:1px solid var(--line-2);
  box-shadow:0 8px 24px rgba(18,20,24,.10);
}

.notes-dropdown{max-height:58vh;overflow:auto}
.notes-item{padding:8px 10px}
.notes-item-body{font-size:11px;line-height:1.45}
.notes-when{font-size:9.5px}
.notes-head{padding:8px 10px}

/* the same paddings as the nav items, so the menu lines up with the links above */
.user-dropdown{padding:4px}
.user-dropdown-head{padding:8px}
.user-dropdown-item{padding:7px 8px;border-radius:5px;font-size:12px;gap:8px}

/* the masthead should outrank a page title, not sit below it */
.brand{height:68px}
.brand img{width:34px;height:34px}
.brand-cn{font-size:16px;font-weight:650}
.brand-en{font-size:7.8px;letter-spacing:.12em}

/* ==========================================================================
   v0.5.0 — datasheet

   The previous look was converging on the generic SaaS pattern: a grid of equal
   rounded cards, soft neutral wash, one accent, generous padding, centred empty
   states. That is exactly the shape a component library produces by default, and
   it reads as "template" no matter how carefully it is tuned.

   This layer goes the other way: the page is a document, not a dashboard.
     · rules instead of cards; one hairline defines a section, not a container
     · the four metric cards became one divided strip
     · left-aligned, information-first; no centred empty hero, no decorative wash
     · radius 3–4px, no shadows, no gradients anywhere
     · monospace for figures and micro labels; the seal carries the identity
   ========================================================================== */

:root{
  --canvas:#f4f2ef;
  --surface:#ffffff;
  --line:#e3ddd6;
  --line-2:#cfc7bf;
  --ink:#151413;
  --ink-2:#3b3835;
  --muted:#6d6762;
  --radius:4px;
  --radius-sm:3px;
}

html,body{background:var(--canvas)}

/* ---------------------------------------------------------------- surfaces */

.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:none}
.section-card{padding:16px 18px}

/* A section header is a rule with a label, not a boxed title. */
.section-title{
  margin:0 0 12px;padding-bottom:8px;
  border-bottom:1px solid var(--line);
  font-family:var(--font-mono);font-size:9.5px;font-weight:500;
  letter-spacing:.12em;text-transform:uppercase;color:var(--muted);
}
.section-title::before{display:none}

/* --------------------------------------------------------------- summaries */

/* four boxes → one strip with dividers */
.stats{gap:0;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);margin:0 0 18px}
.stat{border:0;border-left:1px solid var(--line);border-radius:0;padding:12px 16px;background:transparent}
.stat:first-child{border-left:0}
.stat .value{font-size:20px}
.stat .hint{margin-top:3px;font-size:10px}

/* the rail record block reads like a spec sheet */
.rail-record{gap:6px}
.rail-field b{font-size:11px}

/* --------------------------------------------------------------- controls */

.btn,.input,.select,.textarea{border-radius:var(--radius-sm)}
.btn-primary{background:var(--pku)}
.btn-secondary{background:transparent;border:1px solid var(--line-2)}
.btn-secondary:hover{background:#f7f4f1}

/* a real focus ring, not a soft glow */
.btn:focus-visible,.input:focus-visible,.select:focus-visible,.textarea:focus-visible,
.nav a:focus-visible,.rail-toggle:focus-visible,.user-menu-trigger:focus-visible,
.notes-trigger:focus-visible,.rail-reveal:focus-visible{
  outline:2px solid var(--pku);outline-offset:2px;
}
.input:focus,.select:focus,.textarea:focus{box-shadow:none;border-color:var(--pku)}

/* the rail: active is weight plus a rule, not a coloured pill */
.nav a.active{background:transparent;color:var(--ink);font-weight:600}
.nav a.active::before{background:var(--pku)}
.nav a:hover{background:#efece8}

/* ---------------------------------------------------------------- workflow */

.quick-list{gap:0;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.quick-item{
  border:0;border-bottom:1px solid var(--line);border-radius:0;
  background:transparent;padding:11px 14px;
}
.quick-item:last-child{border-bottom:0}
.quick-item:hover{background:#faf8f6;border-color:var(--line)}
.quick-item strong{font-weight:550}
.quick-list .info-box{margin:0;border:0;border-top:1px solid var(--line);border-radius:0;background:#fbf7f3}

/* ------------------------------------------------------------- empty state */

/* empty areas are a line of text with the action next to it, never a centred hero */
.empty{
  text-align:left;padding:14px 0 2px;margin-top:12px;
  border-top:1px solid var(--line);font-size:12px;color:var(--muted);
}
.empty b{color:var(--ink);font-weight:550}

/* ------------------------------------------------------------ growth panel */

.growth-panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.growth-panel-hint{color:#9a938c}
.timeline-strip{border-radius:var(--radius);background:#fbf9f7}

/* ------------------------------------------------------------------- login */

.login-copy h1{font-size:26px;letter-spacing:-.01em;font-weight:600}
.login-art{background:var(--surface);border-right:1px solid var(--line)}
.login-card{border-radius:var(--radius);border-color:var(--line)}
.login-tag{border-radius:var(--radius-sm)}

/* ------------------------------------------------------------------- chart */

.gc-line{stroke:#1f1c19}
.gc-dot{fill:#1f1c19}

/* the two "new / existing" choices are rows, not marketing cards */
.choice{padding:10px 12px;border-radius:var(--radius-sm);background:var(--surface)}
.choice-top{gap:9px;align-items:flex-start}
.choice h4{margin:0;font-size:12.5px;font-weight:550;line-height:1.3}
.choice p{margin-top:2px;font-size:10.5px;line-height:1.4;color:var(--muted)}
.choice.selected{border-color:var(--pku);background:#fdf7f6;box-shadow:none}
.choice-radio{width:14px;height:14px;margin-top:2px}
.choice:hover{border-color:var(--line-2)}

/* --------------------------------------------------------------- login page */

.login-brand{gap:14px;align-items:center}
.login-brand img{width:64px;height:64px}
.login-brand .name{font-size:20px;font-weight:600;line-height:1.2}
.login-brand-sub{font-family:var(--font-mono);font-size:9px;letter-spacing:.13em;color:#9a938e;margin-top:3px}

.login-copy{max-width:560px}
.login-copy h1{font-size:25px;line-height:1.25;font-weight:600;letter-spacing:-.01em;margin:0 0 12px}
.login-copy p{font-size:12.5px;line-height:1.6;color:var(--muted);margin:0}

/* the tag chips became a factual list: three things the system actually does */
.login-tags{display:none}
.login-facts{margin:22px 0 0;padding:0;border-top:1px solid var(--line)}
.login-facts>div{display:grid;grid-template-columns:96px minmax(0,1fr);gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
.login-facts dt{font-family:var(--font-mono);font-size:9px;letter-spacing:.11em;text-transform:uppercase;color:var(--muted)}
.login-facts dd{margin:0;font-size:11.5px;color:var(--ink-2)}

.login-foot{font-family:var(--font-mono);font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#9a938e}
.login-card h2{font-size:17px;font-weight:600;margin:0 0 2px}
.login-card p{font-size:11.5px;margin:0 0 16px}
.demo-box{font-family:var(--font-mono);font-size:9.5px;line-height:1.7}

/* ==========================================================================
   v0.5.1 — one step larger
   The datasheet layout set type deliberately small (9–12 px mono labels). It reads
   well on a large monitor and poorly on a laptop at arm's length, so every size in
   the app moves up one step (+1 px, or the next step on the small micro labels).
   Line heights move with them; nothing else changes.
   ========================================================================== */

/* base */
html,body{font-size:14px}

/* rail */
.brand-cn{font-size:17px}
.brand-en{font-size:8.5px}
.rail-search input{font-size:13px}
.nav a{font-size:13.5px;padding:7px 9px}
.nav .badge{font-size:11px}
.rail-record-title{font-size:10.5px}
.rail-field span{font-size:9.5px}
.rail-field b{font-size:12.5px}
.rail-note{font-size:11.5px}
.user-menu-copy .name{font-size:13px}
.user-menu-copy .position{font-size:11px}
.user-dropdown-item{font-size:13px}
.user-dropdown-name{font-size:13px}
.sidebar-footer .hall{font-size:10px}
.sidebar-footer .cn{font-size:12.5px}
.sidebar-footer .en{font-size:9.5px}

/* page + sections */
.page-title{font-size:21px}
.page-sub{font-size:13px}
.section-title{font-size:10.5px}
.section-sub{font-size:13px}

/* controls */
.btn{font-size:13px;padding:7px 12px}
.input,.select,.textarea{font-size:13.5px;padding:8px 10px}
.helper{font-size:11.5px}
.field label{font-size:12.5px}
.choice h4{font-size:13.5px}
.choice p{font-size:11.5px}

/* summaries */
.stat .label{font-size:11px}
.stat .value{font-size:22px}
.stat .hint{font-size:11px}
.status{font-size:10.5px}
.empty{font-size:13px}
.quick-item strong{font-size:13px}
.quick-item span{font-size:11.5px}
.info-box{font-size:12.5px}

/* stepper */
.step-item{font-size:12px}
.step-circle{width:24px;height:24px;font-size:11px}

/* growth form */
.growth-panel-title{font-size:11px}
.growth-panel-hint{font-size:10.5px}
.field-block-title{font-size:11px}
.field-block-zh{font-size:11.5px}
.field-unit{font-size:11px}
.tl-value{font-size:16px}
.tl-label{font-size:10.5px}
.auto-tag{font-size:10px}

/* tables and detail blocks */
.data-table{font-size:13px}
.data-table th{font-size:10px}
.data-table td{padding:10px}
.sample-link{font-size:12.5px}
.kv .k{font-size:9.5px}
.kv .v{font-size:13px}
.notes-item-body{font-size:12px}
.notes-when{font-size:10.5px}
.review-update{font-size:12.5px}
.glossary-pair{font-size:12.5px}

/* login */
.login-copy h1{font-size:27px}
.login-copy p{font-size:13.5px}
.login-facts dt{font-size:10px}
.login-facts dd{font-size:12.5px}
.login-card h2{font-size:18px}
.login-card p{font-size:12.5px}
.demo-box{font-size:10.5px}
.login-foot{font-size:10px}

/* form inputs need a touch more height for the larger type */
.field-grid .input,.field-grid .select{height:36px;padding:6px 10px;font-size:13px}
.timeline-grid .derived-field .sci-value{height:34px}

/* ==========================================================================
   v0.5.2 — the record summary reads as a spec block
   Three stacked label/value pairs looked like a form someone forgot to finish:
   ragged baselines, a pill floating on its own line, and a status word shouting.
   It is now a title row (label + status), then label/value rows on one baseline,
   values truncated rather than wrapped.
   ========================================================================== */

.rail-record{display:block;margin:14px 8px 0;padding:10px 6px 0;border-top:1px solid var(--line)}
.rail-record-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:7px;border-bottom:1px solid var(--line)}
.rail-record-title{font-family:var(--font-mono);font-size:9.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}

.rail-spec{margin:0;padding:0;display:block}
.rail-spec>div{display:grid;grid-template-columns:52px minmax(0,1fr);gap:8px;align-items:baseline;padding:5px 0}
.rail-spec dt{
  font-family:var(--font-mono);font-size:8.5px;letter-spacing:.08em;
  text-transform:uppercase;color:#a8a29b;
}
.rail-spec dd{
  margin:0;font-size:12px;line-height:1.45;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.rail-spec dd.dirty{color:#a4622a;font-weight:500}

.rail-note{
  display:block;margin-top:6px;padding-top:8px;border-top:1px solid var(--line);
  font-size:11px;color:var(--muted);text-decoration:none;
}
.rail-note:hover{color:var(--pku)}

/* the old stacked styling is no longer used */
.rail-field{display:none}

/* ==========================================================================
   v0.5.2a — one typography and one radius
   Three inconsistencies were visible on a single page: the rail's record values
   used three different faces (CJK fallback serif, mono, sans), the focused select
   drew a second rounded ring around its 3px border, and the action buttons mixed
   weights and radii.
   ========================================================================== */

/* a CJK-capable sans stack, declared once */
:root{
  --font-ui:"Inter","Segoe UI","Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Noto Sans SC",system-ui,sans-serif;
}
html,body,.input,.select,.textarea,.btn,.rail-spec dd,.choice h4,.choice p{font-family:var(--font-ui)}

/* record block: labels stay mono caps; values are all the same sans */
.rail-spec dt{font-size:9px}
.rail-spec dd{font-size:12px;font-weight:450;color:var(--ink)}
.rail-spec dd.mono{font-family:var(--font-ui);font-variant-numeric:tabular-nums;letter-spacing:0}
.rail-spec dd.dirty{font-weight:500}

/* one radius for every control and surface */
.input,.select,.textarea,.btn,.btn-small,.choice,.card,.user-dropdown,.notes-dropdown,.status,.kv,.quick-item{border-radius:3px}
.growth-panel,.timeline-strip{border-radius:4px}

/* focus: a single red border, no second ring */
.input:focus,.select:focus,.textarea:focus{outline:none;border-color:var(--pku);box-shadow:none}
.input:focus-visible,.select:focus-visible,.textarea:focus-visible{outline:none}

/* one button language: same face, same weight, same height */
.btn,.btn-small,.btn-primary,.btn-secondary,.btn-ghost,.link-button{
  font-family:var(--font-ui);font-size:13px;font-weight:500;letter-spacing:0;
}
.btn{padding:7px 14px}
.btn-small{font-size:12px;padding:5px 9px}
.btn-primary{background:var(--pku);color:#fff;border:1px solid var(--pku)}
.btn-secondary{background:transparent;border:1px solid var(--line-2);color:var(--ink-2)}
.btn-secondary:hover{background:#f6f2ee;border-color:var(--line-2)}
.btn-ghost{background:transparent;border:1px solid transparent;color:var(--muted)}
.btn-ghost:hover{background:#efece8;color:var(--ink)}
.form-actions{align-items:center;margin-top:18px}
.form-actions .right{gap:8px}

/* sanity note inside the growth panel: one line, amber, above the curve */
.growth-note{
  margin:0 0 6px;padding:5px 8px;border-radius:3px;
  border:1px solid #f0e0c6;background:#fdf7ec;
  font-family:var(--font-ui);font-size:11.5px;line-height:1.45;color:#8a5a12;
}
.growth-note[hidden]{display:none}

/* ==========================================================================
   v0.5.2b — growth diagram, following the reference tool
   The panel now carries the same information the reference diagram does: an AUTO
   badge, a one-line description of the program, a chip row with the key figures,
   ramp rates printed on the ramps, and one lane per gas phase with its flow and
   window written inside the bar.
   ========================================================================== */

.growth-badge{
  font-family:var(--font-mono);font-size:9px;letter-spacing:.08em;
  padding:1px 5px;border:1px solid var(--line-2);border-radius:3px;color:var(--muted);
}
.growth-desc{
  margin:6px 0 0;font-size:11.5px;line-height:1.5;color:var(--ink-2);
}
.growth-chips{display:flex;flex-wrap:wrap;gap:4px 14px;margin:6px 0 2px}
.gc-chip{font-size:11px;color:var(--ink-2);white-space:nowrap}
.gc-chip b{
  font-family:var(--font-mono);font-size:9px;font-weight:500;letter-spacing:.06em;
  text-transform:uppercase;color:var(--muted);margin-right:5px;
}

.gc-rate{font-family:var(--font-ui);font-size:9.5px;fill:#6d6762}
.gc-bar-text{font-family:var(--font-ui);font-size:9.5px;fill:#2b2a28;dominant-baseline:middle}
.gc-bar-text-off{fill:#8d8884}
.gc-bar-off{fill:#f3f0ec;stroke:#d8d1c9;stroke-width:1;stroke-dasharray:3 3}
.gc-gas-off{fill:#f3f0ec}

/* ==========================================================================
   v0.5.2c — gas schedule table (flow · start · end), after the reference tool
   ========================================================================== */

.field-block-phases{margin-top:14px}
.phase-table{width:100%;border-collapse:collapse;font-size:12px}
.phase-table thead th{
  text-align:left;padding:0 0 6px;
  font-family:var(--font-mono);font-size:9px;font-weight:500;letter-spacing:.08em;
  text-transform:uppercase;color:#8a8f96;border-bottom:1px solid var(--line);
}
.phase-table thead th i{font-style:normal;color:#b0aaa4;letter-spacing:0;text-transform:none}
.phase-table tbody th{
  text-align:left;font-weight:450;color:var(--ink-2);padding:5px 12px 5px 0;
  width:150px;white-space:nowrap;
}
.phase-table tbody td{padding:4px 10px 4px 0;vertical-align:middle}
.phase-table tbody tr{border-bottom:1px solid #f2efec}
.phase-table tbody tr:last-child{border-bottom:0}

.phase-input{height:30px;padding:4px 8px;font-size:12.5px}
.phase-static{
  display:inline-block;min-width:64px;font-variant-numeric:tabular-nums;
  font-size:12px;color:#8d8884;
}
/* computed windows: amber, the reference tool's "自动联动" treatment */
.phase-auto{
  display:inline-block;min-width:64px;padding:4px 8px;border-radius:3px;
  background:#fdf7ec;border:1px solid #f0e0c6;
  font-variant-numeric:tabular-nums;font-size:12px;color:#8a5a12;
}

/* v0.5.3 — characterization ↔ performance link hint */
.perf-link-hint{
  margin:8px 0 0;padding:7px 10px;border-left:2px solid #d9cbb8;
  background:#faf7f2;border-radius:3px;
  font-size:11.5px;line-height:1.55;color:#6d6258;
}
.perf-link-hint b{font-weight:600;color:#4a423b}

/* v0.6.0 — image identity in the record view */
.perf-flag{color:#8a5a12}
.image-perf-check{display:block;margin-top:8px;font-size:11.5px;color:#6d6258}
.image-perf-check input{margin-right:6px}

/* v0.6.0 — the inline performance block under an image */
.image-perf{margin-top:10px;padding:10px 12px;border-left:2px solid #d9cbb8;background:#faf7f2;border-radius:3px}
.image-perf .field{margin-bottom:8px}
.image-perf .field:last-of-type{margin-bottom:4px}
.image-perf .entry-perf-description{height:34px}
.image-perf-note{margin:2px 0 0;font-size:11px;color:#8b8178}

/* v0.6.0 — the inline property block under an image */
.image-prop{margin-top:10px;padding:10px 12px;border-left:2px solid #d9cbb8;background:#faf7f2;border-radius:3px}
.image-prop > label{display:block;font-size:11.5px;font-weight:500;color:#4a423b;margin-bottom:4px}
.image-prop-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;margin-top:8px}
.image-prop-fields .field{margin:0}
.image-prop-empty{margin:6px 0 0}
.image-prop-note{margin:8px 0 0;font-size:11px;color:#8b8178}

/* v0.6.0 — several images of one method; each row is one image */
.entry-auto .add-auto-entry{margin:8px 0 2px}
.entry-auto .entry-instance + .entry-instance{margin-top:10px}
