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

:root {
  --primary: #1e40af;
  --primary-light: #dbeafe;
  --primary-dark: #1e3a8a;
  --text: #111827;
  --text-body: #374151;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f3f4f6;
  --bg-section: #f9fafb;
  --bg-dark: #111827;
  --border: #e5e7eb;
  --radius-sm: 6px;
  --radius: 12px;
  --max-width: 1100px;
  --nav-height: 68px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica,
               Arial, sans-serif;
  color: var(--text-body);
  line-height: 1.7;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============= Navigation ============= */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s;
}

.navbar.scrolled {
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-menu a {
  display: block;
  padding: 8px 16px;
  color: var(--text-body);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.nav-menu a:not(.nav-cta):hover,
.nav-menu a:not(.nav-cta).active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-cta {
  background: var(--primary) !important;
  color: #fff !important;
  padding: 8px 20px !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  margin-left: 6px;
}

.nav-cta:hover {
  background: var(--primary-dark) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all .3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============= Hero ============= */

.hero {
  padding: calc(var(--nav-height) + 80px) 0 80px;
  background: var(--bg-section);
}

.hero-content {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-content h1 span {
  color: var(--primary);
}

.hero-content p {
  font-size: 1.05rem;
  color: var(--text-light);
  margin: 0 auto 32px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.hero-stat-label {
  font-size: .85rem;
  color: var(--text-light);
}

/* ============= Buttons ============= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  font-size: .95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background .15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-block {
  width: 100%;
}

/* ============= Section Common ============= */

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-section);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.section-header p {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 480px;
  margin: 0 auto;
}

/* ============= About ============= */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
  align-items: center;
}

.about-image-bg {
  width: 100%;
  aspect-ratio: 1;
  max-width: 340px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.about-svg-icon {
  position: relative;
  z-index: 1;
}

.about-code-lines {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

.about-code-lines span {
  display: block;
  height: 3px;
  border-radius: 1px;
  background: rgba(255,255,255,.2);
}

.about-code-lines span:nth-child(1) { width: 28px; }
.about-code-lines span:nth-child(2) { width: 20px; }
.about-code-lines span:nth-child(3) { width: 12px; }

.about-desc {
  color: var(--text-body);
  font-size: .95rem;
  line-height: 1.9;
  margin-bottom: 24px;
}

.about-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  text-align: center;
  padding: 14px 20px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  flex: 1;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: .8rem;
  color: var(--text-light);
  margin-top: 2px;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.about-tags span {
  display: inline-block;
  padding: 4px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  font-size: .82rem;
  font-weight: 500;
}

/* ============= Courses ============= */

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  border: 1px solid var(--border);
  position: relative;
}

.course-card-featured {
  border-color: var(--primary);
  border-width: 1.5px;
}

.course-badge {
  position: absolute;
  top: -1px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 0 0 4px 4px;
}

.course-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
  display: inline-block;
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}

.course-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.course-target {
  font-size: .85rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.course-card ul {
  list-style: none;
  margin-bottom: 20px;
}

.course-card ul li {
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
  font-size: .88rem;
  color: var(--text-body);
}

.course-card ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  background: var(--border);
  border-radius: 50%;
}

.course-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-level {
  display: inline-block;
  padding: 3px 12px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--text-light);
  border-radius: 4px;
}

.course-level.hot {
  background: #fef3c7;
  color: #92400e;
}

.course-level.advanced {
  background: #eef2ff;
  color: var(--primary);
}

/* ============= Features ============= */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  border: 1px solid var(--border);
}

.feature-icon-wrapper {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: .9rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ============= Achievements ============= */

#achievements {
  background: var(--bg-dark);
}

#achievements .section-header h2 {
  color: #fff;
}

#achievements .section-header p {
  color: rgba(255,255,255,.5);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.achievement-card {
  background: rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.08);
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.achievement-card h3 {
  font-size: .95rem;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  margin-bottom: 8px;
}

.achievement-count {
  font-size: 2.4rem;
  font-weight: 800;
  color: #60a5fa;
  line-height: 1.2;
  margin-bottom: 4px;
}

.achievement-card p {
  font-size: .85rem;
  color: rgba(255,255,255,.4);
}

/* ============= Testimonials ============= */

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.testimonial-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border);
}

.testimonial-stars {
  color: #d97706;
  font-size: .9rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.testimonial-text {
  font-size: .9rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 18px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.testimonial-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
  flex-shrink: 0;
}

.testimonial-author strong {
  display: block;
  font-size: .88rem;
  color: var(--text);
}

.testimonial-author span {
  font-size: .78rem;
  color: var(--text-light);
}

/* ============= Scroll to top ============= */

.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-light);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  opacity: 0;
  transform: translateY(16px);
  transition: all .2s;
  z-index: 999;
  pointer-events: none;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  background: var(--bg-alt);
  border-color: var(--text-light);
}

/* ============= FAQ ============= */

.faq-list {
  max-width: 680px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  background: none;
  border: none;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  gap: 12px;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-arrow {
  font-size: .7rem;
  flex-shrink: 0;
  color: var(--text-light);
  transition: transform .25s;
}

.faq-item.active .faq-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding: 0 0 18px;
  color: var(--text-light);
  line-height: 1.8;
  font-size: .92rem;
}

/* ============= Contact ============= */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  max-width: 960px;
  margin: 0 auto;
}

.contact-intro {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-body);
  margin-bottom: 8px;
}

.contact-trust {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}

.contact-trust-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.contact-trust h4 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1px;
}

.contact-trust p {
  font-size: .85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.contact-form {
  background: var(--bg);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .93rem;
  font-family: inherit;
  color: var(--text-body);
  background: var(--bg);
  transition: border-color .15s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.required {
  color: #dc2626;
}

.form-status {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .88rem;
  font-weight: 500;
  display: none;
}

.form-status.success {
  display: block;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-status.error {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ============= Footer ============= */

.footer {
  background: var(--bg-dark);
  color: #9ca3af;
  padding-top: 56px;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
}

.footer-brand h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #e5e7eb;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: .88rem;
  color: #6b7280;
  max-width: 280px;
  line-height: 1.6;
}

.footer-links h4,
.footer-contact h4 {
  font-size: .85rem;
  font-weight: 700;
  color: #d1d5db;
  margin-bottom: 14px;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 8px;
}

.footer-links ul li a {
  color: #6b7280;
  text-decoration: none;
  font-size: .88rem;
  transition: color .15s;
}

.footer-links ul li a:hover {
  color: #e5e7eb;
}

.footer-contact p {
  font-size: .88rem;
  margin-bottom: 6px;
  color: #6b7280;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p {
  font-size: .8rem;
  color: #4b5563;
}

/* ============= Toast ============= */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 9999;
  opacity: 0;
  transform: translateY(16px);
  transition: all .3s;
  pointer-events: none;
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast.success {
  background: #059669;
}

.toast.error {
  background: #dc2626;
}

/* ============= Responsive ============= */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 12px 20px 16px;
    gap: 2px;
    box-shadow: 0 16px 32px rgba(0,0,0,.1);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform .35s, opacity .25s;
    pointer-events: none;
    border-bottom: 1px solid var(--border);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-menu a {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
  }

  .nav-cta {
    margin-left: 0 !important;
    margin-top: 8px;
    text-align: center;
  }

  .hero {
    padding: calc(var(--nav-height) + 40px) 0 50px;
  }

  .hero-content h1 {
    font-size: 1.6rem;
  }

  .hero-content p {
    font-size: .95rem;
    margin-bottom: 24px;
  }

  .hero-stats-row {
    gap: 24px;
    margin-top: 36px;
    padding-top: 24px;
  }

  .hero-stat-number {
    font-size: 1.3rem;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-image-bg {
    max-width: 240px;
  }

  .about-stats {
    flex-direction: column;
    gap: 8px;
  }

  .stat {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 10px 16px;
  }

  .section {
    padding: 56px 0;
  }

  .section-header {
    margin-bottom: 36px;
  }

  .section-header h2 {
    font-size: 1.4rem;
  }

  .course-card {
    padding: 24px 20px;
  }

  .feature-card {
    padding: 24px 20px;
  }

  .contact-form {
    padding: 24px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 12px 14px;
    font-size: 16px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }

  .footer-brand p {
    max-width: none;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
    padding: 12px 18px;
  }
}

@media (max-width: 480px) {
  .hero-buttons .btn {
    width: 100%;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .achievements-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .achievement-card {
    padding: 20px 14px;
  }

  .achievement-count {
    font-size: 1.8rem;
  }

  .hero-stats-row {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .section-header h2 {
    font-size: 1.3rem;
  }

  .about-tags {
    justify-content: center;
  }

  .testimonial-card {
    padding: 20px 18px;
  }

  .scroll-top {
    bottom: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
  }

  .faq-question {
    padding: 14px 0;
    font-size: .9rem;
  }

  .faq-answer p {
    padding: 0 0 14px;
  }
}

@media screen and (max-width: 480px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}
