/* ============================================================
   pages/quiz.html 样式（P0-4-T17 <style> 块外联）
   - 页面 style="..." 与 on* 仍在本页（P0-4-T18 整改）
   ============================================================ */

/* Design Token：项目级 Glassmorphism 规范（与 topbar.8d4aa38f.css 一致） */
:root {
  --glass-bg-light:           rgba(255, 255, 255, 0.55);
  --glass-border-light:        rgba(15, 23, 42, 0.06);
  --glass-highlight-light:     rgba(255, 255, 255, 0.6);
  --glass-shadow-light:        rgba(15, 23, 42, 0.06);
  --glass-bg-dark:             rgba(10, 14, 39, 0.72);
  --glass-border-dark:         rgba(255, 255, 255, 0.06);
  --glass-highlight-dark:      rgba(255, 255, 255, 0.08);
  --glass-shadow-dark:         rgba(0, 0, 0, 0.32);
  --glass-blur:                blur(20px) saturate(180%);
}

  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #e8eaf0;
    background:
      radial-gradient(ellipse 80% 60% at 50% 0%,  rgba(59,130,246,0.18) 0%, transparent 60%),
      radial-gradient(ellipse 50% 40% at 100% 100%, rgba(59,130,246,0.10) 0%, transparent 60%),
      #05071a;
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100vh;
  }
  a { color: inherit; text-decoration: none; }

  /* 原顶栏计时/退出下移为内容区 sticky 工具条（顶栏已换共享组件） */
  .quiz-toolbar {
    position: sticky; top: 58px;
    background: rgba(5, 7, 26, 0.88);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--glass-border-dark);
    z-index: 80; /* < 90，不遮共享顶栏 */
  }
  .toolbar-inner {
    max-width: 800px; margin: 0 auto;
    padding: 8px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 15px; color: #fff;
  }
  .brand .meta {
    font-size: 11px; font-weight: 400;
    color: #a3a8c4; margin-left: 4px;
  }
  .toolbar-right { display: flex; align-items: center; gap: 16px; }
  .timer {
    font-family: "Roboto Condensed", "Inter", monospace;
    font-size: 22px; font-weight: 700;
    color: #3b82f6;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 8px;
    padding: 4px 14px;
    letter-spacing: 2px;
  }
  .timer.danger { color: #ef4444; border-color: #ef4444; background: rgba(239,68,68,0.1); animation: pulse 1s infinite; }
  @keyframes pulse { 50% { opacity: 0.5; } }
  .exit {
    font-size: 13px; color: #a3a8c4;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px;
    cursor: pointer;
    background: transparent;
    font-family: inherit;
  }
  .exit:hover { color: #ef4444; border-color: #ef4444; }

  .progress {
    height: 4px;
    background: rgba(255,255,255,0.05);
  }
  .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    width: 0;
    transition: width 0.3s ease;
  }

  .wrap {
    max-width: 800px;
    margin: 30px auto 120px;
    padding: 0 24px;
  }
  .qcard {
    background: rgba(11,18,32,0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .qcard.answered {
    border-color: rgba(26,188,156,0.45);
    box-shadow: 0 0 0 1px rgba(26,188,156,0.18), 0 4px 16px rgba(26,188,156,0.08);
  }
  .qno {
    display: inline-block;
    font-size: 12px; font-weight: 700; letter-spacing: 2px;
    color: #3b82f6;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 20px;
    padding: 3px 12px;
    margin-bottom: 14px;
  }
  .qtype { font-size: 11px; color: #6b7099; margin-left: 8px; letter-spacing: 1px; }
  .qtext {
    font-size: 22px; font-weight: 700;
    color: #fff;
    margin-bottom: 18px;
    letter-spacing: 1px;
    word-break: break-word;
  }
  .qopts { list-style: none; padding: 0; }
  .qopts li { margin-bottom: 8px; }
  .qopts label {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px; color: #c8cad8;
  }
  .qopts label:hover { border-color: rgba(59,130,246,0.4); background: rgba(59,130,246,0.05); }
  .qopts input[type=radio] { accent-color: #3b82f6; width: 18px; height: 18px; }
  .qopts input[type=radio]:checked + span { color: #3b82f6; font-weight: 600; }
  .qopts label.checked { border-color: #3b82f6; background: rgba(59,130,246,0.1); }

  .qblank {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
  }
  .qblank input {
    flex: 1;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 16px;
    color: #fff;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 6px;
    outline: none;
  }
  .qblank input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }

  /* 图片题（图形卷） */
  .qtext-img { max-width: 100%; max-height: 360px; border-radius: 6px; display: block; margin-bottom: 8px; }
  .qopts-img { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .qopts-img li { margin: 0; }
  .qopts-img label {
    flex-direction: column; align-items: stretch; gap: 6px;
    padding: 10px;
  }
  .qopts-img .qopt-img {
    width: 100%; max-height: 180px; object-fit: contain;
    border-radius: 4px;
  }

  .submit-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(5,7,26,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(59,130,246,0.2);
    padding: 16px 24px;
    z-index: 50;
  }
  .submit-inner {
    max-width: 1180px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
  }
  .answered-info { font-size: 13px; color: #a3a8c4; }
  .answered-info b { color: #3b82f6; font-weight: 700; }
  .submit-btn {
    padding: 12px 36px;
    font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: 3px;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59,130,246,0.4);
    transition: all 0.25s ease;
  }
  .submit-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(59,130,246,0.55); }
  .submit-btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

  .loading { color: #a3a8c4; text-align: center; padding: 60px 0; }
