:root {
  --bg-top: #eef6ff;
  --bg-bottom: #fff6eb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --line: #d6e3ed;
  --text: #183247;
  --muted: #627588;
  --primary: #116d8a;
  --primary-deep: #0a5369;
  --accent: #e9953c;
  --good: #1f8a55;
  --bad: #c95555;
  --shadow: 0 18px 40px rgba(17, 109, 138, 0.12);
  --sticky-top: 12px;
  --control-bar-height: 74px;
  --sticky-safe-offset: calc(var(--sticky-top) + var(--control-bar-height) + 18px);
}

html {
  scroll-padding-top: var(--sticky-safe-offset);
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(17, 109, 138, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(233, 149, 60, 0.2), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  -webkit-tap-highlight-color: rgba(17, 109, 138, 0.14);
}

button,
input,
select {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.page-shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.92fr);
  gap: 20px;
  margin-bottom: 20px;
}

.hero-copy,
.hero-panel,
.bank-tools-card,
.control-bar,
.score-board,
.paper-section {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.hero-copy {
  padding: 28px;
}

.eyebrow,
.panel-eyebrow,
.answer-sheet-eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

.hero-text,
.panel-text {
  margin: 16px 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.mobile-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(17, 109, 138, 0.08);
  border: 1px solid rgba(17, 109, 138, 0.12);
  color: var(--primary-deep);
  line-height: 1.7;
  font-size: 14px;
}

.hero-panel {
  padding: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 109, 138, 0.08), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(17, 109, 138, 0.12);
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.summary-value {
  font-size: 26px;
  font-weight: 700;
}

.summary-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  line-height: 1.7;
}

.bank-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.bank-tab {
  display: grid;
  gap: 8px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(17, 109, 138, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 28px rgba(17, 109, 138, 0.08);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.bank-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(17, 109, 138, 0.14);
}

.bank-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
}

.bank-tab-label {
  font-size: 15px;
  font-weight: 700;
}

.bank-tab-value {
  font-size: 32px;
  line-height: 1;
}

.bank-tab-text {
  font-size: 13px;
  line-height: 1.6;
  color: inherit;
  opacity: 0.9;
}

.control-bar {
  position: sticky;
  top: var(--sticky-top);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.control-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #eef6fb;
  border: 1px solid rgba(17, 109, 138, 0.12);
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-slider {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #bfd2de;
  transition: background 0.18s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(24, 50, 71, 0.16);
  transition: transform 0.18s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-text {
  font-weight: 700;
}

.primary-btn,
.secondary-btn,
.answer-btn,
.mini-tag {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.answer-btn:hover,
.mini-tag:hover {
  transform: translateY(-1px);
}

.primary-btn {
  padding: 11px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 12px 24px rgba(17, 109, 138, 0.25);
}

.secondary-btn,
.answer-btn {
  padding: 11px 18px;
  color: var(--text);
  background: #eef6fb;
  border: 1px solid rgba(17, 109, 138, 0.12);
}

.mini-tag {
  padding: 7px 12px;
  color: var(--text);
  background: #f1f6fb;
  border: 1px solid rgba(17, 109, 138, 0.14);
  font-size: 13px;
  font-weight: 700;
}

.mini-tag.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-color: transparent;
}

.mini-tag.danger.active {
  background: linear-gradient(135deg, #d46e41, #b33f35);
}

.bank-tools {
  margin-bottom: 18px;
}

.bank-tools-card {
  padding: 22px 24px;
}

.bank-tools-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.accuracy-banner {
  max-width: 380px;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(239, 245, 249, 0.9);
  border: 1px solid rgba(17, 109, 138, 0.12);
  color: var(--muted);
}

.accuracy-banner strong {
  color: var(--text);
}

.accuracy-banner.active {
  background: linear-gradient(180deg, rgba(17, 109, 138, 0.08), rgba(255, 255, 255, 0.94));
  color: var(--text);
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.utility-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 109, 138, 0.12);
  box-shadow: 0 10px 20px rgba(17, 109, 138, 0.06);
}

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

.utility-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.35;
}

.utility-kicker {
  display: inline-flex;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.utility-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(17, 109, 138, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.utility-badge.success {
  background: rgba(31, 138, 85, 0.12);
  color: var(--good);
}

.utility-badge.muted {
  background: rgba(98, 117, 136, 0.12);
  color: var(--muted);
}

.utility-text {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.cloud-auth-form,
.course-search-form {
  display: grid;
  gap: 12px;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.mode-switch input {
  margin: 0;
}

.cloud-status-strip {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(17, 109, 138, 0.12);
  background: rgba(17, 109, 138, 0.06);
}

.cloud-status-strip strong {
  font-size: 13px;
}

.cloud-status-strip span {
  color: var(--muted);
  line-height: 1.6;
}

.cloud-status-strip.active {
  background: rgba(17, 109, 138, 0.08);
}

.cloud-status-strip.success {
  background: rgba(31, 138, 85, 0.08);
  border-color: rgba(31, 138, 85, 0.16);
}

.cloud-status-strip.warning {
  background: rgba(201, 85, 85, 0.08);
  border-color: rgba(201, 85, 85, 0.16);
}

.cloud-status-strip.muted {
  background: rgba(98, 117, 136, 0.08);
  border-color: rgba(98, 117, 136, 0.14);
}

.cloud-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.cloud-stat-card {
  padding: 12px;
  border-radius: 16px;
  background: #f7fbfe;
  border: 1px solid rgba(17, 109, 138, 0.1);
}

.cloud-stat-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.cloud-stat-card span {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.course-search-empty {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(17, 109, 138, 0.2);
  background: #fbfdff;
  color: var(--muted);
  line-height: 1.7;
}

.course-search-results {
  display: grid;
  gap: 10px;
}

.course-search-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fbfdff;
  border: 1px solid rgba(17, 109, 138, 0.12);
}

.course-search-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.course-search-head strong {
  line-height: 1.5;
}

.course-search-snippet,
.course-search-meta {
  margin: 0;
  line-height: 1.75;
}

.course-search-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.info-pill {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 109, 138, 0.12);
}

.info-pill strong {
  display: block;
  margin-bottom: 8px;
}

.info-pill span {
  color: var(--muted);
  line-height: 1.6;
}

.filter-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.field-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.field-label input,
.field-label select {
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(17, 109, 138, 0.14);
  background: #fff;
  color: var(--text);
}

.filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filter-foot {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.pager-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.score-board {
  margin-bottom: 18px;
  padding: 22px 24px;
}

.score-empty {
  color: var(--muted);
  line-height: 1.7;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.score-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(233, 149, 60, 0.1), rgba(255, 255, 255, 0.96));
  border: 1px solid rgba(233, 149, 60, 0.12);
}

.score-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.score-card span {
  font-size: 28px;
  font-weight: 700;
}

.score-hint {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.paper-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.paper-main {
  display: grid;
  gap: 20px;
}

.paper-section {
  padding: 20px;
  scroll-margin-top: var(--sticky-safe-offset);
}

.answer-sheet {
  position: sticky;
  top: calc(var(--sticky-safe-offset) + 2px);
}

.answer-sheet-card {
  padding: 20px;
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

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

.answer-sheet-head h3 {
  margin: 0;
  font-size: 22px;
}

.answer-sheet-count {
  min-width: 66px;
  padding: 8px 10px;
  border-radius: 14px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #d57a17);
}

.answer-sheet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.answer-sheet-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.default {
  background: #8ca1b3;
}

.legend-dot.answered {
  background: #137c9d;
}

.legend-dot.correct {
  background: rgba(31, 138, 85, 0.82);
}

.legend-dot.wrong {
  background: rgba(201, 85, 85, 0.82);
}

.sheet-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.sheet-meta-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 109, 138, 0.1);
}

.sheet-meta-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.sheet-meta-card span {
  font-weight: 700;
}

.answer-sheet-section + .answer-sheet-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.answer-sheet-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.answer-sheet-section-head h4 {
  margin: 0;
  font-size: 18px;
}

.answer-sheet-section-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.answer-sheet-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.sheet-question-btn {
  min-height: 42px;
  border: 1px solid #a9bbc8;
  border-radius: 14px;
  background: #e4ebf1;
  color: #425564;
  font-weight: 700;
}

.sheet-question-btn:hover {
  border-color: #6f8798;
  box-shadow: 0 8px 16px rgba(66, 85, 100, 0.12);
}

.sheet-question-btn.answered {
  color: #fff;
  background: linear-gradient(135deg, #1c95b8, #116d8a);
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(17, 109, 138, 0.2);
}

.sheet-question-btn.correct {
  background: rgba(31, 138, 85, 0.14);
  border-color: rgba(31, 138, 85, 0.32);
  color: var(--good);
}

.sheet-question-btn.wrong {
  background: rgba(201, 85, 85, 0.12);
  border-color: rgba(201, 85, 85, 0.26);
  color: var(--bad);
}

.sheet-question-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(17, 109, 138, 0.24);
}

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

.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.section-meta {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef6fb;
  color: var(--primary);
  font-weight: 700;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 18px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  scroll-margin-top: var(--sticky-safe-offset);
}

.question-card.is-correct {
  border-color: rgba(31, 138, 85, 0.35);
  box-shadow: 0 0 0 1px rgba(31, 138, 85, 0.15) inset;
}

.question-card.is-wrong {
  border-color: rgba(201, 85, 85, 0.35);
  box-shadow: 0 0 0 1px rgba(201, 85, 85, 0.12) inset;
}

.question-card.is-focused {
  box-shadow: 0 0 0 2px rgba(17, 109, 138, 0.2), 0 18px 40px rgba(17, 109, 138, 0.12);
}

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

.question-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 700;
}

.question-head-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.type-badge,
.state-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.type-badge.single {
  color: #0d5f7e;
  background: rgba(17, 109, 138, 0.1);
}

.type-badge.multiple {
  color: #9b5d11;
  background: rgba(233, 149, 60, 0.16);
}

.state-badge.correct {
  color: var(--good);
  background: rgba(31, 138, 85, 0.12);
}

.state-badge.wrong {
  color: var(--bad);
  background: rgba(201, 85, 85, 0.12);
}

.question-stem {
  margin: 0 0 14px;
  line-height: 1.75;
  font-weight: 600;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.choice-item.user-selected {
  border-color: rgba(17, 109, 138, 0.35);
  background: rgba(17, 109, 138, 0.08);
}

.choice-item.correct-answer {
  border-color: rgba(31, 138, 85, 0.36);
  background: rgba(31, 138, 85, 0.08);
}

.choice-item.wrong-answer {
  border-color: rgba(201, 85, 85, 0.28);
  background: rgba(201, 85, 85, 0.06);
}

.choice-item input {
  margin-top: 3px;
}

.choice-label {
  min-width: 28px;
  color: var(--primary);
  font-weight: 700;
}

.choice-content {
  flex: 1;
  line-height: 1.65;
}

.question-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.question-actions.source-hidden {
  justify-content: flex-end;
}

.question-meta {
  display: grid;
  gap: 8px;
}

.question-source {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.answer-panel {
  display: none;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: #f6fbff;
  border: 1px dashed rgba(17, 109, 138, 0.3);
}

.answer-panel.visible {
  display: block;
}

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

.answer-summary-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(17, 109, 138, 0.12);
  box-shadow: 0 8px 18px rgba(17, 109, 138, 0.05);
}

.answer-summary-card.correct {
  background: linear-gradient(180deg, rgba(17, 109, 138, 0.08), #ffffff);
}

.answer-summary-card.success {
  background: linear-gradient(180deg, rgba(31, 138, 85, 0.08), #ffffff);
  border-color: rgba(31, 138, 85, 0.18);
}

.answer-summary-card.warning,
.answer-summary-card.alert {
  background: linear-gradient(180deg, rgba(201, 85, 85, 0.08), #ffffff);
  border-color: rgba(201, 85, 85, 0.18);
}

.answer-summary-label {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(17, 109, 138, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.answer-summary-value {
  margin: 0;
  line-height: 1.75;
  font-weight: 600;
}

.explanation-stack {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.explanation-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-top: 12px;
  border-top: 1px dashed rgba(17, 109, 138, 0.18);
}

.explanation-head strong {
  display: block;
  margin-bottom: 4px;
}

.explanation-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.explanation-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(17, 109, 138, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.knowledge-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(17, 109, 138, 0.12);
  box-shadow: 0 10px 20px rgba(17, 109, 138, 0.05);
}

.knowledge-card.muted {
  background: #fbfdff;
  border-style: dashed;
}

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

.knowledge-title-wrap {
  display: grid;
  gap: 6px;
}

.knowledge-head strong {
  font-size: 16px;
  line-height: 1.4;
}

.knowledge-kind,
.knowledge-source-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-kind {
  background: rgba(17, 109, 138, 0.1);
  color: var(--primary);
}

.knowledge-source-badge {
  background: rgba(233, 149, 60, 0.12);
  color: #8f5811;
}

.knowledge-summary {
  margin: 0;
  color: var(--text);
  line-height: 1.8;
}

.knowledge-mnemonic {
  margin: 0;
  color: var(--text);
  line-height: 1.75;
  font-weight: 600;
}

.knowledge-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}

.knowledge-list.compact {
  margin-top: 8px;
}

.knowledge-list li + li {
  margin-top: 8px;
}

.knowledge-mnemonic-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(17, 109, 138, 0.18);
  display: grid;
  gap: 8px;
}

.course-evidence {
  border-left: 4px solid rgba(17, 109, 138, 0.72);
}

.strategy-card {
  border-left: 4px solid rgba(233, 149, 60, 0.72);
}

.structure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.structure-block {
  padding: 14px;
  border-radius: 16px;
  background: #fbfdff;
  border: 1px solid rgba(17, 109, 138, 0.1);
}

.structure-title {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.focus-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.focus-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(17, 109, 138, 0.08);
  border: 1px solid rgba(17, 109, 138, 0.12);
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 700;
}

.course-summary {
  font-size: 15px;
  font-weight: 600;
}

.evidence-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(17, 109, 138, 0.18);
}

.evidence-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef6fb;
  border: 1px solid rgba(17, 109, 138, 0.12);
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.evidence-snippet {
  margin: 0;
  line-height: 1.8;
  color: var(--text);
}

.raw-analysis {
  border-left: 4px solid rgba(233, 149, 60, 0.72);
}

.empty-state,
.list-empty {
  padding: 26px 18px;
  border-radius: 20px;
  border: 1px dashed rgba(17, 109, 138, 0.24);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.empty-state.compact {
  padding: 12px;
}

.empty-state h3,
.list-empty h3 {
  margin: 0 0 8px;
  color: var(--text);
}

.empty-state p,
.list-empty p {
  margin: 0;
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .hero,
  .paper-wrap {
    grid-template-columns: 1fr;
  }

  .bank-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answer-sheet {
    position: static;
    order: -1;
  }

  .filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .utility-grid,
  .structure-grid,
  .cloud-stat-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  :root {
    --sticky-top: 10px;
  }

  .control-bar {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: auto !important;
  }

  .control-bar,
  .bank-tools-head,
  .utility-head,
  .course-search-head,
  .question-head,
  .question-actions,
  .filter-foot,
  .explanation-head,
  .knowledge-head {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-grid,
  .score-grid,
  .info-strip,
  .utility-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --sticky-top: 8px;
    --sticky-safe-offset: calc(var(--sticky-top) + 18px);
  }

  .page-shell {
    width: min(100vw - 18px, 1220px);
    margin: 10px auto 28px;
  }

  .hero-copy,
  .hero-panel,
  .bank-tools-card,
  .paper-section,
  .score-board {
    border-radius: 20px;
  }

  .bank-switcher,
  .summary-grid,
  .score-grid,
  .info-strip,
  .utility-grid,
  .filter-form,
  .sheet-meta-grid,
  .structure-grid,
  .cloud-stat-grid {
    grid-template-columns: 1fr;
  }

  .answer-sheet-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .control-bar {
    gap: 10px;
    padding: 12px;
    margin-bottom: 18px;
  }

  .control-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .control-group:nth-child(2) {
    grid-template-columns: 1fr;
  }

  .toggle-switch {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
  }

  .toggle-text {
    flex: 1;
    min-width: 0;
    font-size: 14px;
  }

  .primary-btn,
  .secondary-btn,
  .answer-btn {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    align-items: center;
  }
}
