:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f7f8fa;
  --accent: #1d4ed8;
  --accent-soft: #eef2ff;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --ok: #047857;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -16px rgba(15, 23, 42, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; cursor: pointer; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

main { padding-top: 56px; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #3730a3;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spacer { flex: 1; }

.meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-3);
  font-size: 13px;
}

.meta b { color: var(--ink); font-weight: 600; }

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 13px;
}
.ghost-btn:hover { border-color: #cbd5e1; background: #f8fafc; }

/* ---------------- 通用容器 ---------------- */
.shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 120px;
}

.center-card {
  max-width: 520px;
  margin: 10vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
}

h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 10px; }
p  { margin: 0 0 12px; color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: 13px; }

.field {
  display: flex;
  gap: 8px;
  margin: 18px 0 10px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

input.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.btn {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn:hover { background: #1940b8; }
.btn:disabled { background: #94a3b8; cursor: not-allowed; }
.btn.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
  font-weight: 500;
}
.btn.secondary:hover { background: #f8fafc; }

.notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid #fde68a;
  background: var(--warn-soft);
  color: var(--warn);
}

.notice.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.boundary {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.7;
}
.boundary ul { margin: 8px 0 0; padding-left: 18px; }
.boundary li { margin-bottom: 5px; }

/* ---------------- 授权确认 ---------------- */
.consent-list {
  margin: 6px 0 0;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 14px;
}
.consent-list li { margin-bottom: 10px; }

.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 4px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.checkline input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------------- 对话 ---------------- */
.chat {
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.msg { display: flex; flex-direction: column; gap: 8px; }
.msg.user { align-items: flex-end; }

.msg.user .bubble {
  max-width: 78%;
  background: var(--ink);
  color: #fff;
  border-radius: 14px 14px 3px 14px;
  padding: 10px 15px;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.assistant .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 3px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.role {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

/* 正文排版 */
.answer { font-size: 15px; color: var(--ink); }
.answer > *:first-child { margin-top: 0; }
.answer > *:last-child { margin-bottom: 0; }
.answer h1, .answer h2, .answer h3 { font-size: 16px; margin: 18px 0 8px; }
.answer h4 { font-size: 15px; margin: 14px 0 6px; }
.answer p { margin: 0 0 10px; color: var(--ink); }
.answer ul, .answer ol { margin: 0 0 10px; padding-left: 22px; }
.answer li { margin-bottom: 5px; }
.answer code {
  background: #f1f5f9;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.answer pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 13px 15px;
  overflow-x: auto;
  font-size: 13px;
}
.answer pre code { background: none; color: inherit; padding: 0; }
.answer blockquote {
  margin: 0 0 10px;
  padding: 6px 12px;
  border-left: 3px solid #cbd5e1;
  color: var(--ink-2);
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}
.answer table { border-collapse: collapse; width: 100%; margin: 0 0 12px; font-size: 13.5px; }
.answer th, .answer td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.answer th { background: #f8fafc; font-weight: 600; }
.answer hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

.cite {
  display: inline-block;
  min-width: 15px;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: #3730a3;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 15px;
  text-align: center;
  vertical-align: super;
  cursor: pointer;
  border: 1px solid #c7d2fe;
}
.cite:hover { background: #e0e7ff; }

.cursor::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 15px;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 引用 */
.refs { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.refs-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ref {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fcfcfd;
}
.ref-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.ref-n {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: #3730a3;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.ref-meta { font-size: 12px; color: var(--ink-3); margin: 3px 0 0 26px; }
.ref-quote {
  margin: 7px 0 0 26px;
  padding-left: 10px;
  border-left: 2px solid #e2e8f0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  max-height: 4.8em;
  overflow: hidden;
}
.ref-quote.expanded { max-height: none; }
.ref-actions { margin: 7px 0 0 26px; display: flex; gap: 12px; font-size: 12.5px; }
.link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12.5px;
}
.link-btn:hover { text-decoration: underline; }

/* 反馈 */
.fb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.fb button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.fb button:hover { border-color: #cbd5e1; }
.fb button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fb input {
  flex: 1;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12.5px;
}
.fb-done { color: var(--ok); font-size: 12.5px; }

.followup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  border: 1px dashed #c7d2fe;
  border-radius: 999px;
  background: #f8faff;
  color: #3730a3;
  font-size: 13px;
  text-align: left;
}
.followup:hover { background: #eef2ff; }

.stream-state { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

/* 输入区 */
.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  background: linear-gradient(to top, var(--canvas) 62%, rgba(247, 248, 250, 0));
  padding: 14px 20px 16px;
}
.composer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 8px 8px 14px;
  box-shadow: var(--shadow);
}
.composer textarea {
  border: none;
  box-shadow: none;
  padding: 6px 0;
  resize: none;
  max-height: 160px;
  font-size: 14.5px;
}
.composer textarea:focus { box-shadow: none; }
.composer .btn { padding: 9px 16px; }
.composer-hint {
  max-width: 900px;
  margin: 7px auto 0;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* 引导 */
.empty {
  text-align: center;
  padding: 9vh 0 0;
  color: var(--ink-3);
}
.empty h2 { color: var(--ink); font-size: 19px; }
.samples { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin: 20px auto 0; }
.sample {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--ink-2);
  font-size: 14px;
}
.sample:hover { border-color: #c7d2fe; background: #fbfcff; }

.hidden { display: none !important; }

/* ================= 启动过渡层 ================= */
/* 会话校验完成前不渲染任何视图：已授权刷新时不会闪到授权码页 */

html[data-authed="0"] body { background: #060a12; }
html[data-authed="0"] .topbar {
  background: rgba(6, 10, 18, 0.86);
  border-bottom-color: rgba(148, 163, 184, 0.14);
  backdrop-filter: saturate(160%) blur(10px);
}
html[data-authed="0"] .brand { color: #e8eefb; }
html[data-authed="0"] .badge {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.32);
  color: #7dd3fc;
}

.boot {
  position: fixed;
  inset: 56px 0 0;
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--canvas);
}
html[data-authed="0"] .boot {
  background:
    radial-gradient(closest-side, rgba(37, 99, 235, 0.22), transparent 100%) 50% 10% / 720px 400px no-repeat,
    #060a12;
}

.boot-mark { display: flex; }
.boot-ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.28);
  border-top-color: #38bdf8;
  animation: boot-spin 0.9s linear infinite;
}
@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

.boot-brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}
html[data-authed="0"] .boot-brand { color: #e8eefb; }

.boot-sub { font-size: 13px; color: var(--ink-3); }
html[data-authed="0"] .boot-sub { color: #94a3b8; }

.boot-bar {
  width: 180px;
  height: 2px;
  margin-top: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
}
.boot-bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #38bdf8, transparent);
  animation: boot-slide 1.1s ease-in-out infinite;
}
@keyframes boot-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.boot-noscript {
  margin-top: 8px;
  font-size: 13px;
  color: #fca5a5;
}

/* ================= 接入终端（登录页） ================= */

body.gate-mode {
  background: #060a12;
}

body.gate-mode .topbar {
  background: rgba(6, 10, 18, 0.86);
  border-bottom-color: rgba(148, 163, 184, 0.14);
  backdrop-filter: saturate(160%) blur(10px);
}
body.gate-mode .brand { color: #e8eefb; }
body.gate-mode .badge {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.32);
  color: #7dd3fc;
}

.gate {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 0 20px 64px;
  overflow: hidden;
}

/* 蓝图网格 + 光晕 */
.gate::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 34%, #000 0%, rgba(0, 0, 0, 0.55) 46%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 34%, #000 0%, rgba(0, 0, 0, 0.55) 46%, transparent 78%);
  pointer-events: none;
  z-index: 0;
}

.gate::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 8%;
  width: 760px;
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.08) 58%, transparent 100%);
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
}

.gate-card {
  position: relative;
  z-index: 1;
  width: 660px;
  max-width: 100%;
  margin: 8vh 0 0;
  padding: 32px 34px 26px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(13, 20, 34, 0.97), rgba(8, 13, 23, 0.98));
  box-shadow:
    0 40px 90px -50px rgba(37, 99, 235, 0.75),
    0 2px 0 rgba(255, 255, 255, 0.03) inset;
  color: #dbe4f0;
  animation: gateIn 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* 渐变描边 */
.gate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.65),
    rgba(99, 102, 241, 0.12) 42%,
    rgba(99, 102, 241, 0.55)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes gateIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.gate-kicker,
.modal-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 14px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55);
  animation: ring 2.2s ease-out infinite;
}

@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

.gate h1 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: -0.015em;
  color: #f1f5f9;
}

.gate-desc {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.75;
  color: #8a9ab0;
}
.gate-desc b { color: #cbd5e1; font-weight: 600; }

.gate-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.gate-label span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #475569;
}

.code-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

input.code {
  flex: 1;
  min-width: 0;
  background: #060b16;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  padding: 15px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  letter-spacing: 0.16em;
  color: #e6f6ff;
  text-transform: uppercase;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input.code::placeholder {
  color: #2f3d52;
  letter-spacing: 0.16em;
}
input.code:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14), 0 0 26px -8px rgba(56, 189, 248, 0.6);
  outline: none;
}

.gate-btn {
  flex: none;
  padding: 0 22px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border: 1px solid rgba(147, 197, 253, 0.35);
  box-shadow: 0 8px 22px -12px rgba(37, 99, 235, 0.9);
  font-size: 14.5px;
}
.gate-btn:hover { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.gate-btn:disabled { background: #1e293b; border-color: rgba(148, 163, 184, 0.2); color: #64748b; }

.code-hint {
  margin-top: 8px;
  font-size: 11.5px;
  color: #4b5c73;
  letter-spacing: 0.02em;
}

.gate .notice.error {
  margin-top: 14px;
  background: rgba(185, 28, 28, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.gate-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 24px 0 0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.14);
}
.gate-status > div {
  background: #0a111d;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.gate-status span {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: #4a5a70;
  text-transform: uppercase;
}
.gate-status b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 500;
  color: #b6c6d9;
}

.gate .boundary {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  color: #6b7b91;
  font-size: 12px;
  line-height: 1.7;
}
.gate .boundary strong { color: #94a3b8 !important; font-weight: 600; }

/* ================= 授权确认弹窗 ================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.74);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-card {
  position: relative;
  width: 600px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 30px 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, #0d1523, #0a111d);
  border: 1px solid rgba(96, 165, 250, 0.24);
  box-shadow: 0 50px 100px -45px rgba(0, 0, 0, 0.95);
  color: #cfdaea;
  animation: modalIn 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.modal-lead {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: #8695aa;
}

.modal-points {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: point;
}
.modal-points li {
  counter-increment: point;
  position: relative;
  padding-left: 30px;
  margin-bottom: 9px;
  font-size: 13.2px;
  line-height: 1.7;
  color: #b7c5d8;
}
.modal-points li::before {
  content: counter(point, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: #38bdf8;
  opacity: 0.85;
  letter-spacing: 0.04em;
}

.modal-note {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.16);
  font-size: 12px;
  line-height: 1.7;
  color: #7f93ab;
}

.checkline.dark {
  margin: 16px 0 0;
  color: #c3d0e0;
  font-size: 13px;
  line-height: 1.65;
}
.checkline.dark input {
  accent-color: #38bdf8;
  width: 17px;
  height: 17px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn.secondary.dark {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.3);
  color: #b6c6d9;
}
.btn.secondary.dark:hover {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.45);
}

@media (max-width: 640px) {
  .gate { padding: 0 14px 48px; }
  .gate-card { margin-top: 4vh; padding: 24px 20px 20px; border-radius: 16px; }
  .gate h1 { font-size: 22px; }
  input.code { font-size: 15px; letter-spacing: 0.12em; padding: 13px 12px; }
  .gate-btn { padding: 0 16px; }
  .gate-status { grid-template-columns: 1fr 1fr; }
  .gate-status > div:last-child { display: none; }
  .modal-card { padding: 22px 18px 18px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}

@media (max-width: 640px) {
  .shell { padding: 0 14px 130px; }
  .center-card { margin-top: 5vh; padding: 22px; }
  .meta .hide-sm { display: none; }
  .composer { padding: 10px 12px 12px; }
  .composer-hint .hide-sm { display: none; }

  /* 窄屏顶栏：收紧间距，禁止换行，避免右侧按钮被裁切 */
  .topbar { padding: 0 12px; gap: 8px; }
  .brand { font-size: 13.5px; white-space: nowrap; }
  .badge { padding: 1px 7px; font-size: 10px; letter-spacing: 0.02em; white-space: nowrap; }
  .meta { gap: 8px; font-size: 12px; flex-shrink: 0; }
  .meta span { white-space: nowrap; }
  .ghost-btn { padding: 4px 9px; font-size: 12.5px; white-space: nowrap; }
}

/* 极窄屏：徽标让位，保品牌名与操作按钮 */
@media (max-width: 480px) {
  .badge { display: none; }
}

