/* === 高中数学 · 共享样式 === */
/* Tufte-inspired: clean typography, generous whitespace, print-friendly */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #fdfdfd;
  --accent: #2c5f8a;
  --accent-light: #e8f0f8;
  --border: #ddd;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --radius: 6px;
  --font-body: "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  --measure: 42rem;
}

html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* --- Typography --- */
h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.15em;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.3em;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.2em;
}

p {
  margin-bottom: 0.7em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* --- Navigation Cards --- */
.grade-list, .topic-list, .lesson-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  margin: 1rem 0;
}

.grade-card, .topic-card, .lesson-card {
  display: block;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.grade-card:hover, .topic-card:hover, .lesson-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.grade-card h2, .topic-card h2, .lesson-card h2 {
  margin: 0 0 0.15em;
  font-size: 1.1rem;
}

.grade-card p, .topic-card p, .lesson-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lesson-card.disabled, .topic-card.disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

/* --- Content Elements --- */
.definition {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1rem;
  margin: 1.2rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.definition .label {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.3em;
}

.theorem {
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  margin: 1.2rem 0;
  border-radius: var(--radius);
}

.theorem .label {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3em;
}

.example {
  margin: 1.2rem 0;
}

.example .label {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3em;
}

.warning {
  background: #fef9e7;
  border-left: 3px solid #d4a017;
  padding: 0.7rem 1rem;
  margin: 1.2rem 0;
  font-size: 0.9rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note {
  background: #f4f4f4;
  padding: 0.7rem 1rem;
  margin: 1.2rem 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
}

/* --- Quiz --- */
.quiz {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}

.quiz .question {
  margin-bottom: 0.8rem;
}

.quiz .options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quiz .option {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  background: white;
  transition: background 0.1s, border-color 0.1s;
}

.quiz .option:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.quiz .option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.quiz .option.correct {
  border-color: #2d8a4e;
  background: #e6f4ea;
}

.quiz .option.incorrect {
  border-color: #c0392b;
  background: #fdecea;
}

.quiz .feedback {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  min-height: 1.5em;
}

/* --- Math --- */
.math {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

.math-block {
  display: block;
  text-align: center;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 1.05em;
}

/* --- Footer --- */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Print --- */
@media print {
  body {
    font-size: 12pt;
    padding: 0;
    max-width: none;
  }
  .quiz {
    break-inside: avoid;
  }
  .back {
    display: none;
  }
  footer {
    display: none;
  }
}

/* --- Responsive --- */
@media (max-width: 600px) {
  html { font-size: 16px; }
  body { padding: 1rem 0.8rem 2rem; }
}
