/* ===== 高中数学总结 - 通用样式 ===== */
/* Generated by Trae Work */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --bg: #f5f7fa;
  --bg2: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --rule: #e2e8f0;
  --accent: #2563eb;
  --accent2: #059669;
  --accent3: #d97706;
  --red: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  min-height: 100vh;
}

/* ===== Navigation Bar ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-nav .nav-brand {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}
.top-nav .nav-links {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-nav .nav-links a {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}
.top-nav .nav-links a:hover,
.top-nav .nav-links a.active {
  color: var(--accent);
  background: rgba(37,99,235,0.08);
}

/* ===== Page Header ===== */
.page-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1e40af 100%);
  color: #fff;
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.page-header .chapter-num {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.5rem;
}
.page-header h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
}
.page-header .subtitle {
  font-size: 1rem;
  font-weight: 300;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Main Content ===== */
.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ===== Section Headings ===== */
h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}
h2 + * { margin-top: 0; }

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 2rem 0 0.8rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--accent);
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.5rem 0 0.5rem;
}

/* ===== Paragraphs & Text ===== */
p {
  margin-bottom: 1rem;
  text-align: justify;
}
strong { color: var(--accent); font-weight: 600; }

/* ===== Cards ===== */
.card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.2rem 0;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title .icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.card-title .icon.blue { background: rgba(37,99,235,0.1); color: var(--accent); }
.card-title .icon.green { background: rgba(5,150,105,0.1); color: var(--accent2); }
.card-title .icon.orange { background: rgba(217,119,6,0.1); color: var(--accent3); }
.card-title .icon.red { background: rgba(220,38,38,0.1); color: var(--red); }

/* ===== Callout Boxes ===== */
.callout {
  background: var(--bg2);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  box-shadow: var(--shadow);
}
.callout.green { border-left-color: var(--accent2); }
.callout.orange { border-left-color: var(--accent3); }
.callout.red { border-left-color: var(--red); }
.callout-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.callout-title.blue { color: var(--accent); }
.callout-title.green { color: var(--accent2); }
.callout-title.orange { color: var(--accent3); }
.callout-title.red { color: var(--red); }

/* ===== Formula Display ===== */
.formula-box {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f4f8 100%);
  border: 1px solid #c7d7fe;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1rem 0;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  overflow-x: auto;
}
.formula-box .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-weight: 400;
}

/* ===== Definition/Theorem Blocks ===== */
.definition {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
}
.definition .def-title {
  font-weight: 700;
  color: var(--accent3);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.theorem {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
}
.theorem .thm-title {
  font-weight: 700;
  color: var(--accent2);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

/* ===== Example Blocks ===== */
.example {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
}
.example .ex-title {
  font-weight: 700;
  color: #c2410c;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.example .solution {
  background: rgba(255,255,255,0.6);
  border-radius: 4px;
  padding: 0.8rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
  margin: 1.2rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
thead th {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
}
tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--rule);
}
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: #eff6ff; }

/* ===== Grid Layouts ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.2rem 0;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.2rem 0;
}

/* ===== Lists ===== */
ul, ol {
  margin: 0.5rem 0 1rem 1.5rem;
}
li {
  margin-bottom: 0.4rem;
}
li::marker {
  color: var(--accent);
}

/* ===== Inline Code / Math ===== */
code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Courier New', Consolas, monospace;
  color: var(--red);
}

/* ===== Knowledge Point Tags ===== */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
}
.tag.core { background: rgba(37,99,235,0.1); color: var(--accent); }
.tag.important { background: rgba(220,38,38,0.1); color: var(--red); }
.tag.enhance { background: rgba(5,150,105,0.1); color: var(--accent2); }

/* ===== Summary Section ===== */
.summary-box {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}
.summary-box h3 {
  color: #fff;
  border-left-color: rgba(255,255,255,0.5);
  margin-top: 0;
}
.summary-box ul {
  list-style: none;
  margin-left: 0;
}
.summary-box li {
  padding: 0.3rem 0;
  padding-left: 1.2rem;
  position: relative;
}
.summary-box li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #86efac;
  font-weight: 700;
}

/* ===== Page Footer ===== */
.page-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  margin-top: 3rem;
}
.page-footer a {
  color: #60a5fa;
  text-decoration: none;
}
.page-footer a:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .page-header h1 { font-size: 1.6rem; }
  .page-header { padding: 2rem 1rem 1.5rem; }
  .content-wrapper { padding: 1.5rem 1rem 3rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .top-nav .nav-links { display: none; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }
}

@media print {
  .top-nav { display: none; }
  .page-header { break-after: page; }
  .card, .callout, .definition, .theorem, .example { break-inside: avoid; }
}

/* ===== Index Page Specific ===== */
.index-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #2563eb 100%);
  color: #fff;
  padding: 4rem 2rem;
  text-align: center;
}
.index-hero h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.index-hero .tagline {
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.85;
  max-width: 500px;
  margin: 0 auto;
}
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.chapter-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.25s;
  box-shadow: var(--shadow);
  display: block;
}
.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.chapter-card .ch-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.chapter-card h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  border: none;
  padding: 0;
  margin: 0.4rem 0 0.6rem;
}
.chapter-card .ch-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}
.chapter-card .ch-tags {
  margin-top: 0.8rem;
}

/* ===== Knowledge Map (SVG) ===== */
.knowledge-map {
  margin: 1.5rem 0;
  text-align: center;
}
.knowledge-map svg {
  max-width: 100%;
  height: auto;
}
