/* ═══════════════════════════════════════════════
   实验室 · 内网档案系统
   ═══════════════════════════════════════════════ */

:root {
  --bg: #060908;
  --bg-2: #090d0c;
  --panel: #0c1110;
  --panel-2: #101615;
  --line: rgba(185, 205, 195, 0.12);
  --line-strong: rgba(185, 205, 195, 0.26);
  --fg: #c8d2ca;
  --fg-dim: #78857d;
  --fg-faint: #48544d;
  --accent: #9dc6b0;
  --accent-dim: #5d7c6c;
  --violet: #a077c9;
  --alert: #c25b4a;

  --mono: "Cascadia Mono", "JetBrains Mono", "Sarasa Mono SC", Consolas, "Courier New", monospace;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --serif: "Songti SC", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body { overflow: hidden; }

::selection { background: rgba(157, 198, 176, 0.25); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: #29322d transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #29322d; border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── 全局特效 ── */
.fx-scan {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.026) 0px,
    rgba(255, 255, 255, 0.026) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.5;
  mix-blend-mode: overlay;
}
.fx-vignette {
  position: fixed; inset: 0; z-index: 901; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.58) 100%);
}
.fx-grain {
  position: fixed; inset: 0; z-index: 899; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.screen { position: relative; z-index: 1; height: 100dvh; }

/* ── 按钮 ── */
button { font-family: inherit; cursor: pointer; }

.ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--fg-dim);
  padding: 7px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-family: var(--mono);
  transition: 0.2s;
}
.ghost:hover { color: var(--accent); border-color: var(--accent-dim); }
.ghost.small { padding: 5px 10px; font-size: 10px; }
.ghost.wide {
  width: 100%;
  padding: 14px 16px;
  letter-spacing: 0.16em;
  font-size: 12px;
  line-height: 1.8;
}
.ghost.wide em {
  display: block;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
}

.solid {
  background: var(--accent);
  color: #0b1210;
  border: 1px solid var(--accent);
  padding: 0 26px;
  font-size: 13px;
  letter-spacing: 0.3em;
  font-weight: 700;
  transition: 0.2s;
  white-space: nowrap;
}
.solid:hover { background: #b4dcc6; }
.solid:disabled { opacity: 0.45; cursor: wait; }

/* ══════════════ 落地页 ══════════════ */

.landing {
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(60, 105, 82, 0.16), transparent 70%),
    radial-gradient(40% 30% at 50% 110%, rgba(120, 80, 160, 0.1), transparent 70%),
    var(--bg);
}
.landing.leaving { animation: landingOut 0.45s ease forwards; }
@keyframes landingOut { to { opacity: 0; transform: scale(1.015); } }

.landing-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(157, 198, 176, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 198, 176, 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(60% 55% at 50% 50%, #000 10%, transparent 78%);
  mask-image: radial-gradient(60% 55% at 50% 50%, #000 10%, transparent 78%);
}

.landing-core {
  position: relative; z-index: 2;
  text-align: center;
  animation: coreIn 1.2s ease both;
}
@keyframes coreIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.landing-mark {
  color: var(--accent-dim);
  margin-bottom: 34px;
  display: flex; justify-content: center;
  animation: markPulse 6s ease-in-out infinite;
}
@keyframes markPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.03); }
}

.landing-kicker {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--accent-dim);
}
.landing-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(48px, 9vw, 88px);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: #e6ecdf;
  text-shadow: 0 0 60px rgba(157, 198, 176, 0.18);
}
.landing-sub {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--fg-faint);
}

.landing-hint {
  position: absolute;
  bottom: 13%;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--fg-dim);
  z-index: 2;
}
.blink { animation: blink 2.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.28; } }

.landing-foot {
  position: absolute;
  bottom: calc(26px + env(safe-area-inset-bottom)); left: 32px; right: 32px;
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: #374139;
  z-index: 2;
}

/* ══════════════ 接入自检 ══════════════ */

.boot {
  display: grid;
  place-items: center;
  align-content: safe center;
  padding: 24px;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(60, 100, 80, 0.1), transparent 70%),
    var(--bg);
}
.boot-box { width: min(560px, 100%); }
.boot-log {
  margin: 0;
  padding: 20px 22px;
  min-height: 240px;
  border: 1px solid var(--line);
  background: rgba(9, 13, 11, 0.6);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2.05;
  color: var(--fg-dim);
  white-space: pre-wrap;
}
.boot-log .warn { color: var(--violet); }
.boot-log .cursor::after {
  content: "▊"; color: var(--accent); animation: blink 1s steps(2) infinite;
}
.boot-progress {
  height: 2px; margin-top: 16px;
  background: #18201b; overflow: hidden;
}
.boot-progress i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(157, 198, 176, 0.6);
  animation: bootFill 2.2s ease forwards;
}
@keyframes bootFill { to { width: 100%; } }

/* ══════════════ 登录 ══════════════ */

.login {
  display: grid;
  place-content: safe center;
  justify-items: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(60% 45% at 50% 38%, rgba(60, 100, 80, 0.1), transparent 70%),
    var(--bg);
}

.login-card {
  position: relative;
  width: min(520px, 92vw);
  padding: 46px 44px 32px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 22, 20, 0.96), rgba(9, 13, 12, 0.96));
  box-shadow: 0 30px 90px -40px #000;
}
.corner { position: absolute; width: 14px; height: 14px; border-color: var(--accent-dim); border-style: solid; border-width: 0; }
.corner.tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

.login-kicker {
  margin: 0 0 14px; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.34em; color: var(--accent-dim);
}
.login-title {
  margin: 0 0 16px; font-family: var(--serif); font-weight: 500;
  font-size: 40px; letter-spacing: 0.26em; color: #e6ecdf;
}
.login-desc {
  margin: 0 0 30px; font-size: 12.5px; line-height: 2; color: var(--fg-dim);
}

#login-form label {
  display: block; margin-bottom: 10px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.28em; color: var(--fg-faint);
}
.input-row { display: flex; gap: 0; border-bottom: 1px solid var(--line-strong); }
.input-row:focus-within { border-bottom-color: var(--accent-dim); }

#code {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #e8eee1;
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.14em;
  padding: 14px 4px;
  text-transform: uppercase;
}
#code::placeholder { color: #333d36; letter-spacing: 0.2em; }
#login-submit { margin-bottom: -1px; height: 46px; }

.or {
  display: flex; align-items: center; gap: 14px;
  margin: 24px 0 16px;
  font-family: var(--mono); font-size: 9px; color: var(--fg-faint);
  letter-spacing: 0.2em;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.login-msg {
  min-height: 22px; margin: 14px 0 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--alert);
}
.login-msg.busy { color: var(--accent); }
.login-msg.hint { color: var(--fg-faint); }

.login-foot {
  display: flex; gap: 10px; align-items: center;
  margin-top: 26px; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--fg-faint);
}
.dot-sep { color: var(--fg-faint); }

.login-note {
  margin-top: 24px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; color: var(--fg-faint);
}

/* ══════════════ 临时访客弹窗 ══════════════ */

.guest-dialog {
  width: min(440px, 90vw);
  padding: 36px 32px 28px;
  border: 1px solid var(--line-strong);
  background: #0b100e;
  color: var(--fg);
  box-shadow: 0 40px 120px -30px #000;
}
.guest-dialog::backdrop { background: rgba(3, 6, 5, 0.82); backdrop-filter: blur(2px); }
.guest-kicker {
  margin: 0 0 12px; font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.3em; color: var(--accent-dim);
}
.guest-dialog h3 {
  margin: 0 0 22px; font-family: var(--serif); font-weight: 500;
  font-size: 22px; letter-spacing: 0.1em; color: #e4e9dc;
}
.guest-code {
  margin: 0 0 16px; padding: 16px 18px;
  border: 1px dashed var(--accent-dim);
  font-family: var(--mono); font-size: 19px; letter-spacing: 0.14em;
  color: var(--accent); text-align: center;
  background: rgba(157, 198, 176, 0.04);
  user-select: all;
}
.guest-tip { margin: 0 0 26px; font-size: 11.5px; line-height: 1.9; color: var(--fg-dim); }
.guest-actions { display: flex; gap: 12px; }
.guest-actions .solid { height: 42px; flex: 1; }
.guest-actions .ghost { height: 42px; }

/* ══════════════ 主界面 ══════════════ */

.app {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) auto;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 21, 19, 0.92), rgba(8, 12, 11, 0.92));
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-seal {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: none;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--serif); font-size: 15px;
  background: rgba(157, 198, 176, 0.05);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.brand-text strong {
  font-family: var(--serif); font-weight: 500; font-size: 14px;
  letter-spacing: 0.12em; color: #dfe6d8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text em {
  font-style: normal; font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.2em; color: var(--fg-faint);
}
.topbar-right { display: flex; align-items: center; gap: 14px; flex: none; }

.clock {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: var(--fg-dim); font-variant-numeric: tabular-nums;
}

.badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  padding: 4px 9px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  background: rgba(157, 198, 176, 0.06);
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  min-height: 0;
}

.rail {
  display: flex; flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 11, 0.6);
}
.rail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 20px 20px 14px;
}
.rail-head h2 {
  margin: 0; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.3em; color: var(--fg-dim); font-weight: 400;
}
.rail-count { font-family: var(--mono); font-size: 9px; color: var(--fg-faint); letter-spacing: 0.1em; }

.doc-list { flex: 1; overflow-y: auto; padding-bottom: 16px; }

.group-label {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.24em;
  color: var(--fg-faint);
}
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.doc-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; border-left: 2px solid transparent;
  padding: 11px 18px 11px 20px;
  color: var(--fg);
  transition: background 0.16s, border-color 0.16s;
  position: relative;
}
.doc-item:hover { background: rgba(185, 205, 195, 0.035); }
.doc-item.active { background: rgba(157, 198, 176, 0.075); border-left-color: var(--accent); }
.doc-item .i-code {
  display: block; font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.12em; color: var(--fg-faint); margin-bottom: 4px;
}
.doc-item .i-title {
  display: -webkit-box; font-size: 12.5px; line-height: 1.6; color: #b6c0b5;
  overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.doc-item.active .i-title { color: #e4e8d9; }
.doc-item.locked .i-title { color: #4b554e; }
.doc-item.locked .i-code { color: #38423b; }
.doc-item .i-lock {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 9px; color: var(--fg-faint);
  border: 1px solid #29332c; padding: 1px 5px; letter-spacing: 0.05em;
}
.doc-item.locked:hover .i-lock { color: var(--alert); border-color: rgba(194, 91, 74, 0.4); }

.seal-tag {
  display: inline-block; margin-left: 6px;
  font-family: var(--mono); font-size: 8px; line-height: 1;
  padding: 2px 4px;
  border: 1px solid rgba(160, 119, 201, 0.45);
  color: var(--violet);
  vertical-align: 1px;
}

.rail-foot {
  padding: 12px 20px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--fg-faint);
}

/* 阅读区 */
.reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.reader-bar { display: none; }

.viewer {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 42px clamp(20px, 5vw, 72px) 80px;
  background: radial-gradient(80% 50% at 50% 0%, rgba(60, 100, 80, 0.07), transparent 70%);
  outline: none;
}
.viewer > * { max-width: 780px; margin-left: auto; margin-right: auto; }

.doc { position: relative; animation: docIn 0.45s ease both; }
@keyframes docIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.doc-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.doc-code {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.24em; color: var(--fg-faint);
}
.doc-stamp {
  font-family: var(--serif); font-size: 12px;
  letter-spacing: 0.34em; padding: 5px 12px 5px 16px;
  border: 1.5px solid currentColor;
  transform: rotate(-5deg);
  opacity: 0.85;
  white-space: nowrap;
}
.stamp-1 { color: #7fa98f; }
.stamp-2 { color: #c9a45e; }
.stamp-3 { color: #c07b55; }
.stamp-4 { color: var(--violet); }

.doc-title {
  margin: 30px 0 18px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.5; letter-spacing: 0.05em; color: #e4e9dc;
}
.doc-meta {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--fg-faint);
  padding-bottom: 24px;
}
.doc-meta b { color: var(--fg-dim); font-weight: 400; }

.sealed-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  margin: 0 0 24px;
  border: 1px dashed rgba(160, 119, 201, 0.4);
  background: rgba(160, 119, 201, 0.05);
}
.sealed-stamp {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.26em;
  color: var(--violet); border: 1px solid rgba(160, 119, 201, 0.5);
  padding: 4px 8px; flex: none;
}
.sealed-banner p {
  margin: 0; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.06em; color: #8b7f96;
}

.doc-body {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 2.1;
  color: #b4beb1;
  padding-top: 4px;
}
.doc-body p { margin: 0 0 1.15em; }
.doc-body h2 {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  letter-spacing: 0.12em; color: #d5ddcd;
  margin: 2em 0 0.9em;
  padding-left: 11px; border-left: 2px solid var(--accent-dim);
}
.doc-body h3 {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; color: #c6cfc0; margin: 1.6em 0 0.7em;
}
.doc-body ul, .doc-body ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.doc-body li { margin-bottom: 0.55em; }
.doc-body blockquote {
  margin: 1.4em 0; padding: 2px 0 2px 18px;
  border-left: 1px solid var(--line-strong);
  color: #8a948a; font-style: italic;
}
.doc-body hr { border: 0; border-top: 1px dashed var(--line); margin: 2em 0; }
.doc-body strong { color: #dde2d2; font-weight: 600; }

.redact {
  font-family: var(--mono);
  color: #212a23;
  background: #212a23;
  letter-spacing: -0.08em;
  border-radius: 1px;
  padding: 0 1px;
  cursor: help;
  user-select: none;
}

.doc-foot {
  margin-top: 44px; padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--fg-faint);
}

/* 无权限 */
.denied { animation: docIn 0.4s ease both; }
.denied-head { display: flex; justify-content: space-between; align-items: center; }
.denied-stamp {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em;
  border: 1px solid rgba(194, 91, 74, 0.5); color: var(--alert);
  padding: 6px 12px; transform: rotate(-3deg);
}
.denied-title {
  margin: 28px 0 10px; font-family: var(--serif); font-size: 26px;
  letter-spacing: 0.06em; color: #6c766d; font-weight: 500;
}
.denied-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--fg-faint); line-height: 1.9; }
.denied-body {
  margin-top: 34px; padding: 30px 28px;
  border: 1px dashed var(--line); background: rgba(13, 17, 15, 0.5);
}
.bar {
  height: 12px; margin-bottom: 14px;
  background: linear-gradient(90deg, #1a211b, #212923 60%, #1a211b);
}
.bar:nth-child(1) { width: 92%; }
.bar:nth-child(2) { width: 78%; }
.bar:nth-child(3) { width: 86%; }
.bar:nth-child(4) { width: 64%; }
.bar:nth-child(5) { width: 40%; }
.denied-actions { margin-top: 30px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.denied-hint { font-family: var(--mono); font-size: 10px; color: var(--fg-faint); letter-spacing: 0.06em; line-height: 1.8; }

/* ── 准入动画：人脸识别 + 载入控制台 ── */

.granted {
  position: fixed; inset: 0; z-index: 960;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  padding: 24px;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(70, 110, 88, 0.14), transparent 70%),
    #050807;
  animation: grantOut 0.5s ease 2.25s forwards;
}

.granted-grid {
  width: min(980px, 94vw);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  align-items: stretch;
}

.granted-bio {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 28px 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 20, 17, 0.95), rgba(8, 12, 10, 0.95));
}

.bio-frame {
  position: relative;
  width: 150px; height: 172px;
  border: 1px solid var(--accent-dim);
  background: radial-gradient(60% 50% at 50% 45%, rgba(157, 198, 176, 0.1), transparent 70%);
  overflow: hidden;
}
.bio-face {
  position: absolute; inset: 8% 6%;
  width: 88%; height: 84%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.3;
  opacity: 0.75;
}
.bio-scan {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(157, 198, 176, 0.9), transparent);
  box-shadow: 0 0 14px rgba(157, 198, 176, 0.6);
  animation: bioScan 2s ease-in-out infinite;
}
@keyframes bioScan {
  0%, 100% { top: 12%; opacity: 0.2; }
  50% { top: 86%; opacity: 1; }
}
.bio-corner {
  position: absolute; width: 12px; height: 12px;
  border: solid var(--accent-dim); border-width: 0;
}
.bio-corner.tl { top: 6px; left: 6px; border-top-width: 1px; border-left-width: 1px; }
.bio-corner.tr { top: 6px; right: 6px; border-top-width: 1px; border-right-width: 1px; }
.bio-corner.bl { bottom: 6px; left: 6px; border-bottom-width: 1px; border-left-width: 1px; }
.bio-corner.br { bottom: 6px; right: 6px; border-bottom-width: 1px; border-right-width: 1px; }

.bio-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bio-ok {
  margin: 20px 0 8px;
  font-family: var(--serif); font-weight: 500;
  font-size: 22px; letter-spacing: 0.18em; color: #e8eee1;
}
.bio-name {
  margin: 0; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.22em; color: var(--accent);
}
.bio-meta {
  margin: 10px 0 0; font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.1em; color: var(--fg-faint); text-align: center;
}

.granted-console {
  display: flex; flex-direction: column;
  min-height: 292px;
  border: 1px solid var(--line);
  background: #070b09;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}
.console-head {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 8.5px;
  letter-spacing: 0.2em; color: var(--fg-faint);
}
.console-head .dots { display: flex; gap: 4px; }
.console-head .dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2a342c; display: block;
}
.console-log {
  flex: 1;
  margin: 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.95;
  color: #8fb9a4;
  overflow: hidden;
  white-space: pre-wrap;
}
.console-log div { animation: lineIn 0.18s ease both; }
.console-log .ok { color: var(--accent); }
@keyframes lineIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.console-progress {
  height: 2px; margin: 0 14px 14px; background: #161d18; overflow: hidden;
}
.console-progress i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(157, 198, 176, 0.7);
  animation: grantFill 1.9s 0.15s ease forwards;
}
@keyframes grantFill { to { width: 100%; } }
@keyframes grantOut { to { opacity: 0; visibility: hidden; } }

.granted-note {
  margin: 0;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.26em; color: var(--fg-faint);
  text-align: center;
}

/* 底部状态栏 */
.statusbar {
  display: flex; align-items: center; gap: 22px;
  min-height: 30px;
  padding: 0 18px calc(env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(7, 10, 9, 0.9);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--fg-faint);
  white-space: nowrap; overflow: hidden;
}
.status-item { display: flex; align-items: center; gap: 7px; }
.status-right { margin-left: auto; color: #3b453e; }
.led {
  width: 5px; height: 5px; border-radius: 50%;
  background: #6aa886; box-shadow: 0 0 6px #6aa886;
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.35; } }

/* 载入 / 错误 */
.plain-msg {
  padding: 60px 0; text-align: center;
  font-family: var(--mono); font-size: 12px; line-height: 2; color: var(--fg-dim);
  white-space: pre-wrap;
}
.plain-msg strong { display: block; color: var(--alert); margin-bottom: 10px; letter-spacing: 0.16em; }

/* ══════════════ 响应式 ══════════════ */

@media (max-width: 880px) {
  .landing-title { font-size: 54px; letter-spacing: 0.24em; }
  .landing-hint { bottom: 16%; font-size: 10px; }
  .landing-foot { left: 18px; right: 18px; }

  .app { grid-template-rows: 52px minmax(0, 1fr) auto; }
  .brand-text em { display: none; }
  .clock { display: none; }
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  .rail {
    display: none;
    height: 100%;
    border-right: 0;
    max-height: none;
  }
  .doc-list { flex: 1; overflow-y: auto; padding-bottom: 28px; }
  .rail-head { padding: 14px 18px 8px; }
  .rail-foot { display: none; }
  .doc-item { padding: 11px 16px; }
  .doc-item .i-title { -webkit-line-clamp: 1; }

  /* 手机端：先目录，后阅读 */
  .app.index-mode .rail { display: flex; }
  .app.index-mode .reader { display: none; }
  .app.reading-mode .rail { display: none; }
  .app.reading-mode .reader { display: flex; }
  .app.reading-mode .reader-bar { display: flex; }

  .reader-bar {
    flex: none;
    align-items: center;
    gap: 12px;
    height: 44px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 12, 11, 0.96);
  }
  .reader-bar .ghost.small { padding: 5px 10px; letter-spacing: 0.08em; }
  .reader-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    color: var(--fg-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .viewer { padding: 22px 18px calc(60px + env(safe-area-inset-bottom)); }
  .doc-title { margin-top: 22px; }
  .login-card { padding: 34px 24px 24px; }
  .login-title { font-size: 32px; }
  .statusbar { gap: 14px; }
  .status-right { display: none; }
  .guest-actions { flex-direction: column; }

  .granted { padding: 16px; gap: 10px; }
  .granted-grid { grid-template-columns: 1fr; gap: 12px; width: min(430px, 94vw); }
  .granted-bio { flex-direction: row; gap: 14px; padding: 14px 16px; justify-content: flex-start; }
  .bio-text { align-items: flex-start; min-width: 0; }
  .bio-frame { width: 84px; height: 98px; flex: none; }
  .bio-ok { font-size: 17px; margin: 0 0 5px; letter-spacing: 0.12em; }
  .bio-name { font-size: 11px; }
  .bio-meta { font-size: 8px; margin-top: 7px; text-align: left; }
  .granted-console { min-height: 166px; }
  .console-head { font-size: 7.5px; letter-spacing: 0.12em; }
  .console-log { font-size: 9px; line-height: 1.75; padding: 10px 12px; }
  .granted-note { font-size: 8px; letter-spacing: 0.18em; }
}

@media (max-width: 400px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-seal { width: 26px; height: 26px; font-size: 13px; }
  .brand-text strong { font-size: 12.5px; letter-spacing: 0.08em; }
  .topbar-right { gap: 8px; }
  .badge { font-size: 9px; padding: 3px 6px; letter-spacing: 0.08em; }
  .ghost.small { padding: 5px 8px; }
  .statusbar { gap: 10px; padding-left: 12px; padding-right: 12px; }
  #status-time { display: none; }
  .landing-title { font-size: 46px; letter-spacing: 0.22em; }
  .landing-foot { left: 16px; right: 16px; font-size: 8px; letter-spacing: 0.1em; }
  .doc-body { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
