/* Zaixing Yang Lab portal — one stylesheet, no framework.
   Paper + ink palette, hairline rules instead of shadows, mono for anything
   that is a timestamp, hash or size. */

:root {
  --paper: #f5f3ee;
  --paper-2: #eeebe4;
  --surface: #fffdf9;
  --hover: #f7f4ec;
  --ink: #1d1c19;
  --ink-2: #47453e;
  --ink-3: #7b786f;
  --ink-4: #a8a499;
  --rule: #e3dfd5;
  --rule-2: #d2ccbf;
  --accent: #24584b;
  --accent-2: #1a4338;
  --accent-wash: #e2ebe6;
  --warn: #94570f;
  --warn-wash: #f5e9d4;
  --danger: #9b3420;
  --danger-wash: #f5e0d9;
  --ok: #2e6a3c;
  --mark: #f1e2a1;
  --radius: 5px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Microsoft YaHei", serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
  --side-w: 228px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 14px/1.6 var(--sans); font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a.link, .prose a, .link-u { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; }
a.link:hover, .prose a:hover { text-decoration-color: currentColor; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 24px 0; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: .92em; }
.num, .mono, td.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--mark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.lg { width: 20px; height: 20px; }
.i.sm { width: 14px; height: 14px; vertical-align: -2px; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--paper-2); border-right: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; }
.brand-mark {
  width: 32px; height: 32px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: #f3efe4; border-radius: 3px;
  font: italic 600 15px/1 var(--serif); letter-spacing: -.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b { font: 600 15px/1.2 var(--serif); letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--ink-3); font-size: 11.5px; letter-spacing: .08em; }

.nav { padding: 4px 0 12px; }
.nav a {
  display: flex; align-items: center; gap: 10px; margin: 1px 10px; padding: 6px 10px;
  border-radius: 4px; color: var(--ink-2); font-size: 13.5px;
}
.nav a:hover { background: rgba(40, 35, 20, .05); color: var(--ink); }
.nav a.is-active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--rule), inset 2px 0 0 var(--accent); }
.nav a .count { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font: 500 10.5px/17px var(--mono); text-align: center; }
.nav-label { margin: 14px 20px 4px; color: var(--ink-4); font-size: 11px; letter-spacing: .12em; }
.side-foot { margin-top: auto; border-top: 1px solid var(--rule); padding: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; }
.side-user:hover { background: rgba(40, 35, 20, .05); }
.side-user .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.side-user .who b { font-weight: 500; font-size: 13.5px; }
.side-user .who small { color: var(--ink-3); font-size: 11.5px; }
.side-env { padding: 6px 10px 2px; font: 10.5px/1.5 var(--mono); color: var(--ink-4); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 54px; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: rgba(245, 243, 238, .94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--ink-4); }
.crumbs .here { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.search { position: relative; width: 300px; }
.search input { width: 100%; height: 32px; padding: 0 34px 0 32px; border: 1px solid var(--rule-2); border-radius: 4px; background: var(--surface); font: inherit; font-size: 13px; color: var(--ink); }
.search input::placeholder { color: var(--ink-4); }
.search > .i { position: absolute; left: 10px; top: 8px; color: var(--ink-3); }
.search kbd { position: absolute; right: 8px; top: 7px; }
kbd { display: inline-block; min-width: 18px; padding: 0 4px; border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 3px; background: var(--surface); color: var(--ink-3); font: 10.5px/15px var(--mono); text-align: center; }
.topbar .menu-btn { display: none; }
.content { width: 100%; max-width: 1320px; padding: 26px 28px 80px; }
.content.narrow { max-width: 880px; }
.content.mid { max-width: 1080px; }

/* ------------------------------------------------------------------ type */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--ink-3); margin-top: 4px; font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.serif { font-family: var(--serif); }
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label { display: block; color: var(--ink-3); font-size: 12px; letter-spacing: .04em; margin-bottom: 6px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.section-title .more { margin-left: auto; font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.section-title .more:hover { color: var(--accent); }
.section-title .count { font: 500 11.5px var(--mono); color: var(--ink-4); }

/* ------------------------------------------------------------------ buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--rule-2); border-radius: 4px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: border-color .12s, background-color .12s;
}
.btn:hover { border-color: #b9b2a2; background: #fff; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fbfaf6; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(40, 35, 20, .06); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-wash); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 26px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.field { margin-bottom: 16px; }
.field .hint { margin-top: 5px; color: var(--ink-3); font-size: 12px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--rule-2); border-radius: 4px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
textarea.input { min-height: 96px; line-height: 1.6; resize: vertical; }
textarea.code, .input.code { font-family: var(--mono); font-size: 12.5px; }
select.input { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237b786f' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input.sm { min-height: 28px; padding: 3px 8px; font-size: 12.5px; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check small { display: block; color: var(--ink-3); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 24px; }
.form-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--rule); }
.errors { margin: 0 0 16px; padding: 10px 14px; border: 1px solid #e5c2b8; border-left: 3px solid var(--danger); background: var(--danger-wash); border-radius: 4px; color: #6f2414; font-size: 13px; }
.errors div + div { margin-top: 2px; }

/* ------------------------------------------------------------------ panels, tables */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--rule); }
.panel-head h2, .panel-head h3 { font-size: 13.5px; font-weight: 600; }
.panel-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel-body { padding: 14px 16px; }
.panel + .panel { margin-top: 16px; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th {
  position: sticky; top: 54px; z-index: 2; background: var(--surface);
  padding: 9px 12px; border-bottom: 1px solid var(--rule-2); text-align: left;
  color: var(--ink-3); font-size: 12px; font-weight: 500; letter-spacing: .03em; white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table .num, .table th.num { text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.table .ts { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.table .w-check { width: 36px; padding-right: 0; }
.table .row-title { font-weight: 500; }
.table .row-sub { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.table-wrap { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.table-wrap .table th { top: 0; }
.table-scroll { overflow-x: auto; }
.table input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; }
.sort-link { color: inherit; }
.sort-link.on { color: var(--ink); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.list > li:last-child { border-bottom: 0; }

.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.empty { padding: 36px 24px; border: 1px dashed var(--rule-2); border-radius: var(--radius); text-align: center; color: var(--ink-3); background: rgba(255, 253, 249, .5); }
.empty b { display: block; color: var(--ink-2); font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.empty .btn-row { justify-content: center; margin-top: 14px; }

/* ------------------------------------------------------------------ small parts */
.avatar {
  --tone: #55534e; display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%; background: var(--tone); color: #fbf9f3;
  font-size: 10.5px; font-weight: 500; letter-spacing: -.02em; line-height: 1; user-select: none;
}
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 72px; height: 72px; font-size: 22px; }
.stack { display: inline-flex; }
.stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.stack .avatar + .avatar { margin-left: -6px; }
.person { display: inline-flex; align-items: center; gap: 7px; }

.ftype {
  --c: #6d6a62; display: inline-block; min-width: 38px; padding: 0 4px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 3px; color: var(--c); background: color-mix(in srgb, var(--c) 6%, transparent);
  font: 600 9.5px/16px var(--mono); letter-spacing: .04em; text-align: center; vertical-align: 1px;
}
.ftype.k-image { --c: #3b5378; }
.ftype.k-table { --c: #2f6650; }
.ftype.k-pdf { --c: #9b3f2a; }
.ftype.k-doc { --c: #5c4d7d; }
.ftype.k-text, .ftype.k-code { --c: #55534e; }
.ftype.k-archive { --c: #7a5c1e; }
.ftype.k-seq { --c: #2f6c76; }
.ftype.k-folder { --c: #8a7a52; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; height: 20px; border-radius: 10px; border: 1px solid var(--rule-2); color: var(--ink-2); font-size: 11.5px; white-space: nowrap; background: var(--surface); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.pill.s-active::before { background: #3d8a5a; }
.pill.s-paused::before { background: #c08a2c; }
.pill.s-done::before { background: #4a6d9c; }
.pill.s-archived { color: var(--ink-3); }
.pill.plain::before { display: none; }
.badge { display: inline-block; padding: 0 6px; border-radius: 3px; background: var(--paper-2); color: var(--ink-2); font-size: 11.5px; line-height: 19px; white-space: nowrap; }
.badge.accent { background: var(--accent-wash); color: var(--accent-2); }
.badge.warn { background: var(--warn-wash); color: var(--warn); }
.badge.danger { background: var(--danger-wash); color: var(--danger); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); vertical-align: 1px; }
.dot.on { background: #3d8a5a; }
.dot.warn { background: #c08a2c; }
.dot.off { background: #c9c3b6; }
.dot.err { background: var(--danger); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c, var(--accent)); flex: none; }
.code-chip { font: 500 11.5px var(--mono); color: var(--ink-3); letter-spacing: .02em; }
.hash { font: 12px/1.5 var(--mono); color: var(--ink-2); word-break: break-all; }
.store { display: inline-flex; gap: 3px; vertical-align: 1px; }
.store i { width: 6px; height: 6px; border-radius: 1px; background: #d8d2c4; display: block; }
.store i.on { background: #5b8f74; }
.store i.cold { background: #6f87ad; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; overflow-x: auto; }
.tabs a { position: relative; padding: 9px 12px 10px; color: var(--ink-3); font-size: 13.5px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); font-weight: 500; }
.tabs a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); }
.tabs a .n { font: 11px var(--mono); color: var(--ink-4); margin-left: 3px; }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 4px; overflow: hidden; background: var(--surface); }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 12.5px; cursor: pointer; }
.seg a + a, .seg button + button { border-left: 1px solid var(--rule-2); }
.seg a.on, .seg button.on { background: var(--paper-2); color: var(--ink); }
.seg .n { font: 11px var(--mono); color: var(--ink-4); }

.flash-wrap { position: fixed; top: 64px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.flash { padding: 10px 14px 10px 12px; border: 1px solid var(--rule-2); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 4px; box-shadow: 0 6px 24px rgba(30, 25, 10, .08); font-size: 13px; animation: flash-in .2s ease-out; }
.flash.error { border-left-color: var(--danger); }
.flash.warning { border-left-color: var(--warn); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }

details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 200px; padding: 5px;
  background: var(--surface); border: 1px solid var(--rule-2); border-radius: 5px; box-shadow: 0 10px 30px rgba(30, 25, 10, .12);
}
.menu-pop.left { left: 0; right: auto; }
.menu-pop.up { top: auto; bottom: calc(100% + 6px); }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; border-radius: 3px; background: none; color: var(--ink-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--hover); color: var(--ink); }
.menu-pop .sep { height: 1px; margin: 5px 0; background: var(--rule); }
.menu-pop .danger { color: var(--danger); }
.bell { position: relative; }
.bell .dotn { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #c0492d; box-shadow: 0 0 0 2px var(--paper); }
.notes-pop { width: 340px; padding: 0; }
.notes-pop .head { display: flex; padding: 10px 14px; border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-3); }
.notes-pop .head a { margin-left: auto; color: var(--accent); }
.notes-pop .note { display: block; padding: 9px 14px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); }
.notes-pop .note:hover { background: var(--hover); }
.notes-pop .note.unread { color: var(--ink); background: #fbf8ef; }
.notes-pop .note small { display: block; color: var(--ink-4); font: 11px var(--mono); margin-top: 2px; }

dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--rule-2);
  border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgba(30, 25, 10, .25);
}
dialog.wide { width: min(780px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(35, 32, 24, .38); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.dlg-head h3 { font-size: 15px; }
.dlg-head .x { margin-left: auto; }
.dlg-body { padding: 18px; overflow: auto; max-height: calc(100vh - 190px); }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 18px; border-top: 1px solid var(--rule); background: #fbf9f4; }
.dlg-foot .left { margin-right: auto; color: var(--ink-3); font-size: 12.5px; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 18px; font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------------ dashboard */
.dash-head { display: flex; align-items: flex-end; gap: 24px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.dash-date { font-family: var(--serif); line-height: 1.05; }
.dash-date .big { font-size: 40px; letter-spacing: -.02em; }
.dash-date .big em { font-style: normal; color: var(--ink-3); font-size: 22px; margin-left: 10px; letter-spacing: 0; }
.dash-date .meta { margin-top: 8px; font: 12px var(--mono); color: var(--ink-3); letter-spacing: .02em; }
.dash-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
.dash-grid > div > section + section { margin-top: 30px; }

.proj-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.proj-row:last-child { border-bottom: 0; }
.proj-row:hover { background: var(--hover); }
.proj-row .bar { align-self: stretch; border-radius: 2px; background: var(--c); }
.proj-row .t { font-weight: 500; }
.proj-row .m { color: var(--ink-3); font-size: 12px; margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.proj-row .r { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: 12px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.feed li:last-child { border-bottom: 0; }
.feed .what { font-size: 13.5px; }
.feed .what b { font-weight: 500; }
.feed .files { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.feed .files a:hover { color: var(--accent); }
.feed .thumbs { display: flex; gap: 6px; margin-top: 8px; }
.feed .thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 3px; border: 1px solid var(--rule); background: var(--paper-2); }
.feed .when { font: 11.5px var(--mono); color: var(--ink-4); white-space: nowrap; }

.today { padding: 16px; }
.today .figs { display: flex; gap: 22px; margin: 2px 0 12px; }
.today .fig b { display: block; font: 500 26px/1.1 var(--serif); }
.today .fig span { color: var(--ink-3); font-size: 12px; }

.heat { display: flex; gap: 3px; }
.heat .col { display: flex; flex-direction: column; gap: 3px; }
.heat i { width: 11px; height: 11px; border-radius: 2px; background: #e6e1d5; display: block; }
.heat i.l1 { background: #c3d6c9; }
.heat i.l2 { background: #8fb5a0; }
.heat i.l3 { background: #4f8a70; }
.heat i.l4 { background: #24584b; }
.heat i.f { background: transparent; }

.mini-list .row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.mini-list .row:last-child { border-bottom: 0; }
.mini-list .row .grow { flex: 1; min-width: 0; }
.mini-list .row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .row small { color: var(--ink-3); font-size: 12px; }
.unread-dot { width: 6px; height: 6px; border-radius: 50%; background: #c0492d; flex: none; }

/* ------------------------------------------------------------------ projects */
.proj-head { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 16px; margin-bottom: 18px; }
.proj-head .bar { border-radius: 2px; background: var(--c); }
.proj-head h1 { font-size: 22px; }
.proj-head .meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; color: var(--ink-3); font-size: 12.5px; }
.proj-head .side-actions { display: flex; align-items: flex-start; gap: 8px; }

.files-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; }
.tree { font-size: 13px; position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; }
.tree a { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 3px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree a:hover { background: rgba(40, 35, 20, .05); }
.tree a.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.tree .i { color: #9a8b62; }
.tree-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 12px; line-height: 1.8; }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .path { display: flex; align-items: center; gap: 4px; font-size: 13.5px; min-width: 0; flex-wrap: wrap; }
.toolbar .path a { color: var(--ink-3); }
.toolbar .path a:hover { color: var(--ink); }
.toolbar .path b { font-weight: 500; }
.toolbar .grow { flex: 1; }

.file-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-name a { font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name a:hover { color: var(--accent); }
.file-name .note { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name .stack-v { display: flex; flex-direction: column; min-width: 0; }
.folder-row .file-name a { font-weight: 500; }

.bulkbar {
  position: sticky; bottom: 16px; z-index: 25; display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 8px 10px 8px 14px; background: var(--ink); color: #f1eee6; border-radius: 6px;
  box-shadow: 0 10px 30px rgba(20, 18, 10, .25); font-size: 13px;
}
.bulkbar .btn { background: transparent; color: #f1eee6; border-color: rgba(255, 255, 255, .22); }
.bulkbar .btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); }
.bulkbar .grow { flex: 1; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.tile { display: block; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.tile:hover { border-color: var(--rule-2); }
.tile .img { aspect-ratio: 4 / 3; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; }
.tile .img img { width: 100%; height: 100%; object-fit: cover; }
.tile .img .ftype { transform: scale(1.4); }
.tile .cap { padding: 7px 9px 8px; }
.tile .cap .n { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .cap .m { font: 11px var(--mono); color: var(--ink-4); }

.drop-overlay { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(36, 88, 75, .1); border: 2px dashed var(--accent); }
.drop-overlay.on { display: grid; }
.drop-overlay div { padding: 18px 26px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 6px; font-size: 15px; box-shadow: 0 10px 30px rgba(20, 18, 10, .15); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; padding: 16px 18px 14px; border: 1px solid var(--rule); border-top: 3px solid var(--c); border-radius: var(--radius); background: var(--surface); min-height: 168px; }
.pcard:hover { border-color: var(--rule-2); border-top-color: var(--c); }
.pcard .top { display: flex; align-items: center; gap: 8px; }
.pcard h3 { font-size: 15.5px; margin-top: 8px; }
.pcard .desc { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; }
.pcard .foot .stack { margin-left: auto; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { padding: 0 6px; border-radius: 3px; background: var(--paper-2); color: var(--ink-2); font-size: 11.5px; line-height: 19px; }

/* ------------------------------------------------------------------ file page */
.file-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.viewer { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-3); }
.viewer-bar .grow { flex: 1; }
.viewer-img { display: grid; place-items: center; padding: 18px; min-height: 360px; background: #e9e5db; background-image: linear-gradient(45deg, #e3dfd3 25%, transparent 25%), linear-gradient(-45deg, #e3dfd3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e3dfd3 75%), linear-gradient(-45deg, transparent 75%, #e3dfd3 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.viewer-img img { max-height: 72vh; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); cursor: zoom-in; background: #fff; }
.viewer-pdf { width: 100%; height: 78vh; border: 0; display: block; background: #e9e5db; }
.viewer-none { padding: 64px 24px; text-align: center; color: var(--ink-3); }
.viewer-none .ftype { transform: scale(1.8); margin-bottom: 22px; }
.text-view { margin: 0; max-height: 72vh; overflow: auto; padding: 12px 0; font: 12.5px/1.65 var(--mono); counter-reset: ln; background: var(--surface); }
.text-view .ln { display: block; padding: 0 16px 0 0; white-space: pre-wrap; word-break: break-all; }
.text-view .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 52px; padding-right: 14px; margin-right: 4px; text-align: right; color: var(--ink-4); border-right: 1px solid var(--rule); user-select: none; }
.sheet-tabs { display: flex; gap: 0; border-top: 1px solid var(--rule); background: #f9f7f1; overflow-x: auto; }
.sheet-tabs button { padding: 6px 14px; border: 0; border-right: 1px solid var(--rule); background: none; font: inherit; font-size: 12.5px; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.sheet-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 2px 0 var(--accent); }
.grid-view { max-height: 70vh; overflow: auto; }
.grid-view table { border-collapse: separate; border-spacing: 0; font: 12px/1.45 var(--mono); }
.grid-view th, .grid-view td { padding: 4px 10px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.grid-view thead th { position: sticky; top: 0; background: #f4f1e9; color: var(--ink-3); font-weight: 500; z-index: 2; }
.grid-view tbody th { position: sticky; left: 0; background: #f9f7f1; color: var(--ink-4); font-weight: 400; text-align: right; z-index: 1; }
.grid-view thead th:first-child { left: 0; z-index: 3; }
.grid-view tbody tr:first-child td { font-weight: 600; color: var(--ink); background: #fbf9f4; }
.grid-note { padding: 7px 12px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--rule); }

.meta-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.meta-card + .meta-card { margin-top: 14px; }
.meta-card h3 { padding: 10px 14px; border-bottom: 1px solid var(--rule); font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.meta-card h3 .right { margin-left: auto; font-weight: 400; }
.meta-card .body { padding: 12px 14px; }
.stamp { border-left: 3px solid var(--accent); }
.stamp .t { font: 500 15px/1.3 var(--mono); letter-spacing: -.01em; }
.stamp .tz { color: var(--ink-3); font: 11px var(--mono); }
.locs { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.locs li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; }
.locs li .ts { font: 11px var(--mono); color: var(--ink-4); }

/* ------------------------------------------------------------------ notebook */
.day-group { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.day-group:first-child { padding-top: 4px; }
.day-num { font-family: var(--serif); line-height: 1; text-align: right; }
.day-num b { display: block; font-size: 34px; font-weight: 500; letter-spacing: -.03em; }
.day-num span { display: block; margin-top: 6px; color: var(--ink-3); font: 11.5px var(--mono); }
.day-num small { display: block; color: var(--ink-4); font: 11px var(--sans); margin-top: 2px; }
.entry-card { display: block; padding: 2px 0 14px; }
.entry-card + .entry-card { padding-top: 14px; border-top: 1px dotted var(--rule-2); }
.entry-card .top { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12px; }
.entry-card h3 { font-size: 15.5px; margin: 5px 0 4px; }
.entry-card:hover h3 { color: var(--accent); }
.entry-card p { color: var(--ink-2); font-size: 13px; margin: 0; }

.entry-head { padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--rule); }
.entry-head .code-chip { display: block; margin-bottom: 6px; }
.entry-head h1 { font-size: 26px; font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
.entry-head .meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }

.prose { font-size: 14.5px; line-height: 1.8; color: #2a2925; overflow-wrap: break-word; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.4em 0 .5em; line-height: 1.35; }
.prose h1 { font-size: 1.45em; } .prose h2 { font-size: 1.25em; } .prose h3 { font-size: 1.08em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1em; }
.prose li + li { margin-top: .2em; }
.prose li.task { list-style: none; margin-left: -1.3em; }
.prose li.task input { margin-right: 6px; accent-color: var(--accent); }
.prose blockquote { margin: 0 0 1em; padding: 2px 0 2px 14px; border-left: 3px solid var(--rule-2); color: var(--ink-3); }
.prose code { padding: 1px 5px; border-radius: 3px; background: var(--paper-2); font-size: .86em; }
.prose pre { padding: 12px 14px; border: 1px solid var(--rule); border-radius: 4px; background: #faf8f2; overflow-x: auto; line-height: 1.55; }
.prose pre code { padding: 0; background: none; font-size: 12.5px; }
.prose table { border-collapse: collapse; margin: 0 0 1em; font-size: 13px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--rule-2); padding: 5px 10px; }
.prose th { background: var(--paper-2); font-weight: 600; }
.prose img { border-radius: 3px; border: 1px solid var(--rule); }
.prose hr { margin: 1.6em 0; }

.editor { border: 1px solid var(--rule-2); border-radius: 4px; background: var(--surface); }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--rule); background: #faf8f2; flex-wrap: wrap; }
.editor-bar button { height: 26px; min-width: 28px; padding: 0 7px; border: 0; border-radius: 3px; background: none; color: var(--ink-2); font: 12.5px var(--sans); cursor: pointer; }
.editor-bar button:hover { background: rgba(40, 35, 20, .07); color: var(--ink); }
.editor-bar button.on { background: var(--surface); box-shadow: 0 0 0 1px var(--rule-2); color: var(--ink); }
.editor-bar .sep { width: 1px; height: 16px; background: var(--rule-2); margin: 0 4px; }
.editor-bar .grow { flex: 1; }
.editor textarea { display: block; width: 100%; min-height: 380px; padding: 14px 16px; border: 0; background: transparent; resize: vertical; font: 13.5px/1.75 var(--mono); color: var(--ink); }
.editor textarea:focus { outline: none; }
.editor .preview { min-height: 380px; padding: 14px 18px; }

.attach-list { list-style: none; margin: 8px 0 0; padding: 0; }
.attach-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.attach-list li .bar { grid-column: 1 / -1; height: 2px; background: var(--rule); border-radius: 1px; overflow: hidden; }
.attach-list li .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.dropzone { padding: 18px; border: 1px dashed var(--rule-2); border-radius: 5px; text-align: center; color: var(--ink-3); font-size: 13px; background: rgba(255, 253, 249, .6); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-2); }

.img-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.img-strip a { display: block; aspect-ratio: 4/3; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--paper-2); }
.img-strip img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------------ protocols */
.proto-group + .proto-group { margin-top: 26px; }
.proto-group h2 { font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .06em; padding-bottom: 8px; border-bottom: 1px solid var(--rule-2); display: flex; gap: 8px; }
.proto-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.proto-row:hover .t { color: var(--accent); }
.proto-row .t { font-weight: 500; font-size: 14.5px; }
.proto-row .s { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.proto-row .r { color: var(--ink-3); font-size: 12px; text-align: right; white-space: nowrap; }
.ver { font: 500 11.5px var(--mono); padding: 1px 6px; border-radius: 3px; background: var(--accent-wash); color: var(--accent-2); }
.diff { font: 12.5px/1.6 var(--mono); }
.diff div { padding: 0 12px; white-space: pre-wrap; word-break: break-all; }
.diff .add { background: #e5f0e3; color: #20502c; }
.diff .add::before { content: "+ "; color: #5d8f63; }
.diff .del { background: #f7e3dc; color: #7a2a17; }
.diff .del::before { content: "− "; color: #b06a55; }
.diff .ctx::before { content: "  "; }
.diff .hunk { color: var(--ink-4); background: var(--paper-2); padding: 3px 12px; margin: 6px 0; }

/* ------------------------------------------------------------------ members */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.person-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.person-card:hover { border-color: var(--rule-2); }
.person-card .n { font-weight: 500; }
.person-card .e { color: var(--ink-3); font-size: 12px; }
.person-card .r { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
.group-title { margin: 26px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .06em; display: flex; gap: 8px; }
.group-title:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ upload queue */
.uq {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 380px; max-height: 60vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule-2); border-radius: 6px; box-shadow: 0 16px 50px rgba(30, 25, 10, .2); overflow: hidden;
}
.uq-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; background: var(--ink); color: #f1eee6; font-size: 13px; }
.uq-head .grow { flex: 1; }
.uq-head .btn { color: #f1eee6; }
.uq-head .btn:hover { background: rgba(255, 255, 255, .1); }
.uq-total { height: 2px; background: #3a3832; }
.uq-total i { display: block; height: 100%; width: 0; background: #8fc0a6; transition: width .3s; }
.uq-list { overflow: auto; }
.uq.min .uq-list { display: none; }
.uq-item { padding: 9px 14px; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.uq-item .row1 { display: flex; gap: 8px; align-items: center; }
.uq-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq-item .st { font: 11px var(--mono); color: var(--ink-3); white-space: nowrap; }
.uq-item .st.ok { color: var(--ok); }
.uq-item .st.err { color: var(--danger); }
.uq-item .bar { height: 3px; margin-top: 6px; background: var(--paper-2); border-radius: 2px; overflow: hidden; }
.uq-item .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.uq-item.done .bar i { background: #6aa284; }
.uq-item.err .bar i { background: var(--danger); }
.uq-item .sub { margin-top: 3px; font: 10.5px var(--mono); color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-files { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; border: 1px solid var(--rule); border-radius: 4px; }
.up-files li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.up-files li:last-child { border-bottom: 0; }
.up-files li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-files li .sz { font: 11.5px var(--mono); color: var(--ink-3); }

/* ------------------------------------------------------------------ admin */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.stat { padding: 14px 18px; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: 0; }
.stat .k { color: var(--ink-3); font-size: 12px; }
.stat .v { font: 500 22px/1.3 var(--serif); margin-top: 2px; }
.stat .d { color: var(--ink-3); font: 11.5px var(--mono); margin-top: 2px; }
.meter { height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter i.warn { background: #c08a2c; }
.meter i.err { background: var(--danger); }
.flow { display: grid; grid-template-columns: 1fr 40px 1fr 40px 1fr; align-items: stretch; gap: 0; }
.flow .node { padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.flow .node h4 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.flow .arrow { display: grid; place-items: center; color: var(--ink-4); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px dotted var(--rule-2); }
.checklist li:last-child { border-bottom: 0; }
.account-slip { border: 1px dashed var(--rule-2); border-radius: 5px; padding: 14px 16px; background: #fffef9; font-size: 13px; }
.account-slip + .account-slip { margin-top: 10px; }
.account-slip .pw { font: 600 16px var(--mono); letter-spacing: .04em; color: var(--accent-2); }
.audit-row td { font-size: 12.5px; }
.audit-row .act { font: 11.5px var(--mono); color: var(--ink-2); }
.notice { padding: 12px 14px; border: 1px solid var(--rule-2); border-left: 3px solid var(--warn); border-radius: 4px; background: #fbf6ea; font-size: 13px; color: #5c4513; }
.notice.info { border-left-color: var(--accent); background: #f2f6f3; color: #24443a; }
.notice + .notice { margin-top: 10px; }
.terminal { margin: 0; padding: 14px 16px; border-radius: 5px; background: #23221e; color: #e8e4d8; font: 12.5px/1.65 var(--mono); overflow-x: auto; white-space: pre; }
.terminal .c { color: #8f8b7e; }
.terminal .p { color: #9cc7a8; }
.copy-wrap { position: relative; }
.copy-wrap .btn { position: absolute; top: 8px; right: 8px; background: #34322c; border-color: #4a473e; color: #d9d4c6; }
.copy-wrap .btn:hover { background: #403d35; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps > li { position: relative; padding: 0 0 26px 44px; }
.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule-2); background: var(--surface); display: grid; place-items: center; font: 500 13px var(--serif); color: var(--ink-2); }
.steps > li::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 4px; width: 1px; background: var(--rule); }
.steps > li:last-child::after { display: none; }
.steps h3 { font-size: 14.5px; margin-bottom: 8px; }

/* ------------------------------------------------------------------ public */
.pub { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.pub-top { display: flex; align-items: center; gap: 12px; height: 68px; border-bottom: 1px solid var(--rule); }
.pub-top .grow { flex: 1; }
.pub-top nav { display: flex; gap: 22px; font-size: 13.5px; color: var(--ink-2); }
.pub-top nav a:hover { color: var(--ink); }
.hero { padding: 88px 0 64px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: end; }
.hero h1 { font: 500 64px/1.02 var(--serif); letter-spacing: -.03em; }
.hero h1 span { display: block; color: var(--ink-3); font-size: .5em; letter-spacing: -.01em; margin-top: 14px; }
.hero .zh { margin-top: 20px; font-size: 18px; color: var(--ink-2); letter-spacing: .1em; }
.hero .tagline { margin-top: 26px; max-width: 560px; color: var(--ink-2); font-size: 16px; line-height: 1.8; }
.hero aside { border-left: 1px solid var(--rule-2); padding-left: 22px; color: var(--ink-3); font-size: 13px; line-height: 1.9; }
.hero aside b { display: block; color: var(--ink); font-weight: 500; }
.pub-sec { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; padding: 48px 0; border-bottom: 1px solid var(--rule); }
.pub-sec > h2 { font: 500 13px var(--sans); color: var(--ink-3); letter-spacing: .14em; padding-top: 4px; }
.pub-sec > h2 b { display: block; font: 500 26px/1.2 var(--serif); color: var(--ink); letter-spacing: -.01em; margin-top: 6px; }
.research { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.research li { display: grid; grid-template-columns: 56px minmax(0, 1fr); padding: 18px 0; border-bottom: 1px solid var(--rule); }
.research li:first-child { padding-top: 0; }
.research li:last-child { border-bottom: 0; }
.research li::before { counter-increment: r; content: counter(r, decimal-leading-zero); font: 500 15px var(--mono); color: var(--accent); padding-top: 3px; }
.research h3 { font-size: 18px; font-weight: 600; }
.research p { margin: 6px 0 0; color: var(--ink-2); line-height: 1.8; }
.roster .grp { display: grid; grid-template-columns: 110px minmax(0, 1fr); padding: 12px 0; border-bottom: 1px solid var(--rule); }
.roster .grp:last-child { border-bottom: 0; }
.roster .grp > span { color: var(--ink-3); font-size: 13px; padding-top: 2px; }
.roster .names { display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 15px; }
.roster .names small { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.pub-foot { padding: 28px 0 40px; display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-3); font-size: 12.5px; }
.pub-foot a:hover { color: var(--ink); }
.pub-foot .grow { flex: 1; }

.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); }
.login-art { position: relative; padding: 48px 56px; background: var(--ink); color: #e9e5da; display: flex; flex-direction: column; overflow: hidden; }
.login-art .brand-text b { font-size: 17px; color: #f4f0e6; }
.login-art .brand-text small { color: #9d998d; }
.login-art .brand-mark { background: #e9e5da; color: var(--ink); }
.login-art .quote { margin-top: auto; max-width: 460px; }
.login-art .quote h2 { font: 400 40px/1.15 var(--serif); letter-spacing: -.02em; color: #f4f0e6; }
.login-art .quote p { margin-top: 18px; color: #a9a597; font-size: 14px; line-height: 1.9; }
.login-art .grid-bg { position: absolute; inset: 0; opacity: .07; background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
.login-art .meta { margin-top: 36px; display: flex; gap: 22px; color: #8d897c; font: 11.5px var(--mono); }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form form { width: 100%; max-width: 340px; }
.login-form h1 { font: 500 26px var(--serif); letter-spacing: -.01em; }
.login-form .sub { color: var(--ink-3); margin: 6px 0 28px; font-size: 13px; }
.login-form .input { height: 40px; font-size: 14px; }
.login-form .btn { width: 100%; height: 40px; font-size: 14px; }
.login-form .foot { margin-top: 26px; color: var(--ink-3); font-size: 12px; line-height: 1.8; }

.err-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.err-page .code { font: 500 88px/1 var(--serif); color: var(--rule-2); letter-spacing: -.04em; }
.err-page h1 { font-size: 20px; margin-top: 14px; }
.err-page p { color: var(--ink-3); margin-top: 8px; }

.lightbox { width: auto; max-width: 96vw; max-height: 96vh; background: #1b1a17; border: 0; }
.lightbox img { display: block; max-width: 96vw; max-height: 90vh; }
.lightbox .cap { padding: 8px 12px; color: #cfcabd; font-size: 12px; display: flex; gap: 12px; }
.lightbox .cap a { color: #e9e5da; margin-left: auto; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .file-layout, .entry-layout { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 85; width: 264px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  body.side-open .side { transform: none; }
  body.side-open::after { content: ""; position: fixed; inset: 0; z-index: 84; background: rgba(30, 28, 20, .3); }
  .topbar .menu-btn { display: inline-flex; }
  .proj-head { grid-template-columns: 4px minmax(0, 1fr); }
  .proj-head .side-actions { grid-column: 2; flex-wrap: wrap; }
  .page-head .actions { margin-left: 0; }
  .topbar { padding: 0 14px; gap: 8px; }
  .search { display: none; }
  .content { padding: 18px 14px 80px; }
  .files-layout { grid-template-columns: minmax(0, 1fr); }
  .tree { display: none; }
  .hide-sm { display: none !important; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 48px 0 40px; }
  .hero h1 { font-size: 44px; }
  .pub-sec { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 32px 0; }
  .pub { padding: 0 18px; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: 28px 24px 32px; min-height: 0; }
  .login-art .quote h2 { font-size: 28px; }
  .login-art .quote { margin-top: 36px; }
  .uq { left: 10px; right: 10px; width: auto; bottom: 10px; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow .arrow { height: 26px; transform: rotate(90deg); }
  .day-group { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .day-num b { font-size: 26px; }
  .proto-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .proto-row .r { text-align: left; }
  .table th { top: 0; }
}
@media print {
  .side, .topbar, .no-print, .flash-wrap, .uq { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
}
