* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #E0E7FF;
  --green: #16A34A;
  --green-light: #DCFCE7;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --amber: #D97706;
  --amber-light: #FEF3C7;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-500: #64748B;
  --gray-700: #334155;
  --gray-900: #0F172A;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  background: #fff;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  z-index: 100;
}
.nav-container {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.logo:hover { text-decoration: none; }
.nav-links { display: flex; list-style: none; gap: 8px; }
.nav-link {
  padding: 6px 14px; border-radius: 6px; font-size: 0.9rem;
  color: var(--gray-700); transition: all 0.2s;
}
.nav-link:hover { background: var(--gray-100); text-decoration: none; }
.nav-link.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* Hero */
.hero {
  margin-top: 60px;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  color: #fff; text-align: center;
  padding: 80px 20px 60px;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 8px; }
.hero > .hero-content > p { font-size: 1.1rem; opacity: 0.85; margin-bottom: 36px; }
.hero-stats {
  display: flex; justify-content: center; gap: 48px;
  margin-bottom: 36px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 2.8rem; font-weight: 800; }
.stat-label { font-size: 0.85rem; opacity: 0.8; margin-top: 2px; }
.btn-primary {
  display: inline-block; padding: 14px 36px;
  background: #fff; color: var(--primary); font-weight: 700;
  border-radius: 8px; font-size: 1.05rem; transition: transform 0.2s;
}
.btn-primary:hover { transform: translateY(-2px); text-decoration: none; }
.btn-outline {
  background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.6);
  margin-left: 12px;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.hero-buttons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--gray-50); }
.section h2 { font-size: 1.8rem; text-align: center; margin-bottom: 12px; color: var(--gray-900); }
.section-desc { text-align: center; color: var(--gray-500); margin-bottom: 36px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* Info Grid */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.info-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; padding: 24px;
  transition: box-shadow 0.2s;
}
.info-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.info-card h3 { color: var(--primary); margin-bottom: 12px; font-size: 1.1rem; }
.info-card ul { padding-left: 18px; }
.info-card li { margin-bottom: 6px; font-size: 0.92rem; color: var(--gray-700); }

/* Topic Cards */
.topic-list { display: flex; flex-direction: column; gap: 16px; }
.topic-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden;
}
.topic-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; cursor: pointer; background: var(--gray-50);
}
.topic-header h3 { font-size: 1.05rem; }
.topic-weight {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600;
  white-space: nowrap;
}
.topic-body { padding: 16px 24px 20px; }
.topic-body p { font-size: 0.88rem; color: var(--gray-500); margin-bottom: 10px; }
.topic-body ul { padding-left: 18px; }
.topic-body li { margin-bottom: 4px; font-size: 0.92rem; color: var(--gray-700); }

/* Practice Section */
.practice-controls {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: flex-start; gap: 16px; margin-bottom: 20px;
}
.category-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  padding: 6px 14px; border: 1px solid var(--gray-300); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 0.85rem; color: var(--gray-700);
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.practice-actions { display: flex; gap: 8px; }
.btn-secondary {
  padding: 6px 16px; border: 1px solid var(--gray-300); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 0.85rem; color: var(--gray-700);
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Score Bar */
.score-bar {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 20px;
}
.score-info { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 10px; font-size: 0.9rem; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.progress-bar {
  height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--primary); border-radius: 3px;
  transition: width 0.3s; width: 0%;
}

/* Quiz Area */
.quiz-area { min-height: 300px; }
.question-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; padding: 28px;
}
.question-category {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 0.78rem; font-weight: 600; margin-bottom: 12px;
  background: var(--primary-light); color: var(--primary-dark);
}
.question-text {
  font-size: 1.05rem; font-weight: 600; margin-bottom: 20px; line-height: 1.5;
}
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 2px solid var(--gray-200); border-radius: 8px;
  background: #fff; cursor: pointer; text-align: left; font-size: 0.95rem;
  transition: all 0.2s; width: 100%;
}
.option-btn:hover:not(.disabled) { border-color: var(--primary); background: var(--primary-light); }
.option-letter {
  flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--gray-100); font-weight: 700;
  font-size: 0.85rem; color: var(--gray-700);
}
.option-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.option-btn.selected .option-letter { background: var(--primary); color: #fff; }
.option-btn.correct { border-color: var(--green); background: var(--green-light); }
.option-btn.correct .option-letter { background: var(--green); color: #fff; }
.option-btn.incorrect { border-color: var(--red); background: var(--red-light); }
.option-btn.incorrect .option-letter { background: var(--red); color: #fff; }
.option-btn.disabled { cursor: default; }

.answer-section {
  margin-top: 20px; padding: 16px; border-radius: 8px;
  background: var(--green-light); border: 1px solid #86EFAC;
}
.answer-section.wrong { background: var(--red-light); border-color: #FCA5A5; }
.answer-section h4 { margin-bottom: 6px; font-size: 0.95rem; }
.answer-section p { font-size: 0.9rem; color: var(--gray-700); }

/* Quiz Navigation */
.quiz-nav {
  display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 20px;
}
.question-counter { font-size: 0.9rem; color: var(--gray-500); font-weight: 600; }

/* Course Section */
.course-nav {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 28px;
}
.course-nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border: 2px solid var(--gray-200); border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left;
  transition: all 0.2s; font-size: 0.88rem; color: var(--gray-700);
}
.course-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.course-nav-btn.active {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 600;
}
.course-nav-btn .course-icon { font-size: 1.4rem; flex-shrink: 0; }

.course-content {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  overflow: hidden;
}
.course-chapter-title {
  padding: 20px 28px; font-size: 1.3rem; font-weight: 700;
  border-bottom: 1px solid var(--gray-200); color: var(--gray-900);
  background: var(--gray-50);
}
.course-sections { padding: 0; }
.course-section {
  border-bottom: 1px solid var(--gray-100);
}
.course-section:last-child { border-bottom: none; }
.course-section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 28px; cursor: pointer; font-weight: 600;
  font-size: 0.95rem; color: var(--gray-700); transition: background 0.2s;
  user-select: none;
}
.course-section-header:hover { background: var(--gray-50); }
.course-section-header .arrow {
  transition: transform 0.2s; font-size: 0.8rem; color: var(--gray-500);
}
.course-section.open .course-section-header { color: var(--primary-dark); background: var(--primary-light); }
.course-section.open .arrow { transform: rotate(90deg); }
.course-section-body {
  display: none; padding: 20px 28px 28px;
  font-size: 0.92rem; line-height: 1.7; color: var(--gray-700);
}
.course-section.open .course-section-body { display: block; }
.course-section-body h4 {
  font-size: 0.98rem; color: var(--gray-900); margin: 18px 0 8px;
}
.course-section-body h4:first-child { margin-top: 0; }
.course-section-body p { margin-bottom: 10px; }
.course-section-body ul, .course-section-body ol { padding-left: 20px; margin-bottom: 10px; }
.course-section-body li { margin-bottom: 4px; }
.course-section-body table {
  width: 100%; border-collapse: collapse; margin-bottom: 14px;
  font-size: 0.88rem;
}
.course-section-body th, .course-section-body td {
  border: 1px solid var(--gray-200); padding: 8px 12px; text-align: left;
}
.course-section-body th {
  background: var(--gray-50); font-weight: 600; color: var(--gray-900);
}
.course-section-body .note-box {
  background: var(--amber-light); border: 1px solid #FCD34D;
  border-radius: 8px; padding: 12px 16px; margin: 12px 0;
  font-size: 0.88rem;
}
.course-section-body .formula-box {
  background: var(--primary-light); border: 1px solid #A5B4FC;
  border-radius: 8px; padding: 12px 16px; margin: 10px 0;
  font-size: 0.88rem; font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.8;
}
.course-section-body .steps-list { display: flex; flex-direction: column; gap: 16px; }
.course-section-body .step {
  display: flex; gap: 16px; align-items: flex-start;
}
.course-section-body .step-num {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--primary); color: #fff;
  font-weight: 700; font-size: 0.85rem;
}
.course-section-body .step-content h4 { margin-top: 0; margin-bottom: 4px; }
.course-section-body .step-content p { margin-bottom: 0; font-size: 0.88rem; }

/* Resource Grid */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.resource-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; padding: 24px;
}
.resource-card h3 { color: var(--primary); margin-bottom: 12px; font-size: 1.05rem; }
.resource-card ul { padding-left: 18px; }
.resource-card li { margin-bottom: 8px; font-size: 0.9rem; }

/* Guide Section (GEO static content) */
.guide-article {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 28px; margin-bottom: 20px;
}
.guide-article h3 {
  color: var(--primary-dark); font-size: 1.15rem; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid var(--primary-light);
}
.guide-article p { font-size: 0.92rem; color: var(--gray-700); line-height: 1.7; margin-bottom: 12px; }
.guide-article ul, .guide-article ol { padding-left: 20px; margin-bottom: 12px; }
.guide-article li { font-size: 0.92rem; color: var(--gray-700); margin-bottom: 6px; line-height: 1.6; }
.guide-table {
  width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 0.88rem;
}
.guide-table th, .guide-table td {
  border: 1px solid var(--gray-200); padding: 10px 12px; text-align: left;
}
.guide-table th { background: var(--gray-50); font-weight: 600; color: var(--gray-900); }
.guide-steps li { margin-bottom: 10px; line-height: 1.7; }
.noscript-content {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; padding: 28px;
}
.noscript-content h3 { color: var(--primary-dark); margin-bottom: 14px; }
.noscript-content li { margin-bottom: 8px; }

/* Footer */
.footer {
  background: var(--gray-900); color: var(--gray-300); text-align: center;
  padding: 32px 20px; font-size: 0.85rem;
}
.footer a { color: var(--gray-300); }
.footer p + p { margin-top: 6px; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.5rem; }
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 2rem; }
  .nav-links { display: none; }
  .practice-controls { flex-direction: column; }
  .score-info { gap: 12px; font-size: 0.82rem; }
  .question-card { padding: 18px; }
  .course-nav { grid-template-columns: repeat(2, 1fr); }
  .course-chapter-title { padding: 16px 18px; font-size: 1.1rem; }
  .course-section-header { padding: 14px 18px; }
  .course-section-body { padding: 16px 18px 20px; }
  .course-section-body .step { flex-direction: column; gap: 8px; }
  .course-section-body table { font-size: 0.8rem; }
  .course-section-body th, .course-section-body td { padding: 6px 8px; }
}
