/* ============================================================
   作业提交系统 · 样式（零外部依赖 / CSP 友好）
   ------------------------------------------------------------
   设计取向：精密、克制、有层次。
   · 用「极细描边 + 极淡阴影」建立层次，不靠厚重投影
   · 主操作用深墨色，交互高亮用单一克制靛蓝
   · 排版以字重与字距建立节奏，不靠大字号
   · 支持系统暗色模式；动画全部尊重 prefers-reduced-motion
   · 所有 class 名与旧版完全兼容 —— 纯视觉升级，不动任何功能
   ============================================================ */

/* ---------- 设计令牌（浅色）---------- */
:root {
  /* 底层与表面 */
  --bg: #fbfbfd;
  --bg-tint: #f6f6f9;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --surface-3: #f4f4f7;

  /* 描边：靠它建层次，而不是阴影 */
  --line: #ececf1;
  --line-2: #e2e2ea;
  --line-3: #d4d4de;

  /* 文字层级 */
  --ink: #101014;
  --ink-2: #3c3c46;
  --ink-3: #6a6a78;
  --muted: #8c8c9a;

  /* 主色：深墨（用于主按钮，比彩色更贵气） */
  --ink-btn: #1a1a1f;
  --ink-btn-h: #000000;

  /* 强调色：克制靛蓝 */
  --accent: #4f46e5;
  --accent-d: #4338ca;
  --accent-l: #6366f1;
  --accent-soft: #f2f2ff;
  --accent-line: #dcdcfa;
  --ring: rgba(79, 70, 229, .18);

  /* 语义色：降饱和，更耐看 */
  --ok: #0d9488;
  --ok-bg: #f0fdfa;
  --ok-line: #b6ede4;
  --ok-ink: #0b6b62;

  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-line: #f5dfa0;
  --warn-ink: #8a4108;

  --err: #dc2626;
  --err-bg: #fef2f2;
  --err-line: #f6cdcd;
  --err-ink: #b91c1c;

  --info: #2563eb;
  --info-bg: #f2f7ff;
  --info-line: #cfdffb;
  --info-ink: #1d4ed8;

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r: 12px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;

  /* 阴影：多层极淡，模拟真实光照 */
  --sh-1: 0 1px 2px rgba(16, 16, 22, .04);
  --sh-2: 0 1px 2px rgba(16, 16, 22, .04), 0 2px 8px -2px rgba(16, 16, 22, .05);
  --sh-3: 0 2px 4px rgba(16, 16, 22, .04), 0 8px 20px -6px rgba(16, 16, 22, .08);
  --sh-4: 0 4px 8px rgba(16, 16, 22, .05), 0 20px 44px -12px rgba(16, 16, 22, .14);
  --sh-ink: 0 1px 2px rgba(16, 16, 22, .3), 0 6px 16px -4px rgba(16, 16, 22, .28);

  /* 字体：优先系统 UI 字体，字重更精细 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;
}

/* ---------- 设计令牌（暗色）---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0c;
    --bg-tint: #0e0e12;
    --surface: #121216;
    --surface-2: #17171d;
    --surface-3: #1d1d25;

    --line: #23232c;
    --line-2: #2c2c37;
    --line-3: #3a3a47;

    --ink: #f2f2f5;
    --ink-2: #c3c3cd;
    --ink-3: #9298a6;
    --muted: #6f6f7e;

    --ink-btn: #f4f4f6;
    --ink-btn-h: #ffffff;

    --accent: #818cf8;
    --accent-d: #a5b4fc;
    --accent-l: #6366f1;
    --accent-soft: #1a1a2e;
    --accent-line: #31315a;
    --ring: rgba(129, 140, 248, .26);

    --ok: #2dd4bf;
    --ok-bg: #0b2523;
    --ok-line: #14524b;
    --ok-ink: #5eead4;

    --warn: #fbbf24;
    --warn-bg: #241c08;
    --warn-line: #584309;
    --warn-ink: #fcd34d;

    --err: #f87171;
    --err-bg: #250e0e;
    --err-line: #5c2323;
    --err-ink: #fca5a5;

    --info: #60a5fa;
    --info-bg: #0d1a2d;
    --info-line: #1e3a5f;
    --info-ink: #93c5fd;

    --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-2: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px -2px rgba(0, 0, 0, .5);
    --sh-3: 0 2px 4px rgba(0, 0, 0, .4), 0 8px 20px -6px rgba(0, 0, 0, .6);
    --sh-4: 0 4px 8px rgba(0, 0, 0, .5), 0 20px 44px -12px rgba(0, 0, 0, .7);
    --sh-ink: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 16px -4px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

/* hidden 属性必须优先于 .btn/.msg 等设置的 display */
[hidden] { display: none !important; }

/* ---------- 基础 ---------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light dark;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1, "cv11" 1;
}

/* 顶部极淡的光晕，只给一点空气感 */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 340px;
  background:
    radial-gradient(680px 280px at 22% -12%, var(--accent-soft), transparent 68%),
    radial-gradient(560px 240px at 82% -18%, var(--bg-tint), transparent 70%);
  opacity: .9;
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .16s ease, opacity .16s ease;
}
a:hover { color: var(--accent-d); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--ring); color: var(--ink); }

/* 细滚动条（高端感的细节之一） */
* { scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-3);
  border-radius: 99px;
  border: 3px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- 布局 ---------- */
.wrap { max-width: 940px; margin: 0 auto; padding: 40px 20px 72px; }
.wrap.wide { max-width: 1320px; }
.wrap.narrow { max-width: 540px; }
.card.narrow2 { max-width: 520px; }

/* ---------- 标题：靠字距与字重建层级 ---------- */
.hero { padding: 4px 2px 28px; }
.hero h1 {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -.03em;
  line-height: 1.24;
  color: var(--ink);
}
.hero p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
  letter-spacing: -.004em;
}
.hero p a { font-weight: 500; }

h1 {
  font-size: 22px;
  font-weight: 670;
  letter-spacing: -.025em;
  line-height: 1.3;
  margin: 0 0 16px;
  color: var(--ink);
}

h2 {
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -.015em;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  color: var(--ink);
}

/* ---------- 卡片：细描边 + 极淡阴影 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 26px;
  margin-bottom: 16px;
  box-shadow: var(--sh-1);
  transition: box-shadow .22s cubic-bezier(.4, 0, .2, 1),
              border-color .22s ease;
}
.card:hover { box-shadow: var(--sh-2); }
.card .card { box-shadow: none; background: var(--surface-2); border-color: var(--line); }

/* ---------- 文本工具 ---------- */
.muted { color: var(--muted); }
.small { font-size: 12.8px; letter-spacing: -.003em; }
.mono {
  font-family: var(--mono);
  font-size: .93em;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.01em;
}
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req { color: var(--err); font-weight: 600; }

/* ---------- 表单 ---------- */
label {
  display: block;
  margin-bottom: 18px;
  font-size: 13.2px;
  font-weight: 560;
  color: var(--ink-2);
  letter-spacing: -.005em;
}

input[type=text], input[type=password], input[type=number],
input[type=email], input[type=datetime-local], input[type=file], select, textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -.005em;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  box-shadow: var(--sh-1);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }

input:hover:not(:focus):not(:disabled),
select:hover:not(:focus),
textarea:hover:not(:focus) { border-color: var(--line-3); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--ring);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* 下拉箭头（内联 SVG，不引外链） */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c8c9a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 34px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 78px; line-height: 1.62; }

input[type=file] {
  padding: 9px;
  cursor: pointer;
  background: var(--surface-2);
  border-style: dashed;
  border-color: var(--line-3);
  box-shadow: none;
}
input[type=file]:hover { border-color: var(--accent); background: var(--accent-soft); }
input[type=file]::file-selector-button {
  padding: 7px 14px;
  margin-right: 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all .16s ease;
}
input[type=file]::file-selector-button:hover {
  background: var(--ink-btn);
  border-color: var(--ink-btn);
  color: var(--surface);
}

.hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.2px;
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: -.002em;
}
.hint b { color: var(--ink-2); font-weight: 600; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 组员名单 ---------- */
.members-block {
  margin: 6px 0 20px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
}
.members-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 12px;
}
.members-head b { font-size: 13.5px; font-weight: 620; letter-spacing: -.01em; }
.member-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 11px; }
.member-rows:empty { margin-bottom: 0; }
.member-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  animation: rowIn .22s cubic-bezier(.2, .8, .3, 1) backwards;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.member-row .m-idx {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 20px;
}
.member-row input {
  margin: 0;
  padding: 8px 11px;
  font-size: 13.5px;
  background: var(--surface);
  box-shadow: none;
}
.member-row .m-del { color: var(--muted); box-shadow: none; }
.member-row .m-del:hover {
  color: var(--err-ink);
  border-color: var(--err-line);
  background: var(--err-bg);
}
@media (max-width: 640px) {
  .member-row { grid-template-columns: 24px 1fr auto; }
  .member-row .m-no { grid-column: 2 / 4; }
  .member-row .m-del { grid-row: 1; grid-column: 3; }
}

/* ---------- 复选框 ---------- */
.checks { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 6px 0 20px; }
.chk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 450;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.chk input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink-btn);
  cursor: pointer;
  flex: none;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: -.006em;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .1s ease, color .15s ease;
  vertical-align: middle;
  box-shadow: var(--sh-1);
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--line-3);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--sh-2);
}
.btn:active { transform: translateY(.5px) scale(.995); box-shadow: none; }

/* 主按钮：深墨色（比彩色更克制、更贵） */
.btn.primary {
  background: var(--ink-btn);
  border-color: var(--ink-btn);
  color: #fff;
  box-shadow: var(--sh-ink);
}
.btn.primary:hover {
  background: var(--ink-btn-h);
  border-color: var(--ink-btn-h);
  color: #fff;
  box-shadow: 0 2px 4px rgba(16,16,22,.3), 0 10px 24px -6px rgba(16,16,22,.35);
}
@media (prefers-color-scheme: dark) {
  .btn.primary { color: #0a0a0c; }
  .btn.primary:hover { color: #0a0a0c; }
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--surface-3);
  border-color: transparent;
  color: var(--ink);
  box-shadow: none;
}

.btn.danger {
  color: var(--err-ink);
  border-color: var(--err-line);
  background: var(--surface);
  box-shadow: none;
}
.btn.danger:hover {
  background: var(--err-bg);
  border-color: var(--err-line);
  color: var(--err-ink);
}

.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn.lg { padding: 12px 24px; font-size: 14.5px; border-radius: 10px; }

.btn:disabled, .btn[disabled] {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
}
.btn:disabled:hover {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink-2);
  box-shadow: none;
  transform: none;
}
.btn.primary:disabled:hover {
  background: var(--ink-btn);
  border-color: var(--ink-btn);
  color: #fff;
}
/* 深色模式下主按钮反为浅底深字，禁用态也要跟着反转，否则白底白字 */
@media (prefers-color-scheme: dark) {
  .btn.primary:disabled,
  .btn.primary:disabled:hover { color: #0a0a0c; }
}

/* 补交按钮：暖橙，明确区分「非正常通道」 */
.btn.primary.late {
  background: linear-gradient(180deg, #d97706, #b45309);
  border-color: #a34a08;
  box-shadow: 0 1px 2px rgba(120, 53, 15, .35), 0 6px 16px -4px rgba(180, 83, 9, .4);
  color: #fff;
}
.btn.primary.late:hover {
  background: linear-gradient(180deg, #c2680a, #9a4707);
  border-color: #8a3f06;
  color: #fff;
}

.btn.disabled, .btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

form.inline { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 消息条 ---------- */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  border: 1px solid transparent;
  line-height: 1.62;
  letter-spacing: -.004em;
  animation: msgIn .24s cubic-bezier(.2, .8, .3, 1) backwards;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}
.msg::before {
  content: "";
  flex: none;
  width: 2.5px;
  align-self: stretch;
  border-radius: 3px;
  background: currentColor;
  opacity: .6;
}
.msg b { font-weight: 620; }
.msg code {
  background: rgba(0, 0, 0, .05);
  color: inherit;
  border: none;
}
@media (prefers-color-scheme: dark) {
  .msg code { background: rgba(255, 255, 255, .08); }
}

.msg.ok   { background: var(--ok-bg);   border-color: var(--ok-line);   color: var(--ok-ink); }
.msg.err  { background: var(--err-bg);  border-color: var(--err-line);  color: var(--err-ink); }
.msg.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.msg.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-ink); }

/* ---------- 文件信息 ---------- */
.file-info {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  margin-bottom: 16px;
  background: var(--surface-2);
  font-size: 13px;
}
.fi-row { display: flex; gap: 12px; padding: 3px 0; }
.fi-row span:first-child { width: 46px; flex: none; color: var(--muted); }
.fi-row b { font-weight: 580; word-break: break-all; min-width: 0; }

/* ---------- 进度条 ---------- */
.progress { margin: 8px 0 20px; }
.bar {
  position: relative;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(16, 16, 22, .06);
}
.bar > i {
  display: block;
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-l), var(--accent));
  transition: width .3s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
.bar > i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .5) 50%, transparent 75%);
  animation: shimmer 1.6s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.pmeta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.004em;
}

/* ---------- 表格：不用斑马纹，靠细线与 hover ---------- */
.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-sm);
}
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: auto;
}
.tbl th, .tbl td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  word-break: normal;
  overflow-wrap: break-word;
  letter-spacing: -.004em;
}
.tbl td.wrap-cell { word-break: break-word; overflow-wrap: break-word; min-width: 0; }
.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; word-break: normal; }

.tbl thead th {
  background: var(--surface-2);
  font-weight: 580;
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  letter-spacing: .02em;
  text-transform: none;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line-2);
}
.tbl thead th:first-child { border-top-left-radius: var(--r-sm); }
.tbl thead th:last-child  { border-top-right-radius: var(--r-sm); }

.tbl tbody tr { transition: background .13s ease; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }

.tbl td.empty {
  text-align: center;
  color: var(--muted);
  padding: 44px 0;
  font-size: 13px;
}
.tbl.kv th {
  width: 220px;
  font-weight: 520;
  color: var(--ink-3);
  background: var(--surface-2);
  font-size: 12.5px;
}
.tbl.kv tr:last-child th,
.tbl.kv tr:last-child td { border-bottom: none; }

/* 操作列按钮不压缩 */
.tbl td .btn { white-space: nowrap; }
.tbl td form.inline { display: inline-flex; vertical-align: middle; }

/* 多列表格：收紧内边距，让整表放进卡片 */
.tbl.tbl-wide th,
.tbl.tbl-wide td { padding: 10px 9px; }
.tbl.tbl-wide thead th { font-size: 11px; letter-spacing: .01em; }
.tbl.tbl-wide .btn.sm { padding: 4px 9px; font-size: 12px; }
.tbl.tbl-wide td:last-child { padding-right: 12px; }

/* ---------- 标签：状态点 + 极淡底 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 560;
  letter-spacing: -.002em;
  line-height: 1.7;
  background: var(--surface-3);
  color: var(--ink-3);
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
  flex: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent);
}
.tag.ok   { background: var(--ok-bg);   color: var(--ok-ink);   border-color: var(--ok-line); }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.tag.err  { background: var(--err-bg);  color: var(--err-ink);  border-color: var(--err-line); }
.tag.g    { background: var(--accent-soft); color: var(--accent-d); border-color: var(--accent-line); }

/* ---------- 后台顶栏：毛玻璃 + 细描边 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 11px 14px;
  margin-bottom: 22px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  position: sticky;
  top: 12px;
  z-index: 50;
}
.brand {
  font-weight: 640;
  font-size: 13.5px;
  letter-spacing: -.015em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}
.brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2.5px;
  background: linear-gradient(145deg, var(--accent-l), var(--accent-d));
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
}

.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs a {
  padding: 6px 12px;
  border-radius: var(--r-xs);
  color: var(--ink-3);
  font-size: 13.2px;
  font-weight: 500;
  letter-spacing: -.006em;
  transition: background .14s ease, color .14s ease;
  white-space: nowrap;
}
.tabs a:hover {
  background: var(--surface-3);
  color: var(--ink);
  text-decoration: none;
}
.tabs a.on {
  background: var(--ink-btn);
  color: #fff;
  font-weight: 560;
  box-shadow: var(--sh-ink);
}
@media (prefers-color-scheme: dark) {
  .tabs a.on { color: #0a0a0c; }
}
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ---------- 统计卡 ---------- */
.statbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.statbar.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .statbar, .statbar.four { grid-template-columns: repeat(2, 1fr); }
}
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-l), var(--accent));
  opacity: .55;
}
.stat:hover {
  box-shadow: var(--sh-2);
  transform: translateY(-1px);
  border-color: var(--line-2);
}
.stat .n {
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -.03em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat .l {
  font-size: 12px;
  color: var(--muted);
  font-weight: 450;
  letter-spacing: -.002em;
}

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }
.inline-form { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.inline-form select,
.inline-form input {
  width: auto;
  margin-top: 0;
  padding: 7px 11px;
  font-size: 13px;
  border-radius: var(--r-xs);
}
.inline-form input[type=text] { min-width: 230px; }

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 2px 0;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 8px;
}
.foot .small { color: var(--muted); font-size: 12px; }

/* ---------- 代码 ---------- */
code {
  background: var(--surface-3);
  padding: 1.5px 6px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  word-break: break-word;
}

.codeblock {
  background: #0d0d11;
  color: #d4d4de;
  padding: 18px 20px;
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.78;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
  border: 1px solid #1e1e28;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), var(--sh-2);
  tab-size: 2;
}
@media (prefers-color-scheme: dark) {
  .codeblock { background: #08080b; border-color: #1a1a22; }
}

/* ============================================================
   作业场次卡片（前台首页）
   ============================================================ */
.crumbs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px 18px;
  font-size: 13.5px;
  flex-wrap: wrap;
  gap: 10px;
}
.crumbs a { font-weight: 500; }

.as-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(336px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  /* 卡片高度各自适应内容，避免「每人模式」这类内容少的卡片被拉高后底部留大片空白 */
  align-items: start;
}
@media (max-width: 720px) { .as-grid { grid-template-columns: 1fr; } }

.as-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-1);
  transition: transform .24s cubic-bezier(.4, 0, .2, 1),
              box-shadow .24s ease, border-color .24s ease;
  overflow: hidden;
}
/* 顶部一条极细的强调线，进场即点明「这是可交互卡片」 */
.as-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-l), var(--accent) 55%, transparent);
  opacity: .85;
}
.as-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: var(--sh-4);
}
.as-card.is-disabled { opacity: .72; background: var(--surface-2); }
.as-card.is-disabled::before { background: var(--line-3); opacity: .6; }
.as-card.is-disabled:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--sh-1);
}

.as-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 10px;
}
.as-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.022em;
  line-height: 1.36;
  word-break: break-word;
  color: var(--ink);
}
.as-note {
  margin: 0 0 15px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
  letter-spacing: -.003em;
  min-height: 21px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.as-meta {
  list-style: none;
  margin: 0 0 16px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.as-meta li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.as-meta li b {
  font-weight: 570;
  text-align: right;
  word-break: break-all;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.004em;
}
.as-meta li .muted { font-size: 12px; flex: none; }

.as-progress { margin-bottom: 16px; }
/* 每人模式没有进度条时，给一段等高的占位，避免卡片底部空洞 */
.as-progress.is-flat { min-height: 0; margin-bottom: 14px; }
.as-progress-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 7px;
  box-shadow: inset 0 1px 2px rgba(16, 16, 22, .05);
}
.as-progress-bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-l), var(--accent));
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.as-progress span { font-variant-numeric: tabular-nums; font-size: 12.2px; }

.as-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: auto;
  align-items: center;
}
.as-actions .btn.lg { flex: 1; min-width: 132px; }

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.login-card {
  width: 100%;
  max-width: 404px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px 32px 26px;
  box-shadow: var(--sh-4);
  position: relative;
  overflow: hidden;
  animation: loginIn .4s cubic-bezier(.2, .8, .3, 1) backwards;
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-l), var(--accent) 60%, transparent);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}
.login-logo {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink-btn);
  box-shadow: var(--sh-ink);
}
@media (prefers-color-scheme: dark) {
  .login-logo { color: #0a0a0c; }
}
.login-brand h1 {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 660;
  letter-spacing: -.022em;
}
.login-brand p { margin: 0; font-size: 12.5px; }
.login-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
}
.login-actions .btn.primary { flex: 1; }
.login-foot {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  line-height: 1.62;
  font-size: 12px;
}
@media (max-width: 640px) {
  .login-card { padding: 26px 22px 22px; border-radius: var(--r-lg); }
  .login-logo { width: 40px; height: 40px; }
  .login-brand h1 { font-size: 17px; }
  .login-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .login-actions .btn { width: 100%; }
}

/* ============================================================
   安全自检
   ============================================================ */
.sc-item {
  border: 1px solid var(--line);
  border-left-width: 2.5px;
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin-bottom: 9px;
  background: var(--surface);
  transition: box-shadow .16s ease, transform .16s ease;
}
.sc-item:hover { box-shadow: var(--sh-2); transform: translateX(1.5px); }
.sc-item.sc-danger { border-left-color: var(--err);  background: var(--err-bg); }
.sc-item.sc-warn   { border-left-color: #f59e0b;     background: var(--warn-bg); }
.sc-item.sc-ok     { border-left-color: var(--ok); }
.sc-item.sc-info   { border-left-color: var(--info); background: var(--info-bg); }

.sc-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 560;
}
.sc-badge {
  font-size: 10.5px;
  font-weight: 620;
  padding: 1.5px 8px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--ink-3);
  flex: none;
  letter-spacing: .02em;
}
.sc-danger .sc-badge { background: var(--err-line); color: var(--err-ink); }
.sc-warn .sc-badge   { background: var(--warn-line); color: var(--warn-ink); }
.sc-ok .sc-badge     { background: var(--ok-line); color: var(--ok-ink); }
.sc-info .sc-badge   { background: var(--info-line); color: var(--info-ink); }

.sc-desc { font-size: 12.8px; line-height: 1.66; color: var(--ink-3); letter-spacing: -.003em; }
.sc-fix { margin-top: 9px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.sc-fix strong { color: var(--ink-2); }
.sc-fix code {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  word-break: break-all;
  color: var(--ink-2);
  font-size: 11.5px;
}

/* ============================================================
   小屏适配
   ============================================================ */
@media (max-width: 640px) {
  .wrap { padding: 22px 13px 48px; }
  .card { padding: 18px; border-radius: var(--r); }
  .hero { padding: 2px 0 20px; }
  .hero h1 { font-size: 21px; }
  .topbar {
    padding: 10px 12px;
    gap: 9px;
    position: static;
    border-radius: var(--r);
  }
  .tb-right { margin-left: 0; width: 100%; }
  .tabs { gap: 1px; }
  .tabs a { padding: 6px 10px; font-size: 13px; }
  .inline-form input[type=text] { min-width: 128px; }
  .ellipsis { max-width: 150px; }
  .as-card { padding: 18px; border-radius: var(--r-md); }
  .as-head h3 { font-size: 15.5px; }
  .as-meta { grid-template-columns: 1fr; gap: 7px; }
  .as-actions .btn.lg { flex: 1 1 100%; }
  .stat { padding: 13px 15px; }
  .stat .n { font-size: 18.5px; }
  .tbl th, .tbl td { padding: 9px 10px; }
  .codeblock { font-size: 11px; padding: 14px; }
  .msg { padding: 11px 13px; font-size: 13px; }
  h1 { font-size: 19px; }
  h2 { font-size: 14.5px; }
}

/* ============================================================
   动态层 —— 编排式进场 / 物理缓动 / 光标光斑 / 数字滚动
   ------------------------------------------------------------
   设计原则：
   · 动效服务于「引导注意力」，不是炫技。每个动画都有明确用途：
     进场揭示层级、hover 确认可交互、进度反馈状态。
   · 全部使用 transform / opacity（GPU 合成层），不触发重排。
   · 统一缓动曲线：--ease-out-quint（快起慢收，最接近真实物理）
     和 --ease-spring（轻微回弹，用于强调元素）。
   · 一级动效（错峰进场）由 JS 驱动 data 属性；无 JS 时自动降级为直接显示。
   ============================================================ */

:root {
  --ease-out-quint: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: .18s;
  --dur-base: .32s;
  --dur-slow: .52s;
  --stagger: 55ms;   /* 错峰步进 */
}

/* ---------- 1. 进场编排 ---------- */
/* 由 JS 给容器加 .reveal，子元素按 --i 依次进场 */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(.985);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translate3d(-10px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(.9); }
  60%  { opacity: 1; transform: scale(1.015); }
  100% { opacity: 1; transform: scale(1); }
}

/* reveal 容器：子元素默认可见（无 JS 时安全降级），
   JS 就绪后加 .reveal-arm 才会先隐藏再逐条放出，避免 FOUC */
.reveal.reveal-arm > * {
  opacity: 0;
  animation: riseIn var(--dur-slow) var(--ease-out-quint) forwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
  will-change: transform, opacity;
}

/* 页面级整体淡入（所有页面都有 body.anim-ready） */
body.anim-ready > .wrap,
body.anim-ready > .login-page {
  animation: fadeIn .34s var(--ease-out-quint) both;
}

/* 页头：标题先落，副标题跟上 */
.hero h1 { animation: riseIn .48s var(--ease-out-quint) both; }
.hero p  { animation: riseIn .48s var(--ease-out-quint) .07s both; }

/* 顶栏：从上方滑入 */
.topbar { animation: riseIn .42s var(--ease-out-quint) both; }

/* 统计卡：错峰弹入 + 数字滚动 */
.statbar .stat {
  animation: riseIn .46s var(--ease-out-quint) both;
}
.statbar .stat:nth-child(1) { animation-delay: .06s; }
.statbar .stat:nth-child(2) { animation-delay: .12s; }
.statbar .stat:nth-child(3) { animation-delay: .18s; }
.statbar .stat:nth-child(4) { animation-delay: .24s; }

/* 统计数字：滚动时轻微上浮 */
.stat .n {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-spring),
              color var(--dur-fast) ease;
}
.stat:hover .n { transform: translateY(-1px) scale(1.04); }

/* ---------- 2. 场次卡片：入场 + 光标跟随光斑 ---------- */
.as-card {
  animation: riseIn .5s var(--ease-out-quint) both;
  /* 光斑位置由 JS 写入 */
  --mx: 50%;
  --my: 50%;
}
.as-grid .as-card:nth-child(1) { animation-delay: .05s; }
.as-grid .as-card:nth-child(2) { animation-delay: .11s; }
.as-grid .as-card:nth-child(3) { animation-delay: .17s; }
.as-grid .as-card:nth-child(4) { animation-delay: .23s; }
.as-grid .as-card:nth-child(5) { animation-delay: .29s; }
.as-grid .as-card:nth-child(6) { animation-delay: .35s; }
.as-grid .as-card:nth-child(n+7) { animation-delay: .4s; }

/* 卡片上的跟随光斑：只在有指针设备时出现 */
@media (hover: hover) and (pointer: fine) {
  .as-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity .28s ease;
    background: radial-gradient(
      240px circle at var(--mx) var(--my),
      color-mix(in srgb, var(--accent) 10%, transparent),
      transparent 62%
    );
  }
  .as-card:hover::after { opacity: 1; }
}

/* 卡片内元素轻微位移，制造「层在动」的深度感 */
.as-card .as-head,
.as-card .as-note,
.as-card .as-meta,
.as-card .as-progress,
.as-card .as-actions {
  transition: transform var(--dur-base) var(--ease-out-quint);
}
.as-card:hover .as-head { transform: translateY(-1px); }

/* 卡片按钮：hover 时箭头类元素右移 */
.as-card:hover .as-actions .btn.primary {
  box-shadow: 0 2px 4px rgba(16,16,22,.28), 0 12px 28px -8px rgba(16,16,22,.4);
}

/* ---------- 3. 进度条：填充有弹性，完成后脉冲 ---------- */
.as-progress-bar > i,
.bar > i {
  transition: width .62s var(--ease-out-quint);
}
@keyframes barPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  100% { box-shadow: 0 0 0 7px transparent; }
}
.as-progress-bar > i[style*="width: 100"],
.bar > i[data-done="1"] {
  animation: barPulse 1.1s var(--ease-out-quint) 1;
}

/* ---------- 4. 按钮：按下回弹 + 主按钮光泽扫过 ---------- */
.btn {
  transition: background var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease,
              color var(--dur-fast) ease,
              transform .11s var(--ease-out-quint);
}
.btn:active { transform: scale(.972); }

/* 主按钮的斜向光泽，只在 hover 时扫一次 */
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}
@media (hover: hover) {
  .btn.primary:hover::after {
    animation: sheen .62s var(--ease-out-quint);
  }
}
@keyframes sheen {
  from { left: -120%; }
  to   { left: 130%; }
}
@media (prefers-color-scheme: dark) {
  /* 深色模式主按钮是浅底，光泽要改成暗色才看得见 */
  .btn.primary::after {
    background: linear-gradient(100deg, transparent, rgba(0,0,0,.12), transparent);
  }
}

/* ---------- 5. 标签：入场弹出 ---------- */
.tag { animation: popIn .34s var(--ease-spring) backwards; }
.tag::before {
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base) ease;
}
.tag:hover::before {
  transform: scale(1.45);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, currentColor 22%, transparent);
}

/* ---------- 6. 表格：行悬停时轻微右移 + 首列强调 ---------- */
.tbl tbody tr {
  transition: background var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out-quint);
}
@media (hover: hover) {
  .tbl tbody tr:hover { transform: translateX(1.5px); }
}

/* ---------- 7. 表单：聚焦时标签微移 ---------- */
label {
  transition: color var(--dur-fast) ease;
}
input:focus, select:focus, textarea:focus {
  transition: border-color var(--dur-fast) ease,
              box-shadow var(--dur-base) var(--ease-out-quint);
}

/* ---------- 8. 消息条：进场 + 左侧色条生长 ---------- */
.msg::before {
  animation: barGrow .42s var(--ease-out-quint) both;
}
@keyframes barGrow {
  from { transform: scaleY(0); transform-origin: top; }
  to   { transform: scaleY(1); transform-origin: top; }
}

/* ---------- 9. 登录卡：品牌图标呼吸 + 卡片入场 ---------- */
@keyframes logoBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-2px) scale(1.02); }
}
.login-logo {
  animation: riseIn .5s var(--ease-out-quint) both,
             logoBreath 3.6s ease-in-out 1s infinite;
}

/* ---------- 10. 顶栏页签：激活项滑动感 ---------- */
.tabs a {
  transition: background var(--dur-fast) ease,
              color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-out-quint);
}
.tabs a:active { transform: scale(.96); }

/* ---------- 11. 安全自检项：逐条进场 ---------- */
/* 由 .reveal 容器统一编排（见上方 .reveal.reveal-arm），
   这里只保留基础过渡，避免和容器错峰打架 */
.sc-item {
  transition: box-shadow .16s ease, transform .16s ease;
}

/* ---------- 12. 卡片进场补充（后台普通卡片） ---------- */
/* 只在非 reveal 容器里做整体淡入，避免与错峰动画叠加导致闪烁 */
.card { animation: fadeIn .34s var(--ease-out-quint) both; }
.reveal .card,
.reveal.reveal-arm > .card { animation: none; }

/* ---------- 13. 滚动进场（长页面） ---------- */
.reveal-io {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity .58s var(--ease-out-quint),
              transform .58s var(--ease-out-quint);
  will-change: opacity, transform;
}
.reveal-io.is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   动效偏好（必须放在所有动画之后，用 !important 统一关停）
   ============================================================ *//* ============================================================
   动效偏好（必须放在所有动画之后）
   ------------------------------------------------------------
   注意：只把 duration 压到极小是不够的 —— 带 animation-delay 且
   fill-mode 为 both 的动画，在 delay 期间会停在 from 状态（opacity:0），
   用户会看到卡片「消失」。实测确认过这个可访问性缺陷，
   所以这里直接把 animation / transition 整个关掉，并显式恢复可见性。
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  /* 任何因动画起始态而隐身的元素，一律恢复可见 */
  .reveal-arm > *,
  .reveal-io,
  .as-card,
  .card,
  .stat,
  .hero h1,
  .hero p,
  .topbar,
  .login-card,
  .login-logo,
  .msg,
  .tag,
  .sc-item,
  body.anim-ready > .wrap,
  body.anim-ready > .login-page {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }
  /* 关掉纯装饰性的持续动画 */
  .bar > i::after,
  .as-card::after,
  .btn.primary::after { display: none !important; }
}

/* ============================================================
   打印
   ============================================================ */
@media print {
  body::before { display: none; }
  .topbar, .foot, .as-actions, .btn, .crumbs { display: none !important; }
  body, .card, .as-card, .stat { background: #fff !important; color: #000 !important; }
  .card, .as-card, .stat {
    box-shadow: none !important;
    border: 1px solid #d0d0d0 !important;
    break-inside: avoid;
  }
  .card:hover, .as-card:hover, .stat:hover { transform: none !important; }
  a { color: #000 !important; text-decoration: none !important; }
}
