:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #2456c5;
  --brand-soft: #e8eefc;
  --aqua: #08b8c9;
  --warm: #f6a65b;
  --soft-aqua: #e8fbfd;
  --soft-warm: #fff5ec;
}

* {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}

body {
  margin: 0;
}

/*
  全局隐藏规则。
  作用：language.js 会给非当前语言的 nav、div、section 等元素设置 hidden；
       这里用 !important 防止后续 display:grid / display:flex 样式意外覆盖隐藏状态。
  扩展方向：后续如果新增更多多语言模块，只要继续使用 hidden 属性即可自动生效。
*/
[hidden] {
  display: none !important;
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: grid;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.brand strong {
  font-size: 1.35rem;
  letter-spacing: .02em;
}

.brand span {
  color: var(--muted);
  font-size: .92rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--card);
  text-decoration: none;
  font-weight: 700;
}

.hero,
.doc {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 20px 60px rgba(17, 24, 39, .08);
}

.hero {
  padding: clamp(28px, 5vw, 52px);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  background: var(--card);
  text-decoration: none;
}

.card strong {
  color: var(--brand);
  font-size: 1.15rem;
}

.card span {
  color: var(--muted);
}

.doc {
  overflow: hidden;
}

.doc-header {
  padding: 28px clamp(22px, 4vw, 40px);
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  border-bottom: 1px solid var(--line);
}

.doc-header h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.doc-header p,
.updated {
  margin: 0;
  color: var(--muted);
}

.language-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.language-nav button {
  appearance: none;
  border: 0;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(36, 86, 197, .09);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
}

.language-nav button.active {
  color: #fff;
  background: var(--brand);
}

.section[hidden] {
  display: none;
}

.section {
  padding: 30px clamp(22px, 4vw, 40px);
  border-top: 1px solid var(--line);
}

.section:first-of-type {
  border-top: 0;
}

.section h2 {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.section h3 {
  margin: 24px 0 10px;
  font-size: 1.25rem;
}

.section p {
  margin: 0 0 14px;
}

.section ul {
  margin: 0;
  padding-left: 1.25rem;
}

.section li {
  margin: 10px 0;
}

footer {
  margin-top: 28px;
  color: var(--muted);
  text-align: center;
  font-size: .9rem;
}

/*
  法律页面底部返回主页入口。
  作用：给隐私政策和使用条款页提供第二个回到主页的固定出口，用户滚动到底部后不需要再回到顶部。
  实现方式：footer-home-link 使用轻量胶囊按钮样式，不改变 footer 中品牌文字的含义。
  扩展方向：如果后续增加更多法律页，也可以复用这个类作为页脚主操作。
*/
.footer-home-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-right: 12px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--card);
  text-decoration: none;
  font-weight: 700;
}

/*
  LingGrid App 首页样式。
  作用：在不影响隐私政策和使用条款页面的前提下，把 index.html 呈现为简约清新的 App 主页。
  实现方式：所有选择器都以 .home-page 或 .home-* 开头，避免覆盖已有 legal document 结构。
  设计思路：蓝色负责可靠与安全，青色呼应 App 截图，少量暖色用于“高考家庭场景”的温情感。
  扩展方向：未来增加 App Store 下载入口时，可以复用 .cta-row、.primary-link 和 .secondary-link。
*/
.home-page {
  background:
    linear-gradient(180deg, #f3fbff 0%, #f8fafc 44%, #fff7ef 100%);
}

.home-shell {
  width: min(1180px, calc(100% - 32px));
  padding-top: 22px;
}

.home-topbar {
  margin-bottom: 18px;
}

.home-topbar .brand span {
  color: #5b677a;
}

.home-topbar .nav a {
  border-color: rgba(36, 86, 197, .16);
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 28px rgba(17, 24, 39, .06);
}

.home-topbar .nav a:hover,
.home-footer a:hover,
.store-link:hover,
.primary-link:hover,
.secondary-link:hover {
  transform: translateY(-1px);
}

/*
  首屏布局。
  作用：左侧承载产品定位和语言切换，右侧直接展示真实 App 截图。
  实现方式：桌面端双栏，移动端上下堆叠；图片区域用稳定 min-height 防止加载时布局跳动。
*/
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1fr);
  align-items: center;
  gap: clamp(24px, 6vw, 72px);
  min-height: min(760px, calc(100vh - 120px));
  padding: clamp(22px, 5vw, 60px) 0 34px;
}

.hero-copy {
  max-width: 590px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--aqua);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  color: #142033;
  font-size: clamp(3.6rem, 10vw, 7.2rem);
  line-height: .92;
  letter-spacing: 0;
}

.home-language-nav {
  margin-top: 22px;
}

.hero-intro p {
  margin: 24px 0 0;
  max-width: 48ch;
  color: #4b5d72;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.8;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/*
  App Store 下载按钮。
  作用：在首屏行动区放置最直接的下载入口，同时通过 App icon 建立产品识别。
  实现方式：按钮内部使用 256px 源图按 44px 显示，兼顾高清屏清晰度和网络体积；文字区分为辅助说明 small 与主要动作 strong。
  参数含义：gap 控制 icon 与文字间距；min-height 保证它和普通 CTA 在同一行时视觉重量接近；box-shadow 延续首页轻量悬浮感。
  设计思路：深色按钮呼应 icon 背景，和现有蓝色主按钮形成层级，避免 App Store 入口被普通链接淹没。
  扩展方向：如果以后增加其他平台下载入口，可以继续使用 store-link，并通过额外 modifier 类调整品牌色。
*/
.store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 60px;
  padding: 8px 16px 8px 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  color: #fff;
  background: #142033;
  box-shadow: 0 18px 38px rgba(20, 32, 51, .2);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.store-link img {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .2);
}

.store-link span {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.store-link small {
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 700;
}

.store-link strong {
  color: #fff;
  font-size: 1.02rem;
  font-weight: 900;
}

.store-link:hover {
  background: #0f1a2b;
  box-shadow: 0 22px 44px rgba(20, 32, 51, .24);
}

/*
  行动链接样式。
  参数含义：primary-link 表示当前最推荐动作；secondary-link 用于补充动作和联系入口。
  mailto 联系入口与普通链接共享视觉语言，用户不用学习新的交互形式。
*/
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-link {
  color: #fff;
  background: #1677ff;
  box-shadow: 0 16px 34px rgba(22, 119, 255, .22);
}

.secondary-link {
  border: 1px solid rgba(20, 32, 51, .1);
  color: #2456c5;
  background: rgba(255, 255, 255, .76);
}

.hero-visual {
  position: relative;
  min-height: 640px;
}

.phone-shot {
  position: absolute;
  width: clamp(210px, 24vw, 310px);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(20, 32, 51, .16);
}

.phone-shot-front {
  left: 4%;
  top: 32px;
  z-index: 2;
}

.phone-shot-back {
  right: 2%;
  top: 104px;
  opacity: .9;
}

/*
  内容段落布局。
  作用：把长介绍拆成“功能摘要、创作初衷、截图展示”，减少一次性阅读压力。
  实现方式：每个语言面板拥有同样结构，language.js 负责只展示当前语言。
*/
.home-content {
  display: grid;
  gap: clamp(40px, 8vw, 78px);
  margin-top: 24px;
}

.feature-section,
.story-section {
  display: grid;
  gap: 22px;
}

.section-heading {
  max-width: 760px;
}

.section-heading h2,
.story-copy h2 {
  margin: 0;
  color: #162235;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.feature-item {
  min-height: 180px;
  padding: 20px;
  border: 1px solid rgba(36, 86, 197, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 14px 34px rgba(17, 24, 39, .06);
}

.feature-item span {
  color: var(--warm);
  font-weight: 900;
}

.feature-item h3 {
  margin: 22px 0 8px;
  color: #142033;
  font-size: 1.12rem;
}

.feature-item p {
  margin: 0;
  color: #5d6b7c;
  line-height: 1.65;
}

.story-section {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: start;
  gap: clamp(24px, 5vw, 56px);
}

.story-copy p {
  margin: 16px 0 0;
  color: #314056;
  font-size: 1.02rem;
  line-height: 1.9;
}

/*
  重要提示盒。
  作用：明确“非官方应用”的边界，避免用户误解。
  实现方式：使用暖色边线和轻背景，与正文区分但不过度警示。
*/
.note-box {
  position: sticky;
  top: 18px;
  padding: 20px;
  border: 1px solid rgba(246, 166, 91, .42);
  border-radius: 8px;
  background: var(--soft-warm);
  color: #51351d;
}

.note-box strong {
  display: block;
  margin-bottom: 8px;
  color: #8a4c12;
  font-size: 1.05rem;
}

.note-box p {
  margin: 0;
  line-height: 1.8;
}

.screen-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 3vw, 26px);
  align-items: start;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(8, 184, 201, .16);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--soft-aqua), rgba(255, 255, 255, .72));
}

.screen-section img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(20, 32, 51, .13);
}

/*
  首页页脚。
  作用：集中放置法律文档和联系我们入口；联系我们只显示动作名称，不在页脚暴露真实邮箱。
  实现方式：每种语言使用一个 data-lang-panel，和正文同步显示。
*/
.home-footer {
  margin-top: 58px;
}

.home-footer div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
}

.home-footer a,
.home-footer span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: #526276;
  text-decoration: none;
}

.home-footer a {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
  transition: transform .18s ease, background .18s ease;
}

.home-footer a:hover {
  background: #fff;
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

/*
  首页响应式。
  作用：让截图、按钮和长标题在手机屏幕上保持清晰且不互相遮挡。
  实现方式：900px 以下改为单栏，特性卡片和截图展示减少列数；620px 以下只保留更紧凑的双截图布局。
*/
@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-visual {
    min-height: 500px;
    order: -1;
  }

  .phone-shot {
    width: min(45vw, 250px);
  }

  .phone-shot-front {
    left: 15%;
    top: 0;
  }

  .phone-shot-back {
    right: 12%;
    top: 70px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-section {
    grid-template-columns: 1fr;
  }

  .note-box {
    position: static;
  }

  .screen-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .home-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 16px;
  }

  .hero-copy h1 {
    font-size: clamp(3rem, 18vw, 4.6rem);
  }

  .hero-visual {
    min-height: 390px;
  }

  .phone-shot {
    width: min(50vw, 205px);
  }

  .phone-shot-front {
    left: 4%;
  }

  .phone-shot-back {
    right: 1%;
    top: 58px;
  }

  .feature-grid,
  .screen-section {
    grid-template-columns: 1fr;
  }
}
