:root {
  --bg: #0b0d11;
  --bg-solid: #0b0d11;
  --surface: #14181f;
  --surface-2: #1a1f28;
  --surface-3: #222833;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #e9edf4;
  --muted: #97a1b2;
  --dim: #6a7486;
  --accent: #56d3a5;
  --accent-dim: #1d9e75;
  --accent-hover: #7ce4bd;
  --accent-ink: #04211a;
  --blue: #85b7eb;
  --amber: #ef9f27;
  --red: #f09595;

  /* 层次色：亮色主题下整体反相，否则白色透明层在浅底上会消失 */
  --grid-line: rgba(255, 255, 255, 0.018);
  --glow-a: rgba(86, 211, 165, 0.09);
  --glow-b: rgba(133, 183, 235, 0.07);
  --hover-1: rgba(255, 255, 255, 0.025);
  --hover-2: rgba(255, 255, 255, 0.045);
  --hover-3: rgba(255, 255, 255, 0.075);
  --edge: rgba(255, 255, 255, 0.2);
  --inset-hi: rgba(255, 255, 255, 0.16);
  --watermark: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(0, 0, 0, 0.28);
  --input-bg-focus: rgba(0, 0, 0, 0.4);
  --btn-a: #5fdcaa;
  --btn-b: var(--accent-dim);
  --btn-a-hover: #6fe6b5;
  --btn-b-hover: #23ab7f;
  --bar-bg: rgba(11, 13, 17, 0.72);
  --bar-bg-solid: rgba(11, 13, 17, 0.94);
  --toast-bg: rgba(30, 36, 46, 0.96);
  --scrim: rgba(4, 6, 9, 0.66);

  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.36);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* 亮色主题：只换外壳配色，证书纸张保持原样 */
[data-theme="light"] {
  --bg: #f7f8f5;
  --bg-solid: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #f2f4ef;
  --surface-3: #e8ebe4;
  --line: rgba(16, 24, 20, 0.1);
  --line-strong: rgba(16, 24, 20, 0.18);
  --text: #131a16;
  --muted: #4f5b54;
  --dim: #75817a;
  --accent: #0b7d57;
  --accent-dim: #075c3f;
  --accent-hover: #0a9668;
  --accent-ink: #ffffff;
  --blue: #2f6fb0;
  --amber: #9a5a00;
  --red: #b23a30;

  --grid-line: rgba(16, 24, 20, 0.024);
  --glow-a: rgba(11, 125, 87, 0.08);
  --glow-b: rgba(47, 111, 176, 0.06);
  --hover-1: rgba(16, 24, 20, 0.035);
  --hover-2: rgba(16, 24, 20, 0.055);
  --hover-3: rgba(16, 24, 20, 0.08);
  --edge: rgba(16, 24, 20, 0.25);
  --inset-hi: rgba(255, 255, 255, 0.55);
  --watermark: rgba(16, 24, 20, 0.09);
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
  --btn-a: #0f8a63;
  --btn-b: #0a6b4b;
  --btn-a-hover: #12a074;
  --btn-b-hover: #0b7d57;
  --bar-bg: rgba(247, 248, 245, 0.82);
  --bar-bg-solid: rgba(247, 248, 245, 0.97);
  --toast-bg: rgba(255, 255, 255, 0.97);
  --scrim: rgba(16, 24, 20, 0.32);

  --shadow-1: 0 1px 2px rgba(16, 24, 20, 0.07);
  --shadow-2: 0 10px 30px rgba(16, 24, 20, 0.09);
  --shadow-3: 0 24px 60px rgba(16, 24, 20, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-solid);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 10% -10%, var(--glow-a), transparent 62%),
    radial-gradient(820px 460px at 94% 0%, var(--glow-b), transparent 58%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.9), transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.9), transparent 78%);
}

a { color: var(--accent); text-decoration: none; transition: color 0.16s var(--ease); }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.35; letter-spacing: -0.2px; }
h1 { font-size: 26px; letter-spacing: -0.5px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

::selection { background: rgba(86, 211, 165, 0.24); }

#top-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 200;
  opacity: 0;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  box-shadow: 0 0 12px rgba(86, 211, 165, 0.5);
  transition: width 0.45s var(--ease), opacity 0.3s var(--ease);
}
#top-progress.on { opacity: 1; width: 72%; }
#top-progress.done { opacity: 0; width: 100%; transition: width 0.2s linear, opacity 0.35s ease 0.2s; }

.boot { display: flex; align-items: center; justify-content: center; min-height: 100vh; color: var(--muted); }
.boot-inner { text-align: center; }
.boot-logo {
  width: 46px; height: 46px; display: block; margin: 0 auto 18px;
  image-rendering: pixelated;
  animation: bootPulse 1.5s ease-in-out infinite;
}
@keyframes bootPulse {
  0%, 100% { opacity: 0.42; transform: scale(0.93); }
  50% { opacity: 1; transform: scale(1); }
}

header.top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bar-bg);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: 1.2px;
  font-size: 14px;
  flex: 0 0 auto;
  transition: opacity 0.16s var(--ease);
}
.brand:hover { color: var(--text); opacity: 0.82; }
.brand-logo {
  width: 22px; height: 22px; display: block; flex: 0 0 auto;
  image-rendering: pixelated;
  transition: transform 0.3s var(--ease);
}
.brand:hover .brand-logo { transform: translateY(-1px) scale(1.05); }

nav.main { display: flex; gap: 3px; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a {
  position: relative;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
nav.main a:hover { color: var(--text); background: var(--hover-2); }
nav.main a.active { color: var(--text); background: var(--hover-3); }
nav.main a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--accent);
  animation: grow 0.26s var(--ease) both;
}
@keyframes grow { from { transform: scaleX(0.2); opacity: 0; } to { transform: none; opacity: 1; } }


/* ---------- 明暗切换 ---------- */
.theme-toggle {
  width: 32px; height: 32px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--muted);
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease), transform 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { background: var(--surface-3); color: var(--text); border-color: var(--edge); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(86, 211, 165, 0.24); }
.theme-toggle svg { width: 15px; height: 15px; display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.top-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(145deg, var(--surface-3), var(--surface-2));
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1);
}

main { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 30px 20px 90px; }
main.wide { max-width: 1280px; }
main > * { animation: pageIn 0.34s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero { padding: 42px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 28px; position: relative; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 2.2px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 16px;
}
.hero-eyebrow::before { content: ""; width: 14px; height: 2px; background: var(--accent); border-radius: 1px; }
.hero h1 { font-size: 36px; margin-bottom: 14px; letter-spacing: -1px; }
.hero-sub { color: var(--muted); max-width: 660px; font-size: 14.5px; line-height: 1.75; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.grid > * { animation: rise 0.38s var(--ease) both; }
.grid > *:nth-child(1) { animation-delay: 0.02s; }
.grid > *:nth-child(2) { animation-delay: 0.06s; }
.grid > *:nth-child(3) { animation-delay: 0.1s; }
.grid > *:nth-child(4) { animation-delay: 0.14s; }
.grid > *:nth-child(5) { animation-delay: 0.18s; }
.grid > *:nth-child(6) { animation-delay: 0.21s; }
.grid > *:nth-child(n + 7) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.22s var(--ease);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.card.tight { padding: 14px 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 500; }
.card-note { font-size: 11.5px; color: var(--dim); }
.card-note a { color: var(--dim); }
.card-note a:hover { color: var(--accent); }

.stat {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 19px;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease);
}
.stat:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.stat-label { font-size: 11.5px; color: var(--muted); margin-bottom: 7px; letter-spacing: 0.2px; }
.stat-value {
  font-family: var(--mono); font-size: 26px; line-height: 1.15;
  letter-spacing: -0.8px; font-variant-numeric: tabular-nums;
}
.stat-value small { font-size: 12px; color: var(--muted); font-family: inherit; margin-left: 5px; letter-spacing: 0; }

.block { margin-bottom: 32px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.block-head h2 { font-size: 17px; }
.block-head .card-note { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; font-size: 13px; font-family: inherit; font-weight: 450;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text);
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
    transform 0.12s var(--ease), box-shadow 0.16s var(--ease), opacity 0.16s var(--ease);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-3); border-color: var(--edge); }
.btn:active { transform: translateY(1px) scale(0.994); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(86, 211, 165, 0.2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b));
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 550;
  box-shadow: 0 1px 0 var(--inset-hi) inset, 0 4px 14px rgba(29, 158, 117, 0.22);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--btn-a-hover), var(--btn-b-hover));
  border-color: transparent;
  box-shadow: 0 1px 0 var(--edge) inset, 0 6px 20px rgba(29, 158, 117, 0.3);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover-2); color: var(--text); border-color: transparent; }
.btn-danger { background: transparent; border-color: rgba(240, 149, 149, 0.32); color: var(--red); }
.btn-danger:hover { background: rgba(240, 149, 149, 0.1); border-color: rgba(240, 149, 149, 0.5); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; letter-spacing: 0.15px; }
.field .hint { font-size: 11.5px; color: var(--dim); margin-top: 6px; line-height: 1.55; }
.req::after { content: " *"; color: var(--red); }

/* 没有写 type 的 input 默认就是 text，必须一起覆盖，否则会露出浏览器默认白底 */
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="url"], input[type="datetime-local"], input:not([type]), select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  -webkit-appearance: none;
}
input:hover, select:hover, textarea:hover { border-color: var(--edge); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-dim);
  background: var(--input-bg-focus);
  box-shadow: 0 0 0 3px rgba(86, 211, 165, 0.12);
}
textarea { resize: vertical; min-height: 86px; line-height: 1.65; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input[type="checkbox"] { accent-color: var(--accent-dim); }

.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.row-wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 5px;
  font-size: 11.5px; font-family: var(--mono); letter-spacing: 0.2px;
  border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
  line-height: 1.6;
}
.tag-teal { color: var(--accent); border-color: rgba(86, 211, 165, 0.3); background: rgba(86, 211, 165, 0.08); }
.tag-blue { color: var(--blue); border-color: rgba(133, 183, 235, 0.3); background: rgba(133, 183, 235, 0.08); }
.tag-amber { color: var(--amber); border-color: rgba(239, 159, 39, 0.3); background: rgba(239, 159, 39, 0.08); }
.tag-red { color: var(--red); border-color: rgba(240, 149, 149, 0.3); background: rgba(240, 149, 149, 0.08); }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 11px; color: var(--dim);
  padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: 0.5px; text-transform: uppercase;
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; transition: background 0.14s var(--ease); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--hover-1); }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 500; color: var(--text); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.empty {
  padding: 40px 22px; text-align: center; color: var(--dim); font-size: 13px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--hover-1);
}

.divider { height: 1px; background: var(--line); margin: 20px 0; }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 13px; }
.tl-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: var(--bg);
  margin-top: 6px; flex: 0 0 auto;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tl-item.done .tl-dot { background: var(--accent); border-color: var(--accent); }
.tl-item.active .tl-dot { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 4px rgba(239, 159, 39, 0.14); }
.tl-line { flex: 1; width: 1px; background: var(--line); margin: 4px 0 0; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 13px; margin-bottom: 3px; }
.tl-time { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 0.2px; }

.track-card { position: relative; overflow: hidden; }
.track-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; transition: width 0.24s var(--ease); }
.track-card:hover::before { width: 3px; }
.track-A::before, .track-B::before { background: var(--blue); }
.track-C::before, .track-D::before { background: var(--amber); }

.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.toast {
  background: var(--toast-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 11px 15px; font-size: 13px;
  max-width: 360px; box-shadow: var(--shadow-3);
  animation: toastIn 0.32s var(--ease) both;
}
.toast.err { border-color: rgba(240, 149, 149, 0.42); color: var(--red); }
.toast.ok { border-color: rgba(86, 211, 165, 0.42); color: var(--accent); }
@keyframes toastIn { from { transform: translateX(18px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-host {
  position: fixed; inset: 0; z-index: 140;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  animation: fade 0.2s ease both;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 540px; max-height: 86vh; overflow: auto;
  box-shadow: var(--shadow-3);
  animation: modalIn 0.28s var(--ease) both;
}
.modal h3 { margin-bottom: 12px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

.notice-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.notice-item:last-child { border-bottom: none; }
.notice-title { font-size: 13.5px; margin-bottom: 3px; }
.notice-meta { font-family: var(--mono); font-size: 10.5px; color: var(--dim); letter-spacing: 0.2px; }

.bar { height: 6px; border-radius: 3px; background: var(--hover-3); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.6s var(--ease);
}

.code {
  font-family: var(--mono); font-size: 12px; background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; overflow-x: auto; color: var(--blue);
}

.rules h2 { font-size: 16px; margin: 30px 0 10px; }
.rules h2:first-child { margin-top: 0; }
.rules h3 { font-size: 13px; margin: 20px 0 6px; color: var(--accent); letter-spacing: 0.3px; }
.rules p, .rules li { font-size: 13px; color: var(--muted); line-height: 1.8; }
.rules ul, .rules ol { margin: 0 0 12px; padding-left: 20px; }
.rules li { margin-bottom: 5px; }
.rules strong { color: var(--text); font-weight: 500; }

.split { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 30px; align-items: start; }
.side-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 1px; }
.side-nav a {
  padding: 7px 11px; border-radius: 7px; color: var(--muted); font-size: 13px;
  border-left: 2px solid transparent;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.side-nav a:hover { background: var(--hover-2); color: var(--text); border-left-color: var(--line-strong); }

.auth-wrap { max-width: 430px; margin: 46px auto; }

/* 登录页说明（后台「内容 → 登录页说明」维护） */
.auth-note { margin-top: 16px; color: var(--dim); font-size: 11.5px; line-height: 1.7; }
.auth-note p { margin: 0 0 6px; }
.auth-note p:last-child { margin-bottom: 0; }
.auth-note strong { color: var(--muted); font-weight: 600; }
.auth-note code { font-family: var(--mono); font-size: 11px; }

.gt-slot { margin: 4px 0 16px; }

.mobile-nav { display: none; }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .side-nav { display: none; }
  .hero h1 { font-size: 27px; letter-spacing: -0.6px; }
  .hero { padding: 28px 0 22px; }
  nav.main { display: none; }
  main { padding: 20px 14px 84px; }
  .card { padding: 16px 16px; }
  .top-user .small { display: none; }
}

@media (max-width: 900px) {
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: var(--bar-bg-solid);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav a {
    flex: 0 0 auto; padding: 6px 13px; font-size: 12px; color: var(--muted);
    border-radius: 8px; transition: color 0.16s var(--ease), background 0.16s var(--ease);
  }
  .mobile-nav a.active { color: var(--accent); background: rgba(86, 211, 165, 0.1); }
}

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

/* ---------- 后台 ---------- */
.admin-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 26px; align-items: start; }
.admin-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.admin-side a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; color: var(--muted);
  border-left: 2px solid transparent;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.admin-side a:hover { background: var(--hover-2); color: var(--text); }
.admin-side a.active { background: var(--hover-3); color: var(--text); border-left-color: var(--accent); }
.admin-body { min-width: 0; }
.admin-body > * { animation: pageIn 0.3s var(--ease) both; }

.pill {
  font-size: 10.5px; padding: 1px 6px; border-radius: 999px;
  background: rgba(239, 159, 39, 0.16); color: var(--amber);
  font-family: var(--mono); font-weight: 500; line-height: 1.6;
}

.todo-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  margin-bottom: 8px; color: var(--text);
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.16s var(--ease);
}
.todo-row:hover { background: var(--hover-1); border-color: var(--line-strong); text-decoration: none; transform: translateX(2px); }
.todo-n { font-family: var(--mono); font-size: 19px; color: var(--amber); min-width: 30px; font-variant-numeric: tabular-nums; }
.todo-t { flex: 1; font-size: 13px; color: var(--muted); }
.todo-arrow { color: var(--dim); font-size: 13px; }

/* ---------- 骨架屏 ---------- */
.skel { padding: 8px 0; }
.skel-line, .skel-block {
  background: linear-gradient(90deg, var(--hover-1), var(--hover-3), var(--hover-1));
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; gap: 16px; }
  .admin-side {
    position: static; flex-direction: row; overflow-x: auto;
    gap: 4px; padding-bottom: 4px; scrollbar-width: none;
    border-bottom: 1px solid var(--line);
  }
  .admin-side::-webkit-scrollbar { display: none; }
  .admin-side a { flex: 0 0 auto; border-left: none; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; }
  .admin-side a.active { border-left: none; border-bottom-color: var(--accent); }
}

/* ---------- 登录方式切换 ---------- */
.auth-tabs {
  display: flex; gap: 4px; padding: 3px; margin-bottom: 20px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.auth-tabs button {
  flex: 1; padding: 7px 10px; font-size: 13px; font-family: inherit;
  background: transparent; border: none; color: var(--muted);
  border-radius: 7px; cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.auth-tabs button:hover:not(.on) { color: var(--text); }
.auth-tabs button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- 证书 ---------- */
.cert-shell { padding: 22px 16px 90px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cert-toolbar { width: min(100%, 1000px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cert-page {
  width: min(100%, 1000px);
  aspect-ratio: 297 / 210;
  background: #fbf9f4;
  color: #1b1a18;
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  font-size: clamp(9px, 1.3vw, 14px);
  line-height: 1.7;
  overflow: hidden;
  padding: 2.2em;
  position: relative;
}
.cert-inner {
  height: 100%;
  border: 0.1em solid #cfc4a9;
  padding: 2.4em 3em;
  display: flex;
  flex-direction: column;
  position: relative;
}
.cert-inner::before,
.cert-inner::after {
  content: "";
  position: absolute;
  width: 1.1em;
  height: 1.1em;
  border: 0.1em solid #cfc4a9;
}
.cert-inner::before { top: 0.5em; left: 0.5em; border-right: none; border-bottom: none; }
.cert-inner::after { bottom: 0.5em; right: 0.5em; border-left: none; border-top: none; }
.cert-head { display: flex; align-items: center; justify-content: space-between; }
.cert-logo {
  width: 1.7em; height: 1.7em; display: block; flex: 0 0 auto;
  image-rendering: pixelated; opacity: 0.95;
}
.cert-org { font-size: 0.95em; letter-spacing: 0.35em; color: #6b6455; text-align: right; }
.cert-org span { display: block; font-size: 0.72em; letter-spacing: 0.32em; color: #a39a86; margin-top: 0.2em; }
.cert-kind { margin-top: 1.9em; font-size: 2.35em; letter-spacing: 0.34em; font-weight: 600; color: #22201c; }
.cert-rule { width: 5.5em; height: 0.14em; background: #2f7d5f; margin: 0.9em 0 1.5em; }
.cert-lead { font-size: 1.02em; color: #6b6455; margin: 0 0 0.45em; letter-spacing: 0.12em; }
.cert-name {
  font-size: 2.5em;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 0.55em;
  border-bottom: 0.06em solid #d8cfb8;
  padding-bottom: 0.22em;
  display: inline-block;
  min-width: 6em;
}
.cert-text { font-size: 1.08em; color: #3a362e; margin: 0; line-height: 2; }
.cert-text b { font-weight: 600; color: #22201c; }
.cert-award { color: #8a5a12; }
.cert-sub { font-size: 0.86em; color: #8c8474; }
.cert-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 2em; padding-top: 1.6em; }
.cert-field { font-size: 0.86em; color: #6b6455; }
.cert-field span { display: block; letter-spacing: 0.18em; color: #a39a86; margin-bottom: 0.35em; }
.cert-field b { font-family: var(--mono); font-size: 1.05em; letter-spacing: 0.08em; color: #22201c; }
.cert-field.right { text-align: right; }
.cert-seal {
  width: 5.2em; height: 5.2em; border-radius: 50%;
  border: 0.12em solid #b04a3a; color: #b04a3a;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-8deg); opacity: 0.9;
}
.seal-ring { font-size: 0.86em; letter-spacing: 0.1em; text-align: center; line-height: 1.15; }
.cert-note { margin: 1.4em 0 0; font-size: 0.72em; color: #a39a86; letter-spacing: 0.05em; }
.cert-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none;
  transition: background 0.16s var(--ease);
}
.cert-row:last-child { border-bottom: none; }
.cert-row:hover { text-decoration: none; background: var(--hover-1); }

@page { size: A4 landscape; margin: 0; }

@media print {
  /* 深色主题下直接打印会白底浅字，这里强制回到浅色 */
  :root, [data-theme="dark"], [data-theme="light"] {
    --bg: #fff; --bg-solid: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #f2f2f2;
    --text: #111; --muted: #444; --dim: #666;
    --line: rgba(0, 0, 0, 0.12); --line-strong: rgba(0, 0, 0, 0.2);
    color-scheme: light;
  }
  body { background: #fff !important; color: #111 !important; }
  body::before, body::after { display: none !important; }
  header.top, .mobile-nav, #top-progress, .no-print, .toast-host { display: none !important; }
  main { padding: 0 !important; max-width: none !important; }
  .cert-shell { padding: 0 !important; gap: 0; }
  .cert-page {
    width: 297mm;
    height: 210mm;
    max-width: none;
    aspect-ratio: auto;
    font-size: 3.55mm;
    box-shadow: none;
    border-radius: 0;
  }
}

/* ---------- 文件行 ---------- */
.file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--hover-1);
}
input[type="file"] {
  width: 100%; padding: 9px 11px; font-size: 12.5px; color: var(--muted);
  background: var(--input-bg); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm); cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 5px 12px; font-size: 12px; font-family: inherit;
  color: var(--text); background: var(--surface-3);
  border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer;
}

/* ---------- 凭证条目 ---------- */
.cert-lines { margin: 0.6em 0 0; display: flex; flex-direction: column; gap: 0.55em; }
.cert-line-item {
  display: flex; align-items: baseline; gap: 1.2em;
  font-size: 1em; border-bottom: 0.05em dashed #ded4bd; padding-bottom: 0.4em;
}
.cert-line-item > span {
  flex: 0 0 8.5em; color: #8c8474; font-size: 0.92em; letter-spacing: 0.06em;
}
.cert-line-item > b { font-weight: 600; color: #26231e; word-break: break-all; }
.cert-line-item > b.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0.02em; }

/* ---------- 组织单位 ---------- */
.org-wall { display: flex; flex-direction: column; gap: 16px; }
.org-group {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; align-items: start;
  padding: 15px 0; border-top: 1px solid var(--line);
}
.org-group:first-child { border-top: none; padding-top: 0; }
.org-role { display: flex; flex-direction: column; gap: 3px; padding-top: 3px; }
.org-role-name { font-size: 12.5px; color: var(--text); letter-spacing: 0.04em; }
.org-role-note { font-size: 10.5px; color: var(--dim); line-height: 1.5; }
.org-row { display: flex; flex-wrap: wrap; gap: 10px; }
.org-card {
  display: flex; align-items: center; gap: 11px; position: relative;
  min-width: 196px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--hover-1);
  color: var(--text); text-decoration: none;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}
a.org-card:hover {
  border-color: var(--line-strong); background: var(--hover-2);
  transform: translateY(-1px); text-decoration: none;
}
.org-logo {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em; color: var(--muted);
}
.org-logo img { width: 100%; height: 100%; object-fit: contain; }
.org-logo.sm { width: 30px; height: 30px; border-radius: 7px; font-size: 11px; }
.org-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.org-meta b { font-size: 13px; font-weight: 500; letter-spacing: 0.01em; }
.org-meta small { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-out { position: absolute; top: 9px; right: 10px; font-style: normal; font-size: 10px; color: var(--dim); opacity: 0; transition: opacity 0.18s var(--ease); }
a.org-card:hover .org-out { opacity: 1; }

.org-admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.org-admin-row:last-child { border-bottom: none; }

/* ---------- 作品展厅 ---------- */
.wk-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.wk-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; font-size: 12px; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.wk-chip b { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--dim); }
.wk-chip:hover { color: var(--text); border-color: var(--line-strong); text-decoration: none; }
.wk-chip.on { color: var(--accent); border-color: rgba(86, 211, 165, 0.38); background: rgba(86, 211, 165, 0.07); }
.wk-chip.on b { color: var(--accent); }
.wk-search {
  width: 210px; padding: 7px 11px; font-size: 12.5px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line);
  border-radius: 8px; color: var(--text);
}
.wk-search:focus { outline: none; border-color: var(--line-strong); }

.work-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--hover-1); color: var(--text); text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.work-card:hover { border-color: var(--line-strong); background: var(--hover-2); transform: translateY(-2px); text-decoration: none; }
.work-cover {
  position: relative; height: 84px; overflow: hidden;
  background: linear-gradient(135deg, var(--hover-2), transparent);
  border-bottom: 1px solid var(--line);
}
.work-pixels { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.track-A .work-pixels { fill: var(--blue); }
.track-B .work-pixels { fill: #a98be0; }
.track-C .work-pixels { fill: var(--amber); }
.track-D .work-pixels { fill: var(--accent); }
.work-code {
  position: absolute; right: 10px; bottom: 8px;
  font-family: var(--mono); font-size: 24px; line-height: 1;
  color: var(--watermark); letter-spacing: 0.04em;
}
.work-body { padding: 12px 13px 11px; display: flex; flex-direction: column; flex: 1; }
.work-title { font-size: 14.5px; font-weight: 500; margin: 0 0 5px; letter-spacing: 0.01em; }
.work-sum {
  font-size: 12px; color: var(--muted); line-height: 1.62; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.work-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.work-split { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 20px; align-items: start; }
.kv {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.kv:last-of-type { border-bottom: none; }
.kv > span { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }
.kv > b { font-size: 12.5px; font-weight: 500; text-align: right; }
.kv.col-kv { flex-direction: column; align-items: flex-start; gap: 4px; }

@media (max-width: 900px) {
  .work-split { grid-template-columns: 1fr; }
  .org-group { grid-template-columns: 1fr; gap: 10px; }
  .work-cover { height: 70px; }
  .wk-search { width: 100%; }
}

/* ---------- 证书（正式版） ---------- */
.cert-page--formal {
  --cert-ink: #2a2620;
  --cert-muted: #6f6653;
  --cert-line: rgba(146, 118, 64, 0.55);
  --cert-line-soft: rgba(146, 118, 64, 0.24);
  --cert-accent: #2f6b55;
  --cert-accent-soft: rgba(47, 107, 85, 0.12);
  --cert-serif: "Songti SC", "STSong", "SimSun", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;

  padding: 1.9em;
  color: var(--cert-ink);
  background:
    radial-gradient(120% 130% at 50% -10%, #fffdf7 0%, #fbf7ec 46%, #f3ecdc 100%);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  box-shadow: var(--shadow-3), 0 2px 0 var(--hover-3) inset;
}
.cert-page--formal.is-award {
  --cert-accent: #8a6a24;
  --cert-accent-soft: rgba(138, 106, 36, 0.13);
}
/* 纸张纹理：极细点阵，压在内容之下 */
.cert-page--formal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(120, 98, 58, 0.16) 0.45px, transparent 0.45px);
  background-size: 4px 4px;
}

.cert-page--formal .cert-inner {
  z-index: 1;
  border: 1px solid var(--cert-line);
  box-shadow:
    inset 0 0 0 3px #faf6ea,
    inset 0 0 0 4px var(--cert-line-soft),
    inset 0 0 70px rgba(140, 112, 60, 0.09);
  padding: 2em 3em 1.6em;
}
.cert-page--formal .cert-inner::before,
.cert-page--formal .cert-inner::after { content: none; }

.cert-corners { position: absolute; inset: 0.62em; pointer-events: none; }
.cert-corners i {
  position: absolute; width: 1.4em; height: 1.4em;
  border: 0.1em solid var(--cert-accent); opacity: 0.5;
}
.cert-corners i:nth-child(1) { top: 0; left: 0; border-right: none; border-bottom: none; }
.cert-corners i:nth-child(2) { top: 0; right: 0; border-left: none; border-bottom: none; }
.cert-corners i:nth-child(3) { bottom: 0; left: 0; border-right: none; border-top: none; }
.cert-corners i:nth-child(4) { bottom: 0; right: 0; border-left: none; border-top: none; }

/* 页眉 */
.cert-brand { display: flex; align-items: center; gap: 0.62em; }
.cert-brand-text {
  font-family: var(--cert-serif); font-size: 0.92em; letter-spacing: 0.3em;
  color: var(--cert-muted); line-height: 1.2;
}
.cert-brand-text small {
  display: block; font-family: var(--mono); font-size: 0.62em;
  letter-spacing: 0.34em; color: #a89c82; margin-top: 0.22em;
}
.cert-head-right { text-align: right; }
.cert-series {
  font-family: var(--mono); font-size: 0.6em; letter-spacing: 0.24em; color: #a89c82;
}
.cert-code {
  font-family: var(--mono); font-size: 0.72em; letter-spacing: 0.1em;
  color: var(--cert-muted); margin-top: 0.4em;
}

/* 主体：居中排布 */
.cert-page--formal .cert-body {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0.8em 0 1.4em;
}
.cert-eyebrow {
  font-family: var(--mono); font-size: 0.68em; letter-spacing: 0.44em;
  color: #a2977f; text-indent: 0.44em; margin-bottom: 1em;
}
.cert-page--formal .cert-kind {
  font-family: var(--cert-serif);
  font-size: 2.5em; font-weight: 600;
  letter-spacing: 0.3em; text-indent: 0.3em;
  color: var(--cert-ink); margin: 0 0 0.55em;
}
.cert-orn { display: flex; align-items: center; gap: 0.55em; margin-bottom: 1.5em; }
.cert-orn i {
  width: 3.4em; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cert-line));
}
.cert-orn i:last-child { background: linear-gradient(90deg, var(--cert-line), transparent); }
.cert-orn b {
  width: 0.34em; height: 0.34em; transform: rotate(45deg);
  background: var(--cert-accent); opacity: 0.75;
}

/* 参赛证书：像素点饰线，呼应站点像素网格 */
.cert-orn--pixel { gap: 0.4em; margin-bottom: 1.6em; }
.cert-orn--pixel i,
.cert-orn--pixel i:last-child {
  width: 0.4em; height: 0.4em; border-radius: 1px;
  background: var(--cert-accent); opacity: 0.4;
}
.cert-orn--pixel i:nth-child(2) {
  width: 0.58em; height: 0.58em; opacity: 1; transform: translateY(-0.03em);
}

/* 参赛证书：成绩记录带 */
.cert-facts {
  display: flex; align-items: stretch;
  width: 100%; max-width: 40em; margin-top: 1.5em;
  border-top: 1px solid var(--cert-line-soft);
  border-bottom: 1px solid var(--cert-line-soft);
}
.cert-facts > div {
  flex: 1 1 0; min-width: 0; padding: 0.92em 1.1em;
  border-left: 1px solid var(--cert-line-soft);
}
.cert-facts > div:first-child { border-left: none; }
.cert-facts span {
  display: block; font-family: var(--mono); font-size: 0.66em;
  letter-spacing: 0.22em; text-indent: 0.22em;
  color: #8f8471; margin-bottom: 0.4em;
}
.cert-facts b {
  display: block; font-family: var(--cert-serif); font-size: 1em;
  font-weight: 600; color: #2f2b24; letter-spacing: 0.05em;
  line-height: 1.5; word-break: break-word; text-wrap: balance;
}

/* 落款上方的收束线：短、居中、实心，比整条淡线更利落 */
.cert-close {
  width: 7.5em; height: 1px;
  margin: auto auto 1.4em;
  background: var(--cert-line);
  position: relative;
}
.cert-close::after {
  content: ""; position: absolute; left: 50%; top: -0.16em;
  width: 0.34em; height: 0.34em; margin-left: -0.17em;
  background: var(--cert-accent); transform: rotate(45deg); opacity: 0.8;
}
.cert-page--formal .cert-lead {
  font-size: 0.78em; letter-spacing: 0.52em; text-indent: 0.52em;
  color: #a2977f; margin: 0 0 0.9em;
}
.cert-page--formal .cert-name {
  font-family: var(--cert-serif);
  font-size: 2.55em; font-weight: 600; line-height: 1.35;
  letter-spacing: 0.1em; color: var(--cert-ink);
  border-bottom: 0.035em solid var(--cert-line-soft);
  padding: 0 0.55em 0.16em; margin-bottom: 1.15em;
  display: inline-block; min-width: 5em;
}
.cert-page--formal .cert-text {
  font-size: 0.94em; line-height: 2.05; color: #3b352b;
  max-width: 44em; margin: 0; word-break: keep-all;
}
.cert-page--formal .cert-text b { font-weight: 600; color: var(--cert-ink); }
.cert-text--tail { margin-top: 0.55em !important; }
.cert-page--formal .cert-sub {
  font-size: 0.85em; color: #948a76; letter-spacing: 0.08em;
}
.cert-award-line {
  font-family: var(--cert-serif);
  font-size: 2.05em; font-weight: 600;
  letter-spacing: 0.36em; text-indent: 0.36em;
  color: var(--cert-accent);
  margin-top: 0.42em; padding-bottom: 0.18em;
  border-bottom: 1px solid var(--cert-accent-soft);
}

/* 落款 */
.cert-page--formal .cert-foot {
  /* 三栏等分：左右即使不等宽，中间落款也严格居中 */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 0; margin-top: 0; gap: 1.4em;
}
.cert-page--formal .cert-field span {
  color: #a2977f; letter-spacing: 0.22em; font-size: 0.88em;
}
.cert-page--formal .cert-field b {
  font-size: 0.96em; color: #3a352b; letter-spacing: 0.06em;
}
.cert-sign { display: flex; flex-direction: column; align-items: center; gap: 0.12em; }
.cert-sign .cert-seal--svg {
  position: static; width: 5.6em; height: 5.6em;
  border: none; border-radius: 0; opacity: 0.84;
  transform: rotate(-6deg); margin-bottom: -0.1em;
}
.cert-issuer {
  font-family: var(--cert-serif); font-size: 1em;
  letter-spacing: 0.18em; text-indent: 0.18em; color: #3a352b;
}
.cert-page--formal .cert-note {
  margin: 0.9em 0 0; font-size: 0.68em; color: #a89c82; letter-spacing: 0.06em;
  text-align: center;
}

/* 印章本体 */
.seal-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.seal-ring-line { fill: none; stroke: #b0442f; stroke-width: 2.2; }
.seal-ring-line.thin { stroke-width: 0.7; opacity: 0.75; }
.seal-arc {
  fill: #b0442f; font-size: 7.4px; letter-spacing: 0.6px;
  font-family: var(--cert-serif);
}
.seal-star { fill: #b0442f; }
.seal-year {
  fill: #b0442f; font-size: 7px; font-family: var(--mono); letter-spacing: 0.5px;
}

@media (max-width: 760px) {
  .cert-shell { align-items: flex-start; overflow-x: auto; padding-bottom: 96px; }
  .cert-page--formal { width: 660px; flex: 0 0 auto; font-size: 11px; }
  .cert-toolbar { width: 660px; flex: 0 0 auto; }
}

@media print {
  .cert-page--formal { font-size: 3.55mm; }
  .cert-page--formal::after { opacity: 0.34; }
  .cert-page--formal .cert-inner { box-shadow: inset 0 0 0 3px #faf6ea, inset 0 0 0 4px rgba(146, 118, 64, 0.24); }
}

/* ---------- 规则阅读确认 ---------- */
.modal.modal-wide { max-width: 720px; }

.rule-ack {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--hover-1);
}
.rule-ack-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.rule-ack.is-ok { border-color: rgba(86, 211, 165, 0.28); }
.rule-ack.is-ok .rule-ack-dot { background: var(--accent); box-shadow: 0 0 8px rgba(86, 211, 165, 0.55); }
.rule-ack.is-todo { border-color: rgba(239, 159, 39, 0.3); }
.rule-ack.is-todo .rule-ack-dot { background: var(--amber); box-shadow: 0 0 8px rgba(239, 159, 39, 0.5); }
.rule-ack-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rule-ack-text b { font-size: 13px; font-weight: 500; }
.rule-ack-text span { font-size: 11.5px; color: var(--dim); line-height: 1.55; }

.rg-body {
  max-height: 46vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 12.5px; line-height: 1.8;
}
.rg-body h2 { font-size: 14px; margin: 20px 0 8px; color: var(--text); letter-spacing: 0.01em; }
.rg-body h2:first-child { margin-top: 0; }
.rg-body h3 { font-size: 13px; margin: 14px 0 6px; color: var(--text); }
.rg-body p { margin: 0 0 9px; color: var(--muted); }
.rg-body ul, .rg-body ol { margin: 0 0 10px; padding-left: 20px; color: var(--muted); }
.rg-body li { margin-bottom: 4px; }
.rg-body strong { color: var(--text); font-weight: 600; }

.rg-foot { margin-top: 14px; }
.rg-check {
  display: flex; align-items: flex-start; gap: 9px;
  cursor: pointer; font-size: 12.5px; color: var(--muted); line-height: 1.6;
}
.rg-check input { margin-top: 3px; }
.rg-check input:disabled + span { opacity: 0.55; }

/* ---------- 证书：水印与附加元素 ---------- */
.cert-page--formal .cert-head,
.cert-page--formal .cert-body,
.cert-page--formal .cert-foot,
.cert-page--formal .cert-close,
.cert-page--formal .cert-note,
.cert-page--formal .cert-colophon,
.cert-page--formal .cert-microtext { position: relative; z-index: 1; }

/* 页眉分隔线 */
.cert-head-rule {
  position: relative; z-index: 1;
  height: 1px; margin: 1.15em 0 0;
  background: linear-gradient(90deg,
    transparent, var(--cert-line) 10%, var(--cert-line) 90%, transparent);
}
.cert-head-rule::after {
  content: ""; position: absolute; left: 50%; top: -0.19em;
  width: 0.36em; height: 0.36em; margin-left: -0.18em;
  background: #faf6ea; border: 1px solid var(--cert-line);
  transform: rotate(45deg);
}

/* 左缘竖排书脊字 */
.cert-spine {
  position: absolute; left: 0.9em; top: 50%; z-index: 0;
  transform: translateY(-50%);
  writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--mono); font-size: 0.44em; letter-spacing: 0.42em;
  color: #9c8f73; opacity: 0.62;
  pointer-events: none; white-space: nowrap;
}

/* 主题与赛期 */
.cert-meta {
  display: flex; align-items: center; justify-content: center; gap: 0.9em;
  margin: -0.15em 0 1em;
  font-family: var(--mono); font-size: 0.63em; letter-spacing: 0.2em;
  color: #9d9179;
}
.cert-meta i {
  width: 0.28em; height: 0.28em; background: #b3a68a;
  transform: rotate(45deg); flex: 0 0 auto;
}

/* 协办署名 */
.cert-colophon {
  margin: 0.5em 0 0; text-align: center;
  font-size: 0.62em; letter-spacing: 0.14em; color: #a2977f;
}

/* 微缩防伪文字 */
.cert-microtext {
  margin-top: 0.85em;
  font-family: var(--mono); font-size: 0.38em; letter-spacing: 0.3em;
  line-height: 1; color: #b3a88f; opacity: 0.85;
  white-space: nowrap; overflow: hidden; text-align: center;
}

/* ---------- 评委团 ---------- */
.judge-card {
  display: flex; flex-direction: column; gap: 7px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--hover-1);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.judge-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.judge-ava {
  width: 54px; height: 54px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 17px; color: var(--muted);
  margin-bottom: 4px;
}
.judge-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.judge-name { font-size: 15px; font-weight: 500; letter-spacing: 0.02em; }
.judge-role { font-size: 11.5px; color: var(--dim); }
.judge-bio { font-size: 12px; color: var(--muted); line-height: 1.72; margin: 2px 0 0; }

.code-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 9px; }
.code-list li { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.code-list li > span:last-child { flex: 1; min-width: 0; }
.code-list li > .mono { flex: 0 0 auto; padding-top: 2px; }

/* ---------- 参赛证书：代码风 ---------- */
.cert-page--formal.is-part {
  --cert-accent: #0f6b5e;
  --cert-accent-soft: rgba(15, 107, 94, 0.13);
}
/* 右缘注释 */
.cert-spine--r {
  left: auto; right: 0.9em;
  color: #8fa39c; opacity: 0.55;
  letter-spacing: 0.34em;
}
/* 四角准星 */
.cert-hud { position: absolute; inset: 1.5em; z-index: 0; pointer-events: none; }
.cert-hud i {
  position: absolute; width: 0.7em; height: 0.7em;
  opacity: 0.5;
}
.cert-hud i::before,
.cert-hud i::after {
  content: ""; position: absolute; background: var(--cert-accent);
}
.cert-hud i::before { left: 50%; top: 0; width: 1px; height: 100%; margin-left: -0.5px; }
.cert-hud i::after { top: 50%; left: 0; height: 1px; width: 100%; margin-top: -0.5px; }
.cert-hud i:nth-child(1) { top: 0; left: 0; }
.cert-hud i:nth-child(2) { top: 0; right: 0; }
.cert-hud i:nth-child(3) { bottom: 0; left: 0; }
.cert-hud i:nth-child(4) { bottom: 0; right: 0; }
/* 记录带改为数据字段 */
.cert-page--formal.is-part .cert-facts { border-color: rgba(15, 107, 94, 0.28); }
.cert-page--formal.is-part .cert-facts > div { border-left-color: rgba(15, 107, 94, 0.22); }
.cert-page--formal.is-part .cert-facts span {
  font-size: 0.6em; letter-spacing: 0.18em; color: #6f8b84;
}

/* 代码风元信息行 */
.cert-page--formal.is-part .cert-meta--code {
  font-size: 0.6em; letter-spacing: 0.16em; color: #6f8b84;
  justify-content: center;
}
.cert-page--formal.is-part .cert-meta--code span { text-indent: 0; }
.cert-page--formal.is-part .cert-spine--r {
  font-size: 0.5em; color: #7b9a92; opacity: 0.62;
}

/* ---------- 亮色主题下的细节修正 ---------- */
/* 纸张与浅色页面底色接近，靠阴影和外描边拉开层次 */
[data-theme="light"] .cert-page {
  box-shadow: 0 18px 46px rgba(16, 24, 20, 0.16), 0 0 0 1px rgba(16, 24, 20, 0.07);
}
/* 顶栏在亮色下用实边，避免半透明叠在浅底上发灰 */
[data-theme="light"] header.top { border-bottom-color: var(--line-strong); }
/* 骨架屏与进度槽在浅底上要有可见的灰度差 */
[data-theme="light"] .bar { background: var(--hover-3); }
/* 选中态 */
[data-theme="light"] ::selection { background: rgba(11, 125, 87, 0.18); }

/* 切换瞬间才启用过渡，避免首屏渲染时闪动 */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: background-color 0.22s var(--ease), color 0.22s var(--ease),
    border-color 0.22s var(--ease), box-shadow 0.22s var(--ease) !important;
}
