/* ====== 基础 ====== */
:root {
  --bg: #f8f9fa;
  --card-bg: #fff;
  --shadow: 0 8px 24px rgba(0, 0, 0, .06);
  --text: #212529;
  --muted: #6c757d;
  --primary: #0d6efd;
  --success: #28a745;
  --danger: #dc3545;
  --secondary: #6c757d;
  --ring: rgba(13, 110, 253, .35);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', '微软雅黑', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====== 卡片与标题 ====== */
.quiz-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-top: 44px;
}

.word-title {
  font-size: clamp(1.5rem, 2.2vw + 1rem, 2rem);
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1.2;
}

.sub {
  color: var(--muted);
}

/* ====== 选项按钮 ====== */
.opt-btn {
  text-align: left;
  width: 100%;
  margin-bottom: 12px;
  border-radius: 12px;
  transition: box-shadow .15s ease, transform .05s ease;
}

.opt-btn:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
}

.opt-btn:active {
  transform: translateY(1px);
}

.opt-btn.active {
  outline: 2px solid var(--primary);
}

/* ====== 顶部控制面板 ====== */
.panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel .form-check {
  margin-right: 10px;
}

/* ====== 弹窗答题卡网格 ====== */
.answer-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 10px;
}

.answer-btn-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, opacity .2s;
  user-select: none;
}

.answer-btn-circle:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}

.answer-btn-circle:active {
  transform: translateY(0);
}

.answer-btn-circle.state-correct {
  background: var(--success);
}

.answer-btn-circle.state-wrong {
  background: var(--danger);
}

.answer-btn-circle.state-pending {
  background: var(--secondary);
}

.answer-btn-circle.state-current {
  box-shadow: 0 0 0 3px var(--ring);
}

.answer-btn-circle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--ring), 0 8px 20px rgba(13, 110, 253, .12);
}

/* 颜色说明小圆点 */
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* ====== 搜索条 ====== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto 16px auto;
  padding: 0;
}

.search-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border: 1px solid #c8d2e2;
  border-radius: 999px;
  background: #f2f4f7;
  font-size: 16px;
  color: #6c757d;
  outline: none;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: #b1bac3;
}

.search-input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.35);
}

.search-btn {
  height: 40px;
  min-width: 60px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid #c8d2e2;
  background: #0d6efd;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

.search-btn:hover {
  background: #0b5ed7;
}

.search-btn:active {
  background: #0a4a94;
}

/* 搜索按钮里的放大镜图标 */
.search-btn .icon-search {
  width: 18px;
  height: 18px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230d6efd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

/* 搜索框和返回按钮布局 */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  flex-grow: 1;
  padding: 8px 16px;
  border-radius: 25px;
  border: 1px solid #ced4da;
  font-size: 16px;
  transition: all 0.3s ease;
}

.search-btn {
  background-color: #0d6efd;
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background-color: #0b5ed7;
}

.return-btn {
  padding: 8px 16px;
  background: #f8f9fa;
  color: #0d6efd;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  border: 2px solid #0d6efd;
  transition: all 0.3s ease;
}

.return-btn:hover {
  background: #0d6efd;
  color: white;
  border-color: #0b5ed7;
}

.return-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.35);
}

/* ====== 登录页背景与卡片 ====== */
body.login-page {
  min-height: 100vh;
  background: url("../img/login-bg.jpg") center/cover no-repeat fixed;
}

.login-card {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: .75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

/* ====== 可访问性与细节 ====== */
:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--ring);
}

button:disabled,
.disabled {
  cursor: not-allowed;
  opacity: .65;
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* 微调样式 */
@media (max-width: 576px) {
  .quiz-card {
    padding: 20px;
    margin-top: 28px;
  }

  .answer-sheet-grid {
    gap: 8px;
  }

  .answer-btn-circle {
    width: 38px;
    height: 38px;
    font-size: .95rem;
  }
}


/* ====== 搜索条（紧凑版）====== */
.search-bar{
  display:flex;
  align-items:center;
  gap:8px;
  max-width:560px;
  margin: 6px auto 8px;    /* 上下更窄，避免挤压下面文字 */
  padding:0;
}

.search-input{
  flex:1;
  height:34px;             /* 由 40px 降到 34px */
  padding:0 12px;          /* 垂直 0，更紧凑 */
  border:1px solid #c8d2e2;
  border-radius:22px;      /* 更扁的胶囊 */
  background:#f2f4f7;
  font-size:15px;
  color:#6c757d;
  outline:none;
  transition:all .2s ease;
}
.search-input::placeholder{ color:#b1bac3; }
.search-input:focus{
  border-color:#0d6efd;
  box-shadow:0 0 0 3px rgba(13,110,253,.35);
}

.search-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  height:34px;             /* 由 40px 降到 34px */
  min-width:56px;
  padding:0 12px;          /* 垂直 0 */
  border-radius:22px;
  border:none;
  background:#0d6efd;
  color:#fff;
  font-weight:600;
  cursor:pointer;
  transition:transform .06s ease, background .2s ease, box-shadow .2s ease;
}
.search-btn:hover{ background:#0b5ed7; box-shadow:0 4px 12px rgba(13,110,253,.25); }
.search-btn:active{ transform:translateY(1px); }

/* 放大镜更突出（白色、变大、带轻微发光） */
.search-btn .icon-search{
  width:20px;              /* 18 -> 20 更醒目 */
  height:20px;
  flex:0 0 20px;
  background:no-repeat center/contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

/* 小屏再紧一点 */
@media (max-width:576px){
  .search-bar{ margin:4px auto 6px; }
  .search-input, .search-btn{ height:32px; border-radius:20px; }
  .search-btn .icon-search{ width:18px; height:18px; }
}

/* ====== 2026 页面体验优化 ====== */
:root {
  --ui-primary: #3157d5;
  --ui-primary-dark: #203ca6;
  --ui-ink: #172033;
  --ui-muted: #667085;
  --ui-line: #dfe5f0;
  --ui-soft: #f3f6fc;
  --ui-surface: rgba(255, 255, 255, .96);
}

/* 登录页 */
body.login-page {
  min-height: 100vh;
  background: #edf2fb;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(430px, .92fr);
}

.login-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: 100vh;
  padding: clamp(48px, 7vw, 96px);
  color: #fff;
  background:
    linear-gradient(155deg, rgba(15, 31, 77, .30), rgba(14, 28, 74, .90)),
    url("../img/login-bg.jpg") center/cover no-repeat;
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 18%, rgba(119, 160, 255, .28), transparent 34%);
  pointer-events: none;
}

.login-hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.login-eyebrow,
.choose-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.login-eyebrow {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
}

.login-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.25rem, 4vw, 4rem);
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -.04em;
}

.login-hero p {
  max-width: 590px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 1.08rem;
  line-height: 1.8;
}

.login-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.login-benefits span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  font-size: .9rem;
  backdrop-filter: blur(8px);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 6vw, 72px);
  background:
    radial-gradient(circle at 100% 0, rgba(49, 87, 213, .10), transparent 32%),
    #f7f9fd;
}

.login-card {
  width: min(100%, 470px);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid rgba(221, 228, 240, .9);
  border-radius: 28px;
  background: var(--ui-surface);
  box-shadow: 0 28px 80px rgba(28, 43, 79, .13);
  backdrop-filter: blur(16px);
}

.login-brand-mark {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #5278ed, #2949bd);
  box-shadow: 0 12px 28px rgba(49, 87, 213, .28);
  font-size: 1.35rem;
}

.login-heading { margin-bottom: 26px; }
.login-kicker { margin: 0 0 6px; color: var(--ui-primary); font-size: .72rem; font-weight: 800; letter-spacing: .18em; }
.login-heading h2 { margin: 0; color: var(--ui-ink); font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.login-heading > p:last-child { margin: 8px 0 0; color: var(--ui-muted); }

.login-messages { margin-bottom: 18px; }
.login-alert { display: flex; align-items: center; gap: 9px; margin: 0; border-radius: 12px; }
.login-field { margin-bottom: 18px; }
.login-field > label { margin-bottom: 8px; color: #344054; font-size: .9rem; font-weight: 700; }
.login-input-wrap { position: relative; }
.login-input-wrap > i {
  position: absolute;
  z-index: 2;
  left: 16px;
  top: 50%;
  color: #8792a7;
  transform: translateY(-50%);
}

.login-input-wrap .form-control {
  height: 52px;
  padding: 0 48px 0 44px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #f9fbff;
  color: var(--ui-ink);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.login-input-wrap .form-control:focus {
  border-color: #6482df;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(49, 87, 213, .12);
}

.password-toggle {
  position: absolute;
  z-index: 3;
  right: 6px;
  top: 6px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  color: #667085;
  background: transparent;
}
.password-toggle:hover { color: var(--ui-primary); background: #eef2ff; }
.caps-lock-hint { margin-top: 7px; color: #a15c00; font-size: .82rem; }

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 24px;
  color: var(--ui-muted);
  font-size: .86rem;
}

.demo-account { position: relative; text-align: right; }
.demo-account summary { color: var(--ui-primary); cursor: pointer; list-style: none; font-weight: 700; }
.demo-account summary::-webkit-details-marker { display: none; }
.demo-account span { display: block; margin-top: 5px; white-space: nowrap; }

.login-submit {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-dark));
  box-shadow: 0 12px 26px rgba(49, 87, 213, .24);
  font-weight: 750;
}
.login-submit:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(49, 87, 213, .30); }
.login-footnote { margin: 22px 0 0; color: #98a2b3; font-size: .8rem; text-align: center; }

/* 题库选择页 */
body.choose-page { min-height: 100vh; background: linear-gradient(180deg, #eef3ff 0, #f8f9fc 320px); }
.choose-shell { max-width: 1160px; padding-top: clamp(38px, 7vw, 76px); padding-bottom: 60px; }
.choose-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.choose-eyebrow { margin-bottom: 10px; color: var(--ui-primary); }
.choose-header h1 { margin: 0; color: var(--ui-ink); font-size: clamp(1.85rem, 4vw, 3rem); font-weight: 850; letter-spacing: -.04em; }
.choose-header p { margin: 10px 0 0; color: var(--ui-muted); font-size: 1rem; }
.choose-logout { border-color: #cbd3e1; border-radius: 12px; background: rgba(255, 255, 255, .65); white-space: nowrap; }
.choose-messages { margin-bottom: 22px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.library-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid #e1e6ef;
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 12px 34px rgba(37, 53, 86, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.library-card:hover { transform: translateY(-3px); border-color: #bdcaf0; box-shadow: 0 20px 42px rgba(37, 53, 86, .12); }
.library-card.is-active { border-color: rgba(49, 87, 213, .48); box-shadow: 0 16px 42px rgba(49, 87, 213, .13); }
.library-card-top { display: flex; align-items: center; justify-content: space-between; min-height: 42px; }
.library-icon { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 13px; color: var(--ui-primary); background: #edf1ff; }
.library-active-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; color: #2855c5; background: #edf2ff; font-size: .75rem; font-weight: 700; }
.library-active-badge i { font-size: .42rem; }
.library-progress-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; color: #94600f; background: #fff5da; font-size: .75rem; font-weight: 750; }
.library-progress-badge i { font-size: .65rem; }
.library-card h2 { margin: 22px 0 8px; color: var(--ui-ink); font-size: 1.28rem; font-weight: 800; }
.library-card > p { margin: 0 0 22px; color: var(--ui-muted); line-height: 1.7; }
.library-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.library-card-footer small { max-width: 120px; overflow: hidden; color: #98a2b3; text-overflow: ellipsis; white-space: nowrap; }
.library-card-footer .btn { border-radius: 11px; }
.choose-tip { margin: 24px 0 0; color: var(--ui-muted); text-align: center; }
.empty-library-state,
.empty-search-state { padding: 54px 24px; border: 1px dashed #cbd5e5; border-radius: 20px; background: rgba(255, 255, 255, .78); text-align: center; }
.empty-library-state > span,
.empty-search-icon { display: inline-flex; width: 64px; height: 64px; align-items: center; justify-content: center; margin-bottom: 18px; border-radius: 20px; color: var(--ui-primary); background: #eaf0ff; font-size: 1.5rem; }
.empty-library-state h2,
.empty-search-state h2 { color: var(--ui-ink); font-size: 1.35rem; font-weight: 800; }
.empty-library-state p,
.empty-search-state p { color: var(--ui-muted); }

/* 测验页搜索与返回 */
.quiz-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.quiz-back-link {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  color: #4b5870;
  background: #fff;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.quiz-back-link:hover { color: var(--ui-primary); border-color: #b8c6ee; background: #f5f7ff; text-decoration: none; }
.quiz-topbar .search-bar { flex: 1; max-width: none; margin: 0; gap: 8px; }
.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap > i { position: absolute; z-index: 2; left: 13px; top: 50%; color: #98a2b3; transform: translateY(-50%); }
.quiz-topbar .search-input { width: 100%; height: 38px; padding: 0 14px 0 38px; border-radius: 999px; color: var(--ui-ink); background: #f5f7fb; }
.quiz-topbar .search-btn { height: 38px; min-width: 66px; border-radius: 999px; }
.search-result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 18px;
  padding: 11px 13px;
  border: 1px solid #dce5fb;
  border-radius: 13px;
  color: #526078;
  background: #f5f8ff;
  font-size: .9rem;
}
.search-result-label { margin-right: 6px; color: var(--ui-primary); font-weight: 800; }
.return-btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #c7d2ef;
  border-radius: 999px;
  color: var(--ui-primary);
  background: #fff;
  font-size: .84rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.return-btn:hover { color: #fff; border-color: var(--ui-primary); background: var(--ui-primary); text-decoration: none; }
.empty-search-state { margin-top: 22px; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { min-height: 280px; align-items: center; padding: 44px clamp(24px, 7vw, 64px); }
  .login-hero h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
  .login-panel { padding: 30px 20px 46px; }
  .login-card { margin-top: -62px; position: relative; z-index: 2; }
}

@media (max-width: 576px) {
  .login-hero { min-height: 250px; padding: 32px 22px 76px; align-items: flex-start; }
  .login-hero p, .login-benefits { display: none; }
  .login-hero h1 { margin-bottom: 0; font-size: 2rem; }
  .login-eyebrow { margin-bottom: 14px; }
  .login-panel { padding: 0 12px 30px; }
  .login-card { margin-top: -46px; padding: 26px 20px; border-radius: 22px; }
  .login-heading h2 { font-size: 1.7rem; }
  .login-options { align-items: flex-start; flex-direction: column; gap: 10px; }
  .demo-account { text-align: left; }
  .choose-shell { padding-top: 30px; }
  .choose-header { align-items: flex-start; flex-direction: column; }
  .choose-logout { align-self: flex-end; }
  .library-grid { grid-template-columns: 1fr; }
  .quiz-card { padding: 18px 15px; }
  .quiz-topbar { align-items: stretch; }
  .quiz-back-link { width: 40px; height: 38px; justify-content: center; padding: 0; }
  .quiz-back-link span { display: none; }
  .quiz-topbar .search-btn { min-width: 58px; padding: 0 10px; }
  .search-result-summary { align-items: flex-start; flex-direction: column; }
  .return-btn { align-self: stretch; justify-content: center; }
}

/* 设置、快捷键与续答标记 */
.quiz-page .progress-mark-btn.is-marked {
  color: #9a6410;
  border-color: #f0cf85;
  background: #fff8e7;
  box-shadow: 0 6px 15px rgba(180, 121, 22, .10);
}
.quiz-page .progress-mark-btn.is-loading { opacity: .62; cursor: wait; }
.legend-bookmark {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: #d09024;
  font-size: .72rem;
}
.answer-sheet-modal .answer-btn-circle { position: relative; overflow: visible; }
.answer-number-bookmark {
  position: absolute;
  top: -6px;
  right: -4px;
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 6px;
  color: #fff;
  background: #d6962d;
  box-shadow: 0 3px 8px rgba(128, 82, 11, .22);
  font-size: .55rem;
}
.answer-sheet-modal .answer-btn-circle.state-bookmarked { border-color: #e2b65f; }
.answer-sheet-progress-actions { display: flex; align-items: center; gap: 9px; }
.answer-sheet-save-mark,
.answer-sheet-clear-mark {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #e0bd73;
  border-radius: 10px;
  color: #95600d;
  background: #fff9eb;
  font-weight: 750;
}
.answer-sheet-save-mark:hover,
.answer-sheet-save-mark.is-marked { color: #7b4e08; border-color: #d6a94f; background: #fff3d3; }
.answer-sheet-clear-mark { color: #6f7b8e; border-color: #dce2ec; background: #fff; }
.answer-sheet-clear-mark:hover { color: #b84351; border-color: #efc3c8; background: #fff5f6; }

.settings-dialog { max-width: 720px; }
.quiz-page .settings-modal { overflow: hidden; border: 0; border-radius: 25px; box-shadow: 0 24px 70px rgba(31, 43, 67, .22); }
.settings-header {
  align-items: center;
  padding: 20px 24px;
  border: 0;
  background: linear-gradient(135deg, #eef3ff 0%, #f8faff 62%, #eefaf7 100%);
}
.settings-heading { display: flex; align-items: center; gap: 14px; }
.settings-heading > span {
  display: inline-flex;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #5577e6, #3157d5);
  box-shadow: 0 9px 20px rgba(49, 87, 213, .22);
}
.settings-heading h5 { margin: 0 0 3px; color: #223049; font-size: 1.14rem; font-weight: 850; }
.settings-heading p { margin: 0; color: #7c899d; font-size: .8rem; }
.settings-body { padding: 22px 24px 8px; background: #fbfcff; }
.settings-section { margin-bottom: 22px; }
.settings-section h6 { margin: 0 0 12px; color: #34425a; font-size: .86rem; font-weight: 850; letter-spacing: .02em; }
.settings-toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-toggle {
  display: flex;
  min-width: 0;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e4e9f1;
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
}
.settings-toggle:hover { border-color: #bdc9ec; box-shadow: 0 6px 18px rgba(48, 65, 105, .07); }
.settings-toggle > span { display: flex; min-width: 0; flex-direction: column; }
.settings-toggle strong { color: #344158; font-size: .84rem; font-weight: 800; }
.settings-toggle small { margin-top: 3px; color: #8995a7; font-size: .72rem; }
.settings-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.settings-toggle > i {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 23px;
  flex: 0 0 40px;
  border-radius: 999px;
  background: #d9dee7;
  transition: .2s ease;
}
.settings-toggle > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(38, 49, 70, .24);
  content: "";
  transition: transform .2s ease;
}
.settings-toggle input:checked + i { background: #4165de; }
.settings-toggle input:checked + i::after { transform: translateX(17px); }
.settings-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.settings-section-title h6 { margin-bottom: 3px; }
.settings-section-title p { margin: 0 0 12px; color: #8995a7; font-size: .72rem; }
.shortcut-master { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #5c6980; font-size: .78rem; cursor: pointer; }
.shortcut-master input { accent-color: #4165de; }
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #e5e9f0;
  border-radius: 15px;
  background: #fff;
  transition: opacity .2s ease;
}
.shortcut-grid.is-disabled { opacity: .48; }
.shortcut-grid > div {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf0f5;
  color: #59667b;
  font-size: .78rem;
}
.shortcut-grid > div:nth-child(odd) { border-right: 1px solid #edf0f5; }
.shortcut-key-group { display: inline-flex; gap: 4px; }
.shortcut-key {
  display: inline-flex;
  min-width: 31px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid #cfd6e2;
  border-bottom-width: 3px;
  border-radius: 8px;
  color: #40506a;
  background: #f9fafc;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 1px rgba(38, 48, 67, .05);
}
.shortcut-key:hover { color: #3157d5; border-color: #9eb0e8; background: #f4f7ff; }
.shortcut-key.is-capturing { color: #fff; border-color: #3157d5; background: #4165de; animation: shortcut-pulse 1s ease infinite; }
@keyframes shortcut-pulse { 50% { box-shadow: 0 0 0 5px rgba(65, 101, 222, .13); } }
.shortcut-feedback { min-height: 18px; margin: 8px 2px 0; color: #4165de; font-size: .72rem; }
.settings-footer { justify-content: space-between; padding: 14px 24px 18px; border-color: #e9edf4; background: #fff; }

.quiz-toast {
  position: fixed;
  z-index: 1090;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 32px));
  padding: 13px 17px;
  border: 1px solid #b9e5d3;
  border-radius: 13px;
  color: #176f51;
  background: #effbf6;
  box-shadow: 0 12px 32px rgba(34, 54, 88, .16);
  font-size: .83rem;
  font-weight: 720;
}
.quiz-toast.is-error { color: #a23d49; border-color: #f0c3c8; background: #fff3f4; }

@media (max-width: 767.98px) {
  .settings-dialog { margin: 8px; }
  .quiz-page .settings-modal { border-radius: 21px; }
  .settings-header { padding: 17px; }
  .settings-heading > span { width: 42px; height: 42px; flex-basis: 42px; }
  .settings-body { padding: 17px 16px 5px; }
  .settings-toggle-grid, .shortcut-grid { grid-template-columns: 1fr; }
  .shortcut-grid > div:nth-child(odd) { border-right: 0; }
  .settings-footer { padding: 13px 16px 16px; }
  .answer-sheet-progress-actions { width: 100%; flex-wrap: wrap; }
  .answer-sheet-progress-actions > button { flex: 1 1 auto; }
  .quiz-toast { right: 16px; bottom: 16px; left: 16px; max-width: none; text-align: center; }
}
/* —— 统一告警样式（无需 Bootstrap） —— */
.alert{
  display:block;
  width:100%;
  padding:.75rem 1rem;
  margin: .75rem 0 0 0;           /* 等价 mt-3 */
  border:1px solid transparent;
  border-radius:.5rem;
  box-sizing:border-box;
  word-break:break-word;
}
.alert-danger{
  background:#f8d7da;
  border-color:#f5c2c7;
  color:#842029;
}
.alert-success{
  background:#d1e7dd;
  border-color:#badbcc;
  color:#0f5132;
}

/* 避免卡片把内部圆角/阴影裁掉 */
.quiz-card{ overflow: visible; }

/* 若父级用了 display:flex 且有挤压，强制占满行 */
#judgeAlert{ flex: 0 0 100%; }

/* ====== 2026 测验页舒适版 ====== */
body.quiz-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(91, 124, 250, .12), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(80, 190, 170, .10), transparent 28%),
    #f4f7fc;
}

.quiz-page-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 58px) clamp(16px, 3vw, 28px) 64px;
}

.quiz-page .quiz-card {
  margin: 0;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(219, 226, 239, .9);
  border-radius: 28px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(42, 58, 92, .12);
}

.quiz-page .quiz-header { margin-bottom: 24px; }
.quiz-page .quiz-topbar { gap: 14px; margin: 0; }
.quiz-page .quiz-back-link {
  height: 46px;
  padding: 0 16px;
  border-color: #dce3ef;
  border-radius: 14px;
  color: #526078;
  background: #f8faff;
}
.quiz-page .quiz-back-link:hover { transform: translateX(-2px); }

.quiz-page .search-bar { display: flex; min-width: 0; }
.quiz-page .search-input-wrap { min-width: 0; }
.quiz-page .search-input-wrap > i { left: 16px; color: #8090aa; }
.quiz-page .search-input {
  height: 46px;
  padding: 0 18px 0 44px;
  border: 1px solid #dce3ef;
  border-radius: 14px;
  outline: 0;
  color: #1e293b;
  background: #f8faff;
  font-size: .96rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.quiz-page .search-input:focus {
  border-color: #8ea6ee;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(49, 87, 213, .11);
}
.quiz-page .search-btn {
  display: inline-flex;
  height: 46px;
  min-width: 96px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #4265df, #3157d5);
  box-shadow: 0 8px 18px rgba(49, 87, 213, .20);
  font-weight: 750;
}
.quiz-page .search-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(49, 87, 213, .27); }

.quiz-page .search-result-summary {
  margin: 18px 0 0;
  padding: 13px 15px;
  border-color: #dce5fb;
  border-radius: 16px;
  background: linear-gradient(135deg, #f5f8ff, #f9fbff);
}
.search-result-copy { display: flex; align-items: center; gap: 11px; min-width: 0; }
.search-result-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #3157d5;
  background: #e8eeff;
  font-size: .8rem;
}
.search-result-title { margin-bottom: 2px; color: #3157d5; font-size: .76rem; font-weight: 850; letter-spacing: .04em; }
.search-result-copy strong { color: #25324a; }
.quiz-page .return-btn { min-height: 38px; border-radius: 12px; }

.quiz-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quiz-library-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #53627a;
  font-size: .88rem;
  font-weight: 750;
}
.quiz-library-badge i {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #3157d5;
  background: #edf1ff;
}
.quiz-quick-actions { display: flex; gap: 8px; }
.quiz-tool-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #dce3ef;
  border-radius: 11px;
  color: #5b687d;
  background: #fff;
  font-size: .84rem;
  font-weight: 700;
}
.quiz-tool-btn:hover { color: #3157d5; border-color: #afbfed; background: #f7f9ff; }

.quiz-progress { height: 5px; margin: 19px 0 22px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.quiz-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4b6ee8, #46b6a9); transition: width .28s ease; }

.quiz-preferences { display: flex; justify-content: flex-end; gap: 18px; margin-bottom: 16px; }
.preference-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #6b778c; font-size: .83rem; cursor: pointer; }
.preference-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #cbd3df; transition: background .18s ease; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .22); transition: transform .18s ease; }
.preference-toggle input:checked + .toggle-track { background: #4265df; }
.preference-toggle input:checked + .toggle-track::after { transform: translateX(14px); }
.preference-toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 4px rgba(49, 87, 213, .15); }

.question-heading { padding: 18px 0 22px; }
.question-eyebrow { margin-bottom: 10px; color: #7c8aa2; font-size: .72rem; font-weight: 850; letter-spacing: .13em; }
.word-line { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.quiz-page .word-title { color: #15213a; font-size: clamp(2.5rem, 6vw, 4.3rem); font-weight: 850; letter-spacing: -.045em; line-height: 1.06; }
.quiz-page .word-title .sub { margin-left: 10px; color: #8290a7; font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 600; letter-spacing: 0; }
.word-audio-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.audio-btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid #d7dfec;
  border-radius: 13px;
  color: #56647b;
  background: #fff;
  font-weight: 700;
}
.audio-btn-primary { color: #3157d5; border-color: #c9d5f8; background: #f1f5ff; }
.audio-btn:hover { color: #3157d5; border-color: #9fb2eb; transform: translateY(-1px); }
.question-prompt { margin: 12px 0 0; color: #68758a; font-size: 1rem; }

.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.quiz-page .opt-btn {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 86px;
  height: 100%;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  padding: 16px 48px 16px 16px;
  border: 1px solid #e0e5ee;
  border-radius: 18px;
  outline: 0;
  color: #2f3c52;
  background: linear-gradient(145deg, #fff, #fafbfe);
  box-shadow: 0 5px 15px rgba(44, 61, 101, .045);
  font-size: .94rem;
  line-height: 1.5;
  text-align: left;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.quiz-page .opt-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: #9fb2eb; background: #f7f9ff; box-shadow: 0 11px 26px rgba(53, 74, 124, .11); }
.quiz-page .opt-btn:focus-visible { border-color: #6e89e8; box-shadow: 0 0 0 4px rgba(49, 87, 213, .13); }
.quiz-page .opt-btn.active { border-color: #6e89e8; background: #eef3ff; box-shadow: 0 0 0 3px rgba(49, 87, 213, .10); }
.quiz-page .opt-btn:disabled { opacity: 1; cursor: default; }
.option-letter { display: inline-flex; width: 42px; height: 42px; flex: 0 0 42px; align-items: center; justify-content: center; border: 1px solid #d7dfeb; border-radius: 13px; color: #4c5b73; background: #f4f6fa; font-size: 1rem; font-weight: 900; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9); transition: all .15s ease; }
.opt-btn:hover:not(:disabled) .option-letter, .opt-btn.active .option-letter { color: #fff; border-color: #4265df; background: linear-gradient(145deg, #5578eb, #3157d5); box-shadow: 0 6px 13px rgba(49, 87, 213, .21); }
.option-content { display: flex; min-width: 0; min-height: 42px; flex: 1 1 auto; flex-direction: column; justify-content: center; gap: 7px; }
.option-sense { display: flex; min-width: 0; align-items: flex-start; gap: 7px; }
.option-sense + .option-sense { padding-top: 7px; border-top: 1px dashed #e3e8f1; }
.option-sense-index { display: inline-flex; width: 19px; height: 19px; flex: 0 0 19px; align-items: center; justify-content: center; margin-top: 1px; border-radius: 50%; color: #63728a; background: #edf1f6; font-size: .64rem; font-weight: 850; }
.option-text { min-width: 0; overflow-wrap: anywhere; font-weight: 620; }
.option-indicator { position: absolute; top: 50%; right: 15px; display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; transform: translateY(-50%); border: 1px solid #dce3ed; border-radius: 50%; color: transparent; background: #fff; font-size: .68rem; transition: all .15s ease; }
.option-indicator i { display: none; }
.opt-btn:hover:not(:disabled) .option-indicator, .opt-btn.active .option-indicator { color: #3157d5; border-color: #aabbee; background: #eef3ff; }
.opt-btn:hover:not(:disabled) .option-indicator-check, .opt-btn.active .option-indicator-check { display: block; }
.quiz-page .opt-btn.is-correct, .quiz-page .opt-btn.is-answer { border-color: #77caaa; background: #eefaf5; box-shadow: 0 0 0 3px rgba(34, 164, 116, .10); }
.quiz-page .opt-btn.is-correct .option-letter, .quiz-page .opt-btn.is-answer .option-letter { color: #fff; border-color: #22a474; background: linear-gradient(145deg, #35bd8b, #16885f); box-shadow: 0 6px 13px rgba(25, 143, 101, .20); }
.quiz-page .opt-btn.is-correct .option-indicator, .quiz-page .opt-btn.is-answer .option-indicator { color: #16885f; border-color: #8dd4b8; background: #e1f7ee; }
.quiz-page .opt-btn.is-correct .option-indicator-check, .quiz-page .opt-btn.is-answer .option-indicator-check { display: block; }
.quiz-page .opt-btn.is-wrong { border-color: #e99aa3; background: #fff3f4; box-shadow: 0 0 0 3px rgba(218, 79, 94, .09); }
.quiz-page .opt-btn.is-wrong .option-letter { color: #fff; border-color: #d85463; background: linear-gradient(145deg, #e87480, #c64453); box-shadow: 0 6px 13px rgba(199, 67, 82, .18); }
.quiz-page .opt-btn.is-wrong .option-indicator { color: #c64453; border-color: #efadb5; background: #ffe6e9; }
.quiz-page .opt-btn.is-wrong .option-indicator-check { display: none; }
.quiz-page .opt-btn.is-wrong .option-indicator-wrong { display: block; }

.analysis-panel { margin: 0 0 20px; padding: 20px; border: 1px solid #dfe6f2; border-radius: 18px; background: #f8faff; }
.analysis-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: #3157d5; font-weight: 800; }
.analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analysis-meta-card { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border: 1px solid #e7ebf4; border-radius: 13px; background: #fff; }
.analysis-meta-card > strong { color: #8793a8; font-size: .74rem; letter-spacing: .04em; }
.analysis-meta-card > span { color: #344054; line-height: 1.55; font-weight: 720; }
.analysis-definition-card { display: flex; min-width: 0; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid; border-radius: 16px; }
.analysis-definition-cn { border-color: #eadcf8; background: linear-gradient(145deg, #fdfaff, #f8f3ff); }
.analysis-definition-en { border-color: #d9e6ff; background: linear-gradient(145deg, #fbfdff, #f2f7ff); }
.analysis-field-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
.analysis-field-heading > span { display: inline-flex; align-items: center; gap: 7px; color: #344054; font-size: .86rem; font-weight: 820; }
.analysis-definition-cn .analysis-field-heading > span i { color: #8b55c5; }
.analysis-definition-en .analysis-field-heading > span i { color: #3157d5; }
.analysis-field-heading small { color: #8995a8; font-size: .68rem; font-weight: 650; line-height: 1.35; text-align: right; }
.analysis-field-heading small i { margin-right: 4px; }
.definition-list { display: flex; min-width: 0; flex-direction: column; gap: 8px; }
.definition-sense { display: grid; min-width: 0; grid-template-columns: 26px minmax(0, 1fr); align-items: flex-start; gap: 9px; padding: 10px 11px; border: 1px solid rgba(131, 145, 172, .13); border-radius: 12px; background: rgba(255, 255, 255, .82); box-shadow: 0 4px 14px rgba(44, 60, 97, .035); }
.definition-sense-number { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; border-radius: 8px; font-size: .72rem; font-weight: 850; line-height: 1; }
.definition-sense-cn .definition-sense-number { color: #7945ae; background: #eee1fa; }
.definition-sense-en .definition-sense-number { color: #3157d5; background: #e5edff; }
.definition-sense p { min-width: 0; margin: 1px 0 0; color: #344054; font-size: .92rem; line-height: 1.68; overflow-wrap: anywhere; }
.definition-sense-cn p { font-weight: 680; }
.definition-sense-en p { color: #40516c; font-weight: 590; }
.gloss-word { position: relative; display: inline; color: #274fc2; border-bottom: 1.5px dashed #7792e5; font-weight: 760; line-height: inherit; cursor: help; outline: none; transition: color .16s ease, border-color .16s ease, background-color .16s ease; }
.gloss-word:hover, .gloss-word:focus, .gloss-word:focus-visible { color: #173da9; border-color: #3157d5; border-radius: 3px; background: #e8efff; }
.gloss-tooltip { position: absolute; z-index: 120; left: 50%; bottom: calc(100% + 10px); display: flex; width: max-content; max-width: min(280px, calc(100vw - 48px)); flex-direction: column; gap: 3px; padding: 9px 11px; color: #fff; border-radius: 10px; background: #233452; box-shadow: 0 12px 30px rgba(25, 40, 72, .25); font-size: .76rem; font-weight: 560; line-height: 1.45; text-align: left; white-space: normal; opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 5px); transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.gloss-tooltip::after { content: ""; position: absolute; top: 100%; left: 50%; border: 6px solid transparent; border-top-color: #233452; transform: translateX(-50%); }
.gloss-tooltip > strong { color: #bfcfff; font-size: .74rem; font-weight: 820; letter-spacing: .02em; }
.gloss-tooltip > span { color: #fff; }
.gloss-word:hover .gloss-tooltip, .gloss-word:focus .gloss-tooltip, .gloss-word:focus-visible .gloss-tooltip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.quiz-page #judgeAlert { margin: 16px 0 0; border-radius: 14px; }
.quiz-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding-top: 22px; border-top: 1px solid #ebeff5; }
.progress-copy { display: flex; align-items: baseline; gap: 9px; color: #8b97aa; }
.progress-copy span { font-size: .78rem; }
.progress-copy strong { color: #36445b; font-size: 1.05rem; }
.question-navigation { display: flex; gap: 10px; }
.nav-btn { display: inline-flex; min-width: 112px; min-height: 46px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 13px; font-weight: 750; }
.nav-btn-secondary { color: #556277; border-color: #d8e0ec; background: #fff; }
.nav-btn-primary { color: #fff; background: linear-gradient(135deg, #4265df, #3157d5); box-shadow: 0 9px 20px rgba(49, 87, 213, .20); }
.nav-btn:hover:not(:disabled) { transform: translateY(-1px); }
.nav-btn:disabled { color: #a7b0bf; border-color: #e8ebf0; background: #f4f5f7; box-shadow: none; cursor: not-allowed; }

.quiz-page .empty-search-state { margin: 8px 0 0; padding: 68px 24px; border-style: solid; background: #fbfcff; }
.empty-search-actions { display: flex; justify-content: center; gap: 10px; }
.empty-search-actions .btn { margin: 0 !important; border-radius: 12px; }
.quiz-page .modal-content { overflow: hidden; border: 0; border-radius: 22px; box-shadow: 0 24px 70px rgba(22, 34, 64, .24); }
.quiz-page .modal-header, .quiz-page .modal-footer { border-color: #ebeff5; }

@media (max-width: 720px) {
  .quiz-page-shell { padding: 14px 10px 34px; }
  .quiz-page .quiz-card { padding: 18px 15px 22px; border-radius: 22px; }
  .quiz-page .quiz-topbar { align-items: stretch; gap: 8px; }
  .quiz-page .quiz-back-link { width: 46px; height: 46px; justify-content: center; padding: 0; }
  .quiz-page .quiz-back-link span { display: none; }
  .quiz-page .search-btn { min-width: 48px; padding: 0; }
  .quiz-page .search-btn span { display: none; }
  .quiz-page .search-result-summary { align-items: stretch; flex-direction: column; }
  .quiz-page .return-btn { justify-content: center; }
  .quiz-meta-row { align-items: flex-start; }
  .quiz-quick-actions { flex-wrap: wrap; justify-content: flex-end; }
  .quiz-preferences { justify-content: flex-start; flex-wrap: wrap; }
  .word-line { align-items: flex-start; flex-direction: column; gap: 16px; }
  .quiz-page .word-title { font-size: clamp(2.6rem, 15vw, 3.7rem); }
  .word-audio-actions { width: 100%; }
  .audio-btn { flex: 1; }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-panel { padding: 16px 13px; }
  .analysis-field-heading { align-items: flex-start; }
  .analysis-field-heading small { max-width: 126px; }
  .analysis-definition-card { padding: 14px 12px; }
  .definition-sense { padding: 9px; }
  .gloss-tooltip { left: 0; transform: translate(0, 5px); }
  .gloss-tooltip::after { left: 18px; transform: none; }
  .gloss-word:hover .gloss-tooltip, .gloss-word:focus .gloss-tooltip, .gloss-word:focus-visible .gloss-tooltip { transform: translate(0, 0); }
  .quiz-options { grid-template-columns: 1fr; gap: 11px; }
  .quiz-page .opt-btn { min-height: 68px; padding: 12px 43px 12px 12px; border-radius: 15px; }
  .option-letter { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .option-content { min-height: 38px; }
  .option-indicator { right: 12px; }
  .quiz-footer { align-items: stretch; flex-direction: column; }
  .progress-copy { justify-content: space-between; }
  .question-navigation { width: 100%; }
  .nav-btn { flex: 1; min-width: 0; }
}

@media (max-width: 390px) {
  .quiz-library-badge { max-width: 125px; }
  .quiz-tool-btn { padding: 0 9px; }
  .question-eyebrow { font-size: .66rem; }
  .option-letter { width: 34px; height: 34px; flex-basis: 34px; }
}

/* 重点词库 */
.quiz-library-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.focus-count-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid #f0dfb7;
  border-radius: 999px;
  color: #8b650d;
  background: #fff9e9;
  font-size: .76rem;
  font-weight: 750;
}
.focus-count-badge i { color: #e0a514; }
.focus-word-btn.is-focused { color: #8a6200; border-color: #e7cd8e; background: #fff8e5; }
.focus-word-btn.is-focused i { color: #e0a514; }
.focus-word-btn.is-loading { opacity: .65; cursor: wait; }
.focus-only-toggle { padding-right: 18px; border-right: 1px solid #e3e8f0; color: #70571a; font-weight: 700; }
.empty-focus-state .empty-search-icon { color: #a97800; background: #fff4cf; }
.empty-focus-state form { margin-top: 20px; }
.empty-focus-state .btn { border-radius: 12px; }

@media (max-width: 720px) {
  .quiz-library-meta { align-items: flex-start; flex-direction: column; gap: 7px; }
  .focus-count-badge { margin-left: 0; }
  .focus-only-toggle { padding-right: 13px; }
}

@media (max-width: 430px) {
  .quiz-meta-row { align-items: stretch; flex-direction: column; }
  .quiz-library-meta { align-items: center; flex-direction: row; }
  .quiz-quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .quiz-tool-btn { justify-content: center; white-space: nowrap; }
}

/* 答题卡 2.0 */
.answer-sheet-dialog { max-width: 940px; }
.quiz-page .answer-sheet-modal { border-radius: 26px; background: #fff; }
.answer-sheet-header {
  align-items: center;
  padding: 22px 24px;
  border: 0 !important;
  background: linear-gradient(135deg, #f5f8ff 0%, #f8fbff 55%, #f1fbf8 100%);
}
.answer-sheet-heading { display: flex; align-items: center; gap: 14px; }
.answer-sheet-heading-icon { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 15px; color: #fff; background: linear-gradient(135deg, #4d70e5, #3157d5); box-shadow: 0 9px 20px rgba(49, 87, 213, .22); }
.answer-sheet-heading h5 { margin: 0 0 4px; color: #1f2b43; font-size: 1.18rem; font-weight: 850; }
.answer-sheet-heading p { margin: 0; color: #748198; font-size: .84rem; }
.answer-sheet-heading p strong { color: #3157d5; }
.answer-sheet-close { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 0; border-radius: 12px; color: #7b879b; background: rgba(255, 255, 255, .82); }
.answer-sheet-close:hover { color: #344054; background: #fff; box-shadow: 0 5px 14px rgba(39, 53, 84, .10); }

.answer-sheet-body { padding: 22px 24px 26px; background: #fbfcff; }
.answer-sheet-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.answer-stat { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #e6eaf1; border-radius: 16px; background: #fff; }
.answer-stat > span { display: inline-flex; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center; border-radius: 12px; }
.answer-stat > div { display: flex; min-width: 0; flex-direction: column; }
.answer-stat strong { color: #27354d; font-size: 1.22rem; line-height: 1.1; }
.answer-stat small { margin-top: 4px; color: #8490a3; font-size: .76rem; }
.answer-stat-correct > span { color: #18865e; background: #e7f8f1; }
.answer-stat-wrong > span { color: #c44e5b; background: #fff0f1; }
.answer-stat-pending > span { color: #68758a; background: #f0f3f7; }

.answer-sheet-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.answer-sheet-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: #748198; font-size: .78rem; }
.answer-sheet-legend > span { display: inline-flex; align-items: center; }
.answer-sheet-legend .legend-dot { width: 9px; height: 9px; margin-right: 6px; }
.legend-correct { background: #35b987; }
.legend-wrong { background: #e7727e; }
.legend-pending { background: #b7c0ce; }
.legend-ring { width: 11px; height: 11px; margin-right: 6px; border: 2px solid #4265df; border-radius: 4px; }
.answer-sheet-page-nav { display: inline-flex; align-items: center; gap: 9px; color: #69768b; font-size: .78rem; white-space: nowrap; }
.answer-sheet-page-nav button { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border: 1px solid #dce2ec; border-radius: 10px; color: #516079; background: #fff; }
.answer-sheet-page-nav button:hover:not(:disabled) { color: #3157d5; border-color: #aebdec; }
.answer-sheet-page-nav button:disabled { opacity: .38; cursor: not-allowed; }

.answer-sheet-modal .answer-sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 9px; padding: 17px; border: 1px solid #e8ecf3; border-radius: 18px; background: #fff; }
.answer-sheet-modal .answer-btn-circle { display: inline-flex; width: 100%; height: 46px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 13px; font-size: .82rem; font-weight: 800; box-shadow: none; }
.answer-sheet-modal .answer-btn-circle.state-pending { color: #68758a; border-color: #e4e8ef; background: #f4f6f9; }
.answer-sheet-modal .answer-btn-circle.state-correct { color: #147956; border-color: #bcebd9; background: #e9f9f2; }
.answer-sheet-modal .answer-btn-circle.state-wrong { color: #b84351; border-color: #f2c5ca; background: #fff0f2; }
.answer-sheet-modal .answer-btn-circle:hover { z-index: 1; transform: translateY(-2px); border-color: #8fa5e8; box-shadow: 0 8px 18px rgba(47, 67, 112, .12); }
.answer-sheet-modal .answer-btn-circle.state-current { border-color: #4265df; box-shadow: 0 0 0 3px rgba(66, 101, 223, .16); }

.answer-sheet-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-color: #e9edf4 !important; background: #fff; }
.answer-sheet-jump { display: flex; align-items: center; gap: 8px; margin: 0; color: #69768b; font-size: .82rem; }
.answer-sheet-jump input { width: 86px; height: 38px; padding: 0 10px; border: 1px solid #dce2ec; border-radius: 10px; outline: 0; }
.answer-sheet-jump input:focus { border-color: #8da3e8; box-shadow: 0 0 0 3px rgba(49, 87, 213, .10); }
.answer-sheet-jump button, .answer-sheet-done { height: 38px; padding: 0 14px; border: 1px solid #d5ddea; border-radius: 10px; color: #526078; background: #fff; font-weight: 700; }
.answer-sheet-done { color: #fff; border-color: #3157d5; background: #3157d5; }
.answer-sheet-jump button:hover { color: #3157d5; border-color: #9eb0e8; }
.answer-sheet-done:hover { background: #274bc3; }

@media (max-width: 576px) {
  .answer-sheet-dialog { margin: 8px; }
  .quiz-page .answer-sheet-modal { border-radius: 22px; }
  .answer-sheet-header { padding: 18px; }
  .answer-sheet-heading-icon { width: 42px; height: 42px; flex-basis: 42px; }
  .answer-sheet-heading h5 { font-size: 1.02rem; }
  .answer-sheet-body { padding: 16px; }
  .answer-sheet-stats { gap: 7px; }
  .answer-stat { align-items: flex-start; flex-direction: column; gap: 7px; padding: 11px; }
  .answer-stat > span { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; }
  .answer-stat strong { font-size: 1rem; }
  .answer-stat small { font-size: .68rem; }
  .answer-sheet-toolbar { align-items: flex-start; flex-direction: column; }
  .answer-sheet-page-nav { align-self: stretch; justify-content: space-between; }
  .answer-sheet-modal .answer-sheet-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; padding: 12px; }
  .answer-sheet-modal .answer-btn-circle { height: 42px; border-radius: 11px; font-size: .76rem; }
  .answer-sheet-footer { align-items: stretch; flex-direction: column; padding: 14px 16px; }
  .answer-sheet-jump { justify-content: space-between; }
  .answer-sheet-done { width: 100%; }
}

/* 在线增强解析与图片记忆卡 */
.analysis-panel { overflow: hidden; }
.analysis-heading { justify-content: space-between; }
.analysis-heading > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.analysis-api-badge { display: inline-flex; min-height: 28px; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid #d7e2fa; border-radius: 999px; color: #4963ad; background: #f1f5ff; font-size: .7rem; font-weight: 750; }

.memory-aid { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e1e7f0; }
.memory-loading, .memory-error { display: flex; min-height: 92px; align-items: center; justify-content: center; gap: 13px; padding: 20px; border: 1px dashed #d6deeb; border-radius: 16px; color: #66758c; background: rgba(255, 255, 255, .68); }
.memory-loading > div, .memory-error > div { display: flex; flex-direction: column; gap: 3px; }
.memory-loading strong, .memory-error strong { color: #334158; font-size: .9rem; }
.memory-loading small, .memory-error small { color: #8793a6; font-size: .76rem; }
.memory-spinner { width: 25px; height: 25px; border: 3px solid #dce4f5; border-top-color: #4265df; border-radius: 50%; animation: memory-spin .75s linear infinite; }
.memory-error > i { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 12px; color: #8b97a9; background: #eef1f5; }
@keyframes memory-spin { to { transform: rotate(360deg); } }

.memory-content { display: grid; grid-template-columns: minmax(250px, .9fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.memory-visual { position: relative; min-width: 0; overflow: hidden; margin: 0; border: 1px solid #dde4ee; border-radius: 17px; background: #edf1f6; box-shadow: 0 10px 24px rgba(43, 59, 91, .09); }
.memory-image-stage { position: relative; display: grid; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; place-items: center; isolation: isolate; background-color: #e8edf4; background-position: center; background-size: cover; }
.memory-image-stage::before { position: absolute; z-index: 0; content: ""; inset: -14px; background: inherit; filter: blur(13px); opacity: .56; transform: scale(1.08); }
.memory-image-stage::after { position: absolute; z-index: 0; content: ""; inset: 0; background: rgba(239, 243, 249, .24); }
.memory-visual img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 15px rgba(21, 31, 55, .15)); }
.memory-image-stage.is-empty { aspect-ratio: 4 / 3; background: linear-gradient(145deg, #f5f8fd, #eaf0f8); }
.memory-image-stage.is-empty::before { display: none; }
.memory-image-empty { position: relative; z-index: 2; display: flex; max-width: 260px; align-items: center; flex-direction: column; padding: 24px; color: #718097; text-align: center; }
.memory-image-empty[hidden] { display: none; }
.memory-image-empty > span { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; margin-bottom: 11px; border: 1px solid #d7e1ef; border-radius: 16px; color: #5070d8; background: #fff; font-size: 1.25rem; box-shadow: 0 8px 20px rgba(53, 74, 124, .08); }
.memory-image-empty strong { color: #526078; font-size: .88rem; }
.memory-image-empty small { margin-top: 6px; color: #8b97aa; font-size: .7rem; line-height: 1.5; }
.memory-visual figcaption { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px; color: #7b879a; background: #fff; font-size: .68rem; line-height: 1.45; }
.memory-visual figcaption span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.memory-visual figcaption a { flex: 0 0 auto; color: #3157d5; font-weight: 700; white-space: nowrap; }
.memory-image-actions { display: inline-flex !important; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; overflow: visible !important; white-space: nowrap; -webkit-line-clamp: initial !important; }
.memory-cache-state { display: inline-flex !important; align-items: center; min-height: 22px; padding: 2px 8px; overflow: visible !important; border: 1px solid #dce5f2; border-radius: 999px; color: #426174; background: #f2f7fb; font-size: .62rem; font-weight: 750; white-space: nowrap; -webkit-line-clamp: initial !important; }
.memory-replace-btn { display: inline-flex; min-height: 26px; align-items: center; justify-content: center; gap: 5px; padding: 3px 8px; border: 1px solid #cfdaf5; border-radius: 8px; color: #3157d5; background: #f3f6ff; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.memory-replace-btn:hover:not(:disabled) { color: #fff; border-color: #4265df; background: #4265df; transform: translateY(-1px); }
.memory-replace-btn:disabled { opacity: .58; cursor: wait; }
.memory-details { display: flex; min-width: 0; flex-direction: column; gap: 13px; }
.memory-tip-card { display: flex; gap: 11px; padding: 14px; border: 1px solid #e9ddb9; border-radius: 15px; background: linear-gradient(135deg, #fffaf0, #fffdf8); }
.memory-tip-card > span { display: inline-flex; width: 36px; height: 36px; flex: 0 0 36px; align-items: center; justify-content: center; border-radius: 11px; color: #a87800; background: #fff0bd; }
.memory-tip-card strong { color: #6b531a; font-size: .78rem; }
.memory-tip-card p { margin: 4px 0 0; color: #5e5133; font-size: .82rem; line-height: 1.6; }
.memory-section { padding: 13px 14px; border: 1px solid #e2e7ef; border-radius: 14px; background: #fff; }
.memory-section h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 9px; color: #526078; font-size: .76rem; font-weight: 800; }
.memory-section h3 i { color: #4265df; }
.memory-definition-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 9px; padding: 7px 0; border-top: 1px solid #eef1f5; }
.memory-definition-row:first-child { padding-top: 0; border-top: 0; }
.memory-definition-row > span { color: #3157d5; font-size: .72rem; font-weight: 750; }
.memory-definition-row p { margin: 0; color: #48566d; font-size: .79rem; line-height: 1.5; }
.memory-section ul { margin: 0; padding-left: 18px; }
.memory-section li { margin: 6px 0; color: #48566d; font-size: .79rem; line-height: 1.55; }
.memory-synonyms { display: flex; gap: 7px; flex-wrap: wrap; }
.memory-synonyms span { padding: 5px 9px; border-radius: 999px; color: #475a85; background: #eef3ff; font-size: .72rem; font-weight: 700; }
.memory-source-note { color: #929cac; font-size: .66rem; line-height: 1.5; }
.memory-source-note a { color: #6377ad; }

@media (max-width: 760px) {
  .memory-content { grid-template-columns: 1fr; }
  .memory-visual { max-width: 520px; }
}

@media (max-width: 480px) {
  .analysis-api-badge { padding: 0 7px; }
  .memory-aid { margin-top: 14px; padding-top: 14px; }
  .memory-visual figcaption { align-items: stretch; flex-direction: column; }
  .memory-image-actions { justify-content: flex-start; flex-wrap: wrap; }
  .memory-definition-row { grid-template-columns: 1fr; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .memory-spinner { animation-duration: 1.5s; }
}

/* 放在答题卡 2.0 之后，确保组合状态仍优先显示书签边框。 */
.answer-sheet-modal .answer-btn-circle.state-bookmarked { border-color: #d9a541; }
