/* ==========================================================================
   试卷与学习诊断 · 主视觉方案 A：教研纸本
   暖米纸白底 + 宣纸白卡片 + 墨蓝主色 + 克制朱砂印章红 + 衬线标题
   ========================================================================== */

:root {
  --bg: #F4EFE6;
  --surface: #FFFCF6;
  --surface-subtle: #ECE5D8;
  --surface-hover: #F7F2E9;
  --border: #D9D1C0;
  --border-strong: #BFB5A0;

  --text: #1E2530;
  --text-secondary: #4C525C;
  --text-muted: #6A6558;

  --primary: #23384F;
  --primary-hover: #18293B;
  --primary-soft: #E8EEF3;
  --primary-border: #BCCADA;

  /* 朱砂印章红：严格克制，仅用于印章标记、步骤序号与重点提示边 */
  --stamp: #A93F2B;
  --stamp-soft: #F9EFEA;
  --stamp-border: #DFBDB3;

  --success: #255C45;
  --success-bg: #EBF4EE;
  --success-border: #B7D6C4;

  --warn: #8A5314;
  --warn-bg: #FBF4E6;
  --warn-border: #E5CFA2;

  --danger: #9B2C2C;
  --danger-bg: #FDF1F0;
  --danger-border: #E5B8B5;

  --radius: 4px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(30, 37, 48, 0.05);
  --shadow-paper: 0 4px 16px rgba(30, 37, 48, 0.09);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.28);

  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部单行栏 ---------- */
.site-header {
  background: rgba(255, 252, 246, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  min-width: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--surface);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
}

.stamp-tag {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--stamp);
  border: 1px solid var(--stamp-border);
  background: var(--stamp-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary);
  color: var(--surface);
}

/* ---------- 主体与通用间距 ---------- */
.main-content {
  padding-top: 26px;
  padding-bottom: 64px;
}

.section {
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 22px;
  line-height: 1.35;
}

.muted { color: var(--text-secondary); }
.muted-sm { color: var(--text-muted); font-size: 13.5px; }
.mono { font-family: var(--font-mono); }

/* ---------- Hero 纸本首屏 ---------- */
.hero-paper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 32px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--stamp);
  border-left: 3px solid var(--stamp);
  padding-left: 9px;
  margin-bottom: 14px;
}

.hero-paper h1 {
  font-size: 30px;
  line-height: 1.32;
  margin-bottom: 14px;
}

.hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 470px;
}

.hero-facts {
  list-style: none;
  padding: 14px 0;
  margin: 0 0 22px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-facts li {
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.fact-dot {
  color: var(--stamp);
  font-weight: 700;
  flex-shrink: 0;
}

.hero-sheet-btn {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.paper-frame {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 8px;
  box-shadow: var(--shadow-paper);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.hero-sheet-btn:hover .paper-frame {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.paper-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 210 / 297;
  object-fit: contain;
  background: #fff;
  border: 1px solid #ece7dc;
}

.hero-sheet-cap {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.hero-sheet-cap strong {
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- 横滑纸面样张带 ---------- */
.sample-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.sample-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sample-title {
  font-size: 18px;
  line-height: 1.4;
  margin-top: 6px;
}

.scroll-gallery {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch;
}

.scroll-gallery::-webkit-scrollbar {
  height: 6px;
}
.scroll-gallery::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.sheet-card {
  flex: 0 0 192px;
  scroll-snap-align: start;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}

.sheet-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.sheet-card img {
  width: 100%;
  aspect-ratio: 210 / 297;
  object-fit: cover;
  object-position: top center;
  background: #fff;
}

.sheet-card-cap {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.sheet-card-num {
  color: var(--stamp);
  font-family: var(--font-mono);
  margin-right: 4px;
}

.more-cases-details {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.more-cases-details > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--primary);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.more-cases-details > summary::-webkit-details-marker { display: none; }

.more-cases-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- 极简三步 ---------- */
.steps-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.step-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.step-kicker {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--stamp);
  margin-bottom: 4px;
}

.step-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---------- 折叠 FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-item > summary {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  list-style: none;
}

.faq-item > summary::-webkit-details-marker { display: none; }

.faq-item > summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
}

.faq-item[open] > summary::after {
  content: "−";
  color: var(--stamp);
}

.faq-answer {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- 通用卡片、表单、触控控件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-subtle {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label, .field-label { font-size: 14.5px; font-weight: 600; color: var(--text); }
.req { color: var(--stamp); }

/* 所有输入框强制 16px，避免 iOS Safari / 微信聚焦自动放大 */
.input, .select, .textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(35, 56, 79, 0.15);
}

.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }

/* 一键点选按钮组（年级 / 科目） */
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-btn {
  min-height: 44px;
  padding: 0 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.choice-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.choice-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
  font-weight: 600;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-tag-btn {
  min-height: 36px;
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.quick-tag-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 400;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* 按钮（全部满足 >= 44px 触控高度） */
.btn-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--surface); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-subtle); }

.btn-ghost { background: transparent; color: var(--primary); padding: 0 12px; }
.btn-ghost:hover:not(:disabled) { background: var(--primary-soft); }

.btn-danger-outline { background: #fff; color: var(--danger); border-color: var(--danger-border); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-bg); }

.btn-sm { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* 状态徽章（只在状态和分类使用，不滥用） */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-neutral { background: var(--surface-subtle); color: var(--text-secondary); }
.badge-status-received { background: var(--primary-soft); color: var(--primary); }
.badge-status-processing { background: var(--warn-bg); color: var(--warn); }
.badge-status-need_more { background: var(--stamp-soft); color: var(--stamp); }
.badge-status-completed { background: var(--success-bg); color: var(--success); }

.case-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 上传热区与拍照要点 ---------- */
.submit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.submit-aside {
  position: sticky;
  top: 74px;
}

.upload-box {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-box:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.photo-tips {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.file-list { display: flex; flex-direction: column; gap: 10px; }

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.file-info { display: flex; flex-direction: column; gap: 2px; min-width: 140px; flex: 1; }
.file-name { font-weight: 600; font-size: 14px; word-break: break-all; }
.file-meta { font-size: 12.5px; color: var(--text-muted); }
.file-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.fold-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 12px 14px;
}

.fold-box > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--primary);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.fold-box > summary::-webkit-details-marker { display: none; }

.fold-box-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- 提示框 ---------- */
.notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  line-height: 1.6;
}

.notice-info { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.notice-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.notice-stamp { background: var(--stamp-soft); border-color: var(--stamp-border); color: var(--stamp); }

/* ---------- 取件码与查询页 ---------- */
.token-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  flex-wrap: wrap;
}

.token-code {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
  word-break: break-all;
}

.query-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.query-bar .input {
  flex: 1;
  min-width: 0;
}

.saved-tokens-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.saved-token-btn {
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
}

.saved-token-btn:hover { background: var(--primary-soft); }

/* 3 段进度条 */
.progress-track-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 16px;
}

.progress-node {
  text-align: center;
  padding: 9px 6px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.progress-node.done {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.progress-node.current {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}

.zone-deliverable { border-left: 4px solid var(--success); }
.zone-original { border-left: 4px solid var(--border-strong); }

.download-hero-card {
  background: var(--surface);
  border: 1.5px solid var(--success);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.print-guide-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* ---------- 手机端底部固定操作栏 ---------- */
.mobile-sticky-bar {
  display: none;
}

/* ---------- 独立管理后台样式 ---------- */
.admin-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.task-list { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; }

.task-item {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: inherit;
}

.task-item:hover { border-color: var(--primary); background: #fff; }
.task-item.active { border-color: var(--primary); background: var(--primary-soft); }
.task-item-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.task-item-title { font-weight: 700; font-size: 14px; color: var(--text); }

.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.thumb-card {
  padding: 0;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.thumb-card:hover { border-color: var(--primary); }
.thumb-img-wrap { aspect-ratio: 3 / 4; background: #fff; overflow: hidden; }
.thumb-img-wrap.landscape { aspect-ratio: 4 / 3; }
.thumb-img-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.thumb-caption {
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- 高清灯箱 ---------- */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 22, 28, 0.88);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.lightbox-shell {
  width: 100%;
  max-width: 980px;
  max-height: 94vh;
  background: #141920;
  color: #F4EFE6;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-title { font-size: 14.5px; font-weight: 600; }
.lightbox-counter { font-size: 12.5px; color: #b8b0a0; }

.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 300px;
  max-height: 74vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c0f14;
  padding: 12px 48px;
  overflow: auto;
  touch-action: pinch-zoom pan-x pan-y;
}

.lightbox-stage img {
  max-height: 70vh;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 2px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 25, 32, 0.78);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-nav:hover { background: var(--primary); }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

.lightbox-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  background: #141920;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-thumb {
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  padding: 0;
  background: #232a34;
  cursor: pointer;
  flex-shrink: 0;
  width: 54px;
  height: 64px;
  opacity: 0.62;
}

.lightbox-thumb.active { border-color: #E5CFA2; opacity: 1; }
.lightbox-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.18); }

/* ---------- Toast & Footer ---------- */
.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.hidden { display: none !important; }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links { display: flex; gap: 16px; font-size: 13.5px; }

/* ---------- 多学科标签与双科样张切换 ---------- */
.subject-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.subject-strip-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 2px;
}

.subject-pill {
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.subject-pill:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
}

.subject-pill-more {
  border-style: dashed;
  color: var(--primary);
  background: transparent;
}

.hero-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.hero-switch-btn,
.case-tab-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hero-switch-btn.active,
.case-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
}

.case-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.featured-cases-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- 移动端优先适配 ---------- */
@media (max-width: 820px) {
  .hero-paper {
    grid-template-columns: 1fr;
    padding: 20px 18px;
    gap: 20px;
  }
  .hero-paper h1 { font-size: 24px; }
  .submit-layout { grid-template-columns: 1fr; }
  .submit-aside { position: static; }
  .steps-row { grid-template-columns: 1fr; gap: 10px; }
  .admin-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .header-inner { min-height: 52px; }
  .brand-title { font-size: 15.5px; }
  .nav-desktop-only { display: none; }
  .nav-query-link {
    padding: 0 8px;
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
  }
  .main-content {
    padding-top: 16px;
    padding-bottom: 92px;
  }
  .card, .sample-panel, .download-hero-card { padding: 16px; }
  .query-bar { flex-direction: column; }
  .query-bar .btn { width: 100%; }
  .sheet-card { flex: 0 0 168px; }
  .token-code { font-size: 17px; }
  .lightbox-stage { padding: 8px 10px; }
  .lightbox-nav { width: 34px; height: 34px; font-size: 18px; }

  body:not(.is-admin-page) .mobile-sticky-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: rgba(255, 252, 246, 0.97);
    border-top: 1px solid var(--border);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
    align-items: center;
  }
  body:not(.is-admin-page) .site-footer {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

@media print {
  .site-header, .site-footer, .mobile-sticky-bar, .toast { display: none !important; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; padding: 0; }
}
