/* ---------- 设计令牌：与设计稿一一对应，改色只改这里 ---------- */
:root {
  --berry: #dc4560;
  --berry-dark: #c23550;
  --berry-soft: #fdf0f3;
  --tagline: #f96774;

  --ink: #17181c;
  --ink-2: #5f6368;
  --ink-3: #8a8f98;
  --ink-4: #9aa0a6;
  --ink-5: #b4b8bf;

  --line: #e7e9ed;
  --line-soft: #f1f2f4;
  --surface: #fafafb;
  --fill: #f4f5f7;
  --white: #fff;

  --ok: #12805c;
  --ok-bg: #e8f5ee;
  --warn: #e0a21a;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --font: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --font-num: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 内容不足一屏时，页脚贴住视口底部 */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 只作用于站点页（后台的 main 在 .admin-shell 里，不受影响） */
body > main { flex: 1 0 auto; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }

@media (min-width: 1100px) {
  .wrap { width: min(1200px, 100% - 240px); }
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.site-nav a { font-size: 13px; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--berry); font-weight: 500; }

@media (max-width: 640px) {
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 12px; }
  .brand { font-size: 13px; gap: 8px; }
  .brand img { width: 26px; height: 26px; border-radius: 7px; }
  .site-header .wrap { height: 56px; }
}

/* ---------- 首屏信息卡 ---------- */
.hero { padding: 28px 0 8px; }

.hero-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
}

.hero-app { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hero-app img { width: 64px; height: 64px; border-radius: 16px; flex: none; }
.hero-app .name { font-size: 20px; font-weight: 600; letter-spacing: .2px; }
.hero-app .tagline { font-size: 12px; color: var(--tagline); margin-top: 2px; }

.hero-stats { display: flex; align-items: center; margin-left: auto; flex: none; }
.hero-stats .cell { padding: 0 26px; border-left: 1px solid var(--line); }
.hero-stats .cell:first-child { border-left: 0; }
.hero-stats .v { font-family: var(--font-num); font-size: 20px; font-weight: 600; letter-spacing: -.2px; line-height: 1.3; }
.hero-stats .k { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

@media (max-width: 860px) {
  .hero { padding: 20px 0 0; }
  .hero-card { flex-direction: column; align-items: stretch; gap: 18px; padding: 20px; }
  .hero-app img { width: 60px; height: 60px; border-radius: 15px; }
  .hero-app .name { font-size: 18px; }
  .hero-stats { margin-left: 0; border-top: 1px solid var(--line); padding-top: 14px; width: 100%; }
  .hero-stats .cell { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  .hero-stats .cell:first-child { padding-left: 0; }
  .hero-stats .cell:last-child { padding-right: 0; }
  .hero-stats .v { font-size: 14px; letter-spacing: -.3px; white-space: nowrap; }
  .hero-stats .k { font-size: 10px; white-space: nowrap; }
}

/* ---------- 通用区块 ---------- */
.section { padding: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: .2px; }
.section-head .hint { font-size: 11px; color: var(--ink-3); }
.section-head .hint strong { color: var(--ink-2); font-weight: 500; }

@media (max-width: 860px) {
  .section { padding: 20px 0; }
  .section-head h2 { font-size: 16px; font-weight: 600; }
}

/* ---------- 应用截图 ---------- */
.shots {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.shots::-webkit-scrollbar { display: none; }

.shots figure {
  margin: 0;
  flex: none;
  width: 168px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--white);
  transition: transform .18s ease, box-shadow .18s ease;
}
.shots figure:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23, 24, 28, .08); }
/* height:auto 必须写：img 上的 height 属性会当成 CSS 高度，不写就压不回 9:20 */
.shots img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 20; object-fit: cover; }

/* 图外面套 <a>，点了放大；没 JS 就是直接开原图 */
.shot-open { display: block; cursor: zoom-in; }
.shot-open:focus-visible { outline: 2px solid var(--berry); outline-offset: -2px; }

@media (min-width: 861px) {
  .shots figure { width: 232px; }
  .shots { gap: 20px; justify-content: center; }
}

/* ---------- 截图大图预览 ---------- */
html.lb-lock { overflow: hidden; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(23, 24, 28, .86);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.lb.is-open { display: flex; }

.lb-img {
  width: auto;
  height: auto;
  max-width: min(86vw, 440px);
  max-height: 84vh;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.lb.is-open .lb-img { animation: lb-in .18s ease-out; }
@keyframes lb-in {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  transition: background .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn[hidden] { display: none; }
.lb-btn:hover { background: rgba(255, 255, 255, .26); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-btn svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-close { top: max(16px, env(safe-area-inset-top)); right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

.lb-count {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .68);
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .04em;
}

@media (max-width: 640px) {
  .lb-img { max-width: 88vw; max-height: 78vh; }
  .lb-btn { width: 36px; height: 36px; }
  /* 手机上大图快占满宽度，箭头挪到底部，别压在图边上 */
  .lb-prev, .lb-next { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: none; }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
  .lb-count { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 10px); }
}

@media (prefers-reduced-motion: reduce) {
  .shots figure { transition: none; }
  .lb.is-open .lb-img { animation: none; }
}

/* ---------- 下载区 ---------- */
.plat-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  overflow: hidden;
}

.plat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px 20px;
}
.plat-row + .plat-row { border-top: 1px solid var(--line-soft); }

.plat-icon {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--fill);
  color: var(--ink-2);
}
.plat-icon svg { width: 18px; height: 18px; }
/* 真标：按各家 logo 的长宽比单独配光学尺寸，不然安卓机器人会被压成一条 */
.plat-icon { --logo: 18px; }
.plat-icon .plat-logo { display: block; object-fit: contain; }
.plat-icon .plat-logo[data-p="android"] { width: calc(var(--logo) * 1.15); height: calc(var(--logo) * 0.68); }
.plat-icon .plat-logo[data-p="ios"] { width: calc(var(--logo) * 0.82); height: var(--logo); }
.plat-icon .plat-logo[data-p="harmony"] { width: calc(var(--logo) * 0.95); height: calc(var(--logo) * 0.95); }
.plat-icon .plat-logo[data-p="windows"] { width: calc(var(--logo) * 0.9); height: calc(var(--logo) * 0.9); }
.plat-row:hover .plat-icon,
.ver-row:hover .plat-icon { background: var(--berry-soft); }
.plat-row.is-soon .plat-icon .plat-logo { filter: grayscale(1); opacity: .45; }
.step-card h3 img { width: 18px; height: 18px; object-fit: contain; }

.plat-name { font-size: 14px; font-weight: 600; width: 126px; }

.plat-meta { font-size: 11px; color: var(--ink-3); font-family: var(--font-num); }
.plat-meta .sep { margin: 0 6px; color: var(--ink-5); }

.actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.btn svg { width: 13px; height: 13px; flex: none; }

.btn-primary { background: var(--berry); color: #fff; }
.btn-primary:hover { background: var(--berry-dark); }

.btn-ghost { background: var(--white); border-color: var(--berry); color: var(--berry); }
.btn-ghost:hover { background: var(--berry-soft); }

.btn .label-mobile { display: none; }

/* 「适合您的设备」占一个固定宽度的槽位：只有当前设备那行有内容，
   但每行都留着，版本号那一列才能竖着对齐 */
.tag-slot {
  flex: none;
  width: 84px;
  display: flex;
  align-items: center;
}

.tag {
  flex: none;
  background: var(--berry-soft);
  color: var(--berry);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.pill-soon {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-4);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 6px 14px;
}

.plat-row.is-soon .plat-name,
.plat-row.is-soon .plat-meta { color: var(--ink-4); }
.plat-row.is-soon .plat-icon { color: var(--ink-5); }
.plat-row.is-soon { background: #fcfcfd; }

@media (max-width: 640px) {
  .plat-row { padding: 12px; min-height: 52px; flex-wrap: wrap; }
  .plat-name { width: auto; font-size: 13px; }
  .plat-meta { display: none; }
  /* 手机上没版本号那一列，槽位不用占宽度；没标签就直接不占位 */
  .tag-slot { width: auto; }
  .tag-slot:empty { display: none; }
  .btn { height: 36px; padding: 0 14px; }
  .btn .label-desktop { display: none; }
  .btn .label-mobile { display: inline; }
  .actions.multi { width: 100%; margin-left: 0; }
  .actions.multi .btn { flex: 1; }
}

/* ---------- 更新日志 ---------- */
.log-list { display: grid; gap: 10px; }

.log-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 20px;
  background: var(--white);
}
.log-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-version { font-family: var(--font-num); font-size: 15px; font-weight: 600; }
.log-plat { font-size: 11px; color: var(--ink-3); }
.log-date { margin-left: auto; font-size: 11px; color: var(--ink-4); font-family: var(--font-num); }
.log-note { margin-top: 8px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }

/* ---------- 页脚 ---------- */
.site-footer { margin-top: 40px; background: var(--ink); color: #fff; }
.site-footer .wrap { padding: 28px 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer .f-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.site-footer img { width: 26px; height: 26px; border-radius: 7px; }
.site-footer .links { margin-left: auto; display: flex; gap: 20px; font-size: 12px; color: rgba(255,255,255,.72); }
.site-footer .links a:hover { color: #fff; }
.site-footer .copy { width: 100%; font-size: 11px; color: rgba(255,255,255,.42); }

@media (max-width: 640px) {
  .site-footer .links { margin-left: 0; gap: 16px; }
}

/* ---------- 历史版本 ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2);
  background: var(--white);
}
.chip b { font-family: var(--font-num); font-size: 11px; color: var(--ink-4); font-weight: 500; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.active b { color: rgba(255,255,255,.6); }

.ver-card { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--white); }
.ver-row {
  display: grid;
  grid-template-columns: 120px 92px 1fr 88px 196px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
}
.ver-row:first-child { border-top: 0; }
.ver-row.head { font-size: 11px; color: var(--ink-4); padding: 12px 20px; background: var(--surface); }

.ver-plat { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ver-plat .plat-icon { width: 28px; height: 28px; border-radius: 7px; --logo: 15px; }
.ver-plat .plat-icon svg { width: 15px; height: 15px; }
.ver-num { font-family: var(--font-num); font-size: 14px; font-weight: 600; }
.ver-notes { font-size: 12px; color: var(--ink-2); line-height: 1.6; min-width: 0; }
.ver-size { font-size: 11px; color: var(--ink-3); font-family: var(--font-num); }
.ver-dl { text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ver-count { font-size: 11px; color: var(--ink-4); font-family: var(--font-num); white-space: nowrap; }
.ver-date { font-size: 11px; color: var(--ink-4); font-family: var(--font-num); white-space: nowrap; }

@media (max-width: 860px) {
  .ver-row { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; }
  .ver-row.head { display: none; }
  .ver-plat { grid-column: 1; grid-row: 1; }
  .ver-date { grid-column: 2; grid-row: 1; text-align: right; }
  .ver-num { grid-column: 1; grid-row: 2; font-size: 12px; color: var(--ink-3); }
  .ver-dl { grid-column: 2; grid-row: 2; justify-self: end; }
  .ver-notes { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; }
  .ver-size { grid-column: 1 / -1; grid-row: 4; }
}

/* ---------- 安装说明 ---------- */
.install { max-width: 760px; margin-inline: auto; }
.install h1 { font-size: 26px; margin: 32px 0 6px; letter-spacing: .3px; }
.install .lead { color: var(--ink-2); font-size: 13px; margin: 0 0 8px; }

.step-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 22px; margin-top: 14px; background: var(--white); }
.step-card h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.step-card .sub { font-size: 11px; color: var(--ink-3); margin-bottom: 12px; }
.step-card ol { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.9; }
.step-card ol b { color: var(--ink); font-weight: 500; }
.step-card p { font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }
.step-card code { background: var(--fill); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.step-card.is-soon { background: var(--surface); border-style: dashed; }
.step-card.is-soon h3, .step-card.is-soon .sub, .step-card.is-soon p { color: var(--ink-4); }

.callout {
  display: flex; gap: 10px;
  background: var(--berry-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 12px;
  color: #8c2f40;
  margin-top: 16px;
  line-height: 1.7;
}

.faq { margin-top: 32px; }
.faq h2 { font-size: 17px; margin: 0 0 10px; }
.faq details { border-top: 1px solid var(--line-soft); padding: 12px 0; }
.faq summary { font-size: 13px; font-weight: 500; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '＋'; color: var(--ink-4); margin-right: 8px; }
.faq details[open] summary::before { content: '－'; }
.faq p { font-size: 12px; color: var(--ink-2); margin: 8px 0 0 20px; line-height: 1.8; }

/* ---------- 空态 ---------- */
.empty { padding: 60px 0; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- 无障碍 ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--berry); outline-offset: 2px; border-radius: 4px; }
