/* ============================================================
   mails.offerdao.ai — design system v4
   Modern product UI with restrained cassette-futurist hardware cues.
   ============================================================ */

/* Geist / Geist Mono — same faces as offerdao.ai */
@font-face {
  font-family: "GeistVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/vendor/fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist MonoVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/vendor/fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:            #f6f3eb;
  --bg-subtle:     #eeebe2;
  --surface:       #fdfcf8;
  --surface-raised:#e6e2d7;
  --hardware:      #d3cec0;
  --hardware-dark: #858175;
  --text:          #1b1d19;
  --text-2:        #65665f;
  --text-3:        #96958b;
  --border:        rgba(34, 35, 30, 0.09);
  --border-strong: rgba(34, 35, 30, 0.18);
  --accent:        #2497f1;
  --accent-hover:  #1583db;
  --accent-soft:   rgba(36, 151, 241, 0.09);
  --accent-glow:   rgba(36, 151, 241, 0.25);
  --phosphor:      #62b977;
  --phosphor-soft: rgba(98, 185, 119, 0.12);
  --amber:         #c68b31;
  --amber-soft:    rgba(198, 139, 49, 0.11);
  --ink:           #20231f;
  --ok:            #17a34a;
  --err:           #d33d32;
  --err-soft:      rgba(211, 61, 50, 0.08);

  --font-sans: "GeistVariable", "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", serif;
  --font-mono: "Geist MonoVariable", "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --t-fast: 140ms;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);

  --nav-height: 72px;
  --nav-item-height: 32px;
  --nav-font-size: 13.5px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(circle at 82% -10%, rgba(36, 151, 241, 0.055), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  height: var(--nav-height);
  border-bottom: 1px solid var(--border);
  background: rgba(246, 243, 235, 0.92);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.55), 0 4px 18px -18px rgba(37,38,32,0.65);
  position: relative; z-index: 50;
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 100%;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  flex: none; min-height: var(--nav-item-height);
  font-weight: 650; font-size: 15px; line-height: 1; letter-spacing: -0.01em;
}
.brand svg { color: var(--text); }
.brand img { width: 20px; height: 20px; display: block; filter: invert(1); /* offerdao logo ships white; ink it for the light nav */ }
.accent-text { color: var(--accent); }
.brand .brand-suffix { color: var(--text-3); font-weight: 450; }
.nav-links {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0;
}
.nav-links > a,
.nav-links > .acct .acct-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--nav-item-height); min-height: var(--nav-item-height);
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 0 12px;
  background: transparent; color: var(--text-2);
  font-family: var(--font-sans); font-size: var(--nav-font-size); font-weight: 500; line-height: 1;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-links > a:hover,
.nav-links > .acct .acct-btn:hover { color: var(--text); background: var(--bg-subtle); }
.nav-links > a[aria-current="page"],
.nav-links > .acct .acct-btn[aria-current="page"] {
  color: var(--text); background: linear-gradient(#f5f2e9, var(--surface-raised));
  border-color: var(--border-strong); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 0 rgba(71,69,62,0.22);
}

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.dot.ok { background: var(--phosphor); box-shadow: 0 0 7px rgba(98,185,119,0.65); }
.dot.err { background: var(--err); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 14.5px; font-weight: 550;
  background: var(--ink); color: #fff;
  border: 1px solid #121410; border-radius: 7px;
  padding: 11px 24px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 2px 0 #080a08;
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.ghost {
  background: linear-gradient(#fffefa, #ece8de); color: var(--text); border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 2px 0 rgba(95,92,82,0.32);
}
.btn.ghost:hover { opacity: 1; background: var(--bg-subtle); }
.btn.danger { background: var(--err); border-color: #a82d26; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 2px 0 #8d2721; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.text-link { color: var(--accent-hover); }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- forms ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
textarea, select {
  font-family: var(--font-sans); font-size: 14.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 10px 14px; width: 100%;
  box-shadow: inset 0 1px 2px rgba(45,45,39,0.04), 0 1px 0 rgba(255,255,255,0.6);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 120px; font-family: var(--font-mono); font-size: 13px; }
label {
  display: block; font-size: 12px; font-weight: 550; letter-spacing: 0.04em;
  color: var(--text-2); margin: 16px 0 6px;
}
input[type="file"] { border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: 14px; width: 100%; font-size: 13px; color: var(--text-2); background: var(--surface); }

/* ---------- text utils ---------- */
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 650;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3);
}
.kicker::before {
  content: ""; width: 6px; height: 6px; flex: none; border-radius: 2px;
  background: var(--phosphor); box-shadow: 0 0 7px rgba(98,185,119,0.55);
}
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.err-text { color: var(--err); }
.ok-text { color: var(--ok); }

/* Geist Mono calt joins "--" into a dash that inks over the preceding
   space — disable ligatures wherever mono renders CLI text */
code, .code, pre, .term-body, .usage-lines {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

code, .code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: #ece9df; border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 7px; word-break: break-all;
}
.cmdrow { display: flex; gap: 8px; align-items: stretch; margin: 6px 0; }
.cmdrow .code { flex: 1; padding: 10px 14px; display: block; }
.cmdrow .code.code-single-line {
  min-width: 0; white-space: nowrap; overflow-x: auto; overflow-y: hidden; text-overflow: clip; word-break: normal;
  overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch;
}
.cmdrow .code.code-single-line,
code.keymask { scrollbar-width: thin; scrollbar-color: rgba(91,89,80,.45) transparent; }
.cmdrow .code.code-single-line:focus-visible,
code.keymask:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmdrow .code.code-single-line::-webkit-scrollbar,
code.keymask::-webkit-scrollbar { height: 4px; }
.cmdrow .code.code-single-line::-webkit-scrollbar-thumb,
code.keymask::-webkit-scrollbar-thumb { background: rgba(91,89,80,.38); border-radius: var(--r-pill); }
.copybtn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: linear-gradient(#fffefa, #e9e5da); color: var(--text-2); cursor: pointer; padding: 0 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78), 0 2px 0 rgba(95,92,82,0.28);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.copybtn:hover { color: var(--text); background: var(--bg-subtle); }
.copybtn:active { transform: translateY(2px); box-shadow: none; }

pre {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 18px 20px; overflow-x: auto; margin: 12px 0;
}

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; font-weight: 550; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }

/* card table: bordered rounded container, filled header band (settings: API keys) */
.tbl-card {
  margin-top: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface); box-shadow: 0 10px 28px -26px rgba(35,35,30,0.55);
  overflow: hidden;
}
.tbl-card th {
  background: linear-gradient(#eeebe2, #e4e0d5); color: var(--text-2);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.tbl-card td { padding: 11px 14px; vertical-align: middle; }
.tbl-card th:last-child, .tbl-card td:last-child { text-align: right; }
.tbl-card tbody tr:last-child td { border-bottom: none; }
.tbl-card.loading { padding: 12px 14px; }
.tbl-card > p { margin: 0; padding: 12px 14px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--bg-subtle); }

.badge {
  display: inline-block; border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  padding: 0 8px; font-size: 11px; color: var(--text-2);
}
.badge.out { background: var(--ink); border-color: var(--ink); color: #fff; }

.loading { color: var(--text-3); }
.empty { color: var(--text-3); }

/* ---------- landing (minimal, two-column) ---------- */
.hero-min {
  display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  gap: 72px; align-items: center;
  padding: 11vh 0 0; text-align: left;
  min-height: 62vh;
}
.hero-min .mark {
  width: 64px; height: 64px; border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #2fa4f7, #1274c4);
  color: #fff; margin-bottom: 30px;
  box-shadow: 0 12px 32px -12px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.35);
}
.hero-min h1 {
  font-size: clamp(32px, 4.2vw, 46px); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.25; margin: 0 0 22px;
}
.hero-min h1 .quiet { color: var(--text-3); font-weight: 650; }
.hero-min h1 .accent-serif { font-family: var(--font-serif); font-style: italic; font-weight: 500; letter-spacing: -0.02em; }
.hero-min .sub {
  font-size: 16px; color: var(--text-2); line-height: 1.7;
  max-width: 440px; margin: 0 0 36px;
}
.claim-row { display: flex; gap: 10px; max-width: 470px; margin: 0; }
.claim-row .addr-wrap {
  flex: 1; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 0 18px 0 20px;
  box-shadow: inset 0 1px 2px rgba(45,45,39,0.035), 0 1px 0 rgba(255,255,255,0.65);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.claim-row .addr-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.claim-row input {
  border: 0; background: transparent; padding: 12px 0; box-shadow: none; border-radius: 0;
  font-size: 15px; min-width: 0;
}
.claim-row input:focus { box-shadow: none; border: 0; }
.claim-row .addr-domain { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.hero-min .alt-cmd { margin-top: 16px; font-size: 13px; color: var(--text-3); }
.hero-min .alt-cmd code { background: transparent; border: 0; color: var(--text-2); }

/* install / usage rows (mails.dev-style) */
.hrule { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }
.row-grid { display: grid; grid-template-columns: 76px 1fr; gap: 18px; align-items: start; max-width: 470px; }
.row-grid > div { min-width: 0; }
.row-grid .row-label { font-size: 13px; font-weight: 650; padding-top: 9px; }
.usage-lines { display: grid; gap: 7px; font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.usage-lines .u-dim { color: var(--text-3); }

.claim-panel-min { max-width: 470px; margin: 0; text-align: left; }

/* retro-futurist computer — a physical CRT showing the Agent Mail loop */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.shot { margin: 0; min-width: 0; position: relative; isolation: isolate; }
.shot::before {
  content: ""; position: absolute; inset: -12% -10% -8%; z-index: -1;
  background:
    radial-gradient(42% 48% at 18% 22%, rgba(36, 151, 241, 0.34), transparent 72%),
    radial-gradient(36% 40% at 82% 28%, rgba(255, 180, 72, 0.22), transparent 70%),
    radial-gradient(46% 42% at 58% 86%, rgba(45, 212, 191, 0.22), transparent 72%);
  filter: blur(36px); pointer-events: none;
}
.retro-computer {
  position: relative; width: min(100%, 470px); margin: 0 auto;
  transform: perspective(1200px) rotateY(-1.2deg) rotateX(0.5deg);
  transform-origin: center bottom;
  transition: transform 420ms var(--ease);
}
.retro-computer:hover { transform: perspective(1200px) rotateY(0) rotateX(0) translateY(-2px); }
.monitor-shell {
  position: relative; padding: 15px 17px 13px;
  border: 1px solid rgba(63, 59, 50, 0.25); border-radius: 28px 28px 34px 34px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.44), transparent 28%),
    linear-gradient(145deg, #e2dfd4 0%, #c9c4b5 58%, #aaa596 100%);
  box-shadow:
    0 34px 70px -30px rgba(37, 42, 44, 0.55),
    inset 0 1px 0 rgba(255,255,255,0.72),
    inset 0 -2px 0 rgba(63,59,50,0.13);
}
.monitor-shell::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -9px; height: 13px;
  border-radius: 0 0 50% 50%; background: #8f8b80; z-index: -1;
  box-shadow: 0 7px 16px rgba(35,35,32,0.25);
}
.monitor-labels {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 9px 10px; color: #4d4b45;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em;
}
.machine-brand { color: #22221f; font-weight: 800; letter-spacing: 0.14em; }
.machine-model { color: #747168; }
.crt-bezel {
  padding: 12px; border-radius: 23px;
  background: linear-gradient(145deg, #363834, #151814 70%);
  border: 1px solid rgba(23,25,22,0.75);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.85),
    0 1px 0 rgba(255,255,255,0.35);
}
.crt-screen {
  position: relative; isolation: isolate; overflow: hidden;
  aspect-ratio: 4 / 3; border-radius: 19px / 16px;
  color: #a9efb9; background:
    radial-gradient(circle at 50% 46%, rgba(28, 92, 47, 0.17), transparent 62%),
    #061008;
  border: 1px solid rgba(119, 206, 138, 0.2);
  box-shadow:
    inset 0 0 34px rgba(0,0,0,0.94),
    inset 0 0 10px rgba(86, 220, 115, 0.16),
    0 0 14px rgba(81, 205, 108, 0.09);
  text-shadow: 0 0 6px rgba(120, 255, 147, 0.42);
}
.crt-content {
  position: relative; z-index: 2; display: grid;
  grid-template-rows: 28px minmax(0, 1fr) 24px; height: 100%;
  transform-origin: center;
}
.crt-screen::before {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0, rgba(255,255,255,0.025) 1px, rgba(0,0,0,0.12) 2px, rgba(0,0,0,0.12) 4px);
  mix-blend-mode: screen; opacity: 0.8;
}
.crt-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 54%, rgba(0,0,0,0.24) 78%, rgba(0,0,0,0.58) 100%);
  box-shadow: inset 0 0 18px rgba(0,0,0,0.72);
}
.crt-power-flash {
  position: absolute; z-index: 7; top: 50%; left: 50%; width: 0; height: 2px;
  border-radius: 50%; opacity: 0; pointer-events: none;
  background: #d8ffe0; transform: translate(-50%, -50%);
  box-shadow: 0 0 8px #c7ffd2, 0 0 22px rgba(120,255,147,0.88), 0 0 44px rgba(120,255,147,0.42);
}
.crt-screen.is-off {
  color: transparent; background: #020403; text-shadow: none;
  border-color: rgba(255,255,255,0.045);
  box-shadow: inset 0 0 38px rgba(0,0,0,0.96), 0 1px 0 rgba(255,255,255,0.03);
}
.crt-screen.is-off .crt-content,
.crt-screen.is-off .crt-power-flash { opacity: 0; }
.crt-screen.is-off::before { opacity: 0; }
.retro-computer.is-off .power-led { background: #55534d; box-shadow: none; animation: none; }
.retro-computer.is-off .monitor-status { color: #67645d; }
/* 关机晾着几秒后的委屈状态：LED 转琥珀色慢闪 */
.retro-computer.is-sulking .power-led { background: var(--amber); box-shadow: 0 0 8px rgba(198,139,49,0.75); }
.retro-computer.is-sulking .monitor-status { color: var(--amber); }
/* 关机后的驻留幽灵：磷光余辉小机器人（爱、死亡与机器人）。居中不游荡，靠表情过日子 */
.crt-ghost {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity 1400ms var(--ease);
}
.crt-ghost.on { opacity: 0.5; }
.crt-screen.is-haunted::before { opacity: 0.28; }  /* 幽灵在时，玻璃上找回一点扫描线 */
.ghost-face {
  position: relative; width: 112px; height: 88px;
  border: 2.5px solid rgba(158, 238, 176, 0.75); border-radius: 24px;
  box-shadow: 0 0 26px rgba(117, 239, 143, 0.3), inset 0 0 16px rgba(117, 239, 143, 0.14);
  transition: transform 600ms var(--ease);
}
.ghost-face[data-mood="sleep"] { transform: rotate(-5deg); }
.ghost-antenna {
  position: absolute; top: -20px; left: 50%; margin-left: -2px;
  width: 4px; height: 18px; border-radius: 2px; background: rgba(158, 238, 176, 0.75);
}
.ghost-antenna::after {
  content: ""; position: absolute; top: -11px; left: -4.5px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #9eeeb0; box-shadow: 0 0 14px rgba(117, 239, 143, 0.85);
}
.ghost-eye {
  position: absolute; top: 26px; width: 17px; height: 24px; border-radius: 6px;
  background: #9eeeb0; box-shadow: 0 0 12px rgba(117, 239, 143, 0.55);
  font: 600 26px/26px var(--font-mono); color: #9eeeb0; text-align: center;
  transition: height 140ms var(--ease), transform 140ms var(--ease), border-radius 140ms var(--ease);
}
.ghost-eye.left { left: 26px; }
.ghost-eye.right { right: 26px; }
.ghost-eye.char {
  width: 26px; height: 26px; background: transparent; box-shadow: none;
  text-shadow: 0 0 12px rgba(117, 239, 143, 0.7);
}
.ghost-face.blink .ghost-eye { height: 4px; transform: translateY(11px); }
.ghost-face.glance-l .ghost-eye { transform: translateX(-6px); }
.ghost-face.glance-r .ghost-eye { transform: translateX(6px); }
/* 睡觉：闭眼弧 + 脑袋微歪 + 飘 z */
.ghost-face[data-mood="sleep"] .ghost-eye { height: 4px; transform: translateY(12px); border-radius: 0 0 6px 6px; }
/* 害羞：眯眯眼（上弯弧）+ 腮红 */
.ghost-face[data-mood="shy"] .ghost-eye { height: 5px; transform: translateY(5px); border-radius: 6px 6px 0 0; }
.ghost-blush {
  position: absolute; top: 54px; width: 16px; height: 6px; border-radius: 3px;
  background: rgba(255, 133, 150, 0.42); box-shadow: 0 0 9px rgba(255, 99, 122, 0.35);
  opacity: 0; transition: opacity 200ms var(--ease);
}
.ghost-blush.left { left: 17px; }
.ghost-blush.right { right: 17px; }
.ghost-face[data-mood="shy"] .ghost-blush { opacity: 1; }
/* 生气：斜眉 + 眯起的眼 */
.ghost-brow {
  position: absolute; top: 15px; width: 20px; height: 4px; border-radius: 2px;
  background: #9eeeb0; box-shadow: 0 0 10px rgba(117, 239, 143, 0.5);
  opacity: 0; transition: opacity 140ms var(--ease);
}
.ghost-brow.left { left: 23px; transform: rotate(20deg); }
.ghost-brow.right { right: 23px; transform: rotate(-20deg); }
.ghost-face[data-mood="angry"] .ghost-brow { opacity: 1; }
.ghost-face[data-mood="angry"] .ghost-eye { height: 13px; transform: translateY(7px); }
.ghost-mouth {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 4px; border-radius: 3px; background: #9eeeb0;
  box-shadow: 0 0 10px rgba(117, 239, 143, 0.5);
  transition: width 200ms var(--ease), height 200ms var(--ease), transform 200ms var(--ease);
}
.ghost-face[data-mood="love"] .ghost-mouth {
  width: 34px; height: 14px; background: transparent; box-shadow: none;
  border: 3px solid #9eeeb0; border-top: 0; border-radius: 0 0 20px 20px;
}
/* 情绪道具允许离开磷光绿：红爱心（脸和嘴保持绿，守住三色上限） */
.ghost-face[data-mood="love"] .ghost-eye.char {
  color: #ff8798; text-shadow: 0 0 13px rgba(255, 99, 122, 0.8);
}
.ghost-face[data-mood="dead"] .ghost-mouth { width: 22px; transform: translateX(-50%) rotate(-9deg); }
/* 圈圈眼：被敲晕了，嘴巴惊成 o */
.ghost-face[data-mood="dizzy"] .ghost-mouth {
  width: 15px; height: 15px; background: transparent; box-shadow: none;
  border: 3px solid #9eeeb0; border-radius: 50%;
}
.ghost-face[data-mood="sleep"] .ghost-mouth { width: 14px; height: 3px; }
.ghost-face[data-mood="shy"] .ghost-mouth {
  width: 20px; height: 9px; background: transparent; box-shadow: none;
  border: 3px solid #9eeeb0; border-top: 0; border-radius: 0 0 12px 12px;
}
/* 哼歌：小 o 嘴 + 飘音符 */
.ghost-face[data-mood="hum"] .ghost-mouth {
  width: 11px; height: 11px; background: transparent; box-shadow: none;
  border: 3px solid #9eeeb0; border-radius: 50%;
}
.ghost-face[data-mood="angry"] .ghost-mouth { width: 13px; }
.ghost-notes {
  position: absolute; top: -28px; left: -42px; width: 54px; height: 48px;
  display: none; font-family: var(--font-mono); font-weight: 700;
  /* “黑白”音符：这块屏上的无彩色只能是银白 */
  color: rgba(250, 253, 252, 0.98); text-shadow: 0 0 12px rgba(255, 255, 255, 0.75);
}
.ghost-face[data-mood="hum"] .ghost-notes { display: block; }
.ghost-notes i { position: absolute; font-style: normal; opacity: 0.85; }
.ghost-notes i:nth-child(1) { left: 30px; top: 26px; font-size: 14px; }
.ghost-notes i:nth-child(2) { left: 13px; top: 10px; font-size: 17px; }
.ghost-notes i:nth-child(3) { left: 0; top: -6px; font-size: 14px; }
.ghost-zzz {
  position: absolute; top: -30px; right: -42px; width: 54px; height: 48px;
  display: none; font-family: var(--font-mono); font-weight: 700;
  color: rgba(158, 238, 176, 0.8); text-shadow: 0 0 10px rgba(117, 239, 143, 0.6);
}
.ghost-face[data-mood="sleep"] .ghost-zzz { display: block; }
.ghost-zzz i { position: absolute; font-style: normal; opacity: 0.8; }
.ghost-zzz i:nth-child(1) { left: 0; top: 28px; font-size: 12px; }
.ghost-zzz i:nth-child(2) { left: 15px; top: 13px; font-size: 16px; }
.ghost-zzz i:nth-child(3) { left: 32px; top: -4px; font-size: 21px; }
.crt-topbar,
.crt-footer {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 0 13px; font-family: var(--font-mono); line-height: 1;
  font-size: 9px; letter-spacing: 0.08em; color: rgba(169,239,185,0.62);
  background: rgba(76, 194, 101, 0.045);
}
.crt-topbar { border-bottom: 1px solid rgba(132, 238, 154, 0.11); }
.crt-footer { border-top: 1px solid rgba(132, 238, 154, 0.11); }
.crt-footer span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crt-footer span:last-child { flex: none; margin-left: 10px; }
.crt-online { display: inline-flex; align-items: center; gap: 6px; color: #88e99c; }
.crt-online i { width: 5px; height: 5px; border-radius: 50%; background: #74ef8e; box-shadow: 0 0 8px #74ef8e; }
.crt-body {
  position: relative; z-index: 2; overflow: hidden;
  padding: 12px 14px 10px; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.48;
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0;
}
.crt-line { min-height: 1.48em; white-space: pre-wrap; overflow-wrap: anywhere; }
.crt-line + .crt-line { margin-top: 2px; }
.crt-line.dim { color: rgba(169,239,185,0.48); }
.crt-line.sys { color: #67b8ff; text-shadow: 0 0 7px rgba(68,162,246,0.45); }
.crt-line.ok { color: #9cffad; }
.crt-line.amber { color: #ffd17c; text-shadow: 0 0 7px rgba(255,190,80,0.36); }
.crt-prompt { color: #69baff; margin-right: 6px; }
.crt-cursor {
  display: inline-block; width: 6px; height: 1.05em; margin-left: 2px;
  background: #9eeeb0; vertical-align: -2px; box-shadow: 0 0 7px rgba(117,239,143,0.7);
}
.crt-mail {
  margin: 8px 0 7px; padding: 8px 10px; border: 1px solid rgba(136,233,156,0.32);
  border-radius: 4px; color: #b8f4c4; background: rgba(72, 175, 94, 0.08);
  box-shadow: inset 3px 0 0 rgba(103,184,255,0.68);
}
.crt-mail-head { display: flex; justify-content: space-between; gap: 8px; color: #69baff; margin-bottom: 4px; }
.crt-mail-head span:last-child { color: rgba(169,239,185,0.5); }
.crt-mail-subject { color: #ddffe4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crt-mail-meta { margin-top: 3px; color: #ffd17c; }
.crt-mail.meeting { border-color: rgba(103,184,255,0.42); background: rgba(72,135,175,0.1); }
.crt-mail-link {
  margin-top: 4px; color: #79c4ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: underline; text-decoration-color: rgba(121,196,255,0.4); text-underline-offset: 2px;
}
.monitor-controls {
  display: flex; align-items: center; min-height: 43px; padding: 9px 6px 0 9px;
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.08em; color: #66635b;
}
.power-led { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(36,151,241,0.75); }
.power-label { margin-left: 6px; }
.monitor-status { margin-left: 18px; color: #89857a; }
.monitor-copy {
  margin-left: auto; height: 24px; border: 1px solid rgba(65,62,55,0.28); border-radius: 5px;
  padding: 0 9px; cursor: pointer; background: rgba(255,255,255,0.24); color: #57554f;
  font-family: var(--font-mono); font-size: 8px; font-weight: 650; letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 1px rgba(50,48,43,0.12);
}
.monitor-copy:hover { background: rgba(255,255,255,0.48); color: #22221f; }
.monitor-copy:focus-visible,
.mode-key:focus-visible,
.monitor-knob:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.monitor-knob {
  position: relative; display: grid; place-items: center;
  width: 26px; height: 26px; margin-left: 9px; border-radius: 50%;
  flex: none; padding: 0; cursor: pointer; appearance: none;
  background: radial-gradient(circle at 38% 32%, #77766f, #242622 72%);
  border: 1px solid rgba(20,20,18,0.65);
  box-shadow: 0 1px 1px rgba(255,255,255,0.38), inset 0 0 0 2px rgba(255,255,255,0.05), 0 0 0 rgba(36,151,241,0);
  transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.monitor-knob svg {
  display: block; width: 14px; height: 14px; overflow: visible;
  fill: none; stroke: #d2cec1; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  transform: translateY(-0.15px);
}
.monitor-knob:hover { filter: brightness(1.16); transform: translateY(-1px); box-shadow: 0 2px 2px rgba(255,255,255,0.35), inset 0 0 0 2px rgba(255,255,255,0.07), 0 0 9px rgba(36,151,241,0.22); }
.monitor-knob:active { transform: translateY(1px) scale(0.96); }
.monitor-knob[aria-pressed="false"] svg { stroke: #858279; }
.retro-keyboard {
  position: relative; z-index: -1; display: flex; align-items: flex-start; gap: 6px;
  width: 88%; min-height: 52px; margin: -1px auto 0; padding: 14px 14px 8px;
  border: 1px solid rgba(66,62,54,0.22); border-radius: 0 0 18px 18px;
  background: linear-gradient(#c9c4b7, #aaa597);
  box-shadow: 0 13px 25px -14px rgba(36,36,32,0.55), inset 0 1px 0 rgba(255,255,255,0.48);
}
.mode-key {
  display: inline-flex; align-items: center; justify-content: center;
  height: 27px; min-width: 52px; padding: 0 9px; cursor: pointer;
  border: 1px solid rgba(48,47,43,0.46); border-radius: 5px;
  background: linear-gradient(#f1eee4, #d3cfc3); color: #5e5b53;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 0 #817d72;
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 600; line-height: 1;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.mode-key:hover { color: #1f211e; background: linear-gradient(#fffdf4, #ded9cb); }
.mode-key:active,
.mode-key.is-pressed { transform: translateY(2px); box-shadow: inset 0 1px 2px rgba(0,0,0,0.14); }
.mode-key.active { color: #e9fff0; background: linear-gradient(#365f43, #203c29); border-color: #1e3625; box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 2px 0 #122718; }
.snd-key { margin-left: auto; min-width: 40px; }

@media (prefers-reduced-motion: no-preference) {
  .crt-online i, .power-led { animation: ledPulse 2.2s ease-in-out infinite; }
  .crt-cursor { animation: crtBlink 0.9s steps(1) infinite; }
  .crt-screen.is-booting .crt-content { animation: crtContentOn 760ms ease-out; }
  .crt-screen.is-booting .crt-power-flash { animation: crtFlashOn 760ms ease-out; }
  .crt-screen.is-powering-off { animation: crtGlassOff 720ms ease-in forwards; }
  .crt-screen.is-powering-off .crt-content { animation: crtContentOff 720ms ease-in forwards; }
  .crt-screen.is-powering-off .crt-power-flash { animation: crtFlashOff 720ms ease-in forwards; }
  .crt-screen.is-powering-on { animation: crtGlassOn 1180ms ease-out; }
  .crt-screen.is-powering-on .crt-content { animation: crtContentOn 1180ms ease-out; }
  .crt-screen.is-powering-on .crt-power-flash { animation: crtFlashOn 1180ms ease-out; }
  .retro-computer.is-sulking .power-led { animation: sulkBlink 1.8s ease-in-out infinite; }
  @keyframes sulkBlink { 50% { opacity: 0.22; } }
  .crt-ghost.on { animation: ghostBreath 4.6s ease-in-out infinite; }
  @keyframes ghostBreath { 50% { transform: translateY(-7px); } }
  .ghost-face[data-mood="dizzy"] .ghost-eye { animation: ghostSpin 900ms linear infinite; }
  @keyframes ghostSpin { to { rotate: 360deg; } }
  .ghost-zzz i { animation: zzzFloat 2.6s ease-in-out infinite; }
  .ghost-zzz i:nth-child(2) { animation-delay: 0.6s; }
  .ghost-zzz i:nth-child(3) { animation-delay: 1.2s; }
  .ghost-notes i { animation: zzzFloat 2.2s ease-in-out infinite; }
  .ghost-notes i:nth-child(2) { animation-delay: 0.5s; }
  .ghost-notes i:nth-child(3) { animation-delay: 1s; }
  @keyframes zzzFloat {
    0% { opacity: 0; transform: translateY(8px); }
    35% { opacity: 0.85; }
    65% { opacity: 0.85; }
    100% { opacity: 0; transform: translateY(-10px); }
  }
  .crt-screen.is-degauss .crt-content { animation: crtDegauss 640ms var(--ease); }
  @keyframes crtDegauss {
    0% { transform: none; filter: none; }
    16% { transform: scale(1.014, 0.985) skewX(1.4deg); filter: hue-rotate(24deg) saturate(1.7) brightness(1.3); }
    36% { transform: scale(0.99, 1.012) skewX(-1deg); filter: hue-rotate(-16deg) saturate(1.35) brightness(1.08); }
    58% { transform: scale(1.006, 0.996) skewX(0.5deg); filter: hue-rotate(9deg); }
    78% { transform: scale(0.998, 1.002) skewX(-0.2deg); filter: hue-rotate(-4deg); }
    100% { transform: none; filter: none; }
  }
  @keyframes ledPulse { 50% { opacity: 0.55; } }
  @keyframes crtBlink { 50% { opacity: 0; } }
  @keyframes crtGlassOff {
    0%, 45% { background-color: #061008; }
    100% { background-color: #020403; border-color: rgba(255,255,255,0.045); box-shadow: inset 0 0 38px rgba(0,0,0,0.96); }
  }
  @keyframes crtGlassOn {
    0% { background-color: #020403; border-color: rgba(255,255,255,0.045); box-shadow: inset 0 0 38px rgba(0,0,0,0.96); }
    48% { background-color: #07120a; }
    100% { background-color: #061008; }
  }
  @keyframes crtContentOff {
    0%, 34% { opacity: 1; filter: none; transform: none; }
    58% { opacity: 1; filter: brightness(2.8); transform: scaleY(0.025); }
    74%, 100% { opacity: 0; filter: brightness(4); transform: scaleY(0.003); }
  }
  @keyframes crtContentOn {
    0%, 38% { opacity: 0; filter: brightness(4); transform: scaleY(0.003); }
    54% { opacity: 1; filter: brightness(3); transform: scaleY(0.025); }
    78% { opacity: 0.86; filter: brightness(1.35); transform: scaleY(1.018); }
    100% { opacity: 1; filter: none; transform: none; }
  }
  @keyframes crtFlashOff {
    0%, 34% { width: 100%; height: 2px; opacity: 0; }
    55% { width: 100%; height: 2px; opacity: 1; }
    78% { width: 18%; height: 2px; opacity: 1; }
    100% { width: 0; height: 1px; opacity: 0; }
  }
  @keyframes crtFlashOn {
    0% { width: 2px; height: 2px; opacity: 0; }
    15% { width: 3px; height: 3px; opacity: 1; }
    34% { width: 18%; height: 2px; opacity: 1; }
    52% { width: 100%; height: 2px; opacity: 1; }
    68%, 100% { width: 100%; height: 1px; opacity: 0; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .retro-computer, .retro-computer:hover { transform: none; transition: none; }
}
@media (max-width: 520px) {
  .monitor-shell { padding: 12px 13px 11px; border-radius: 23px 23px 28px 28px; }
  .crt-bezel { padding: 9px; border-radius: 19px; }
  .crt-screen { border-radius: 15px / 13px; }
  .crt-content { grid-template-rows: 25px minmax(0, 1fr) 22px; }
  .crt-body { padding: 9px 11px 7px; font-size: 9px; }
  .crt-topbar, .crt-footer { padding: 0 10px; font-size: 8px; }
  .monitor-status { display: none; }
  .snd-key { margin-left: 0; }
  .retro-keyboard { width: 92%; padding-left: 10px; padding-right: 10px; }
  .mode-key { flex: 1; min-width: 0; justify-content: center; padding: 0 5px; }
}

/* ---------- footer ---------- */
.footer { padding: 24px 0 40px; }
.footer-inner {
  display: flex; flex-direction: column; justify-content: center; gap: 10px; align-items: center;
  border-top: 1px solid var(--border); padding-top: 22px;
  font-size: 13px; color: var(--text-3);
}
.footer-links { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.footer .copyright { font-size: 12px; color: var(--text-3); }
.footer a { color: var(--text-3); transition: color var(--t-fast) var(--ease); }
.footer a:hover { color: var(--text); }
.footer .sep { user-select: none; }

/* ---------- console ---------- */
/* settings: collapsed developer options (webhook) */
.dev-opts summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 550; color: var(--text-2);
  transition: color var(--t-fast) var(--ease);
}
.dev-opts summary::-webkit-details-marker { display: none; }
.dev-opts summary::before {
  content: ""; flex: none; width: 6px; height: 6px;
  border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transform: rotate(-45deg);
  transition: transform var(--t-fast) var(--ease);
}
.dev-opts[open] summary::before { transform: rotate(45deg); }
.dev-opts summary:hover { color: var(--text); }

.console {
  display: grid; grid-template-columns: 216px minmax(0, 1fr);
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: var(--surface);
  min-height: calc(100dvh - 140px);
  overflow: hidden; margin: 28px 0 32px;
  box-shadow: 0 28px 70px -46px rgba(38,39,33,0.58), inset 0 1px 0 rgba(255,255,255,.68);
}
.side {
  border-right: 1px solid var(--border-strong);
  background: linear-gradient(145deg, #e8e4d9 0%, #dcd7ca 100%);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 2px;
}
.navbtn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: var(--r-sm);
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  color: var(--text-2); padding: 9px 12px; cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.navbtn svg { flex: none; opacity: 0.8; }
.navbtn .nav-dot {
  display: inline-flex;   /* 比 .navbtn span 高一级，移动端隐藏文字时徽标仍可见 */
  align-items: center; justify-content: center;
  flex: none; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: #e5484d; color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1; margin-left: auto;
}
.navbtn:hover { background: rgba(0,0,0,0.045); color: var(--text); }
.navbtn.active {
  background: rgba(253,252,248,.62); color: var(--text); font-weight: 650;
  box-shadow: inset 3px 0 0 var(--phosphor), inset 0 0 0 1px rgba(41,42,36,.08), 0 1px 0 rgba(255,255,255,.42);
}
.side .spacer { flex: 1; }
.main { padding: 26px 32px; overflow-x: auto; min-width: 0; background: var(--surface); }
.main .kicker { display: inline-flex; margin-bottom: 16px; }
.main > h3 { letter-spacing: -.01em; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.profile-name-row input { flex: 1; width: auto; min-width: 220px; }
.profile-editor { display: flex; align-items: flex-start; gap: 13px; }
.profile-editor-fields { flex: 1; min-width: 0; }
.profile-editor .profile-name-row { margin-bottom: 6px; }
.profile-avatar-note { margin: 8px 0 0 57px; max-width: 520px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 16px; }
.filters input, .filters select { min-height: 36px; font-size: 13px; padding: 7px 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.mailframe { width: 100%; min-height: 120px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: #fff; margin-top: 12px; }
/* 纯文本正文与 HTML 渲染（.mailframe）保持同一张白底卡片观感 */
pre.mailtext {
  white-space: pre-wrap; word-break: break-word;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 16px; margin-top: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 14px; line-height: 1.6; color: #1a1a1a;
}
.meta-table { max-width: 720px; margin-bottom: 8px; }
.meta-table th { width: 88px; }

/* ---------- docs ---------- */
.docs-layout {
  display: grid; grid-template-columns: 190px minmax(0, 1fr);
  gap: 64px; align-items: start; padding: 48px 0 56px;
}
.toc { position: sticky; top: 32px; display: flex; flex-direction: column; gap: 2px; }
.toc .toc-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.toc a {
  font-size: 13px; color: var(--text-2); padding: 6px 10px; border-radius: var(--r-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.toc a:hover { color: var(--text); background: var(--bg-subtle); }
.toc a.active {
  color: var(--text); background: linear-gradient(#f5f2e9, var(--surface-raised)); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--phosphor), inset 0 0 0 1px var(--border);
}

.doc { max-width: 720px; }
.doc .doc-title { font-size: clamp(30px, 4vw, 40px); font-weight: 700; letter-spacing: -0.04em; margin: 10px 0 14px; }
.doc .doc-lead { font-size: 15.5px; color: var(--text-2); line-height: 1.75; margin-bottom: 32px; }
.doc h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; margin: 56px 0 12px; scroll-margin-top: 32px; }
.doc h2 .h-num {
  color: var(--accent); font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  margin-right: 12px; vertical-align: 3px;
}
.doc h3 { font-size: 15px; margin: 24px 0 8px; }
.doc p { color: var(--text-2); font-size: 14.5px; line-height: 1.75; }
.doc p code, .doc td code { color: var(--text); }
.doc table { margin: 16px 0; }
.doc td:first-child { white-space: nowrap; }
.doc .note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--amber-soft); border: 1px solid rgba(198,139,49,.18); border-radius: var(--r-md);
  padding: 14px 18px; font-size: 13.5px; color: var(--text-2); margin: 16px 0;
}
.doc .note svg { flex: none; color: var(--amber); margin-top: 2px; }
.doc pre {
  color: #c2e9c9; background:
    radial-gradient(circle at 18% 0, rgba(82,165,101,.1), transparent 28rem),
    #171b17;
  border-color: #30382f; border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 14px 30px -26px rgba(14,17,14,.85);
  text-shadow: 0 0 7px rgba(98,185,119,.12);
}
.doc table { border: 1px solid var(--border-strong); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--surface); }
.doc table th { background: linear-gradient(#eeebe2, #e4e0d5); }
.doc table tr:last-child td { border-bottom: 0; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .toc .toc-label { display: none; }
  .toc a { border: 1px solid var(--border); border-radius: var(--r-pill); padding: 5px 12px; }
}
@media (max-width: 960px) {
  .hero-min { grid-template-columns: 1fr; gap: 48px; min-height: 0; padding-top: 8vh; }
  .hero-min .shot { max-width: 560px; }
}
@media (max-width: 760px) {
  .claim-row { flex-direction: column; }
  .console { grid-template-columns: 1fr; min-height: 0; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px; }
  .navbtn { width: auto; padding: 8px 12px; }
  .navbtn span { display: none; }
  .side .spacer { display: none; }
  .main { padding: 20px; }
  .split { grid-template-columns: 1fr; }
  .nav .status-pill { display: none; }
}

@media (max-width: 560px) {
  :root { --nav-height: 64px; --nav-item-height: 30px; --nav-font-size: 13px; }
  .container { padding-left: 16px; padding-right: 16px; }
  .nav-inner { gap: 10px; }
  .nav-links { gap: 2px; }
  .nav-links > a,
  .nav-links > .acct .acct-btn { padding: 0 9px; }
}

@media (max-width: 480px) {
  .profile-editor { gap: 10px; }
  .profile-name-row { align-items: stretch; }
  .profile-name-row input { min-width: 0; }
  .profile-avatar-note { margin-left: 54px; }
}

@media (max-width: 420px) {
  .nav .brand-name,
  .nav .brand-suffix { display: none; }
}

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

/* ---------- mail-client list (conventional inbox look) ---------- */
.compose-btn { width: 100%; margin-bottom: 14px; }
.mail-search-wrap {
  display: flex; align-items: center; gap: 2px;
  height: 44px;
  background: #f1eee6;
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 0 6px;
  margin-bottom: 12px;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.mail-search-wrap:focus-within {
  background: var(--surface); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.mail-search-wrap input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  box-shadow: none; border-radius: 0; padding: 8px 4px; font-size: 14px;
}
.mail-search-wrap input:focus { box-shadow: none; outline: none; }
.ms-icon {
  flex: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text-3); width: 34px; height: 34px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.ms-icon:hover { background: rgba(0, 0, 0, 0.06); color: var(--text); }
.quota-meter {
  flex: none; margin: 0 6px 0 2px; padding: 3px 8px;
  font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--text-3); background: rgba(0, 0, 0, 0.04);
  border-radius: var(--r-sm); cursor: default;
}
.quota-meter:empty { display: none; }
.quota-meter .qm-label { opacity: .7; margin-right: 4px; }
.quota-meter.quota-full { color: #b23; background: rgba(204, 51, 51, 0.1); }
.mail-head {
  display: grid; grid-template-columns: 28px 188px minmax(0, 1fr) 92px; gap: 12px;
  min-height: 44px; padding: 10px 12px; align-items: center;
  font-size: 12.5px; color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.mail-head-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mail-head-time { text-align: right; }
.mail-selection-summary { flex: none; color: var(--text-2); font-weight: 600; }
.mail-batch-actions { display: inline-flex; align-items: center; gap: 4px; }
.mail-batch-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 28px;
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 3px 8px;
  background: transparent; color: var(--text-2); cursor: pointer;
  font-family: var(--font-sans); font-size: 12px; font-weight: 550;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.mail-batch-btn:hover { color: var(--text); background: var(--bg-subtle); border-color: var(--border); }
.mail-batch-btn.danger:hover { color: var(--err); background: var(--err-soft); border-color: rgba(211,61,50,.12); }
.mail-batch-btn:disabled { opacity: .45; cursor: wait; }
.mail-check {
  display: inline-grid; place-items: center; width: 20px; height: 20px;
  padding: 0; margin: 0; cursor: pointer; line-height: 1; letter-spacing: 0;
}
.mail-check input {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px; margin: 0;
  border: 1.5px solid #9a998f; border-radius: 3px; background: rgba(255,255,255,.48);
  cursor: pointer; position: relative;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.mail-check input:hover { border-color: var(--text-2); }
.mail-check input:disabled { opacity: .42; cursor: default; }
.mail-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mail-check input:checked,
.mail-check input:indeterminate { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.mail-check input:checked::after {
  content: ""; position: absolute; left: 3.5px; top: 1px; width: 4px; height: 7px;
  border: solid white; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.mail-check input:indeterminate::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 5.5px; height: 1.5px;
  border-radius: 2px; background: white;
}
.mail-group { font-size: 13px; font-weight: 600; padding: 16px 12px 6px 52px; }
.mail-group .cnt { color: var(--text-3); font-weight: 400; font-size: 12px; }
.mail-row {
  display: grid; grid-template-columns: 28px 188px minmax(0, 1fr) 92px; gap: 12px;
  padding: 14px 12px; border-bottom: 1px solid var(--border);
  cursor: pointer; align-items: center; position: relative;
  transition: background var(--t-fast) var(--ease);
}
.mail-row:hover { background: var(--bg-subtle); }
.mail-row.selected { background: var(--accent-soft); }
.mail-row.selected:hover { background: rgba(36,151,241,.13); }
/* 未读：左缘圆点 + 加粗（Apple Mail 式） */
.mail-row.unread::before {
  content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.mail-row.unread .mail-from, .mail-row.unread .mail-subj { font-weight: 700; }
.mail-row.unread .mail-time { color: var(--text); font-weight: 600; }
/* 已读：整行退到次级灰、字重回落——扫一眼就知道哪些处理过了 */
.mail-row.read .mail-from, .mail-row.read .mail-subj { color: var(--text-2); font-weight: 450; }
.mail-row.read .mail-att, .mail-row.read .mail-clip { opacity: .7; }
.mail-row.read:hover .mail-from, .mail-row.read:hover .mail-subj { color: var(--text); }
.mail-from { font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mail-subj { color: var(--text); font-weight: 550; }
.mail-prev { color: var(--text-3); font-weight: 400; }
.mail-chip {
  display: inline-block; font-family: var(--font-mono); font-size: 11px;
  color: #8a6d1a; background: #faf0d3; border-radius: var(--r-pill);
  padding: 0 8px; margin-left: 8px; vertical-align: 1px;
}
.mail-att { margin-left: 6px; font-size: 12px; color: var(--text-3); }
/* 草稿行上的附件 / 定时 / 上次发送失败标记 */
.mail-clip { margin-left: 6px; font-size: 12px; color: var(--text-3); }
.mail-time { text-align: right; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.mail-empty { padding: 56px 12px; text-align: center; color: var(--text-3); font-size: 13.5px; }
/* 空状态 / 加载态的终端小屏条 —— 延续落地页 CRT 的磷光语言 */
.term-chip {
  display: inline-flex; align-items: baseline;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.09em;
  color: #9ee8af;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.02) 0, rgba(255,255,255,0.02) 1px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 3px),
    radial-gradient(circle at 24% 0, rgba(82,165,101,0.16), transparent 16rem),
    #141814;
  border: 1px solid #2d352c; border-radius: 7px; padding: 8px 14px;
  text-shadow: 0 0 6px rgba(120,255,147,0.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045), inset 0 0 14px rgba(0,0,0,0.5), 0 10px 22px -18px rgba(14,17,14,0.9);
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0;
}
.term-cursor {
  display: inline-block; flex: none; width: 5px; height: 0.95em; margin-left: 7px;
  background: #9eeeb0; box-shadow: 0 0 6px rgba(117,239,143,0.65);
  transform: translateY(1px);
}
.mail-empty .term-chip { margin-bottom: 14px; }
.mail-empty p { margin: 0; }
/* 收件箱空状态的小屏幕是真按钮：点击复制自己的地址 */
.term-chip-btn {
  cursor: pointer; appearance: none;
  transition: filter var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.term-chip-btn:hover { filter: brightness(1.3); border-color: #46543f; transform: translateY(-1px); }
.term-chip-btn:active { transform: translateY(1px); }
.term-chip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .term-cursor { animation: crtBlink 0.9s steps(1) infinite; }
  .nav-dot.pop { animation: badgePop 0.55s var(--ease); }
  .dot.flash { animation: dotFlash 1.4s var(--ease); }
  @keyframes badgePop { 35% { transform: scale(1.5); } 65% { transform: scale(0.9); } }
  @keyframes dotFlash { 0%, 60% { background: var(--amber); box-shadow: 0 0 9px rgba(198,139,49,0.9); } }
}

/* 发送成功邮戳：盖在 compose 卡片上，砸下 → 停留 → 淡出 */
.send-stamp {
  position: absolute; left: 50%; top: 42%; z-index: 5; pointer-events: none;
  width: 134px; height: 134px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  color: #c14038; border: 2.5px solid currentColor;
  transform: translate(-50%, -50%) rotate(-12deg);
  mix-blend-mode: multiply; opacity: 0.92;
}
.send-stamp::before {
  content: ""; position: absolute; inset: 6px;
  border: 1.5px solid currentColor; border-radius: 50%; opacity: 0.75;
}
.send-stamp span {
  font-family: var(--font-mono); font-size: 15.5px; font-weight: 750;
  letter-spacing: 0.13em; line-height: 1.4;
}
@media (prefers-reduced-motion: no-preference) {
  .send-stamp {
    animation: stampThump 420ms cubic-bezier(0.2, 1.4, 0.4, 1) backwards,
               stampFade 320ms ease 1080ms forwards;
  }
  @keyframes stampThump {
    0% { transform: translate(-50%, -50%) rotate(-26deg) scale(2.1); opacity: 0; }
    62% { transform: translate(-50%, -50%) rotate(-12deg) scale(0.95); opacity: 0.95; }
    100% { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 0.92; }
  }
  @keyframes stampFade { to { opacity: 0; transform: translate(-50%, -52%) rotate(-12deg) scale(1.03); } }
}
.mail-more-wrap { display: flex; justify-content: center; padding: 14px 0 6px; }
@media (max-width: 760px) {
  .mail-head { grid-template-columns: 28px minmax(0, 1fr); }
  .mail-head-who, .mail-head-time { display: none; }
  .mail-head-main { gap: 8px; }
  .mail-batch-actions { margin-left: auto; }
  .mail-batch-btn span { display: none; }
  .mail-batch-btn { padding: 4px 7px; }
  .mail-row { grid-template-columns: 28px minmax(0, 1fr) 70px; }
  .mail-row .mail-from { display: none; }
  .mail-group { padding-left: 52px; }
}

.cfm-input {
  width: 100%; margin: 10px 0 2px; padding: 8px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 13px; background: #fff; color: var(--text);
}
.cfm-input:focus { outline: none; border-color: var(--accent); }

/* ---------- conversation view (Gmail-style thread) ---------- */
.thread-subject { font-size: 18px; font-weight: 650; margin: 14px 0 12px; }
.thread-subject .thread-count { font-size: 12.5px; color: var(--text-3); font-weight: 400; margin-left: 10px; white-space: nowrap; }
.thread-list { display: flex; flex-direction: column; gap: 10px; max-width: 980px; }
.msg-card { border: 1px solid var(--border-strong); border-radius: var(--r-md); background: #fff; overflow: hidden; }
.msg-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; }
.msg-head:hover { background: var(--bg-subtle); }
.msg-head-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.msg-from { font-weight: 600; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-addr { color: var(--text-3); font-weight: 400; }
.msg-meta { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-card .msg-meta-open { display: none; }
.msg-card.open .msg-meta-open { display: inline; }
.msg-card.open .msg-meta-closed { display: none; }
.msg-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.msg-body { padding: 0 16px 14px; }
/* 卡片内的正文不再套一层卡片边框，像 Gmail 一样平铺 */
.msg-body .mailframe, .msg-body pre.mailtext { border: none; border-radius: 0; margin-top: 4px; padding: 8px 0 0; }
.msg-actions { display: flex; gap: 8px; margin-top: 12px; }
@media (max-width: 760px) {
  .msg-time { display: none; }
}

/* ---------- attachments (email detail, Gmail-style) ---------- */
.att-section { margin: 20px 0 8px; max-width: 720px; }
.att-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.att-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.att-card {
  display: flex; align-items: center; gap: 10px; width: 244px; max-width: 100%;
  padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.att-card:hover { background: var(--bg-subtle); box-shadow: 0 10px 24px -18px rgba(35, 35, 30, 0.5); }
.att-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.att-card.unavailable { cursor: default; opacity: 0.62; }
.att-card.unavailable:hover { background: var(--surface); box-shadow: none; }
.att-icon {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: var(--r-sm); background: var(--bg-subtle); color: var(--text-2);
}
.att-icon[data-kind="image"] { color: #7c5cd6; background: rgba(124, 92, 214, 0.1); }
.att-icon[data-kind="pdf"] { color: var(--err); background: var(--err-soft); }
.att-icon[data-kind="doc"] { color: var(--accent); background: var(--accent-soft); }
.att-icon[data-kind="archive"] { color: var(--amber); background: var(--amber-soft); }
.att-icon[data-kind="audio"], .att-icon[data-kind="video"] { color: var(--phosphor); background: var(--phosphor-soft); }
.att-info { min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.att-name { font-size: 13px; font-weight: 550; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-dl {
  flex: none; margin-left: auto; display: grid; place-items: center;
  width: 28px; height: 28px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-3); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.att-dl:hover { background: rgba(0, 0, 0, 0.07); color: var(--text); }

/* attachment preview lightbox */
.attv-overlay {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column;
  background: rgba(20, 21, 18, 0.88);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.attv-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: #eceade; }
.attv-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 550; }
.attv-actions { margin-left: auto; display: inline-flex; gap: 6px; }
.attv-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: var(--r-sm); padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08); color: #eceade; cursor: pointer;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 550;
  transition: background var(--t-fast) var(--ease);
}
.attv-btn:hover { background: rgba(255, 255, 255, 0.18); }
.attv-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 18px 18px; }
.attv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.8); }
.attv-frame { width: min(920px, 100%); height: 100%; border: 0; border-radius: var(--r-sm); background: #fff; }
.attv-video { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); }
.attv-text {
  width: min(880px, 100%); max-height: 100%; overflow: auto; margin: 0;
  background: var(--surface); color: var(--text); border-radius: var(--r-md);
  padding: 18px 20px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.attv-note { color: #cfcdc2; font-size: 13.5px; margin: 0; }
.attv-note.is-err { color: #ff9d94; }
.attv-fallback { display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---------- compose popup (Gmail-style) ---------- */
.compose-panel {
  position: fixed; right: 28px; bottom: 0; z-index: 60;
  width: min(540px, calc(100vw - 24px));
  height: min(560px, 80vh);
  background: var(--surface);
  border: 1px solid var(--border-strong); border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 16px 56px -16px rgba(0, 0, 0, 0.28);
  display: flex; flex-direction: column;
}
.compose-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 18px;
  background: linear-gradient(135deg, #e1ddd2, #cbc6b8);
  border-bottom: 1px solid var(--border-strong);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  font-weight: 600; font-size: 14px; color: var(--text);
}
.compose-head > span { display: inline-flex; align-items: center; gap: 8px; }
.compose-head > span::before {
  content: "TX"; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 18px; border-radius: 3px; color: #dff7e4; background: #34543d;
  font: 700 8px/1 var(--font-mono); letter-spacing: .08em; box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.compose-x { border: 0; background: transparent; cursor: pointer; color: var(--text-2); padding: 4px 6px; border-radius: 6px; }
.compose-x:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.compose-row { display: flex; align-items: center; gap: 8px; padding: 2px 18px; border-bottom: 1px solid var(--border); }
.compose-row input { border: 0; box-shadow: none; border-radius: 0; padding: 9px 0; font-size: 14px; background: transparent; }
.compose-row input:focus { box-shadow: none; border: 0; outline: none; }
.cr-label { font-size: 13.5px; color: var(--text-3); flex: none; }
.cc-toggles { flex: none; font-size: 13px; color: var(--text-3); display: flex; gap: 12px; }
.cc-toggles a { cursor: pointer; }
.cc-toggles a:hover { color: var(--text); }
.compose-reply-chip {
  margin: 8px 18px 0; align-self: flex-start;
  font-size: 12px; color: var(--text-2);
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 2px 10px;
}
.compose-reply-chip a { cursor: pointer; color: var(--text-3); margin-left: 4px; }
.compose-body {
  flex: 1; border: 0; border-radius: 0; box-shadow: none; resize: none;
  padding: 14px 18px; font-family: var(--font-sans); font-size: 14px;
  background: transparent; min-height: 0;
}
.compose-body:focus { box-shadow: none; outline: none; }
.compose-foot { display: flex; align-items: center; gap: 6px; padding: 12px 18px; border-top: 1px solid var(--border); }
.compose-foot .btn.send { background: var(--accent); border-color: var(--accent); padding: 9px 26px; }
.compose-foot .btn.send:hover { background: var(--accent-hover); border-color: var(--accent-hover); opacity: 1; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; color: var(--text-2);
  padding: 7px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.html-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); margin: 0; text-transform: none; letter-spacing: 0; }
.html-toggle input { width: auto; min-height: 0; }
@media (max-width: 760px) {
  .compose-panel { right: 0; width: 100vw; height: 86vh; }
}

/* ---------- api key list (settings) ---------- */
code.keymask {
  display: inline-block; width: 166px; max-width: 38vw; vertical-align: middle;
  white-space: nowrap; overflow-x: auto; overflow-y: hidden; text-overflow: clip; word-break: normal;
  overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch;
}
.keybtn {
  border: 0; background: transparent; cursor: pointer;
  color: var(--text-3); font-size: 12px; padding: 2px 6px; margin-left: 4px;
  border-radius: 4px; transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.keybtn:hover { color: var(--text); background: var(--bg-subtle); }

/* ---------- confirm dialog ---------- */
.cfm-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(19, 19, 19, 0.32);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.cfm-panel {
  width: min(400px, 100%);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.35);
  padding: 22px 24px 20px;
}
.cfm-panel h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 8px; }
.cfm-panel p { color: var(--text-2); line-height: 1.65; margin: 0 0 18px; }
.cfm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- account switcher (top pill dropdown) ---------- */
.acct { position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3);
  padding: 6px 10px; border-radius: var(--r-pill);
  transition: background var(--t-fast) var(--ease);
}
.mail-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  overflow: hidden; border: 1px solid rgba(29, 31, 27, 0.22); border-radius: 7px;
  color: #fff; font-family: var(--font-sans); font-weight: 700; line-height: 1;
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 2px 0 rgba(38,38,33,.18);
}
.mail-avatar[data-tone="0"] { background: linear-gradient(145deg, #3ca7f4, #237ab9); }
.mail-avatar[data-tone="1"] { background: linear-gradient(145deg, #72b681, #477957); }
.mail-avatar[data-tone="2"] { background: linear-gradient(145deg, #d4a04e, #936527); }
.mail-avatar[data-tone="3"] { background: linear-gradient(145deg, #a58abe, #715783); }
.mail-avatar[data-tone="4"] { background: linear-gradient(145deg, #55aaa9, #357676); }
.mail-avatar[data-tone="5"] { background: linear-gradient(145deg, #c87a64, #8d5041); }
.mail-avatar-menu { width: 30px; height: 30px; font-size: 11px; }
.mail-avatar-profile { width: 44px; height: 44px; border-radius: 10px; font-size: 15px; }
.acct-btn:hover { background: var(--bg-subtle); color: var(--text-2); }
.acct-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 300px; z-index: 70;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: 6px;
  box-shadow: 0 16px 48px -16px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,.7);
}
.acct-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2);
  padding: 9px 12px; border-radius: var(--r-sm);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.acct-item:hover { background: var(--bg-subtle); color: var(--text); }
.acct-item.on { color: var(--text); font-weight: 600; }
.acct-item .acct-identity { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.acct-item .acct-name { overflow: hidden; color: var(--text); font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.acct-item .acct-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-item .acct-check { margin-left: auto; color: var(--accent); }
.acct-sep { border-top: 1px solid var(--border); margin: 6px 4px; }
.acct-empty { padding: 10px 12px; font-size: 12.5px; color: var(--text-3); }

/* ---------- operations ---------- */
.admin-page { max-width: 920px; padding-top: 48px; padding-bottom: 64px; }
.admin-page h1 { font-size: 28px; font-weight: 680; letter-spacing: -.035em; margin: 10px 0 6px; }
.admin-auth {
  max-width: 680px; margin-top: 22px; padding: 18px;
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: linear-gradient(145deg, rgba(253,252,248,.86), rgba(231,227,216,.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 20px 48px -40px rgba(35,35,30,.7);
}
.admin-auth .toolbar { margin: 0; }
.admin-page #a-list:not(:empty) {
  margin-top: 24px; border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  overflow-x: auto; background: var(--surface); box-shadow: 0 22px 50px -42px rgba(35,35,30,.68);
}
.admin-page #a-list table th { background: linear-gradient(#eeebe2, #e4e0d5); }
.admin-page #a-list table tr:last-child td { border-bottom: 0; }

@media (max-width: 560px) {
  .admin-page { padding-top: 34px; }
  .admin-auth { padding: 14px; }
}

/* ---- OfferDao 账号登录弹窗（sso.js 注入，claim / landing / app 共用） ---- */
.sso-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(36,37,31,.42); backdrop-filter: blur(3px);
  padding: 20px;
}
.sso-panel {
  position: relative; width: 100%; max-width: 380px;
  background: linear-gradient(145deg, rgba(253,252,248,.99), rgba(242,239,230,.97));
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  padding: 26px 26px 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 32px 70px -40px rgba(36,37,31,.85);
}
.sso-panel h3 { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 6px; }
.sso-sub { font-size: 12.5px; color: var(--text-3); line-height: 1.65; margin: 0 0 16px; }
.sso-close {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
}
.sso-close:hover { background: rgba(36,37,31,.06); color: var(--text); }
.sso-google {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 40px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 0 rgba(36,37,31,.06);
  transition: all var(--t-fast) var(--ease);
}
.sso-google:hover { border-color: var(--text-3); transform: translateY(-1px); }
.sso-gsi { display: flex; align-items: center; justify-content: center; min-height: 40px; }
.sso-gsi-hint { font-size: 12px; color: var(--text-3); }
.sso-forgot { float: right; color: var(--accent); cursor: pointer; }
.sso-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 12px; color: var(--text-3); font-size: 11.5px;
}
.sso-divider::before, .sso-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sso-input {
  width: 100%; height: 38px; margin-bottom: 8px;
  padding: 0 12px; font-size: 13.5px; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
}
.sso-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36,151,241,.14); }
.sso-submit { width: 100%; height: 38px; margin-top: 2px; }
.sso-toggle { margin: 12px 0 0; color: var(--text-3); }
.sso-toggle a { color: var(--accent); cursor: pointer; }
#sso-err { margin: 8px 0 0; }
#sso-note { margin: 8px 0 0; line-height: 1.6; }

/* ---- 控制台初始化失败重试（网络故障时保留账号，绝不清除） ---- */
.init-retry {
  min-height: 62vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  text-align: center; font-size: 14px; color: var(--text-2); line-height: 1.8;
}

/* ---- docs：窄屏时表格在自身内横向滚动，避免撑破页面 ---- */
@media (max-width: 480px) {
  .page-docs table { display: block; overflow-x: auto; }
}
