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

:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #e0f2fe;
  --secondary: #0f172a;
  --accent: #f59e0b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  transition: transform 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  box-shadow: var(--shadow-md);
}
.navbar.hidden {
  transform: translateY(-100%);
}
.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
}
.navbar-brand:hover { color: var(--secondary); }
.navbar-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 18px;
  font-weight: bold;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--gray-700);
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid var(--gray-200);
    transform: translateY(-120%);
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .nav-links a {
    width: 100%;
    padding: 12px 16px;
  }

  .navbar-brand span { font-size: 16px; }
}

/* Hero */
.hero {
  padding: 140px 24px 80px;
  background: linear-gradient(135deg, var(--secondary) 0%, #1e3a5f 50%, var(--primary-dark) 100%);
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(14,165,233,0.15) 0%, transparent 60%),
              radial-gradient(circle at 70% 50%, rgba(245,158,11,0.1) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-5%, 5%); }
}
.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--accent), #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: clamp(16px, 2vw, 20px);
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--white);
  color: var(--secondary);
}
.btn-primary:hover {
  background: var(--gray-100);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  color: var(--secondary);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
}
.btn-outline:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
  color: var(--white);
}

/* Section */
.section {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.section-header p {
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto;
  font-size: 18px;
}
.section-header .badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Chapter Cards Grid */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.chapter-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.chapter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.chapter-card:hover::before { transform: scaleX(1); }
.chapter-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}
.chapter-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.chapter-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}
.chapter-card p {
  color: var(--gray-500);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.chapter-card .btn-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chapter-card .btn-link:hover { gap: 10px; }
.btn-link svg { transition: transform 0.2s; }
.chapter-card .btn-link:hover svg { transform: translateX(2px); }

/* Content Page */
.page-header {
  padding: 120px 24px 48px;
  background: linear-gradient(135deg, var(--secondary), var(--primary-dark));
  color: var(--white);
  text-align: center;
}
.page-header h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  margin-bottom: 8px;
}
.page-header .breadcrumb {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 16px;
}
.page-header .breadcrumb a {
  color: rgba(255,255,255,0.8);
}
.page-header .breadcrumb a:hover { color: var(--white); }
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.page-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--secondary);
  margin: 36px 0 12px;
}
.page-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--secondary);
  margin: 28px 0 10px;
}
.page-content p {
  margin-bottom: 16px;
  color: var(--gray-600);
  line-height: 1.8;
}
.page-content ul, .page-content ol {
  margin: 12px 0 20px;
  padding-left: 24px;
}
.page-content li {
  margin-bottom: 10px;
  color: var(--gray-600);
  line-height: 1.7;
}
.page-content ul li::marker { color: var(--primary); }
.page-content .tip-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
}
.page-content .tip-box p { color: var(--gray-700); margin-bottom: 0; }
.page-content .tip-box strong { color: var(--primary-dark); }

.page-nav {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--white);
  transition: all 0.2s;
}
.page-nav a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* FAQ Accordion */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.faq-item:hover { box-shadow: var(--shadow); }
.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  text-align: left;
  gap: 16px;
  transition: color 0.2s;
}
.faq-question:hover { color: var(--primary); }
.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s;
  color: var(--gray-400);
}
.faq-item.active .faq-question svg {
  transform: rotate(180deg);
  color: var(--primary);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.active .faq-answer {
  max-height: 500px;
}
.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--gray-600);
  line-height: 1.7;
}
.faq-answer-inner p { margin-bottom: 8px; }
.faq-answer-inner p:last-child { margin-bottom: 0; }

/* Privacy Policy */
.privacy-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.privacy-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--secondary);
  margin: 40px 0 16px;
}
.privacy-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--secondary);
  margin: 24px 0 12px;
}
.privacy-content p {
  margin-bottom: 14px;
  color: var(--gray-600);
  line-height: 1.8;
}
.privacy-content ul {
  margin: 12px 0 20px;
  padding-left: 24px;
}
.privacy-content li {
  margin-bottom: 8px;
  color: var(--gray-600);
}
.privacy-content .last-updated {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* About Page */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.about-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--secondary);
  margin: 36px 0 12px;
}
.about-content p {
  margin-bottom: 16px;
  color: var(--gray-600);
  line-height: 1.8;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin: 32px 0;
}
.feature-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: all 0.3s;
}
.feature-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}
.feature-item h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}
.feature-item p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 0;
}

/* Footer */
.footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.7);
  padding: 64px 24px 32px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-col:first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer h4 {
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.footer p { font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  transition: all 0.2s;
}
.footer-links a:hover { color: var(--white); padding-left: 4px; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
}
.footer-bottom a { color: rgba(255,255,255,0.7); }
.footer-bottom a:hover { color: var(--white); }

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin: 48px 0;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}
.stat-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 500;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--secondary), var(--primary-dark));
  padding: 80px 24px;
  text-align: center;
  color: var(--white);
}
.cta-section h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  margin-bottom: 16px;
}
.cta-section p {
  color: rgba(255,255,255,0.7);
  max-width: 500px;
  margin: 0 auto 32px;
  font-size: 18px;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 999;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 40px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  color: var(--gray-800);
  background: var(--white);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-submit:hover { background: var(--primary-dark); }
