/* ==========================================================================
   Province Practice v2 - Modern Lumina Studio Style
   Clean typography, balanced layout hierarchy, fluid animations & micro-interactions
   ========================================================================== */

:root {
  /* Canvas & Background Surfaces */
  --bg-page: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8faff;
  --bg-active: #edf2f7;

  /* Line & Borders */
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --line-focus: #93c5fd;

  /* Text & Typography */
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --subtle: #94a3b8;

  /* Primary Brand (Sapphire / Royal Indigo) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --primary-glow: rgba(37, 99, 235, 0.15);

  /* Feedback Colors */
  --green: #10b981;
  --green-bg: #ecfdf5;
  --green-border: #a7f3d0;
  --green-text: #047857;
  --green-2: #d1fae5;

  --red: #ef4444;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --red-text: #b91c1c;

  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --amber-text: #b45309;

  /* Legacy aliases for compatibility */
  --blue: var(--primary);
  --blue-light: var(--primary-light);
  --paper: #ffffff;
  --surface: #ffffff;
  --wash: #f8fafc;
  --canvas: var(--bg-page);
  --border: var(--line);
  --accent: #38bdf8;
  --navy: #0f172a;

  /* Geometric Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Studio Shadow Elevations */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 24px -4px rgba(15, 23, 42, 0.09), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow: var(--shadow-sm);
  --shadow-elevated: 0 20px 40px -6px rgba(15, 23, 42, 0.14);

  /* Typography Stack */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

button, select, input {
  font: inherit;
}

button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: transparent;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.16s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Skip Navigation */
.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 1000;
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.skip:focus {
  top: 14px;
}

/* ==========================================================================
   Full-Height Clean Studio Sidebar
   ========================================================================== */
.app {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  color: var(--ink);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--line-light);
  margin-bottom: 14px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}
.brand span {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.brand small {
  margin-top: 1px;
  color: var(--subtle);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.sidebar-caption {
  margin: 6px 10px 8px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 9px 12px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 550;
  transition: all 0.16s ease;
}
.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--ink);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
}
.nav-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.85;
}
.nav-item.active .nav-icon {
  opacity: 1;
}
.nav-icon svg {
  display: block;
}
.nav-count {
  margin-left: auto;
  min-width: 22px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--muted);
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  font-family: var(--font-mono);
}
.nav-item.active .nav-count {
  background: var(--primary-border);
  color: var(--primary);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--line-light);
}
.local-label {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.local-icon {
  color: var(--primary);
  margin-right: 6px;
  display: flex;
  align-items: center;
}
.sidebar-bottom p {
  margin: 4px 0 10px;
  color: var(--subtle);
  font-size: 11.5px;
  line-height: 1.45;
}
.library-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}

/* ==========================================================================
   Workspace Shell
   ========================================================================== */
.workspace {
  margin-left: 240px;
  width: calc(100% - 240px);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Minimalist Clean Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 54px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.breadcrumb {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.breadcrumb span {
  margin: 0 6px;
  opacity: 0.35;
}
.breadcrumb strong {
  color: var(--ink);
  font-weight: 650;
}

.account-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  background: var(--bg-subtle);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-light);
  cursor: pointer;
  transition: all 0.16s ease;
}
.sync-state:hover {
  background: #e2e8f0;
  color: var(--ink);
}
.sync-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
}
.sync-state.error {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}
.sync-state.error::before {
  background: var(--red);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

/* Main Content Area */
main {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 18px 32px 60px;
}

/* ==========================================================================
   Page Heading & Stats Strip
   ========================================================================== */
.heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 16px;
}
.eyebrow {
  display: none;
}
h1, .paper-title, .result-card h2, .empty h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.heading p:not(.eyebrow) {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Sleek Pill Metric Badges */
.heading-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.heading-stats > div {
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.heading-stats > div:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.heading-stats strong {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
  font-weight: 700;
}
.heading-stats span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.stat-total {
  background: var(--primary-light) !important;
  border-color: var(--primary-border) !important;
}
.stat-total strong, #stat-usable {
  color: var(--primary) !important;
}
.stat-total span {
  color: var(--primary) !important;
}

/* Notice & Alert */
.notice {
  margin-bottom: 14px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  color: #1e40af;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: var(--shadow-xs);
}
.notice.warning {
  background: var(--amber-bg);
  border-left-color: var(--amber);
  color: var(--amber-text);
}
.notice strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 650;
}
.notice p {
  margin: 0;
}

/* ==========================================================================
   Filter Panel (Completely Solves "排版别扭" Issue!)
   Balanced two-tiered layout: Segmented Tabs on Top, Granular Selects Below
   ========================================================================== */
.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease;
}
.filter-panel:hover {
  box-shadow: var(--shadow-sm);
}

.filter-panel > summary, .question-jump > summary {
  display: none;
}

.filter-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Segmented Control for Groups */
.group-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 3px;
  padding: 3px;
  background: var(--bg-subtle);
  border-radius: 9px;
  border: 1px solid var(--line-light);
}
.group-tab {
  border-radius: 7px;
  padding: 6px 14px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.group-tab:hover {
  color: var(--ink);
}
.group-tab.active {
  background: #ffffff;
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Granular Dropdown Selects */
.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--line-light);
}
.filter-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
select {
  height: 34px;
  min-width: 110px;
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background-color: #ffffff;
  padding: 0 28px 0 10px;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  text-overflow: ellipsis;
  white-space: nowrap;
}
select:hover {
  border-color: #cbd5e1;
}
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Context Strip */
.filter-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 2px 12px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 13px;
}
.filter-summary strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 650;
}
.filter-summary strong::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.filter-summary strong span {
  font-weight: 400;
  color: var(--muted);
}
.filter-summary > span {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 650;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Study Workspace Layout (Question Left, Sticky Inspector Right)
   ========================================================================== */
.study-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 18px;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

/* ==========================================================================
   Question Card (Core Practice Workspace)
   ========================================================================== */
.question-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.question-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-xs);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 3px 9px;
  font-weight: 650;
  font-size: 11.5px;
  letter-spacing: 0.01em;
}
.tag.muted {
  background: var(--bg-subtle);
  color: var(--muted);
  border-color: var(--line-light);
  font-weight: 500;
}

/* Bookmark Button with Star Glow */
.bookmark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--muted);
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}
.bookmark:hover {
  border-color: #cbd5e1;
  color: var(--ink);
  transform: scale(1.06);
}
.bookmark.saved {
  background: #fefce8;
  color: #ca8a04;
  border-color: #fde047;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  animation: starPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes starPop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.question-content {
  padding: 18px 24px 12px;
}

/* Question Title & Stem */
.question-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.question-number {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}
.stem {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.75;
  font-weight: 500;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  letter-spacing: 0.005em;
}

/* Code Block in Stem */
.stem.code-text {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  background: #0f172a;
  color: #f8fafc;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid #1e293b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.question-context {
  margin: 0 0 16px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border-left: 3px solid #94a3b8;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ==========================================================================
   Question Options (Tactile, Responsive, Clear Feedback)
   ========================================================================== */
.options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 20px;
}
.option {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  text-align: left;
  line-height: 1.6;
  font-size: 14.5px;
  color: var(--ink);
  min-height: 50px;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}
.option:hover:not(:disabled) {
  border-color: #93c5fd;
  background: var(--bg-hover);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.06);
}
.option:active:not(:disabled) {
  background: #eff6ff;
}
.option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1.5px var(--primary);
}
.option.correct {
  border-color: var(--green);
  background: var(--green-bg);
  box-shadow: 0 0 0 1.5px var(--green);
}
.option.incorrect {
  border-color: var(--red);
  background: var(--red-bg);
  box-shadow: 0 0 0 1.5px var(--red);
}
.option:disabled {
  opacity: 1;
}

/* Option Letter Badge */
.option-key {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
  background: var(--bg-subtle);
  color: #475569;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 1px;
  transition: all 0.16s ease;
}
.option.selected .option-key {
  background: var(--primary);
  color: #ffffff;
}
.option.correct .option-key {
  background: var(--green);
  color: #ffffff;
}
.option.incorrect .option-key {
  background: var(--red);
  color: #ffffff;
}
.option-text {
  min-width: 0;
  flex: 1;
  padding-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.option-img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 6px;
  display: block;
  margin: 2px 0;
  object-fit: contain;
}
.code-text {
  font-family: var(--font-mono);
  font-size: 13px;
}
.question-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ==========================================================================
   Answer and Review Panel
   ========================================================================== */
.answer-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-xs);
  animation: slideFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.answer-panel.match {
  background: var(--green-bg);
  border-left-color: var(--green);
}
.answer-panel.mismatch {
  background: var(--red-bg);
  border-left-color: var(--red);
}
.answer-panel strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 700;
}
.answer-panel.match strong {
  color: var(--green-text);
}
.answer-panel.mismatch strong {
  color: var(--red-text);
}
.answer-panel p {
  margin: 4px 0;
  font-size: 13.5px;
}
.answer-note {
  color: var(--muted) !important;
  font-size: 12px !important;
  margin-top: 6px !important;
}

/* ==========================================================================
   Question Action Bar (Integrated Seamless Footer, No Nested Box!)
   ========================================================================== */
.question-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 16px 24px 20px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line-light);
  background: transparent;
}
.action-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Button Styles */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.button:active:not(:disabled) {
  transform: scale(0.98);
}
.button.primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}
.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.36);
  transform: translateY(-1px);
}
.button.secondary {
  border-color: var(--line);
  background: #ffffff;
  color: #334155;
  box-shadow: var(--shadow-xs);
}
.button.secondary:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: var(--bg-hover);
  color: var(--ink);
  transform: translateY(-1px);
}
.button.text {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
}
.button.text:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--ink);
}
.button.small {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 12px;
}

/* ==========================================================================
   Right-Side Question Inspector / Progress Card
   ========================================================================== */
.study-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-card {
  position: sticky;
  top: 70px;
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}
.progress-top {
  display: block;
}
.card-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}
.card-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
}
.progress-num {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
  margin-top: 10px;
  color: var(--ink);
}
.progress-num small {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
}
.progress-track {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: #e2e8f0;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}
.progress-caption span:last-child {
  font-family: var(--font-mono);
  font-weight: 650;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* Question Map Matrix (答题卡数字矩阵 - 清爽通风、无形变畸变) */
.question-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  max-height: 310px;
  margin-top: 14px;
  overflow-y: auto;
  padding: 4px 6px 4px 2px;
}
.map-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  position: relative;
}
.map-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ink);
}

/* Current active item: Razor-sharp focus frame, no distorted scaling */
.map-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
  z-index: 2;
}
.map-btn.active::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 11px;
  border: 2px solid var(--primary);
  pointer-events: none;
}

.map-btn.match {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.map-btn.match:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.map-btn.mismatch {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.map-btn.mismatch:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.map-btn.staged {
  background: var(--primary-light);
  color: #1e40af;
  border: 1px solid var(--primary-border);
}

.map-btn.view-only {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.map-btn.view-only:hover {
  background: #fef3c7;
}
.map-btn.view-only.active {
  background: #d97706 !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
}
.map-btn.view-only.active::after {
  border-color: #d97706;
}

/* Modernized Legend Chips */
.map-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-light);
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  font-size: 11.5px;
  font-weight: 550;
  color: #475569;
}
.map-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94a3b8;
  box-shadow: 0 0 0 2px #e2e8f0;
}
.map-legend i.green {
  background: #10b981;
  box-shadow: 0 0 0 2px #d1fae5;
}
.map-legend i.red {
  background: #ef4444;
  box-shadow: 0 0 0 2px #fee2e2;
}
.map-legend i.amber {
  background: #f59e0b;
  box-shadow: 0 0 0 2px #fef3c7;
}

.side-note {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.side-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-weight: 650;
}

/* ==========================================================================
   Empty States
   ========================================================================== */
.empty {
  padding: 60px 24px;
  text-align: center;
}
.empty-symbol {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}
.empty h2 {
  font-size: 20px;
}
.empty p {
  max-width: 420px;
  margin: 8px auto 20px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ==========================================================================
   Exam Mode & Results
   ========================================================================== */
.exam-setup, .result-card {
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.exam-info, .result-stats, .coverage-intro {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.exam-info div, .result-stats div, .coverage-stat {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
}
.exam-info strong, .result-stats strong, .coverage-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.exam-info span, .result-stats span, .coverage-stat span, .coverage-stat small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
  display: block;
}

.exam-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #ffffff;
  box-shadow: var(--shadow-md);
}
.timer {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
}
.exam-banner .button {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
}
.exam-banner .button:hover {
  background: #7dd3fc;
}

/* ==========================================================================
   Coverage View (题库与待补资料)
   ========================================================================== */
.paper-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.paper-card {
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.paper-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.paper-card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 700;
}
.paper-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}
.paper-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.section-label {
  margin: 28px 0 12px;
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
}
.quarantine-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quarantine-item {
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}
.quarantine-item summary {
  padding: 14px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.quarantine-item summary span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.quarantine-body {
  padding-bottom: 18px;
}
.quarantine-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  font-family: inherit;
  font-size: 13px;
}
.reason {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: var(--amber-bg);
  color: var(--amber-text);
  font-size: 12.5px;
  font-weight: 550;
}

/* ==========================================================================
   Source Figures and Materials
   ========================================================================== */
.source-materials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}
.source-link {
  margin: 4px 0;
}
.source-figure {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}
.source-figure img {
  display: block;
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: var(--radius-xs);
}
.source-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.ready-count {
  color: var(--primary);
}

/* ==========================================================================
   Footer & Toast Notification
   ========================================================================== */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  color: var(--subtle);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  max-width: 60vw;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  background: #0f172a;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.96);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ==========================================================================
   Confirmation Dialog
   ========================================================================== */
dialog {
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  border: 0;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-elevated);
}
dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
dialog h2 {
  margin: 12px 0 6px;
  font-size: 19px;
  font-weight: 700;
}
dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.dialog-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.hidden, [hidden] {
  display: none !important;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media(max-width: 1180px) {
  .study-layout {
    grid-template-columns: 1fr;
  }
  .progress-card {
    position: static;
  }
}

@media(max-width: 900px) {
  .sidebar {
    width: 68px;
    padding: 14px 8px;
  }
  .brand > span:not(.brand-mark), .sidebar-caption, .sidebar-bottom, .nav-count {
    display: none;
  }
  .brand, .nav-item {
    justify-content: center;
  }
  .nav-item {
    font-size: 0;
    padding: 12px;
  }
  .nav-icon {
    width: 20px;
    height: 20px;
    margin: 0;
  }
  .workspace {
    margin-left: 68px;
    width: calc(100% - 68px);
  }
}

@media(max-width: 720px) {
  html {
    scroll-padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .app, .workspace, main, #content, .study-layout, .study-side {
    min-width: 0;
  }
  .sidebar {
    inset: auto 0 0;
    width: 100%;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    border-radius: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
  }
  .brand, .sidebar-caption, .sidebar-bottom {
    display: none;
  }
  .nav {
    flex-direction: row;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-around;
  }
  .nav-item {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    color: var(--muted);
    padding: 4px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 48px;
  }
  .nav-item.active {
    background: transparent;
    color: var(--primary);
  }
  .nav-icon {
    width: 18px;
    height: 18px;
    margin: 0;
  }
  .nav-icon svg {
    width: 18px;
    height: 18px;
  }
  .workspace {
    margin: 0 0 calc(64px + env(safe-area-inset-bottom, 0px));
    width: 100%;
  }
  .topbar {
    height: 50px;
    padding: 0 14px;
    gap: 8px;
  }
  .breadcrumb {
    flex: 1;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .breadcrumb-root {
    display: none;
  }
  .account-top {
    gap: 6px;
    flex-shrink: 0;
  }
  .sync-state {
    max-width: 125px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    padding: 3px 8px;
  }
  .account-top .button {
    display: block;
    min-height: 44px;
    max-width: 124px;
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }
  main {
    padding: 14px 14px 24px;
  }
  h1 {
    font-size: 18px;
  }
  .heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .heading .eyebrow, .heading #page-description {
    display: none;
  }
  .heading-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .heading-stats::-webkit-scrollbar {
    display: none;
  }
  .heading-stats > div {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 9px 10px;
  }
  .heading-stats span {
    font-size: 10.5px;
  }
  .filter-panel {
    display: block;
    padding: 0;
  }
  .filter-panel > summary, .question-jump > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 12px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
  }
  .filter-panel > summary::-webkit-details-marker, .question-jump > summary::-webkit-details-marker {
    display: none;
  }
  .filter-toggle-label, .question-jump > summary span {
    color: var(--primary);
    font-size: 12px;
  }
  .filter-toggle-label::after {
    content: "展开";
  }
  .filter-panel[open] .filter-toggle-label::after {
    content: "收起";
    font-size: 12px;
  }
  .filter-fields {
    padding: 0 12px 12px;
    gap: 10px;
  }
  .filter-panel:not([open]) > .filter-fields {
    display: none;
  }
  .group-tabs {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .filter-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    align-items: stretch;
    border-top: 1px solid var(--line-light);
    padding-top: 8px;
  }
  .filter-row label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    font-size: 11px;
    width: 100%;
  }
  select {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 44px;
    font-size: 16px;
  }
  .paper-grid, .coverage-intro, .exam-info, .result-stats {
    grid-template-columns: 1fr;
  }
  .question-card {
    padding: 0;
  }
  .question-head {
    padding: 12px 14px 0;
    gap: 8px;
  }
  .question-head .tags {
    min-width: 0;
    flex: 1;
  }
  .bookmark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  .question-content {
    padding: 12px 14px;
  }
  .question-title {
    gap: 8px;
  }
  .filter-summary {
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
  }
  .filter-summary strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .filter-summary strong::before {
    display: none;
  }
  .filter-summary strong span {
    display: block;
    margin-top: 2px;
  }
  .filter-summary > span {
    flex-shrink: 0;
    padding: 3px 7px;
  }
  .question-number {
    font-size: 17px;
  }
  .stem {
    font-size: 16px;
  }
  .stem.code-text {
    padding: 10px 12px;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre;
    overflow-wrap: normal;
  }
  .option {
    padding: 12px;
    font-size: 15px;
    gap: 10px;
  }
  .question-actions {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 4px 14px 14px;
    padding-top: 12px;
  }
  .question-actions .button {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    font-size: 12px;
    white-space: nowrap;
  }
  .action-group {
    min-width: 0;
    flex: 2;
    display: flex;
    gap: 8px;
  }
  .question-map {
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    gap: 5px;
    max-height: 260px;
  }
  .map-btn {
    min-height: 40px;
    aspect-ratio: auto;
    font-size: 12px;
  }
  .progress-card {
    position: static;
    padding: 14px;
  }
  .question-jump {
    margin-top: 12px;
    border-top: 1px solid var(--line);
  }
  .question-jump > summary {
    padding: 12px 0 0;
  }
  .side-note {
    display: none;
  }
  .source-materials {
    flex-wrap: wrap;
    gap: 6px;
  }
  .source-materials .button {
    font-size: 11.5px;
    min-height: 44px;
    max-width: 100%;
    padding: 8px;
    overflow-wrap: anywhere;
  }
  .source-figure {
    padding: 6px;
  }
  .exam-banner {
    flex-wrap: wrap;
    gap: 8px;
  }
  .student-paper {
    gap: 12px;
    flex-wrap: wrap;
  }
  .footer {
    display: none;
  }
}

@media(max-width: 420px) {
  .sync-state {
    max-width: 85px;
  }
  .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Focused study layout; keep the existing blue, white and slate palette. */
main { max-width: 1480px; width: 100%; margin: 0 auto; }
.heading { margin-bottom: 24px; }
.heading-stats > div { border-radius: 12px; box-shadow: var(--shadow-xs); }
.filter-panel { border-radius: 14px; box-shadow: var(--shadow-xs); }
.card { border-radius: 16px; }
.question-card { box-shadow: var(--shadow-md); }
.question-title { line-height: 1.85; }
.options { gap: 10px; }
.option { border-radius: 12px; min-height: 54px; }
.option:hover:not(:disabled) { box-shadow: var(--shadow-xs); }
.question-actions { border-top-color: var(--line-light); }
.question-tools { margin-top: 16px; border-top: 1px solid var(--line-light); font-size: 12px; color: var(--muted); }
.question-tools summary { padding: 8px 0; min-height: 36px; cursor: pointer; width: fit-content; }
.question-tools .button { margin-bottom: 8px; min-height: 40px; }
.answer-comparison { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.explanation { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text); }
.explanation h3 { margin: 0 0 8px; font-size: 13px; }
.answer-option { display: flex; gap: 10px; padding: 8px 0; font-size: 13px; }
.answer-option-text { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.answer-option b { color: var(--primary); }
.concept-note { margin-top: 12px; padding: 12px; background: var(--bg-card); border-radius: 10px; border: 1px solid var(--line); }
.concept-note strong { font-size: 13px; color: var(--ink) !important; }
.concept-note p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.concept-note a { display: inline-block; color: var(--primary); font-size: 12px; margin-top: 6px; }
.progress-stats-link { width: 100%; min-height: 44px; display: flex; justify-content: space-between; align-items: center; padding: 12px 0 0; margin-top: 12px; border-top: 1px solid var(--line); color: var(--primary); font-size: 12px; font-weight: 600; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 30px; border-bottom: 1px solid var(--line); background: var(--bg-hover); }
.panel-heading h2 { margin: 5px 0; font-size: 24px; letter-spacing: -.5px; color: var(--ink); }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.panel-eyebrow { font-size: 11px; color: var(--primary); font-weight: 600; }
.panel-body { padding: 28px 30px; }
.metric-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.metric-grid > div { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-page); min-width: 0; }
.metric-grid span { color: var(--muted); font-size: 12px; }
.metric-grid strong { display: block; font-size: 34px; font-weight: 750; line-height: 1.3; color: var(--ink); margin: 10px 0; }
.metric-grid small { color: var(--subtle); font-size: 11px; }
.learning-section { margin-top: 28px; }
.learning-section h3 { color: var(--ink); margin: 0; font-size: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-head > span { color: var(--muted); font-size: 11px; }
.trend-chart { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 12px; padding: 20px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-page); }
.trend-day { min-width: 0; text-align: center; font-size: 12px; color: var(--muted); }
.trend-day > span { font-size: 12px; color: var(--ink); }
.bar-track { height: 100px; display: flex; align-items: flex-end; justify-content: center; margin: 12px 0 8px; border-bottom: 1px solid var(--line); }
.bar-fill { width: min(32px,80%); background: var(--primary); border-radius: 6px 6px 0 0; }
.trend-day small { font-size: 11px; }
.chapter-list,.repeat-list { display: grid; gap: 10px; }
.chapter-row,.repeat-row { display: flex; width: 100%; text-align: left; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-card); }
.chapter-row:hover,.repeat-row:hover { background: var(--bg-hover); border-color: var(--primary-border); }
.chapter-row > div,.repeat-row > div { flex: 1; min-width: 0; }
.chapter-row strong,.repeat-row strong { display: block; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.chapter-row small,.repeat-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.chapter-row > b { color: var(--primary); white-space: nowrap; font-size: 14px; }
.chapter-row > b span { margin-left: 10px; color: var(--muted); }
.chapter-track { height: 4px; background: var(--bg-subtle); border-radius: 8px; margin-top: 10px; overflow: hidden; }
.chapter-track span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.repeat-count { flex-shrink: 0; display: block; width: 48px; text-align: center; font-size: 22px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 6px; border-radius: 10px; }
.repeat-count small { font-size: 9px; font-weight: 400; }
.empty-inline,.loading-note { padding: 20px 0; color: var(--muted); font-size: 13px; }
.request-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.request-row strong,.request-row small { display: block; overflow-wrap: anywhere; }
.request-row small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.report-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-top: 12px; font-size: 13px; }
.report-card blockquote { margin: 12px 0; padding: 12px; background: var(--bg-subtle); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.report-actions small { color: var(--muted); flex: 1 1 100%; }
.detail-actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
@media(max-width:720px) {
  .heading { gap: 14px; margin-bottom: 16px; }
  .card { border-radius: 14px; }
  .question-head { padding: 14px 16px 0; }
  .question-content { padding: 12px 16px; }
  .question-title { line-height: 1.8; }
  .option { border-radius: 11px; min-height: 54px; }
  .question-actions { margin: 4px 16px 16px; }
  .answer-panel { padding: 14px; }
  .panel-heading { padding: 18px 16px; align-items: flex-start; }
  .panel-heading h2 { font-size: 21px; }
  .panel-heading p { font-size: 12px; }
  .panel-heading .button { flex-shrink: 0; min-height: 40px; }
  .panel-body { padding: 18px 16px; }
  .metric-grid { gap: 6px; }
  .metric-grid > div { padding: 12px 8px; border-radius: 10px; }
  .metric-grid span { font-size: 10px; }
  .metric-grid strong { font-size: 27px; margin: 8px 0 4px; }
  .metric-grid small { display: none; }
  .section-head { gap: 8px; align-items: flex-start; }
  .section-head > span { max-width: 48%; text-align: right; }
  .learning-section { margin-top: 24px; }
  .learning-section h3 { font-size: 15px; }
  .trend-chart { gap: 4px; padding: 16px 6px 10px; }
  .trend-day small { font-size: 10px; }
  .chapter-row,.repeat-row { padding: 12px; gap: 10px; }
  .chapter-row > b { font-size: 12px; }
  .chapter-row > b span { margin-left: 4px; }
  .repeat-count { width: 40px; font-size: 20px; }
  .report-card { padding: 12px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

