/**
 * 鲸语通 / WhaleLink 文档站 —— 共享样式
 * 站点：https://unicgames.com/rdshapp/
 *
 * 品牌色对齐 App（rdsh-app/lib/config/app_theme.dart:6 → Color(0xFF1976D2)）
 * 移动优先：文档主要在手机 / App WebView 内阅读。
 */

:root {
  --brand: #0d47a1;
  --brand-dark: #0a2f5c;
  --brand-light: #e8f1fb;
  --text: #1f2328;
  --text-muted: #3f4750;
  --surface: #ffffff;
  --surface-alt: #f6f8fa;
  --border: #d8dee4;
  --radius: 10px;
  --maxw: 760px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.75;
  font-size: 16px;
}

/* ── 站点头部 ── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-header__brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.site-header__nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
}

.site-header__nav a:hover,
.site-header__nav a[aria-current="page"] {
  background: var(--brand-light);
  color: var(--brand);
}

/* ── 正文容器 ── */
.doc {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.doc h1 {
  font-size: 1.5rem;
  line-height: 1.35;
  margin: 8px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.doc h2 {
  font-size: 1.2rem;
  margin: 32px 0 12px;
}

.doc h3 {
  font-size: 1.05rem;
  margin: 24px 0 8px;
}

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

.doc ul,
.doc ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.doc li {
  margin-bottom: 6px;
}

.doc a {
  color: var(--brand);
  text-decoration: none;
  word-break: break-all;
}

.doc a:hover {
  text-decoration: underline;
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.doc blockquote {
  border-left: 3px solid var(--brand);
  background: var(--brand-light);
  padding: 12px 16px;
  margin: 18px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.doc blockquote p:last-child {
  margin-bottom: 0;
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.doc pre {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow-x: auto;
  margin: 0 0 16px;
}

.doc pre code {
  background: none;
  border: 0;
  padding: 0;
}

.doc img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 12px 0;
}

.doc .muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── 语言切换 ── */
.lang-switch {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 8px;
  font-size: 0.85rem;
}

.lang-switch a {
  color: var(--brand);
  text-decoration: none;
}

.lang-switch a:hover {
  text-decoration: underline;
}

/* ── 页脚 ── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px;
}

.site-footer a {
  color: var(--text-muted);
}

/* ── 栏目索引（首页 / 博客列表）── */
.card-list {
  list-style: none;
  padding: 0;
}

.card-list li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.card-list a {
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.card-list p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  body {
    font-size: 17px;
  }

  .doc {
    padding: 40px 24px 80px;
  }

  .doc h1 {
    font-size: 1.75rem;
  }
}

/* ══════════════════════════════════════════════════════════
   产品营销区块（首页专用，R9）
   仅追加，不影响文档页既有样式
   ══════════════════════════════════════════════════════════ */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 16px 8px;
  text-align: center;
}

.hero__lang {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero__lang a {
  color: var(--brand);
  text-decoration: none;
}

.hero__top {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  margin-bottom: 20px;
}

.hero__icon {
  width: 84px;
  height: 84px;
  border-radius: 19px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.hero__meta { min-width: 0; }

.hero__name {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
}

.hero__name span {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 1rem;
}

.hero__subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero__publisher {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--brand);
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.stat__value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand);
}

.stat__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 下载区：紧凑单行（照 GarSync 的 download-row）——图片直接排，无边框无背景 */
.download {
  margin-bottom: 8px;
}

.download__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download__row img.store {
  display: block;
  height: 42px;
  width: auto;
  opacity: 0.55;
}

.download__row img.store--sq {
  width: 42px;
  height: 42px;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 0 14px;
  height: 42px;
  font-size: 0.84rem;
  white-space: nowrap;
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-store img {
  height: 18px;
  width: auto;
}

/* 体验版 BETA：唯一已可下载的渠道 —— 从 `.btn-store` 的"未上线"灰态里解出来
   （父类的 opacity/.55 + cursor:not-allowed 是给商店和正式版 APK 留的） */
.btn-store--beta {
  opacity: 1;
  cursor: pointer;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.btn-store--beta:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* 兼容版 APK（内置 Firefox/GeckoView 内核）：与 BETA 同为已可下载渠道 */
.btn-store--compat {
  opacity: 1;
  cursor: pointer;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.btn-store--compat:hover {
  background: var(--brand-dark);
}

.download__soon {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* 截图区：结构就位，本轮不放图（R9.6 / Q2=A） */
.screenshots {
  max-width: var(--maxw);
  margin: 8px auto 0;
  padding: 0 16px;
}

.screenshots__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 14px 4px 18px;
  -webkit-overflow-scrolling: touch;
}

.shot {
  flex: 0 0 auto;
  margin: 0;
  width: 172px;
}

/* 手机外框：深色金属边 + 立体阴影（纯 CSS，无需素材） */
.shot__frame {
  --frame-pad: 5px;
  --screen-radius: 17px;
  position: relative;
  padding: var(--frame-pad);
  border-radius: calc(var(--screen-radius) + var(--frame-pad));
  background: linear-gradient(155deg, #4a5058 0%, #2b3038 45%, #1b1f24 100%);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.16),
    0 3px 8px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.shot__frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--screen-radius);
  background: #fff;
}

.shot figcaption {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

@media (min-width: 640px) {
  .shot { width: 200px; }
  .shot figcaption { font-size: 0.82rem; }
  .shot__frame {
    --frame-pad: 6px;
    --screen-radius: 20px;
  }
}

/* 功能特性网格 */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.feature__icon {
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 8px;
}

.feature__name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.feature__desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 帮助入口网格 */
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  list-style: none;
  padding: 0;
}

.help-grid a {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.help-grid a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

@media (min-width: 640px) {
  .features { grid-template-columns: 1fr 1fr; }
  .hero__icon { width: 96px; height: 96px; border-radius: 22px; }
  .hero__name { font-size: 1.6rem; }
}

@media (min-width: 900px) {
  .features { grid-template-columns: repeat(3, 1fr); }
  .help-grid { grid-template-columns: repeat(4, 1fr); }
}
