/* ============================================================
   培训课件系统 · 全站样式
   ============================================================ */

:root {
  color-scheme: light;

  --paper: #f7f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #1a1a1a;
  --ink-2: #6b6b6b;
  --ink-3: #9a9a9a;
  --line: #e3ded6;
  --line-strong: #d3ccc0;
  --brand: #1f4e5f;
  --brand-2: #2c6679;
  --brand-soft: #e8eff1;
  --accent: #e07b39;
  --accent-2: #c9682c;
  --accent-soft: #fdf0e6;
  --danger: #c0392b;
  --danger-soft: #fbeceb;
  --ok: #27ae60;

  --s-yuwen: #c0392b;
  --s-shuxue: #2e86ab;
  --s-yingyu: #8e44ad;
  --s-wuli: #16a085;
  --s-huaxue: #d68910;
  --s-shengwu: #27ae60;
  --s-zhengzhi: #7f8c8d;
  --s-lishi: #a0522d;
  --s-dili: #2980b9;
  --s-xinxi: #34495e;
  --s-zonghe: #6c7a89;

  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --page-x: clamp(16px, 4vw, 48px);
  --content-max: 1280px;

  --sh-sm: 0 1px 2px rgba(26, 26, 26, 0.05);
  --sh-md: 0 4px 16px -4px rgba(26, 26, 26, 0.1);
  --sh-lg: 0 18px 48px -12px rgba(26, 26, 26, 0.22);

  --z-header: 10;
  --z-overlay: 100;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-x);
}

/* ---------- 学科色 ---------- */
[data-subject="语文"] { --sub: var(--s-yuwen); }
[data-subject="数学"] { --sub: var(--s-shuxue); }
[data-subject="英语"] { --sub: var(--s-yingyu); }
[data-subject="物理"] { --sub: var(--s-wuli); }
[data-subject="化学"] { --sub: var(--s-huaxue); }
[data-subject="生物"] { --sub: var(--s-shengwu); }
[data-subject="政治"] { --sub: var(--s-zhengzhi); }
[data-subject="历史"] { --sub: var(--s-lishi); }
[data-subject="地理"] { --sub: var(--s-dili); }
[data-subject="信息技术"] { --sub: var(--s-xinxi); }
[data-subject="综合"] { --sub: var(--s-zonghe); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  padding: 14px var(--page-x);
  background: rgba(247, 245, 241, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

.topbar-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.topbar-title h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title p { margin: 0; font-size: 12px; color: var(--ink-3); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }

.btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent-2); background: var(--accent-2); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(31, 78, 95, 0.06); color: var(--ink); }

.btn-danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.btn-danger:hover { border-color: #a5301f; background: #a5301f; }

.btn-manage { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.btn-manage:hover { background: #fbe6d6; }
.btn-manage[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-icon { width: 36px; padding: 0; border-radius: 50%; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- 输入 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }

.input, .select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 14.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder { color: var(--ink-3); }

.input:focus, .select:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6b6b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ============================================================
   密码页
   ============================================================ */
.gate-body {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(760px 460px at 50% -8%, #e9f0f2 0%, rgba(233, 240, 242, 0) 64%),
    radial-gradient(520px 380px at 88% 96%, #fdf0e6 0%, rgba(253, 240, 230, 0) 62%),
    var(--paper);
}

.gate-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(31, 78, 95, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}

.gate-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 48px var(--page-x) 64px;
}

.gate-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 20px 44px -20px rgba(31, 78, 95, 0.28);
  padding: 44px 34px 30px;
  text-align: center;
  overflow: hidden;
}

.gate-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 52%, var(--accent) 100%);
}

.gate-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--brand-2), var(--brand));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 23px;
  font-weight: 600;
  box-shadow: 0 10px 22px -10px rgba(31, 78, 95, 0.6);
}

.gate-card h1 { margin: 0 0 8px; font-size: 23px; font-weight: 600; letter-spacing: -0.02em; }
.gate-sub { margin: 0 0 30px; font-size: 13.5px; color: var(--ink-2); }

.gate-input {
  width: 100%;
  height: 62px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.gate-input::placeholder {
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-indent: 0;
  color: var(--ink-3);
}

.gate-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.gate-input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }

.gate-error {
  display: none;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--danger);
  text-align: left;
  padding-left: 2px;
}

.gate-error.show { display: block; }

.gate-submit {
  width: 100%;
  margin-top: 18px;
  height: 50px;
  border: none;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 15.5px;
  font-weight: 500;
  box-shadow: 0 10px 20px -12px rgba(31, 78, 95, 0.7);
  transition: background 0.15s, transform 0.1s;
}

.gate-submit:hover { background: var(--brand-2); }
.gate-submit:active { transform: translateY(1px); }

.gate-foot {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}

/* ============================================================
   大厅
   ============================================================ */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 44px 0 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.hero h2 { margin: 0 0 10px; font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.24; }
.hero p { margin: 0; font-size: 14px; color: var(--ink-2); max-width: 46ch; }

.stats { display: flex; flex: none; }

.stat { padding: 0 26px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; padding-left: 0; }
.stat:last-child { padding-right: 0; }

.stat b {
  display: block;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}

.stat span { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); }

.admin-banner {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 11px 16px;
  border: 1px solid #f3d5bc;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  font-size: 13px;
  color: var(--accent-2);
}

body.is-admin .admin-banner { display: flex; }

.dot-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 0 3px rgba(224, 123, 57, 0.18);
}

.filter-bar { display: flex; align-items: center; gap: 14px; padding: 22px 0 20px; }
.filter-label { flex: none; font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.04em; }

.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.filters::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.16s;
}

.chip:hover { border-color: var(--ink-3); color: var(--ink); transform: translateY(-1px); }
.chip .n { font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: 0.55; }

.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(31, 78, 95, 0.9);
}

.chip[aria-pressed="true"] .n { opacity: 0.72; }
.chip[data-subject][aria-pressed="true"] { background: var(--sub); border-color: var(--sub); box-shadow: 0 6px 14px -8px var(--sub); }

.chip[data-subject]::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sub);
  flex: none;
}

.chip[data-subject][aria-pressed="true"]::before { background: rgba(255, 255, 255, 0.9); }

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding-bottom: 72px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  text-align: left;
  padding: 0;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.035);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 30px -14px rgba(26, 26, 26, 0.28);
}

.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--sub, var(--brand));
  overflow: hidden;
  isolation: isolate;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.14) 0 2px,
    rgba(255, 255, 255, 0) 2px 12px
  );
  opacity: 0.7;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(120% 92% at 16% 6%, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0) 56%),
    linear-gradient(162deg, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.3) 100%);
}

.cover-mark {
  position: absolute;
  right: -8px;
  bottom: -38px;
  z-index: 3;
  font-size: 100px;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.19);
  letter-spacing: -0.05em;
  user-select: none;
  transition: transform 0.35s ease;
}

.card:hover .cover-mark { transform: scale(1.08) translateY(-3px); }

.cover-tag {
  position: absolute;
  left: 11px;
  top: 11px;
  z-index: 4;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.95);
  color: var(--sub, var(--brand));
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}

.card-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); margin-top: auto; }
.card-meta .who { color: var(--ink-2); font-weight: 500; }
.card-meta .sep { color: var(--line-strong); }

.card-tools { position: absolute; right: 9px; top: 9px; z-index: 5; display: none; gap: 6px; }
body.is-admin .card-tools { display: flex; opacity: 0.6; transition: opacity 0.16s; }
body.is-admin .card:hover .card-tools,
body.is-admin .card:focus-within .card-tools { opacity: 1; }

.tool {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  transition: background 0.14s, color 0.14s, transform 0.14s;
}

.tool:hover { background: #fff; color: var(--brand); transform: translateY(-1px); }
.tool.danger:hover { color: var(--danger); }

.empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 84px 20px 104px;
  text-align: center;
  grid-column: 1 / -1;
}

.grid[data-state="empty"] .empty { display: flex; }
.grid[data-state="empty"] .card { display: none; }

.empty-ico {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  color: var(--brand);
  font-size: 20px;
}

.empty p { margin: 0; font-size: 14px; color: var(--ink-2); }
.empty small { font-size: 12.5px; color: var(--ink-3); }

/* ---------- 浮层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(20, 22, 24, 0.6);
  backdrop-filter: blur(3px);
}

.overlay.open { display: flex; }

.preview-panel {
  width: min(1100px, 100%);
  height: min(780px, 100%);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: pop 0.18s ease-out;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.pv-title { min-width: 0; }
.pv-title strong { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-title span { font-size: 12px; color: var(--ink-3); }

.preview-stage { flex: 1; background: #f2f0ec; padding: 14px; overflow: hidden; }

.preview-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--r-md);
  background: #fff;
  display: block;
}

.sheet {
  width: min(460px, 100%);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: pop 0.18s ease-out;
}

.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 22px 0; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.sheet-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.sheet-body { padding: 20px 22px 4px; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 22px; }
.sheet-foot .btn { height: 40px; padding: 0 20px; border-radius: var(--r-md); }

.del-target {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.7;
}

.del-target b { display: block; font-weight: 600; color: var(--ink); }
.del-target span { font-size: 12.5px; color: var(--ink-3); }

/* ============================================================
   上传
   ============================================================ */
.upload-main { padding: 40px var(--page-x) 80px; }
.panel { width: 100%; max-width: 680px; margin: 0 auto; }
.panel-head { margin-bottom: 24px; }
.panel-head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.panel-head p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.lock, .form-wrap, .done { display: none; }
.panel[data-view="lock"] .lock { display: block; }
.panel[data-view="form"] .form-wrap { display: block; }
.panel[data-view="done"] .done { display: block; }

.lock-card {
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}

.lock-ico {
  width: 44px; height: 44px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.lock-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.lock-card > p { margin: 0 0 20px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }

.lock-row { display: flex; gap: 10px; }
.lock-row .input { flex: 1; }
.lock-row .btn { flex: none; height: 44px; padding: 0 24px; border-radius: var(--r-md); }

.lock-error { display: none; margin: 10px 0 0; font-size: 13px; color: var(--danger); line-height: 1.6; }
.lock-error.show { display: block; }

.form-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.form-grid .full { grid-column: 1 / -1; }

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 172px;
  padding: 26px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.form-wrap.dragging .dropzone { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }

.dz-ico {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.dz-main { font-size: 14px; font-weight: 500; color: var(--ink); }
.dz-main em { font-style: normal; color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.dz-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

.dz-file {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: left;
}

.dz-file.show { display: flex; }

.dz-file .fname {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dz-file .fsize { font-size: 12px; color: var(--ink-3); flex: none; }
.dz-file .fok { flex: none; font-size: 12px; font-weight: 600; color: var(--ok); }
.dz-file .fno { flex: none; font-size: 12px; font-weight: 600; color: var(--danger); }

.dz-file .fx {
  flex: none;
  width: 24px; height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1;
}

.dz-file .fx:hover { background: var(--danger-soft); color: var(--danger); }

.form-error {
  display: none;
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  font-size: 13px;
  color: var(--danger);
  line-height: 1.6;
}

.form-error.show { display: block; }

.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.form-actions .tip { flex: 1; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.form-actions .btn { height: 44px; padding: 0 28px; border-radius: var(--r-md); font-size: 14.5px; }

.done-card {
  padding: 44px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  text-align: center;
}

.done-ico {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #eaf7ef;
  display: grid;
  place-items: center;
  color: var(--ok);
}

.done-card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; }
.done-card p { margin: 0 0 22px; font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }

.done-name {
  display: inline-block;
  margin-bottom: 22px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13.5px;
}

.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   管理后台
   ============================================================ */
.admin-main { padding: 34px var(--page-x) 80px; }
.admin-wrap { width: 100%; max-width: 900px; margin: 0 auto; }

.notice {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.6;
}

.notice.ok { background: #eaf7ef; color: #1e7d47; border: 1px solid #c8e9d5; }
.notice.bad { background: var(--danger-soft); color: var(--danger); border: 1px solid #f2cfcb; }

.admin-new {
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  margin-bottom: 34px;
}

.admin-new h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.admin-new-sub { margin: 0 0 20px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

.new-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 14px; align-items: end; }

.admin-list h2 { margin: 0 0 16px; font-size: 17px; font-weight: 600; }

.admin-empty {
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 13.5px;
}

.batch-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--sh-sm);
  transition: border-color 0.15s;
}

.batch-card:hover { border-color: var(--line-strong); }
.batch-card.is-off { opacity: 0.62; }

.batch-head { display: flex; align-items: center; gap: 14px; }
.batch-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.batch-title h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

.batch-badge {
  flex: none;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 600;
}

.is-off .batch-badge { background: #f0eee9; color: var(--ink-3); }

.batch-actions { margin-left: auto; flex: none; }
.batch-actions .btn { height: 32px; padding: 0 14px; font-size: 13px; }

.batch-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.batch-info > div { display: flex; flex-direction: column; gap: 3px; }
.batch-info dt { font-size: 11.5px; color: var(--ink-3); }
.batch-info dd { margin: 0; font-size: 13.5px; }

.batch-info code {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
}

.batch-edit { margin-top: 14px; }

.batch-edit summary {
  display: inline-block;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.batch-edit summary::-webkit-details-marker { display: none; }
.batch-edit summary:hover { color: var(--brand); }
.batch-edit[open] summary { color: var(--brand); }

.edit-form {
  margin-top: 12px;
  padding: 18px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.edit-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }

.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}

.switch input { width: 16px; height: 16px; accent-color: var(--brand); }

.edit-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.edit-foot .btn { height: 38px; padding: 0 18px; border-radius: var(--r-md); }
.del-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.del-form .btn { height: 34px; padding: 0 16px; font-size: 12.5px; }

.admin-foot { margin-top: 34px; font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }

.admin-foot code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 980px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 24px; }
  .stats { width: 100%; }
  .stat { flex: 1; padding: 0 18px; }
  .hero h2 { font-size: 28px; }
  .new-grid { grid-template-columns: 1fr 1fr; }
  .edit-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 15px; }
}

@media (max-width: 720px) {
  body { font-size: 13.5px; }
  .topbar { padding: 10px var(--page-x); }
  .topbar-inner { gap: 10px; }
  .topbar-title h1 { font-size: 15px; }
  .topbar-title p { display: none; }
  .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
}

@media (max-width: 700px) {
  .hero { padding: 28px 0 20px; }
  .hero h2 { font-size: 23px; }
  .hero p { font-size: 13px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 11.5px; }
  .filter-bar { padding: 16px 0 14px; }
  .filter-label { display: none; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 11px 12px 12px; gap: 7px; }
  .card-title { font-size: 13px; min-height: 3.1em; }
  .cover-mark { font-size: 72px; bottom: -26px; }
  .preview-panel { border-radius: var(--r-md); }
  .preview-stage { padding: 8px; }
  .tool { width: 26px; height: 26px; }

  .upload-main { padding: 24px var(--page-x) 60px; }
  .panel-head h2 { font-size: 20px; }
  .form-card { padding: 20px; }
  .lock-card { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .lock-row { flex-direction: column; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; }

  .gate-card { padding: 36px 22px 24px; border-radius: 16px; }
  .gate-card h1 { font-size: 20px; }
  .gate-input { height: 56px; font-size: 23px; }
  .gate-mark { width: 50px; height: 50px; font-size: 20px; margin-bottom: 18px; }

  .admin-main { padding: 24px var(--page-x) 60px; }
  .admin-new { padding: 20px; }
  .new-grid, .edit-grid { grid-template-columns: 1fr; }
  .batch-card { padding: 16px; }
  .batch-head { flex-wrap: wrap; }
  .batch-info { gap: 10px 20px; }
}

@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;
  }
}
