/* 根目录各语言首页（index.html、zh.html 等）共用的样式。
   首页由 blog/generate-seo-assets.js 生成，所有语言共用同一份结构，因此样式集中在这里，
   不再内联在 index.html 里随生成器复制到每个语言页面。 */
:root {
  text-autospace: normal;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
}

.logo {
  text-align: center;
  margin-bottom: 2px;
}

.logo img {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto;
}

/* 17 个语言入口是静态链接，供爬虫发现各语言首页，也供用户切换。用小号字和弱化颜色，
   手机宽度下自动换成几行，避免压过标题和正文。 */
.home-language-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  max-width: 600px;
  margin: 6px auto 0;
  font-size: 13px;
  line-height: 1.5;
}

.home-language-nav a {
  /* 行间距与上下内边距一起把可点区域撑到约 24px 高，手指点按不易误触相邻语言。 */
  padding: 2px 0;
  color: #666;
  white-space: nowrap;
}

.home-language-nav a[aria-current="page"] {
  color: #2c3e50;
  font-weight: 600;
}

h1, h2 {
  color: #2c3e50;
}

/* h1 承担品牌与核心词，但视觉上只比正文小标题略大，保持原来以 Logo 为视觉中心的页面气质。 */
.home-title {
  font-size: 1.5rem;
  line-height: 1.35;
  margin: 24px 0 12px;
}

h2 {
  margin-top: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.divider {
  height: 2px;
  background-color: #eee;
  margin: 40px 0;
}

.summary {
  color: #666;
  font-style: italic;
  margin-bottom: 30px;
}

.summary2 {
  color: #666;
  margin-top: 30px;
}

a {
  text-decoration: none;
}

li {
  margin-bottom: 12px;
  margin-left: -20px;
}

/* 荧光笔高亮效果 */
.highlight {
  position: relative;
  display: inline;
}

.highlight::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 102%;
  height: 100%;
  background-color: rgba(1, 117, 194, 0.2);
  z-index: -1;
  border-radius: 4px;
}

.app-store-badge {
  display: block;
  text-align: left;
  margin: 20px 0;
  width: 140px;
  max-width: 140px;
  /* Apple 官方徽章的标准比例是 3:1。资源尚未下载完成时先保留高度，
     避免首屏按钮从零尺寸突然展开。 */
  aspect-ratio: 3 / 1;
}

.app-store-badge img {
  width: 100%;
  height: 100%;
  display: block;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
  align-items: center;
}

.play-store-badge {
  display: block;
  text-align: left;
  width: 134px;
  max-width: 134px;
  /* Google Play 英文徽章的原始画布为 646×250。
     明确比例后，慢速网络下也不会因为图片解码而改变布局。 */
  aspect-ratio: 646 / 250;
}

.play-store-badge img {
  width: 100%;
  height: 100%;
  display: block;
}

/* 常见问题由正文块里的 <section class="home-faq"> 提供：每个问题是 h3，回答是紧随其后的 p。
   生成器据此输出 FAQPage 结构化数据，这里只负责让问答在页面上清楚可读。 */
.home-faq h3 {
  font-size: 1.05rem;
  color: #2c3e50;
  margin: 24px 0 6px;
}

.home-faq p {
  margin: 0 0 12px;
}

.blog-section {
  margin-top: 30px;
}

.blog-list {
  list-style: none;
  padding-left: 0;
}

.blog-list li {
  margin-left: 0;
  padding: 12px 0;
}

.blog-list a {
  font-weight: 600;
  color: #2c3e50;
}

.blog-summary {
  margin-top: 4px;
  color: #666;
  font-size: 0.95rem;
}

.blog-index-link {
  margin-top: 8px;
  font-size: 0.95rem;
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin-top: 24px;
  border-radius: 16px;
  border: 1px solid #d9d9d9;
  background-color: #fff;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  color: #2c3e50;
}

.comparison-table thead th {
  background-color: #f4f4f4;
  color: #2c3e50;
  font-weight: 600;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e3e3e3;
  border-right: 1px solid #e3e3e3;
  font-size: clamp(0.92rem, 2.1vw, 1rem);
  word-break: break-word;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
  border-right: none;
}

.comparison-table tbody tr {
  background-color: #fff;
  transition: background-color 0.3s ease;
}

.comparison-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table td strong {
  font-weight: 600;
}

.comparison-table tbody tr:hover {
  background-color: #f0f0f0;
}

.voice-demo {
  margin: 40px auto 10px;
  text-align: center;
}

/* 视频文件本身已经处理成 2:3 白色画布。
   宽屏上用 76vh 反推最大宽度，避免播放器按正文宽度撑开后高度超过屏幕。 */
.voice-demo video {
  display: block;
  width: min(100%, 420px, calc(76vh * 2 / 3));
  max-height: 76vh;
  aspect-ratio: 2 / 3;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.14);
}

.footer {
  text-align: center;
  margin-top: 40px;
  font-size: 14px;
  color: #666;
}

.footer a {
  color: #666;
}

.footer-qr img {
  width: 200px;
  height: auto;
}

.footer-support {
  margin-top: 15px;
}

.footer-links a {
  margin: 0 8px;
}

/* 同一团队另一款作品的那句话：与协议链接隔开一点，沿用页脚的字色与链接色。 */
.footer-sibling {
  margin-top: 20px;
}

.company-name {
  margin-top: 20px;
  color: #666;
}

/* 暗色模式样式 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }
  h1, h2 {
    color: #9bbce3;
  }
  h2 {
    border-bottom-color: #333;
  }
  .divider {
    background-color: #333;
  }
  .summary {
    color: #aaa;
  }
  a {
    color: #64b5f6;
    text-decoration: none;
  }
  .home-language-nav a {
    color: #aaa;
  }
  .home-language-nav a[aria-current="page"] {
    color: #9bbce3;
  }
  .home-faq h3 {
    color: #9bbce3;
  }
  .footer,
  .footer a,
  .company-name {
    color: #aaa;
  }

  /* 暗色模式下的荧光笔高亮效果 */
  .highlight::after {
    background-color: rgba(68, 138, 255, 0.2);
  }

  /* 暗色模式下的App Store按钮样式 */
  .app-store-badge img {
    filter: invert(1);
  }

  /* 博客条目样式定义在主暗色模式块之后；这里单独补一层更靠后的覆盖，避免被浅色链接色级联覆盖。 */
  .blog-list a {
    color: #9bbce3;
  }

  .blog-summary {
    color: #c7c7c7;
  }

  .blog-index-link {
    color: #c7c7c7;
  }

  .comparison-table-wrapper {
    background-color: #1f1f1f;
    border-color: #3a3a3a;
  }

  .comparison-table {
    color: #e0e0e0;
  }

  .comparison-table thead th {
    background-color: #2b2b2b;
    color: #f5f5f5;
  }

  .comparison-table th,
  .comparison-table td {
    border-color: #3f3f3f;
  }

  .comparison-table tbody tr {
    background-color: #1f1f1f;
  }

  .comparison-table tbody tr:nth-child(even) {
    background-color: #252525;
  }

  .comparison-table tbody tr:hover {
    background-color: #303030;
  }

  .comparison-table td::before,
  .comparison-table td:first-child {
    color: #d0d0d0;
  }
}

@media (max-width: 860px) {
  body {
    padding: 20px 16px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 18px 14px;
  }

  .home-title {
    font-size: 1.3rem;
  }

  .comparison-table-wrapper {
    border-radius: 20px;
  }

  .comparison-table thead {
    display: none;
  }

  .comparison-table,
  .comparison-table tbody,
  .comparison-table tr,
  .comparison-table td {
    display: block;
    width: 100%;
  }

  .comparison-table tbody tr {
    border-bottom: 1px solid #e3e3e3;
    padding: 16px 18px;
    box-sizing: border-box;
  }

  .comparison-table tbody tr:last-child {
    border-bottom: none;
  }

  .comparison-table td {
    border: none;
    padding: 8px 0;
    font-size: 0.95rem;
  }

  .comparison-table td:first-child {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
  }

  .comparison-table td:first-child::before {
    content: none;
  }

  .comparison-table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    text-transform: none;
  }
}

@media (prefers-color-scheme: dark) and (max-width: 640px) {
  .comparison-table tbody tr {
    border-bottom: 1px solid #3f3f3f;
  }

  .comparison-table td:first-child,
  .comparison-table td::before {
    color: #d0d0d0;
  }
}
