/* ========================================
   奇乐AI编程 - 全局样式
   品牌色：科技蓝 #2563EB 活力橙 #F97316
   ======================================== */

/* --- 基础重置 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --accent: #F97316;
  --accent-dark: #EA580C;
  --accent-light: #FFF7ED;
  --success: #10B981;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --text: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* --- 导航栏 --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.nav-logo:hover { color: var(--primary-dark); }
.nav-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: #fff;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 8px 18px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* 移动端汉堡菜单 */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

/* --- 页脚 --- */
.footer {
  background: #1E293B;
  color: #CBD5E1;
  padding: 48px 24px 24px;
  margin-top: 80px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-brand h3 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 8px;
}
.footer-brand p { font-size: 14px; line-height: 1.8; }
.footer-col h4 {
  font-size: 15px;
  color: #fff;
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: #94A3B8;
  font-size: 14px;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 13px;
  color: #64748B;
}

/* --- 通用容器 --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 60px 0;
}
.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.section-title p {
  font-size: 16px;
  color: var(--text-muted);
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.45);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(249,115,22,0.35);
}
.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.45);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-white {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow);
}
.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* --- 卡片基础 --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* --- 标签/徽章 --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-orange { background: var(--accent-light); color: var(--accent); }
.badge-green { background: #D1FAE5; color: #059669; }

/* --- Banner --- */
.hero {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 30%, #FFF7ED 70%, #FEF3C7 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
  top: -100px; right: -100px;
}
.hero::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
  bottom: -80px; left: -80px;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero h1 .blue { color: var(--primary); }
.hero h1 .orange { color: var(--accent); }
.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}
.hero .btn-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- 亮点/特性卡片 --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.feature-card {
  text-align: center;
  padding: 40px 28px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.feature-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
}
.feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- 作品卡片 --- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.work-card .card-img {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  position: relative;
  overflow: hidden;
}
.work-card .card-img iframe {
  width: 100%; height: 100%; border: none;
}
.work-card .card-body {
  padding: 20px 24px 24px;
}
.work-card .card-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.work-card .card-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.work-card .card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.work-card .card-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.6;
}

/* --- 筛选栏 --- */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.filter-btn {
  padding: 8px 20px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.filter-btn:hover,
.filter-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* --- 课程卡片 --- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.course-card {
  padding: 32px 28px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  transition: all 0.3s;
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.course-card.level-1 { border-top-color: #10B981; }
.course-card.level-2 { border-top-color: var(--primary); }
.course-card.level-3 { border-top-color: var(--accent); }
.course-card .course-icon {
  font-size: 40px;
  margin-bottom: 16px;
}
.course-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.course-card .course-age {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
}
.course-card .course-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.course-card .course-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* --- 学习路径 --- */
.pathway {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 20px 0;
}
.path-step {
  text-align: center;
  padding: 24px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 160px;
  position: relative;
}
.path-arrow {
  font-size: 28px;
  color: var(--primary);
  margin: 0 8px;
  flex-shrink: 0;
}
.path-step .step-num {
  display: inline-block;
  width: 32px; height: 32px;
  line-height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}
.path-step h4 { font-size: 16px; font-weight: 700; }
.path-step p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* --- 联系页 --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.contact-info .info-item {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}
.contact-info .info-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.contact-info h4 { font-size: 16px; margin-bottom: 4px; }
.contact-info p { font-size: 14px; color: var(--text-muted); }

.qr-box {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.qr-box .qr-placeholder {
  width: 160px; height: 160px;
  background: var(--bg);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
}
.qr-box p { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* --- FAQ --- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 18px 24px;
  text-align: left;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font);
}
.faq-question::after {
  content: '+';
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.3s;
}
.faq-item.open .faq-question::after {
  content: '−';
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
}
.faq-answer p {
  padding: 0 24px 18px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- 联系表单 --- */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  transition: border-color 0.2s;
  background: var(--bg);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* --- 作品详情弹窗 --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 24px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 24px 28px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 22px; }
.modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 28px; }
.modal-body iframe { width: 100%; height: 400px; border: none; border-radius: 8px; }

/* --- 响应式 --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: #fff; padding: 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .nav-toggle { display: block; }

  .hero h1 { font-size: 32px; }
  .features-grid { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }

  .pathway { flex-direction: column; }
  .path-arrow { transform: rotate(90deg); margin: 8px 0; }

  .section { padding: 40px 0; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 0; }
  .hero h1 { font-size: 26px; }
  .section-title h2 { font-size: 24px; }
}
