/* ============================================================
   书智AI · 智能英语学习平台 — 主样式表
   设计语言：参考智驰文化科技官网，现代卡片化、蓝色渐变、清爽专业
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #007bff;
  --brand-dark: #0056b3;
  --brand-light: #4da3ff;
  --brand-gradient: linear-gradient(135deg, #007bff 0%, #4da3ff 100%);
  --brand-gradient-2: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
  --bg-page: #F7FAFC;
  --bg-section-a: #EEF2F6;
  --bg-section-b: #F9FBFC;
  --text: #1a1a2e;
  --text-secondary: #666;
  --text-muted: #999;
  --white: #ffffff;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s ease;
}

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

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- Navbar --- */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08); }
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.nav-logo { font-size: 1.3rem; font-weight: 700; color: var(--brand); text-decoration: none; letter-spacing: 0.5px; }
.nav-logo span { color: var(--text); margin-left: 2px; }
.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-secondary); font-size: 0.95rem; font-weight: 500; transition: color var(--transition); }
.nav-links a:hover { color: var(--brand); }
.nav-cta {
  background: var(--brand-gradient); color: #fff !important;
  padding: 8px 20px; border-radius: 24px; font-weight: 600 !important;
  transition: transform var(--transition), box-shadow var(--transition) !important;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 123, 255, 0.35); }

/* Mobile nav toggle */
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* --- Section --- */
.section { padding: 100px 0; }
.section-a { background: var(--bg-section-a); }
.section-b { background: var(--bg-section-b); }

.section-header { text-align: center; margin-bottom: 56px; }
.section-header .badge {
  display: inline-block; font-size: 2rem; margin-bottom: 12px;
  width: 64px; height: 64px; line-height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0,123,255,0.08), rgba(0,123,255,0.15));
}
.section-header h2 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.section-header p { font-size: 1.1rem; color: var(--text-secondary); }

/* --- Hero --- */
.hero {
  padding: 140px 0 100px;
  background: linear-gradient(180deg, #EEF2F6 0%, #F7FAFC 100%);
  overflow: hidden;
}
.hero .container { display: flex; align-items: center; gap: 60px; }
.hero-text { flex: 1; min-width: 0; }
.hero-text h1 {
  font-size: 2.6rem; font-weight: 800; line-height: 1.3; margin-bottom: 16px;
  background: var(--brand-gradient-2); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-text h3 { font-size: 1.2rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.hero-text p { font-size: 1rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 32px; }
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }
.btn-primary {
  display: inline-block; padding: 14px 36px;
  background: var(--brand-gradient); color: #fff; text-decoration: none;
  border-radius: 30px; font-weight: 600; font-size: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 6px 24px rgba(0, 123, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(0, 123, 255, 0.4); }
.btn-outline {
  display: inline-block; padding: 14px 36px;
  background: transparent; color: var(--brand); text-decoration: none;
  border: 2px solid var(--brand); border-radius: 30px;
  font-weight: 600; font-size: 1rem; transition: all var(--transition);
}
.btn-outline:hover { background: var(--brand); color: #fff; }

.hero-visual {
  flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

/* --- Pain Points --- */
.pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px; max-width: 1000px; margin: 0 auto;
}
.pain-card {
  background: var(--white); border-radius: var(--radius-sm);
  padding: 28px 20px; text-align: center;
  box-shadow: var(--card-shadow); border-top: 3px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.pain-card:hover { transform: translateY(-6px); box-shadow: var(--card-shadow-hover); border-top-color: var(--brand); }
.pain-icon { font-size: 2rem; margin-bottom: 12px; }
.pain-card strong { display: block; font-size: 1rem; margin-bottom: 8px; color: var(--text); }
.pain-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

.pain-conclusion {
  text-align: center; font-size: 1.15rem; margin-top: 36px;
  color: var(--text-secondary);
}
.pain-conclusion strong { color: var(--brand); }

/* --- Features --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px; max-width: 1100px; margin: 0 auto;
}
.feature-card {
  background: var(--white); border-radius: var(--radius);
  padding: 36px 28px; box-shadow: var(--card-shadow);
  border-top: 4px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--card-shadow-hover); border-top-color: var(--brand); }
.feature-icon {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; border-radius: 16px; margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(0,123,255,0.08), rgba(0,123,255,0.18));
  transition: transform var(--transition);
}
.feature-card:hover .feature-icon { transform: scale(1.08); }
.feature-card h4 { font-size: 1.15rem; margin-bottom: 14px; color: var(--text); }
.feature-card ul { list-style: none; }
.feature-card ul li {
  padding: 5px 0; font-size: 0.9rem; color: var(--text-secondary);
  position: relative; padding-left: 20px;
}
.feature-card ul li::before {
  content: '✓'; position: absolute; left: 0; color: var(--brand); font-weight: bold;
}

/* --- Learning Loop --- */
.loop-wrap { max-width: 1000px; margin: 0 auto; }
.loop-flow {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px; margin-bottom: 24px;
}
.loop-step {
  background: var(--white); border-radius: var(--radius-sm);
  padding: 14px 24px; box-shadow: var(--card-shadow);
  font-weight: 600; font-size: 0.95rem; color: var(--brand);
  transition: transform var(--transition), box-shadow var(--transition);
}
.loop-step:hover { transform: scale(1.05); box-shadow: var(--card-shadow-hover); }
.loop-arrow { font-size: 1.3rem; color: #ccc; font-weight: bold; }
.loop-cycle {
  text-align: center; font-size: 1.8rem; color: var(--brand); margin: 12px 0;
}
.loop-desc { text-align: center; color: var(--text-muted); font-size: 0.95rem; }

/* --- For Parents --- */
.parents-content {
  max-width: 900px; margin: 0 auto; display: flex; gap: 40px; align-items: center;
}
.parents-list { flex: 1; }
.parents-list ul { list-style: none; }
.parents-list ul li {
  padding: 10px 0 10px 28px; position: relative; color: var(--text-secondary);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.parents-list ul li::before {
  content: '📊'; position: absolute; left: 0; font-size: 0.9rem;
}
.parents-visual {
  flex: 0 0 280px; background: var(--white); border-radius: var(--radius);
  padding: 40px 30px; text-align: center; box-shadow: var(--card-shadow);
}
.parents-visual .big-icon { font-size: 5rem; margin-bottom: 16px; }
.parents-visual h4 { font-size: 1.1rem; color: var(--brand); }

/* --- Institutions --- */
.inst-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px; max-width: 1000px; margin: 0 auto;
}
.inst-card {
  background: var(--white); border-radius: var(--radius);
  padding: 36px 28px; text-align: center; box-shadow: var(--card-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.inst-card:hover { transform: translateY(-6px); box-shadow: var(--card-shadow-hover); }
.inst-icon { font-size: 2.8rem; margin-bottom: 16px; }
.inst-card h4 { font-size: 1.1rem; margin-bottom: 10px; color: var(--text); }
.inst-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* --- Highlights --- */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px; max-width: 900px; margin: 0 auto;
}
.highlight-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--white); border-radius: var(--radius-sm);
  padding: 20px 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border-left: 4px solid transparent;
  transition: all var(--transition);
}
.highlight-item:hover { border-left-color: var(--brand); transform: translateX(4px); }
.highlight-item strong { font-size: 0.95rem; color: var(--text); }
.highlight-item span { font-size: 0.85rem; color: var(--text-muted); margin-left: auto; }

/* --- Belief + CTA --- */
.belief-content { max-width: 700px; margin: 0 auto; text-align: center; }
.belief-content p {
  font-size: 1.15rem; color: var(--text-secondary); line-height: 1.9; margin-bottom: 24px;
}

.cta-box {
  max-width: 650px; margin: 50px auto 0 auto;
  padding: 44px 48px; text-align: center;
  background: var(--brand-gradient-2);
  border-radius: var(--radius); color: #fff;
  box-shadow: 0 12px 48px rgba(0, 123, 255, 0.3);
  transition: transform var(--transition);
}
.cta-box:hover { transform: scale(1.02); }
.cta-box h3 { font-size: 1.5rem; margin-bottom: 10px; }
.cta-box p { font-size: 1rem; opacity: 0.9; margin-bottom: 24px; }
.cta-box .btn-primary { background: #fff; color: var(--brand); box-shadow: 0 6px 24px rgba(0,0,0,0.15); }
.cta-box .btn-primary:hover { background: rgba(255,255,255,0.9); }

/* --- Footer --- */
.footer {
  background: #1a1a2e; color: rgba(255,255,255,0.65); padding: 60px 0 30px;
}
.footer .container { display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between; }
.footer-col { flex: 1; min-width: 200px; }
.footer-col h4 { color: #fff; margin-bottom: 18px; font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 0.9rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--brand-light); }
.footer-col p { font-size: 0.9rem; line-height: 1.8; }
.copyright {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px; margin-top: 48px;
  text-align: center; font-size: 0.85rem;
}
.copyright a { color: var(--brand-light); text-decoration: none; }

/* --- Floating Sidebar --- */
.floating-bar {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
}
.floating-bar a {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--white); color: var(--brand);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  text-decoration: none; font-size: 1.1rem;
  transition: all var(--transition);
}
.floating-bar a:hover { background: var(--brand); color: #fff; transform: scale(1.1); }

/* --- Responsive --- */
@media (max-width: 992px) {
  .hero .container { flex-direction: column; gap: 40px; text-align: center; }
  .hero-btns { justify-content: center; }
  .hero-text h1 { font-size: 2rem; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .inst-grid { grid-template-columns: repeat(2, 1fr); }
  .parents-content { flex-direction: column; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 68px; left: 0; width: 100%; background: var(--white);
    padding: 20px; gap: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  }
  .nav-toggle { display: flex; }
  .features-grid { grid-template-columns: 1fr; }
  .inst-grid { grid-template-columns: 1fr; }
  .highlights-grid { grid-template-columns: 1fr; }
  .loop-flow { flex-direction: column; gap: 4px; }
  .loop-arrow { transform: rotate(90deg); }
  .section { padding: 60px 0; }
  .hero { padding: 120px 0 60px; }
  .section-header h2 { font-size: 1.5rem; }
}


/* ====== 修复: 图片区域样式 ====== */

/* Hero 图片 */
.hero-visual { position: relative; }
.hero-img {
  max-width: 100%; height: auto; border-radius: var(--radius);
  box-shadow: 0 12px 56px rgba(0, 123, 255, 0.15);
  transition: transform 0.4s ease;
}
.hero-img:hover { transform: scale(1.02); }
.hero-fallback {
  font-size: 10rem; animation: float 3s ease-in-out infinite;
  display: none;   /* 默认隐藏 */
}
/* 图片加载失败时显示回退 */
.hero-img[style*="display: none"] ~ .hero-fallback { display: block; }

/* Nav Logo */
.nav-logo-img { height: 38px; width: auto; vertical-align: middle; }
.nav-logo-text { font-size: 1.3rem; font-weight: 700; color: var(--brand); display: none; }
.nav-logo-text span { color: var(--text); margin-left: 2px; }
/* Logo 图片加载失败时显示文字 */
.nav-logo-img[style*="display: none"] ~ .nav-logo-text { display: inline; }

/* 功能总览图 */
.features-overview-img {
  max-width: 900px; margin: 0 auto 48px auto;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.06);
  transition: transform 0.4s ease;
}
.features-overview-img:hover { transform: scale(1.01); }
.features-overview-img img { width: 100%; height: auto; display: block; }

/* 学习闭环图 */
.loop-img-wrap {
  max-width: 800px; margin: 0 auto 36px auto;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}
.loop-img-wrap img { width: 100%; height: auto; display: block; }

/* 家长报告 */
.parents-visual {
  flex: 0 0 300px; border-radius: var(--radius); overflow: hidden;
  position: relative;
}
.parents-img {
  width: 100%; height: auto; display: block;
  box-shadow: var(--card-shadow); border-radius: var(--radius);
}
.parents-fallback {
  display: none;   /* 默认隐藏 */
  background: var(--white); border-radius: var(--radius);
  padding: 40px 30px; text-align: center; box-shadow: var(--card-shadow);
}
/* 图片加载失败时显示回退 */
.parents-img[style*="display: none"] ~ .parents-fallback { display: block; }
.parents-fallback .big-icon { font-size: 5rem; margin-bottom: 16px; }
.parents-fallback h4 { font-size: 1.1rem; color: var(--brand); }

/* 教育机构场景图 */
.inst-img-wrap {
  max-width: 950px; margin: 0 auto 44px auto;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.06);
  transition: transform 0.4s ease;
}
.inst-img-wrap:hover { transform: scale(1.01); }
.inst-img-wrap img { width: 100%; height: auto; display: block; }

/* 响应式 */
@media (max-width: 768px) {
  .hero-img { max-width: 90%; }
  .parents-visual { flex: 0 0 auto; max-width: 280px; margin: 20px auto 0; }
  .nav-logo-img { height: 30px; }
}

/* --- Scroll reveal --- */
.revealed { opacity: 1 !important; transform: translateY(0) !important; }
