/* 报寝 · 正式前端视觉系统：夜空主视觉 + 明亮内容卡片。纯 CSS，无外部字体与依赖。 */
:root {
  color-scheme: light;
  --bg: #f1f3f9;
  --surface: #ffffff;
  --surface-2: #f6f7fc;
  --surface-3: #eceff7;
  --ink: #0f1b3d;
  --ink-2: #394566;
  --muted: #69738f;
  --faint: #a0a8bf;
  --line: #e2e6f0;
  --line-strong: #cdd3e3;
  --primary: #4f56e8;
  --primary-2: #7a5cf5;
  --primary-soft: #eef0ff;
  --primary-line: #d6daff;
  --primary-ink: #3036b8;
  --ok: #0e9f6e;
  --ok-soft: #e6f7f0;
  --ok-line: #b5e7d3;
  --ok-ink: #07734f;
  --warn: #d48806;
  --warn-soft: #fff6e0;
  --warn-line: #f6dca0;
  --warn-ink: #8f5800;
  --danger: #e0433b;
  --danger-soft: #feefee;
  --danger-line: #f8cbc8;
  --danger-ink: #b3261e;
  --carried: #8b5cf6;
  --carried-soft: #f4f0ff;
  --carried-line: #ddd0fd;
  --carried-ink: #6431d8;
  --admin: #2f80ed;
  --admin-soft: #eaf3ff;
  --admin-line: #c8defb;
  --admin-ink: #1b5eb5;
  --slate: #58637e;
  --slate-soft: #eff1f6;
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 61, .06);
  --shadow: 0 1px 2px rgba(15, 27, 61, .04), 0 12px 32px -14px rgba(15, 27, 61, .18);
  --shadow-lg: 0 30px 70px -20px rgba(6, 14, 40, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "DIN Alternate", "Bahnschrift", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--primary); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.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; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.18em; }

/* ================= 夜空主视觉 ================= */
.sky {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 420px at 88% -120px, rgba(129, 140, 248, .42), transparent 62%),
    radial-gradient(700px 320px at 0% -60px, rgba(56, 189, 248, .20), transparent 60%),
    linear-gradient(180deg, #060c20 0%, #0c1636 45%, #1a2960 100%);
}
.sky-stars {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 35%, rgba(0, 0, 0, .35) 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 35%, rgba(0, 0, 0, .35) 70%, transparent 100%);
}
.sky-stars circle { fill: #fff; opacity: .5; animation: twinkle var(--d, 5s) ease-in-out var(--delay, 0s) infinite; }
.sky-stars .shoot { stroke: url(#shoot-grad); stroke-width: 1.4; stroke-linecap: round; opacity: 0; animation: shoot 9s ease-in 3s infinite; }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }
@keyframes shoot { 0%, 86% { opacity: 0; transform: translate(0, 0); } 88% { opacity: 1; } 96% { opacity: 0; transform: translate(-240px, 120px); } 100% { opacity: 0; } }
.sky-inner { position: relative; margin: 0 auto; padding: 14px 20px 0; }
.narrow { max-width: 600px; }
.wide { max-width: 1280px; }
.skyline { display: block; width: 100%; height: 84px; margin-top: 4px; }
.skyline .b { fill: #081130; }
.skyline .b2 { fill: #0c1740; }
.skyline .w { fill: #1b295a; }
.skyline .w.on { fill: #ffd27a; filter: drop-shadow(0 0 3px rgba(255, 196, 92, .8)); }
.skyline .w.flick { animation: window 7s ease-in-out var(--delay, 0s) infinite; }
@keyframes window { 0%, 100% { fill: #ffd27a; } 45%, 60% { fill: #1b295a; filter: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; min-width: 0; }
.brand .logo { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 6px 14px rgba(99, 102, 241, .45)); }
.brand strong { display: block; font-size: 16px; letter-spacing: .06em; line-height: 1.25; }
.brand small { display: block; font-size: 12px; color: rgba(214, 222, 255, .7); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.hero { padding: 26px 0 0; }
.hero-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; font-size: 13.5px; color: rgba(222, 229, 255, .78); }
.hero-title { font-size: 36px; font-weight: 800; letter-spacing: .02em; line-height: 1.18; margin-top: 8px; text-shadow: 0 6px 30px rgba(99, 102, 241, .35); }
.hero-sub { font-size: 14px; color: rgba(222, 229, 255, .8); margin-top: 8px; line-height: 1.65; }
.hero-sub strong { color: #fff; }
.link-light { background: none; border: 0; padding: 0; color: #c7ceff; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.link-light:hover { color: #fff; }

/* 夜空弧线时间线：月亮沿弧线从开放移动到截止 */
.arc { position: relative; margin-top: 14px; }
.arc-sky { position: relative; height: 92px; }
.arc-svg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; overflow: visible; }
.arc-base { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 2; stroke-dasharray: 3 7; stroke-linecap: round; }
.arc-done { fill: none; stroke: url(#arc-grad); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s var(--ease); filter: drop-shadow(0 0 6px rgba(165, 180, 252, .75)); }
.arc-dot {
  position: absolute; left: 0; top: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: #121d47; border: 2px solid rgba(255, 255, 255, .45); transition: background .4s, border-color .4s, box-shadow .4s, transform .6s var(--ease);
}
.arc-dot.done { background: linear-gradient(135deg, #a5b4fc, #ffd27a); border-color: #fff; box-shadow: 0 0 12px rgba(165, 180, 252, .9); }
.arc-dot.warn { background: #f5b83d; border-color: #fff; }
.arc-dot.next { border-color: #ffd27a; box-shadow: 0 0 0 0 rgba(255, 210, 122, .6); animation: beacon 1.8s ease-out infinite; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(255, 210, 122, .6); } 80%, 100% { box-shadow: 0 0 0 12px rgba(255, 210, 122, 0); } }
.arc-moon { position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; transition: transform 1.1s var(--ease), opacity .6s; pointer-events: none; }
.arc-moon svg { width: 100%; height: 100%; overflow: visible; }
.arc-moon .halo { transform-origin: 23px 23px; animation: halo 3.2s ease-in-out infinite; }
.arc-moon.dim { opacity: .45; }
.arc-instant .arc-dot, .arc-instant .arc-moon { transition: none !important; }
.arc-moon { animation: fade-in 1s ease both; }
@keyframes fade-in { from { opacity: 0; } }
.arc-moon.dim .halo { animation: none; opacity: .4; }
@keyframes halo { 0%, 100% { transform: scale(.85); opacity: .6; } 50% { transform: scale(1.12); opacity: 1; } }
.arc-labels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; margin-top: 4px; }
.arc-labels li { font-size: 12px; color: rgba(222, 229, 255, .62); line-height: 1.45; padding: 0 2px; }
.arc-labels b { display: block; font-family: var(--font-num); font-size: 16px; font-weight: 700; color: rgba(255, 255, 255, .72); letter-spacing: .02em; }
.arc-labels .reached b { color: #fff; }
.arc-labels .reached { color: rgba(222, 229, 255, .9); }
.arc-labels .deadline b { color: #ffc98a; }

/* ================= 主体与卡片 ================= */
.main { position: relative; z-index: 1; margin: -30px auto 0; padding: 0 20px 44px; }
.card {
  position: relative; background: var(--surface); border: 1px solid rgba(15, 27, 61, .06); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 750; line-height: 1.4; flex-wrap: wrap; }
.title-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.title-ic .i { width: 18px; height: 18px; }
.title-ic.ok { background: var(--ok-soft); color: var(--ok); }
.title-ic.warn { background: var(--warn-soft); color: var(--warn); }
.title-ic.carried { background: var(--carried-soft); color: var(--carried); }
.title-ic.admin { background: var(--admin-soft); color: var(--admin); }
.title-ic.slate { background: var(--slate-soft); color: var(--slate); }
.card-sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.section-label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 20px 0 10px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.page-foot { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 10px; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.boot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 44px 20px; color: var(--muted); font-size: 14px; }
.loader { width: 44px; height: 44px; }
.loader .track { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.loader .spin { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 30 100; transform-origin: 22px 22px; animation: spin 1s linear infinite; }

/* ================= 按钮 ================= */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 17px;
  border-radius: 12px; border: 1px solid transparent; color: #fff; font-weight: 650; font-size: 14px; line-height: 1.3; cursor: pointer;
  text-decoration: none; white-space: nowrap; touch-action: manipulation;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 18px -8px rgba(79, 86, 232, .75), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .12s, box-shadow .2s, filter .2s, background-color .2s;
}
.btn:hover { filter: brightness(1.07); box-shadow: 0 12px 24px -10px rgba(79, 86, 232, .85), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; box-shadow: none; }
.btn .i { width: 17px; height: 17px; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: #b9c1d6; filter: none; box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: none; }
.btn-ghost:hover { background: var(--primary-soft); filter: none; box-shadow: none; }
.btn-danger { background: #fff; color: var(--danger-ink); border-color: var(--danger-line); box-shadow: none; }
.btn-danger:hover { background: var(--danger-soft); filter: none; box-shadow: none; }
.btn-ok { background: linear-gradient(135deg, #12b07b, #0b8c61); box-shadow: 0 8px 18px -8px rgba(14, 159, 110, .8), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-ok:hover { box-shadow: 0 12px 24px -10px rgba(14, 159, 110, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-carried { background: var(--carried-soft); color: var(--carried-ink); border-color: var(--carried-line); box-shadow: none; }
.btn-carried:hover { background: #ebe3ff; filter: none; box-shadow: none; }
.btn-glass { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; box-shadow: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .18); filter: none; box-shadow: none; }
.btn-moon { background: linear-gradient(135deg, #ffe3a3, #ffc46b); color: #3a2600; box-shadow: 0 0 0 0 rgba(255, 210, 122, .5), 0 10px 24px -10px rgba(255, 196, 92, .9); animation: beacon 1.8s ease-out infinite; }
.btn-moon:hover { filter: brightness(1.05); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13px; border-radius: 10px; gap: 5px; }
.btn-sm .i { width: 15px; height: 15px; }
.btn-lg { min-height: 54px; font-size: 16.5px; padding: 12px 24px; border-radius: 15px; letter-spacing: .04em; }
.btn-block { width: 100%; }
.btn.is-busy::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; text-align: left; }
.link-btn:disabled { color: var(--faint); cursor: default; text-decoration: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--primary-line); background: #fff; color: var(--primary-ink); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .15s, transform .12s; }
.chip:hover { background: var(--primary-soft); }
.chip:active { transform: scale(.97); }
.chip .i { width: 15px; height: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 标签 ================= */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
  line-height: 1.75; white-space: nowrap; vertical-align: middle; background: var(--slate-soft); color: var(--slate);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.no-dot::before { display: none; }
.pill .i { width: 14px; height: 14px; }
.pill-ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill-warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill-danger { background: var(--danger-soft); color: var(--danger-ink); }
.pill-primary { background: var(--primary-soft); color: var(--primary-ink); }
.pill-carried { background: var(--carried-soft); color: var(--carried-ink); }
.pill-admin { background: var(--admin-soft); color: var(--admin-ink); }
.pill-slate { background: var(--slate-soft); color: var(--slate); }
.pill-outline { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.pill-lg { font-size: 13.5px; padding: 4px 13px; }
.pill.live::before { background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: live 1.6s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); } 80%, 100% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } }
.pill-glass { background: rgba(255, 255, 255, .1); color: #e3e8ff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pill-glass.ok { background: rgba(16, 185, 129, .18); color: #8af0c9; box-shadow: inset 0 0 0 1px rgba(138, 240, 201, .28); }
.pill-glass.warn { background: rgba(251, 191, 36, .16); color: #fcd98a; box-shadow: inset 0 0 0 1px rgba(252, 217, 138, .3); }
.pill-glass.danger { background: rgba(248, 113, 113, .2); color: #ffc0bb; box-shadow: inset 0 0 0 1px rgba(255, 192, 187, .3); }
.pill-glass.carried { background: rgba(167, 139, 250, .22); color: #e2d8ff; box-shadow: inset 0 0 0 1px rgba(226, 216, 255, .3); }
.pill-glass.primary { background: rgba(129, 140, 248, .24); color: #dde1ff; box-shadow: inset 0 0 0 1px rgba(221, 225, 255, .3); }

/* ================= 提示 ================= */
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 14px; line-height: 1.6; margin-bottom: 16px;
}
.notice > .i { margin-top: 2px; width: 18px; height: 18px; }
.notice > div { min-width: 0; flex: 1; }
.notice strong { font-weight: 700; }
.notice-info { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-ink); }
.notice-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.notice-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
.notice-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); }
.notice-carried { background: var(--carried-soft); border-color: var(--carried-line); color: var(--carried-ink); }
.notice-preview { background: #f7f8fd; border: 1px dashed #b7bfd8; color: var(--ink-2); }
.notice .actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.glass-strip {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.55;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); color: rgba(230, 235, 255, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); margin-top: 12px;
}
.glass-strip > .i { width: 18px; height: 18px; color: #c7ceff; }
.glass-strip > div { flex: 1; min-width: 0; }
.glass-strip strong { color: #fff; }
.glass-strip.danger { background: rgba(224, 67, 59, .22); border-color: rgba(255, 170, 164, .4); }
.glass-strip.danger > .i { color: #ffb4ae; }
.glass-strip .btn { flex: none; }

/* ================= 表单 ================= */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 7px; }
.field-label .muted { font-weight: 400; margin-left: 6px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--surface-2);
  font-size: 15px; transition: border-color .15s, box-shadow .15s, background-color .15s; appearance: none; -webkit-appearance: none;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2369738f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 4px rgba(79, 86, 232, .14); }
.input:disabled, .select:disabled, .textarea:disabled { color: var(--ink-2); -webkit-text-fill-color: var(--ink-2); cursor: default; opacity: 1; border-color: transparent; }
.input.is-invalid, .textarea.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(224, 67, 59, .12); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 19px; height: 19px; accent-color: var(--primary); margin: 0; flex: none; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.form-error { margin: 14px 0 0; }

.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-3); border-radius: 14px; padding: 4px; margin-bottom: 20px; }
.seg::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 11px; background: #fff; box-shadow: 0 2px 8px rgba(15, 27, 61, .12); transition: transform .3s var(--ease); }
.seg[data-active="register"]::before { transform: translateX(100%); }
.seg button { position: relative; border: 0; background: transparent; border-radius: 11px; min-height: 42px; font-weight: 650; color: var(--muted); cursor: pointer; transition: color .2s; }
.seg button[aria-selected="true"] { color: var(--ink); }

/* ================= 弹窗与浮动提示 ================= */
dialog.modal {
  border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 40px);
  box-shadow: var(--shadow-lg); color: var(--ink); background: var(--surface);
}
dialog.modal[open] { animation: modal-in .28s var(--ease); }
dialog.modal::backdrop { background: rgba(6, 12, 32, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 22px 24px 6px; font-size: 18px; font-weight: 750; line-height: 1.45; }
.modal-head .title-ic { width: 38px; height: 38px; border-radius: 12px; }
.modal-body { padding: 10px 24px 6px; font-size: 14.5px; overflow: auto; color: var(--ink-2); }
.modal-body p + p, .modal-body p + .quote, .modal-body .quote + p, .modal-body ul + p, .modal-body p + ul { margin-top: 10px; }
.modal-body ul { display: grid; gap: 8px; }
.modal-body li { position: relative; padding-left: 18px; }
.modal-body li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); opacity: .7; }
.modal-foot { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.quote { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.7; color: var(--ink); }

.toasts { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(540px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; padding: 13px 12px 13px 15px; border-radius: 16px;
  background: rgba(15, 27, 61, .92); color: #fff; box-shadow: 0 18px 40px -12px rgba(6, 12, 32, .5); font-size: 14px; line-height: 1.55;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: toast-in .32s var(--ease);
}
.toast > .i { width: 19px; height: 19px; margin-top: 1px; color: #a5b4fc; }
.toast-ok > .i { color: #6ee7b7; }
.toast-danger { background: rgba(122, 24, 20, .95); }
.toast-danger > .i { color: #fecaca; }
.toast-warn > .i { color: #fcd34d; }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast .toast-action { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .35); border-radius: 9px; padding: 3px 11px; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.toast .toast-close { background: transparent; border: 0; color: inherit; opacity: .65; cursor: pointer; font-size: 20px; line-height: 1; padding: 0 4px; }
.toast .toast-close:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ================= 进入页 ================= */
.auth-card { padding: 26px 24px 22px; }
.auth-card h2 { font-size: 21px; font-weight: 800; line-height: 1.4; }
.auth-card .lead { color: var(--muted); font-size: 14px; margin: 6px 0 20px; }
.auth-card .check { margin: 2px 0 20px; }
.auth-foot { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 18px; line-height: 1.65; padding-top: 16px; border-top: 1px dashed var(--line); }
.auth-foot .i { color: var(--faint); margin-top: 2px; }

/* ================= 填报页 ================= */
.record { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.record-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; background: var(--slate-soft); color: var(--slate); }
.record-icon svg { width: 26px; height: 26px; }
.record.ok .record-icon { background: var(--ok-soft); color: var(--ok); }
.record.warn .record-icon { background: var(--warn-soft); color: var(--warn); }
.record.carried .record-icon { background: var(--carried-soft); color: var(--carried); }
.record.admin .record-icon { background: var(--admin-soft); color: var(--admin); }
.record-body { flex: 1; min-width: 0; }
.record-body b { display: block; font-size: 16px; font-weight: 750; line-height: 1.4; }
.record-body span { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }
.record-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.draw circle, .draw path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.draw.play circle { stroke-dashoffset: 1; animation: draw .6s var(--ease) forwards; }
.draw.play path { stroke-dashoffset: 1; animation: draw .4s .45s var(--ease) forwards; }
.record.just .record-icon { animation: pop .6s var(--ease); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

.form-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-top > div:first-child { min-width: 0; }
.gauge { position: relative; width: 88px; height: 88px; flex: none; }
.gauge > svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.gauge .bar { fill: none; stroke: var(--line-strong); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .5s var(--ease), stroke .3s; }
.gauge.warn .bar { stroke: var(--warn); }
.gauge.ok .bar { stroke: var(--ok); }
.gauge.bad .bar { stroke: var(--danger); }
.gauge-center { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.gauge-center b { font-family: var(--font-num); font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gauge-center span { font-family: var(--font-num); font-size: 12px; color: var(--muted); margin-top: 2px; }
.gauge .tick { position: absolute; right: -2px; top: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 10px -2px rgba(14, 159, 110, .6); transform: scale(0); transition: transform .35s var(--ease); }
.gauge .tick .i { width: 15px; height: 15px; }
.gauge.ok .tick { transform: scale(1); }
.gauge-text { font-size: 13.5px; font-weight: 600; margin: 12px 0 14px; padding: 9px 13px; border-radius: 11px; background: var(--surface-2); color: var(--muted); transition: background .3s, color .3s; }
.gauge-text.warn { background: var(--warn-soft); color: var(--warn-ink); }
.gauge-text.ok { background: var(--ok-soft); color: var(--ok-ink); }
.gauge-text.bad { background: var(--danger-soft); color: var(--danger-ink); }

.present {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 17px; margin-bottom: 4px;
  background: linear-gradient(135deg, #f4f5ff, #f8f4ff); border: 1.5px solid #e1e3fd; transition: border-color .15s, box-shadow .15s, background .15s;
}
.present:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 86, 232, .14); background: #fff; }
.present.is-invalid { border-color: var(--danger); }
.present-label b { display: block; font-size: 16px; font-weight: 750; }
.present-label small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.present-input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font-family: var(--font-num); font-size: 40px; font-weight: 700; line-height: 1.1; color: var(--ink); padding: 2px 4px; text-align: center; font-variant-numeric: tabular-nums; }
.present-input:focus { outline: none; }
.present-input::placeholder { color: var(--faint); font-weight: 500; font-size: 17px; font-family: var(--font); }
.present-input:disabled { -webkit-text-fill-color: var(--ink); opacity: 1; }
.cats { margin: 6px 0 18px; }
.cat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.cat:last-child { border-bottom: 0; }
.cat-label b { display: block; font-size: 15.5px; font-weight: 650; line-height: 1.35; }
.cat-label small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 15px; padding: 3px; flex: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.stepper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 86, 232, .14); background: #fff; }
.stepper.is-invalid { border-color: var(--danger); }
.step { width: 38px; height: 38px; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(15, 27, 61, .12); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; transition: transform .1s, background .15s; }
.step:hover { background: var(--primary-soft); color: var(--primary); }
.step:active { transform: scale(.92); }
.step .i { width: 17px; height: 17px; }
.step-input { width: 52px; border: 0; background: transparent; text-align: center; font-family: var(--font-num); font-size: 21px; font-weight: 700; padding: 0; min-height: 38px; font-variant-numeric: tabular-nums; }
.step-input:focus { outline: none; }
.step-input::placeholder { color: var(--faint); font-weight: 400; }
.step-input:disabled { -webkit-text-fill-color: var(--ink); opacity: 1; }
.readonly .step, .readonly #all-present { display: none; }
.readonly .stepper { background: transparent; border-color: transparent; }
.readonly .present { background: var(--surface-2); border-color: transparent; }
.readonly .textarea { min-height: 48px; resize: none; background: var(--surface-2); border-color: transparent; }
.dropzone { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px dashed var(--line-strong); border-radius: 15px; background: var(--surface-2); flex-wrap: wrap; }
.dropzone .file-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); flex: none; }
.dropzone .file-ic .i { width: 20px; height: 20px; }
.dropzone .file-main { flex: 1; min-width: 150px; }
.dropzone .file-main b, .dropzone .file-main button.file-name { display: block; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.dropzone .file-main span { display: block; font-size: 12.5px; color: var(--muted); }
.dropzone .file-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.submit-row { margin-top: 20px; }
.submit-meta { font-size: 12.5px; color: var(--muted); margin-top: 10px; text-align: center; }
.readonly-note { margin: 18px 0 0; }

/* ================= 管理页：头部 ================= */
.toolbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-top: 16px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.day-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(222, 229, 255, .75); }
.select-glass { min-height: 36px; width: auto; min-width: 210px; padding: 5px 34px 5px 12px; font-size: 14px; font-weight: 650; color: #fff; background-color: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); border-radius: 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23dfe4ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.select-glass:hover { border-color: rgba(255, 255, 255, .35); }
.select-glass:focus { background-color: rgba(255, 255, 255, .16); border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(165, 180, 252, .25); }
.select-glass option { color: var(--ink); }
.toolbar-end { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stamp-time { font-size: 12px; color: rgba(222, 229, 255, .6); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; margin-top: 22px; }
.hero-date { font-size: 14px; color: rgba(222, 229, 255, .75); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.phase-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phase-row .hero-title { margin-top: 6px; }
.hero-help { font-size: 14.5px; color: rgba(222, 229, 255, .82); margin-top: 8px; max-width: 760px; line-height: 1.7; }
.hero-help strong { color: #fff; }
.hero-side { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; width: 136px; height: 136px; flex: none; }
.donut > svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut .track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 12; }
.donut .seg { fill: none; stroke-width: 12; stroke-dasharray: 0 100; transition: stroke-dasharray .9s var(--ease), stroke-dashoffset .9s var(--ease); }
.donut .seg.reported { stroke: #34d399; }
.donut .seg.admin { stroke: #60a5fa; }
.donut .seg.carried { stroke: #a78bfa; }
.donut-center { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.donut-center b { font-family: var(--font-num); font-size: 34px; font-weight: 700; }
.donut-center b small { font-size: 18px; color: rgba(222, 229, 255, .6); font-weight: 600; }
.donut-center span { font-size: 12px; color: rgba(222, 229, 255, .7); margin-top: 4px; }
.legend { display: grid; gap: 7px; font-size: 13px; color: rgba(222, 229, 255, .8); }
.legend li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend b { font-family: var(--font-num); font-size: 15px; color: #fff; margin-left: auto; padding-left: 12px; }
.arc-admin { margin-top: 18px; }
.arc-admin .arc-sky { height: 118px; }
.stage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; text-align: center; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 0 4px; }
.stage-time { font-family: var(--font-num); font-size: 20px; font-weight: 700; letter-spacing: .02em; color: rgba(255, 255, 255, .6); }
.stage.done .stage-time, .stage.next .stage-time { color: #fff; }
.stage-title { font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .88); }
.stage-desc { font-size: 12px; color: rgba(222, 229, 255, .55); }
.stage-result { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-top: 7px; font-size: 12.5px; color: rgba(222, 229, 255, .85); }
.stage-result .who { overflow-wrap: anywhere; }
.stage-result .at { font-size: 11.5px; color: rgba(222, 229, 255, .5); }
.stage-mark { display: none; }
.demo-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 20px; padding: 11px 14px; border-radius: 16px; background: rgba(167, 139, 250, .12); border: 1px solid rgba(221, 210, 255, .22); font-size: 13.5px; color: rgba(236, 232, 255, .9); }
.demo-bar .grow { flex: 1; min-width: 200px; }
.sky-admin .sky-inner { padding-bottom: 58px; }

/* ================= 管理页：统计 ================= */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; overflow: hidden; border-radius: 16px; padding: 14px 16px 13px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.tile::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-strong); }
.tile.ok::after { background: var(--ok); }
.tile.admin::after { background: var(--admin); }
.tile.carried::after { background: var(--carried); }
.tile.warn::after { background: var(--warn); }
.tile .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tile .v { font-family: var(--font-num); font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile.ok .v { color: var(--ok-ink); }
.tile.admin .v { color: var(--admin-ink); }
.tile.carried .v { color: var(--carried-ink); }
.tile.warn .v { color: var(--warn-ink); }
.tile .names { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; min-height: 1.5em; overflow-wrap: anywhere; line-height: 1.5; }
.tile .names.none { color: var(--faint); }
.totals { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #f5f6ff, #f8f5ff); border: 1px solid #e3e5fb; }
.totals div { padding: 12px 14px; min-width: 0; position: relative; }
.totals div + div::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: #e0e3f7; }
.totals b { display: block; font-family: var(--font-num); font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.totals b.nil { color: var(--faint); }
.totals span { font-size: 12.5px; color: var(--muted); }
.totals .sub { display: block; font-size: 11.5px; color: var(--muted); }
.totals .lead b { color: var(--primary-ink); }
.missing-line { margin: 14px 0 0; }

/* ================= 管理页：班级明细 ================= */
.legend-row { display: flex; gap: 6px; flex-wrap: wrap; }
.xtable { border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.xhead, .xrow { display: grid; grid-template-columns: minmax(210px, 1.3fr) 52px repeat(6, 64px) minmax(170px, 1.5fr) 170px; gap: 8px; align-items: start; padding: 11px 14px; }
.xhead { background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--muted); border-radius: 16px 16px 0 0; position: sticky; top: 0; z-index: 2; align-items: center; border-bottom: 1px solid var(--line); letter-spacing: .02em; }
.xhead .c { text-align: center; }
.xrow { position: relative; border-top: 1px solid var(--line); transition: background .2s; }
.xhead + div .xrow:first-child { border-top: 0; }
.xrow:last-child { border-radius: 0 0 16px 16px; }
.xrow::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; transition: background .2s; }
.xrow.src-reporter::before { background: var(--ok); }
.xrow.src-admin::before { background: var(--admin); }
.xrow.src-carried::before { background: var(--carried); }
.xrow.src-missing::before { background: var(--warn); }
.xrow.is-missing { background: repeating-linear-gradient(135deg, rgba(212, 136, 6, .045) 0 10px, rgba(255, 255, 255, 0) 10px 20px), #fffcf5; }
.xrow.is-dirty { background: #f7f8ff; }
.xrow.is-dirty::before { background: var(--primary); width: 4px; }
.xrow.flash { animation: row-flash 1.2s ease-out; }
@keyframes row-flash { 0% { background: #e9ffe6; } 100% { background: transparent; } }
.x-class { min-width: 0; }
.x-name { font-weight: 750; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.x-name .exp-inline { display: none; font-weight: 500; color: var(--muted); font-size: 13px; }
.x-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.x-tags .pill { font-size: 11.5px; padding: 0 8px; line-height: 1.8; }
.x-meta { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.x-sum { font-size: 12.5px; margin-top: 5px; font-weight: 600; font-family: var(--font-num); }
.x-sum.ok { color: var(--ok-ink); }
.x-sum.bad { color: var(--danger-ink); }
.x-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.x-actions:empty, .x-sum:empty { display: none; }
.x-expected { text-align: center; font-family: var(--font-num); font-weight: 700; font-size: 16px; padding-top: 8px; color: var(--ink-2); }
.x-num .input { min-height: 40px; padding: 5px 4px; text-align: center; font-family: var(--font-num); font-size: 17px; font-weight: 700; border-radius: 11px; background: var(--surface-2); }
.x-lab { display: none; }
.x-val { display: block; text-align: center; padding: 8px 0; font-family: var(--font-num); font-weight: 700; font-size: 17px; }
.x-val.nil { color: var(--faint); font-weight: 400; }
.x-note .textarea { min-height: 40px; padding: 8px 10px; font-size: 13.5px; resize: none; overflow: hidden; border-radius: 11px; }
.x-note-text { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 8px; }
.x-note-text.nil { color: var(--faint); }
.x-file { min-width: 0; font-size: 13px; padding-top: 6px; }
.file-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.file-name { font-weight: 650; overflow-wrap: anywhere; }
.x-file .file-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.x-msg { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 9px 12px; border-radius: 11px; animation: toast-in .3s var(--ease); }
.x-msg .i { margin-top: 2px; }
.x-msg.info { background: var(--carried-soft); color: var(--carried-ink); }
.x-msg.warn { background: var(--warn-soft); color: var(--warn-ink); }
.x-msg.danger { background: var(--danger-soft); color: var(--danger-ink); }
.x-msg.ok { background: var(--ok-soft); color: var(--ok-ink); }
.nil-dash { color: var(--faint); }

.actionbar {
  position: sticky; bottom: 12px; z-index: 5; margin: 18px 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom) * .5);
  background: rgba(255, 255, 255, .88); border: 1px solid rgba(15, 27, 61, .08); border-radius: 18px; box-shadow: 0 16px 40px -18px rgba(15, 27, 61, .35);
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
}
.ab-info { font-size: 13.5px; color: var(--ink-2); display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.ab-info .dirty { color: var(--danger-ink); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.ab-info .dirty::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: live-red 1.4s ease-out infinite; }
@keyframes live-red { 0% { box-shadow: 0 0 0 0 rgba(224, 67, 59, .6); } 80%, 100% { box-shadow: 0 0 0 7px rgba(224, 67, 59, 0); } }
.ab-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ================= 管理页：汇总、盖章与群聊 ================= */
.summary-box { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.8; min-height: 120px; }
.target-line { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; }
.target-line span { display: inline-flex; align-items: center; gap: 6px; }
.target-line b { color: var(--ink); }
.summary-box.has-stamp { padding-right: 140px; min-height: 150px; }
.stamp { position: absolute; right: 14px; bottom: 12px; width: 118px; height: 118px; pointer-events: none; transform: rotate(-14deg); opacity: .9; }
.stamp.play { animation: stamp-in .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes stamp-in { from { transform: rotate(-14deg) scale(1.9); opacity: 0; } 60% { opacity: .95; } to { transform: rotate(-14deg) scale(1); opacity: .9; } }
.deliveries { display: grid; gap: 10px; }
.delivery { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; flex-wrap: wrap; }
.delivery .d-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.delivery .d-ic.xlsx { background: #e7f6ee; color: #178a55; }
.delivery .d-ic.text { background: var(--primary-soft); color: var(--primary); }
.delivery .d-ic .i { width: 19px; height: 19px; }
.delivery .d-main { flex: 1; min-width: 140px; }
.delivery .d-main b { display: block; font-size: 14px; }
.delivery .d-main span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.delivery .detail { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.delivery.placeholder { color: var(--muted); font-size: 13.5px; background: var(--surface-2); border-style: dashed; }

.chat { position: relative; background: linear-gradient(180deg, #f2f4fb, #eceff8); border-radius: 18px; padding: 0 0 14px; max-height: 660px; overflow: auto; }
.chat-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(242, 244, 251, .92); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 18px 18px 0 0; }
.group-avatar { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #0f1b3d, #3b4f9a); color: #fff; display: grid; place-items: center; flex: none; }
.group-avatar .i { width: 18px; height: 18px; }
.chat-head b { font-size: 14px; display: block; line-height: 1.3; }
.chat-head span { font-size: 12px; color: var(--muted); }
.chat-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 16px 0; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.is-new { animation: msg-in .45s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg-avatar { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 14px -6px rgba(79, 86, 232, .8); }
.msg-avatar .i { width: 19px; height: 19px; }
.msg-body { min-width: 0; flex: 1; }
.msg-meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 5px; }
.msg-meta b { color: var(--ink-2); }
.msg-meta .pill { font-size: 11px; padding: 0 7px; line-height: 1.65; }
.bubble { display: inline-block; max-width: 100%; background: #fff; border-radius: 5px 16px 16px 16px; padding: 10px 14px; box-shadow: 0 1px 2px rgba(15, 27, 61, .07); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; }
.bubble .mention { color: var(--admin); font-weight: 650; background: var(--admin-soft); border-radius: 5px; padding: 0 3px; }
.msg.is-old .bubble, .msg.is-old .file-card { opacity: .55; }
.msg-foot { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.msg-foot .pill { font-size: 11px; padding: 0 8px; line-height: 1.7; }
.file-card { display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 5px 16px 16px 16px; padding: 12px 14px; cursor: pointer; max-width: 100%; box-shadow: 0 1px 2px rgba(15, 27, 61, .07); transition: border-color .15s, transform .15s; }
.file-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.xlsx-icon { position: relative; width: 38px; height: 46px; flex: none; }
.xlsx-icon svg { width: 100%; height: 100%; }
.file-card .fn { display: block; font-weight: 650; font-size: 13.5px; overflow-wrap: anywhere; color: var(--ink); }
.file-card .fs { display: block; font-size: 12px; color: var(--muted); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px 22px; text-align: center; color: var(--muted); font-size: 14px; }
.empty .i { width: 34px; height: 34px; color: var(--faint); }

/* ================= 管理页：历史与设置 ================= */
.hist { border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: box-shadow .2s; }
.hist + .hist { margin-top: 10px; }
.hist[open] { box-shadow: var(--shadow); }
.hist summary { cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; list-style: none; }
.hist summary::-webkit-details-marker { display: none; }
.hist summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
.hist[open] summary::before { transform: rotate(45deg); }
.hist-body { padding: 0 16px 16px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.mini-table th, .mini-table td { padding: 8px 9px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.mini-table th { background: var(--surface-2); font-weight: 700; color: var(--muted); border-top: 0; white-space: nowrap; font-size: 12px; }
.mini-table td:first-child, .mini-table th:first-child { text-align: left; }
.mini-table td.note { text-align: left; color: var(--ink-2); min-width: 150px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
.table-scroll .mini-table { margin-top: 0; }
.settings summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary .chev { margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.settings[open] summary .chev { transform: rotate(-135deg); }
.settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.settings-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }

/* ================= 响应式 ================= */
@media (max-width: 1079px) {
  .xhead { display: none; }
  .xrow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px 16px 16px 18px; }
  .x-class, .x-note, .x-file, .x-msg { grid-column: 1 / -1; }
  .x-expected { display: none; }
  .x-name .exp-inline { display: inline; }
  .x-lab { display: block; font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 4px; }
  .x-note .textarea { min-height: 46px; }
  .x-note-text { padding-top: 0; }
  .x-note::before, .x-file::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
  .x-val { background: var(--surface-2); border-radius: 11px; }
  .xrow.ro { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 6px; }
  .xrow.ro .x-lab { font-size: 11.5px; white-space: nowrap; }
  .xrow.ro .x-val { font-size: 16px; padding: 6px 0; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .totals { grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); }
  .totals .lead { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
  .totals div:nth-child(n+5) { border-top: 1px solid #e0e3f7; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .arc-admin .arc-sky { display: none; }
  .stage-grid { grid-template-columns: minmax(0, 1fr); gap: 0; text-align: left; position: relative; }
  .stage { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 0 0 16px 30px; position: relative; }
  .stage::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: -4px; width: 2px; background: rgba(255, 255, 255, .16); }
  .stage:last-child::before { display: none; }
  .stage-mark { display: block; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: #121d47; border: 2px solid rgba(255, 255, 255, .45); }
  .stage.done .stage-mark { background: linear-gradient(135deg, #a5b4fc, #ffd27a); border-color: #fff; }
  .stage.warn .stage-mark { background: #f5b83d; border-color: #fff; }
  .stage.next .stage-mark { border-color: #ffd27a; animation: beacon 1.8s ease-out infinite; }
  .stage-desc { flex-basis: 100%; }
  .stage-result { align-items: flex-start; flex-basis: 100%; margin-top: 4px; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-side { justify-content: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .sky-inner { padding: 12px 16px 0; }
  .main { padding: 0 14px 34px; margin-top: -26px; }
  .card { padding: 18px 16px; border-radius: 18px; margin-bottom: 14px; }
  .brand .logo { width: 32px; height: 32px; }
  .hero { padding-top: 20px; }
  .hero-title { font-size: 30px; }
  .input, .select, .textarea { font-size: 16px; }
  .x-num .input { font-size: 17px; }
  .skyline { height: 70px; }
  .totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .totals .lead { grid-row: auto; grid-column: 1 / -1; }
  .totals div:nth-child(n+2) { border-top: 1px solid #e0e3f7; }
  .totals div:nth-child(2)::before, .totals div:nth-child(5)::before { display: none; }
  .totals b { font-size: 22px; }
  .tile .v { font-size: 26px; }
  .actionbar { bottom: 8px; padding: 10px 12px; border-radius: 16px; }
  .ab-buttons { width: 100%; }
  .ab-buttons .btn { flex: 1 1 auto; }
  .toolbar { padding: 10px; }
  .day-field { width: 100%; }
  .select-glass { flex: 1; min-width: 0; }
  .toolbar-end { margin-left: 0; width: 100%; }
  .toolbar-end .btn { flex: 1 1 auto; }
  .stamp-time { width: 100%; }
  .donut { width: 112px; height: 112px; }
  .donut-center b { font-size: 28px; }
  .settings-grid, .settings-grid.two { grid-template-columns: minmax(0, 1fr); }
  .modal-foot .btn { flex: 1 1 auto; }
  .gauge { width: 80px; height: 80px; }
  .summary-box.has-stamp { padding-right: 18px; padding-bottom: 96px; }
  .stamp { width: 88px; height: 88px; }
  .present-input { font-size: 36px; }
  .form-top .card-title { font-size: 16px; }
  .sky-admin .sky-inner { padding-bottom: 50px; }
}
@media (max-width: 480px) {
  .present { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label chip" "input input"; row-gap: 4px; }
  .present-label { grid-area: label; }
  .present .chip { grid-area: chip; }
  .present-input { grid-area: input; min-height: 52px; }
}
@media (max-width: 480px) {
  .top-actions .btn-text { display: none; }
  .top-actions .btn { padding: 5px 10px; }
}
@media (max-width: 400px) {
  .record { padding: 14px; gap: 12px; }
  .record .btn-text { display: none; }
  .record .btn { padding: 5px 9px; }
  .record-icon { width: 42px; height: 42px; }
}
@media (max-width: 380px) {
  .cat { gap: 8px; }
  .step { width: 34px; height: 34px; }
  .step-input { width: 44px; }
  .xrow, .xrow.ro { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
