/* ==================================================================
   上音乐理模拟考试系统 · 全局样式（学院古典 = Conservatory）
   设计语言：宣纸暖白底 + 墨绿主色 + 古铜金细节 + 宋体标题 + 发丝细线
   原则：只换皮不动骨 —— 类名与旧版一致，页面 JS / DOM id 均不需改
   ================================================================== */

:root {
  /* 纸与墨 */
  --paper:      #F5F1E8;
  --paper-2:    #EFE9DC;
  --card:       #FFFCF7;
  --ink:        #211E1A;
  --ink-2:      #4E483F;
  --text:       var(--ink);
  --text-light: #7B7267;
  /* 线 */
  --line:       #E4DAC8;
  --line-2:     #D8CBB2;
  --border:     var(--line);
  /* 主色：墨绿 / 古铜金 / 陶红 */
  --green:      #1D4438;
  --green-2:    #2A5B4A;
  --primary:    var(--green);
  --primary-dark: var(--green-2);
  --navy:       var(--ink);
  --gold:       #A98342;
  --gold-2:     #C9AB6E;
  --gold-tint:  rgba(169, 131, 66, .07);
  --brown:      #8A6A34;
  --orange:     var(--gold);
  --red:        #9E3B2F;
  /* 形 */
  --r:          3px;
  --r-sm:       2px;
  --shadow:     0 10px 28px rgba(60, 45, 20, .055);
  --shadow-2:   0 18px 44px rgba(60, 45, 20, .10);
  /* 字 */
  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans:  "PingFang SC", "Helvetica Neue", -apple-system, "Microsoft YaHei", "Segoe UI", sans-serif;

  /* --- 兼容旧页面里引用过、但从未被定义的 9 个遗留 token ---
     （exam_result.html 等页写的是 var(--color-*)，此前全部解析失败，
       表现为卡片背景透明、边框变成文字色。这里补齐，顺手修好那些页面。） */
  --color-background-primary:    var(--card);
  --color-background-secondary:  var(--paper-2);
  --color-background-tertiary:   var(--paper);
  --color-border-tertiary:       var(--line);
  --color-text-primary:          var(--ink);
  --color-text-secondary:        var(--ink-2);
  --color-text-tertiary:         var(--text-light);
  --color-success:               #1D6B4A;
  --color-danger:                var(--red);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  /* 极淡的宣纸横纹：几乎察觉不到，但去掉就会显得"塑料" */
  background-image: repeating-linear-gradient(0deg, rgba(120, 100, 60, .022) 0 1px, transparent 1px 7px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.ico {
  width: 1em; height: 1em;
  vertical-align: -.15em;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  display: inline-block;
}
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 30px; height: 30px; }
.ico-xl { width: 42px; height: 42px; }

/* ---------------- 顶部导航 ---------------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}
/* 压边的金线：这套设计最省力的"贵气"来源 */
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-2) 18%, var(--gold-2) 82%, transparent);
}
.topbar .logo {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .1em;
  margin-right: 18px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .logo .note { color: var(--green); }
/* 校徽式圆章（用伪元素做，免得逐页改 HTML） */
.topbar .logo::before {
  content: "上";
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 18px; font-weight: 600;
  color: var(--green);
  letter-spacing: 0; line-height: 1;
  box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 3.8px rgba(169, 131, 66, .32);
}
.topbar .logo .ico { display: none; }   /* 圆章取代原音符图标 */
.topbar .logo .ico:not(:first-of-type) { display: inline-block; }

.topbar nav { display: flex; gap: 2px; flex: 1; margin-left: 10px; }
.topbar nav a {
  position: relative;
  padding: 8px 13px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 14px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.topbar nav a::after {
  content: "";
  position: absolute; left: 13px; right: 13px; bottom: 3px; height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .22s ease;
}
.topbar nav a:hover { background: transparent; color: var(--green); text-decoration: none; }
.topbar nav a:hover::after { transform: scaleX(1); }
.topbar nav a.active { background: transparent; color: var(--green); font-weight: 600; }
.topbar nav a.active::after { transform: scaleX(1); }

.topbar .user { font-size: 13px; color: var(--text-light); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.topbar .user a { color: var(--ink-2); }
.member-badge {
  font-size: 11px; letter-spacing: .16em;
  color: var(--gold);
  border: 1px solid rgba(169, 131, 66, .45);
  padding: 2px 8px; border-radius: var(--r-sm);
  background: transparent; white-space: nowrap;
}
.user-right { color: var(--green); }
.user-wrong { color: var(--red); }

/* ---------------- 布局 ---------------- */
.container { max-width: 1040px; margin: 30px auto; padding: 0 24px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
}
/* 卡片首行标题：宋体 + 金线短横 */
.card > h2:first-child,
.card > h3:first-child {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .16em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.card > h2:first-child::after,
.card > h3:first-child::after {
  content: "";
  position: absolute; left: 0; bottom: -1px; width: 54px; height: 1.5px;
  background: var(--gold);
}
.card h2 .ico, .card h3 .ico, h2 .ico, h3 .ico { color: var(--green); }

.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 14px; margin: 18px auto; }
  .topbar { padding: 0 14px; height: auto; flex-wrap: wrap; }
  .topbar nav { order: 3; width: 100%; overflow-x: auto; margin: 0 0 8px; }
  .topbar .logo { margin-right: auto; }
}

.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt16 { margin-top: 16px; }
.mb16 { margin-bottom: 16px; }
.center { text-align: center; }
.muted { color: var(--text-light); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; font-family: var(--serif); }
.red { color: var(--red); }
.right { text-align: right; }
.title { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .1em; }
.pair { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; background: var(--card); }
.part { font-family: var(--serif); font-size: 12px; letter-spacing: .2em; color: var(--gold); }
.preview { color: var(--text-light); font-size: 13px; }
.arr { color: var(--gold); }
.empty {
  text-align: center; color: var(--text-light);
  padding: 56px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: rgba(255, 252, 247, .6);
  font-size: 14px;
}
.empty .ico { width: 46px; height: 46px; color: var(--line-2); display: block; margin: 0 auto 12px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 11px 24px;
  font-size: 14px; font-family: var(--sans); letter-spacing: .08em;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
  text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--green); color: #F7F4EC; }
.btn-primary:hover:not(:disabled) { background: var(--green-2); text-decoration: none; }
.btn-brown { background: var(--green); color: #F7F4EC; }
.btn-brown:hover:not(:disabled) { background: var(--green-2); filter: none; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--green); color: var(--green); background: transparent; }
.btn-orange { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn-orange:hover:not(:disabled) { background: var(--gold-tint); }
.btn-danger { background: transparent; border-color: rgba(158, 59, 47, .5); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: rgba(158, 59, 47, .06); }
.btn-sm { padding: 8px 15px; font-size: 12.5px; letter-spacing: .06em; }
.btn-xs { padding: 5px 11px; font-size: 12px; letter-spacing: .04em; }
.btn-lg { padding: 14px 40px; font-size: 16px; letter-spacing: .12em; }
.toggle-btn {
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  border-radius: var(--r-sm); padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: var(--sans);
}
.toggle-btn.active { background: var(--green); border-color: var(--green); color: #F7F4EC; }

/* ---------------- 表单 ---------------- */
label { font-size: 12.5px; color: var(--text-light); display: block; margin: 12px 0 4px; letter-spacing: .06em; }
input, select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 14px; font-family: var(--sans);
  background: #fff; color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #B3A99B; }
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint);
}
textarea { min-height: 74px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--green); }
input[type=file] { padding: 8px; }
.form { display: none; }
.form.active { display: block; }
.form input { margin-bottom: 10px; }
.form-switch { display: flex; gap: 8px; margin-bottom: 16px; }
.form-switch button {
  flex: 1; padding: 10px; border: 1px solid var(--line); background: transparent;
  border-radius: var(--r-sm); cursor: pointer; font-size: 14px; font-family: var(--sans);
  color: var(--ink-2); letter-spacing: .08em; transition: all .18s;
}
.form-switch button.active { background: var(--green); color: #F7F4EC; border-color: var(--green); }
.form button[type=submit] {
  width: 100%; padding: 13px; background: var(--green); color: #F7F4EC;
  border: none; border-radius: var(--r-sm); font-size: 15px; cursor: pointer;
  font-family: var(--sans); letter-spacing: .16em; transition: background .18s;
}
.form button[type=submit]:hover { background: var(--green-2); }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th {
  background: transparent; color: var(--text-light); font-weight: 500;
  font-size: 11px; letter-spacing: .2em; white-space: nowrap;
  border-bottom: 1px solid var(--line-2);
}
tr:hover td { background: rgba(169, 131, 66, .035); }
.mini-table { font-size: 12.5px; }
.mini-table th, .mini-table td { padding: 7px 9px; }

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-sm);
  font-size: 11.5px; letter-spacing: .1em;
  border: 1px solid var(--line-2); color: var(--text-light);
  white-space: nowrap;
}
.badge-green, .badge-correct { background: rgba(29, 68, 56, .05); color: var(--green); border-color: rgba(29, 68, 56, .3); }
.badge-gray { background: transparent; color: var(--text-light); border-color: var(--line-2); }
.badge-red, .badge-wrong { background: rgba(158, 59, 47, .05); color: var(--red); border-color: rgba(158, 59, 47, .32); }
.badge-orange, .badge-points { background: var(--gold-tint); color: var(--gold); border-color: rgba(169, 131, 66, .42); }

/* ---------------- 页面主标题（各页 container 下首个 h2） ---------------- */
.container > h2:first-child {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .16em;
  margin-bottom: 22px !important;   /* 页面里写死了 inline margin-bottom，需压过 */
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.container > h2:first-child::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; height: 2px; background: var(--gold);
}
.container > h2:first-child .ico { width: 22px; height: 22px; color: var(--green); }

/* ---------------- 首页主视觉带 ---------------- */
.page-hero {
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.page-hero .eyebrow {
  font-size: 11px;
  letter-spacing: .32em;
  color: var(--gold);
  margin-bottom: 14px;
}
.page-hero h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.3;
}
.page-hero h1::after {
  content: ""; display: block; width: 56px; height: 2px; background: var(--gold); margin-top: 16px;
}
.page-hero .sub { margin-top: 14px; color: var(--text-light); font-size: 13.5px; max-width: 620px; }
/* .hero-btns 规则已删（2026-09-30 用户要求去掉首页与功能卡片重复的那对按钮）；
   hero 的留白同步收紧（见上 .page-hero 的 padding/margin），正文之后直接接功能卡片。
   ⛔ 别再往 hero 里加「开始模拟考 / 题型专训」按钮 —— scripts/test-web-pages.js 有闸门会报红。 */
@media (max-width: 620px) { .page-hero h1 { font-size: 24px; } }

/* ---------------- 首页 ---------------- */
.login-container { max-width: 430px; margin: 30px auto 60px; }
.login-container h2 {
  font-family: var(--serif); font-size: 21px; letter-spacing: .2em; font-weight: 600;
  text-align: center; margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line); position: relative;
}
.login-container h2::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; width: 56px; height: 2px;
  transform: translateX(-50%); background: var(--gold);
}
.redeem-section {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 18px; margin-top: 22px;
}
.redeem-section h3 { font-family: var(--serif); font-size: 15px; letter-spacing: .16em; font-weight: 600; }
.redeem-section .flex { margin-top: 10px; }
.member-status { margin: 12px 0; font-size: 14px; }
.logged-in-container > h2 {
  font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .16em;
  margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
  position: relative;
}
.logged-in-container > h2::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; height: 2px; background: var(--gold);
}
.feature-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.feature-cards .card {
  text-align: left; padding: 24px 20px; margin: 0; cursor: pointer;
  overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.feature-cards .card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.feature-cards .card:hover { transform: translateY(-2px); border-color: var(--green); box-shadow: 0 10px 26px rgba(60, 45, 20, .08); }
.feature-cards .card:hover::before { transform: scaleX(1); }
.feature-cards .card .icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--green); font-size: 20px; margin-bottom: 14px;
}
.feature-cards .card .icon .ico { width: 20px; height: 20px; color: var(--green); }
.feature-cards .card a { color: var(--ink); display: block; font-family: var(--serif); font-size: 16px; letter-spacing: .1em; }
.feature-cards .card a:hover { text-decoration: none; color: var(--green); }
.fe-name { font-family: var(--serif); font-size: 16px; letter-spacing: .1em; }
@media (max-width: 700px) { .feature-cards { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- 试卷 / 题目卡片 ---------------- */
.qcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; margin-bottom: 14px; position: relative; overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.qcard::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.qcard:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(60, 45, 20, .07); }
.qcard:hover::before { transform: scaleX(1); }
.qcard-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qcard-title { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .1em; }
.qcard-score { font-family: var(--serif); font-size: 14px; color: var(--gold); letter-spacing: .08em; }
.qcard-body { color: var(--text-light); font-size: 13px; margin: 8px 0 14px; }
.qcard-detail { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.qcard-status { font-size: 12.5px; }
.qcard-img { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.qcard-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qcard.is-correct { border-left: 3px solid #1D6B4A; }
.qcard.is-wrong { border-left: 3px solid var(--red); }

/* ---------------- 考试页 ---------------- */
.exam-header {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 66px; z-index: 90; flex-wrap: wrap;
}
.exam-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}
.exam-header .timer {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--green); letter-spacing: .04em;
}
.exam-header .timer.warn { color: var(--red); animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.exam-header .type-tag {
  background: transparent; border: 1px solid rgba(29, 68, 56, .3); color: var(--green);
  padding: 3px 12px; border-radius: var(--r-sm); font-size: 12px; letter-spacing: .18em;
}
.exam-body { max-width: 880px; margin: 24px auto; padding: 0 24px; }
.q-title { font-family: var(--serif); font-size: 18.5px; letter-spacing: .02em; margin: 16px 0; line-height: 1.75; }
.q-score { color: var(--gold); font-size: 12.5px; letter-spacing: .1em; }

.audio-bar {
  display: flex; align-items: center; gap: 16px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 16px 18px; margin: 16px 0;
}
.play-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green); color: #F7F4EC; border: 1px solid var(--gold);
  cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px var(--card), 0 0 0 5px rgba(169, 131, 66, .32);
  transition: transform .18s; flex: none;
}
.play-btn:hover:not(:disabled) { transform: scale(1.05); }
.play-btn:disabled { background: #CDC6B8; border-color: #C0B8A8; cursor: not-allowed; box-shadow: 0 0 0 4px var(--card); }
.remain { font-size: 12.5px; color: var(--text-light); letter-spacing: .06em; }

/* 选项 */
.opts-list { display: grid; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 13px 18px; margin: 8px 0;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; font-size: 15px; font-family: var(--sans); color: var(--ink);
  text-align: left;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.opt:hover { background: #FBF7EE; border-color: var(--gold); }
.opt.selected { border-color: var(--green); background: rgba(29, 68, 56, .06); box-shadow: inset 3px 0 0 var(--green); }
.opt .key, .opt-key {
  min-width: 26px; height: 26px; line-height: 1;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%;
  background: transparent; color: var(--text-light);
  font-family: var(--serif); font-size: 13px; font-weight: 600;
  flex: none; transition: all .18s;
}
.opt.selected .key, .opt.selected .opt-key { background: var(--green); border-color: var(--green); color: #fff; }
.opt-mark { color: var(--green); }
.opt-file { border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 8px; }

/* 答题卡弹层 */
.answer-sheet-overlay {
  position: fixed; inset: 0; background: rgba(33, 30, 26, .42);
  display: none; align-items: center; justify-content: center; z-index: 200;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.answer-sheet-overlay.show { display: flex; }
/* 交卷确认弹层（模拟考：未作答提示 + 确认交卷）—— 比答题卡(z200)高一层 */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(33, 30, 26, .42);
  display: none; align-items: center; justify-content: center; z-index: 300;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.confirm-overlay.show { display: flex; }
.confirm-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 26px; width: min(460px, 92vw); box-shadow: var(--shadow-2);
}
.confirm-box h3 { font-family: var(--serif); font-size: 17px; letter-spacing: .12em; font-weight: 600; }
.answer-sheet {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px; width: min(660px, 92vw); max-height: 80vh; overflow: auto;
  box-shadow: var(--shadow-2); position: relative;
}
.answer-sheet::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gold);
}
.answer-sheet h3 { font-family: var(--serif); font-size: 17px; letter-spacing: .16em; font-weight: 600; }
.sheet-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin: 18px 0; }
.sheet-cell {
  height: 40px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-2); border: 1px solid var(--line);
  cursor: pointer; font-size: 13px; font-family: var(--serif); font-weight: 600;
  color: var(--ink-2); transition: all .15s;
}
.sheet-cell:hover { border-color: var(--gold); }
.sheet-cell.answered { background: rgba(29, 68, 56, .08); border-color: rgba(29, 68, 56, .3); color: var(--green); }
.sheet-cell.current { outline: 2px solid var(--gold); outline-offset: 1px; }
.sheet-cell.wrong { background: rgba(158, 59, 47, .08); border-color: rgba(158, 59, 47, .35); color: var(--red); }

/* ---------------- 连线题 ---------------- */
.match-box { position: relative; }
/* 连线题必须**永远**左右两列：学生要在左右两列之间画线，堆成上下就没法连线了。
   注意窄屏下 `.grid-2` 会塌成一列（见 @media max-width:900px），这里用更高优先级
   （.match-box .grid-2 = 0,2,0 > .grid-2 = 0,1,0）钉住两列，只缩小列间距。
   2026-09-22 用户报「音乐术语配对是上下分开的，不是左右两列」——他的 Safari 窗口 856px 宽，正好踩中。 */
.match-box .grid-2 { gap: 96px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .match-box .grid-2 { gap: 40px; }
}
@media (max-width: 560px) {
  .match-box .grid-2 { gap: 20px; }
  .match-box .match-item { padding: 8px 10px; font-size: 14px; }
}
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 96px; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-item {
  position: relative; padding: 12px 32px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; text-align: center;
}
.match-item:hover { background: #FBF7EE; border-color: var(--gold); }
.match-item.selected { border-color: var(--green); background: rgba(29, 68, 56, .06); color: var(--green); }
.match-item.connected { border-color: rgba(169, 131, 66, .55); }
.match-item.disabled { opacity: .55; cursor: not-allowed; }
.match-text { position: relative; z-index: 3; }
.match-dot {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line-2);
  top: 50%; transform: translateY(-50%);
  z-index: 4; pointer-events: none; transition: all .15s;
}
.match-dot-right { right: 8px; }
.match-dot-left { left: 8px; }
.match-item.selected .match-dot,
.match-item.connected .match-dot {
  background: var(--green); border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(29, 68, 56, .12);
}
.match-lines {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 2; overflow: visible;
}
.match-lines line { stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; }
.match-lines line.preview { stroke-dasharray: 5, 5; opacity: .6; stroke: var(--gold); }

/* ---------------- 谱面与放大 ---------------- */
.score-wrap { position: relative; display: inline-block; max-width: 100%; }
.score-zoom-btn {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: rgba(255, 252, 247, .94);
  color: var(--text-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .18s;
}
.score-zoom-btn:hover { color: var(--green); border-color: var(--green); }
.score-zoom-btn .ico { width: 16px; height: 16px; }
.score-zoom-overlay {
  position: fixed; inset: 0; background: rgba(33, 30, 26, .55);
  display: none; align-items: center; justify-content: center; z-index: 300;
}
.score-zoom-overlay.show { display: flex; }
.score-zoom-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  width: min(960px, 94vw); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-2);
}
.score-zoom-panel > .flex { padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.score-zoom-body { overflow: auto; padding: 20px 24px 28px; }
.score-zoom-inner { transition: transform .15s; }

/* ---------------- 结果与解析 ---------------- */
.score-big {
  font-family: var(--serif); font-size: 62px; font-weight: 600;
  text-align: center; line-height: 1; color: var(--green); letter-spacing: -.01em;
}
.level-tag {
  display: inline-block; padding: 6px 22px;
  font-family: var(--serif); font-size: 15px; font-weight: 600;
  letter-spacing: .3em; color: var(--gold);
  border-radius: 0;
  border-top: 1px solid var(--gold-2); border-bottom: 1px solid var(--gold-2);
}
.analysis-box {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--green);
  border-radius: var(--r-sm); padding: 16px 18px;
  font-size: 13.5px; line-height: 1.9; color: var(--ink-2);
}
.detail-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.detail-label { font-size: 11px; letter-spacing: .2em; color: var(--text-light); }
.detail-value { font-size: 14px; color: var(--ink); }

/* 统计小块 */
.stat-icon {
  display: inline-flex; width: 40px; height: 40px; border-radius: var(--r-sm);
  background: rgba(29, 68, 56, .06); color: var(--green);
  border: 1px solid rgba(29, 68, 56, .16);
  align-items: center; justify-content: center; margin-right: 10px; flex: none;
}
.stat-icon .ico { width: 18px; height: 18px; }
.stat-icon.orange { background: var(--gold-tint); color: var(--gold); border-color: rgba(169, 131, 66, .3); }
.stat-icon.blue { background: rgba(31, 48, 80, .06); color: #1F3050; border-color: rgba(31, 48, 80, .16); }
.stat-icon.purple { background: rgba(90, 62, 110, .06); color: #5A3E6E; border-color: rgba(90, 62, 110, .16); }

/* ---------------- 视频与付费 ---------------- */
.video-card { overflow: hidden; padding: 0; }
.video-card .thumb {
  height: 148px; position: relative;
  background: linear-gradient(150deg, #1D4438 0%, #143029 60%, #2A5B4A 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-2); font-size: 34px;
}
.video-card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 11px);
}
.video-card .thumb .ico { width: 40px; height: 40px; }
.video-card .body { padding: 14px 16px; }
.video-card .title { font-family: var(--serif); font-weight: 600; font-size: 15px; margin-bottom: 8px; letter-spacing: .06em; }
.video-card .price { color: var(--gold); font-family: var(--serif); font-weight: 600; font-size: 15px; }
.pay-opt {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px;
  margin: 8px 0; cursor: pointer; transition: all .18s; background: var(--card);
}
.pay-opt:hover { border-color: var(--gold); }
.pay-opt.selected { border-color: var(--green); background: rgba(29, 68, 56, .06); }
.pay-price { color: var(--gold); font-family: var(--serif); font-size: 15px; }
.pay-total { font-size: 20px; }
/* 题目图片：加一道发丝细边，并轻微提亮（题库截图底色偏灰，压到白纸调性里） */
#scoreBox img, .opt img, .qcard-img { width: 100%; max-width: 100%; height: auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-sm); filter: brightness(1.04) contrast(1.02); }

/* ---------------- 管理后台 ---------------- */
.admin-nav {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin-bottom: 22px;
}
.admin-nav button {
  border: 0; background: transparent; cursor: pointer; font-family: var(--sans);
  font-size: 14px; letter-spacing: .08em; color: var(--ink-2);
  padding: 10px 16px; position: relative;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.admin-nav button:hover { color: var(--green); background: rgba(169, 131, 66, .05); }
.admin-nav button.active { color: var(--green); font-weight: 600; background: transparent; }
.admin-nav button.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--gold);
}
.tab-page { display: none; }
.tab-page.active { display: block; }
.gen-item {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; margin-bottom: 10px; background: var(--paper-2);
}
/* ---------------- 待复核：复核卷面 ---------------- */
/* 通用：把并排按钮并成一个控件（发丝分隔，首尾圆角），比一排散按钮整齐 */
.btn-group { display: inline-flex; align-items: stretch; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.btn-group > .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.btn-group > .btn + .btn { border-left: 0; }

/* 顶部工具区：标题与汇总在左，筛选 + 展开控制在右，控件同高一排 */
.rv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px 26px; flex-wrap: wrap; }
.rv-head-info { flex: 1 1 320px; min-width: 250px; }
.rv-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-field { display: flex; align-items: center; gap: 7px; }
.rv-field label {
  margin: 0; font-family: var(--serif); font-size: 12px;
  letter-spacing: .18em; color: var(--text-light); white-space: nowrap;
}
.rv-field select {
  width: auto; height: 33px; padding: 6px 26px 6px 10px;
  font-size: 12.5px; border-color: var(--line-2); background-color: #fff;
}
.rv-field select:hover { border-color: var(--line-2); }
.rv-field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }

/* 复核条目 */
.rv-item-main { flex: 1; min-width: 0; }
.rv-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.rv-item-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 260px; min-width: 0; }
.rv-item-title b { font-weight: 600; }
.rv-ansline { margin-top: 5px; font-size: 12.5px; }
.rv-ansline b { color: var(--green); font-family: var(--serif); }

/* 展开的卷面：整块像一张纸，内部用「题面 / 选项 / 解析」分区 */
.rv-prev { display: none; }
.rv-prev.open { display: block; }
.rv-sheet {
  margin-top: 10px; padding: 12px 16px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.rv-sheet svg { max-width: 100%; height: auto; }   /* 内容比格子宽时按比例缩，绝不撑破布局 */
/* 还没轮到的谱面先占好位置：按需渲染时页面高度不跳、滚动条不抖 */
.rv-sheet .rv-spec, .rv-sheet .rv-dsl { min-height: 128px; }
/*
 * 题干内嵌小图（2026-09-26 三连音新题型）：题干文字里嵌一张文字级的小谱面。
 * 尺寸口径在 web/js/scoreFit.js::RULE.inline（页面不写死宽高）；这里只管**行内对齐**：
 * 必须 inline-block + vertical-align:middle，否则小图会把题干文字顶成上下两行。
 */
.title-inline {
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px;
  line-height: 0;
}
.title-inline svg { display: inline-block; vertical-align: middle; }
.rv-sec {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-size: 12px; letter-spacing: .24em;
  color: var(--text-light); margin: 14px 0 9px;
}
.rv-sec:first-child { margin-top: 2px; }
.rv-sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* 选项：窄屏一列、宽屏两列；选项谱面用窄画布，四个选项不再各占一整行 */
.rv-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 10px; }
.rv-opts > .rv-opt { min-width: 0; }
/* 多小节谱面（听辨节奏 4 小节）的选项占满整行：两列布局下卡片 ~340px，4 小节谱表
   会被等比缩到 ~0.45、音符太小（2026-09-24 用户报；官方样张就是一行一张谱表）。
   :has() 需要 Safari 15.4+ / Chrome 105+，本项目目标环境满足。 */
.rv-opts > .rv-opt:has(.score-multibar) { grid-column: 1 / -1; }
.rv-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .62);
}
.rv-opt.is-ans {
  border-color: rgba(29, 68, 56, .34); background: rgba(29, 68, 56, .05);
  box-shadow: inset 2px 0 0 var(--green);
}
.rv-key {
  flex: none; width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 13px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff;
}
.rv-opt.is-ans .rv-key { background: var(--green); border-color: var(--green); color: #F7F4EC; }
.rv-opt-main { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.7; }
.rv-opt-main .rv-spec, .rv-opt-main .rv-dsl { margin-top: 8px; }
.rv-opt .qcard-img { width: auto; max-width: 100%; max-height: 120px; object-fit: contain; }
.rv-ans-mark {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; color: var(--green);
  border: 1px solid rgba(29, 68, 56, .38); background: rgba(255, 255, 255, .7);
}

/* 谱面放大按钮：小一号、半透明，紧贴谱面右上角，不再悬在空白里 */
.rv-sheet .score-zoom-btn { width: 26px; height: 26px; opacity: .7; }
.rv-sheet .score-zoom-btn .ico { width: 14px; height: 14px; }
.rv-sheet .score-zoom-btn:hover { opacity: 1; background: #fff; }

/* 解析：只有听音题才有，用古铜色块与题目（墨绿）明确区分 */
.rv-analysis {
  margin-top: 16px; padding: 11px 14px 12px;
  background: var(--gold-tint);
  border: 1px solid rgba(169, 131, 66, .28); border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
}
.rv-analysis-head {
  font-family: var(--serif); font-size: 12px; letter-spacing: .24em;
  color: var(--gold); margin-bottom: 5px;
}
.rv-analysis-body { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }

/* 页脚信息：标签 / 来源 */
.rv-meta {
  margin-top: 14px; padding-top: 9px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-light);
}
.gen-chk, .q-chk, .rv-chk { width: auto; accent-color: var(--green); }

/* ---------------- 加载与提示 ---------------- */
.loading-bar { height: 2px; width: 100%; background: var(--paper-2); overflow: hidden; border-radius: 2px; }
.loading-bar::after {
  content: ""; display: block; width: 34%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: slide 1.1s infinite linear;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(320%); } }
.spin { display: inline-block; animation: rot 1s infinite linear; }
@keyframes rot { to { transform: rotate(360deg); } }
.toast {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 11px 24px; border-radius: var(--r-sm);
  font-size: 14px; letter-spacing: .06em; z-index: 999;
  box-shadow: var(--shadow-2); border-bottom: 2px solid var(--gold);
  /* 默认可见：有页面（如 index.html）的 toast() 只创建元素、不加 .show 类，
     若这里保持 display:none，登录失败之类的提示就完全看不见——用户只看到「点了没反应」。
     空元素自动隐藏，避免静态占位元素露出一条空黑条。 */
  display: block;
}
.toast:empty { display: none; }
.toast.show { display: block; animation: fadein .2s; }
@keyframes fadein {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- 图片就地放大 ---------------- */
img.img-zoomable { cursor: zoom-in; }
.img-zoom-overlay {
  position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(33, 30, 26, .78); cursor: zoom-out;
}
.img-zoom-overlay.open { display: flex; }
.img-zoom-box { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; }
.img-zoom-overlay .img-zoom-img {
  max-width: 92vw; max-height: 84vh; width: auto; height: auto;
  object-fit: contain; background: #fff; border-radius: var(--r-sm);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45); cursor: zoom-out;
}
.img-zoom-tip { color: rgba(255, 252, 247, .85); font-size: 13px; user-select: none; letter-spacing: .1em; }
body.img-zoom-locked { overflow: hidden; }

/* ---------------- 功能开关（唯一真相：web/js/features.js） ----------------
   标了 data-feature="videos" 的入口（导航链接 / 首页卡片 / 专训「关联视频」/ 会员文案）
   **默认不渲染**；features.js 在 <head> 里同步判定，开关为 true（或管理员）时给 <html> 加 .videos-on，
   本规则立刻失效 → 所有入口一起出现。2.0 上线 = 把 FEATURES.videos 改成 true（一处）。 */
html:not(.videos-on) [data-feature="videos"] { display: none !important; }

/* ---------------- 页脚（版本号由 features.js 填，页面不写死） ---------------- */
.app-foot {
  max-width: 1040px; margin: 26px auto 30px; padding: 0 24px;
  text-align: center; font-size: 12px; color: var(--text-light); letter-spacing: .04em;
}

/* ---------------- 打印 ---------------- */
@media print {
  body { background: #fff; }
  .topbar, .exam-header, .btn, .toast, .admin-nav, .app-foot { display: none !important; }
  .card { box-shadow: none; border-color: #ddd; }
}
