:root {
  color-scheme: dark;
  --bg: #121512;
  --surface: #1c211d;
  --border: #354038;
  --ink: #f3f6f3;
  --muted: #a6b4aa;
  --accent: #a5e7bc;
  --accent-ink: #12331d;
  font-family: Roboto, "Noto Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

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

button, a, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, select { font: inherit; }
button, summary, select { cursor: pointer; }
button { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
svg, img { display: block; }
svg { flex-shrink: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.page {
  max-width: 560px;
  margin-inline: auto;
  padding-bottom: calc(105px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: calc(12px + env(safe-area-inset-top)) 22px 12px;
  border-bottom: 1px solid var(--border);
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  line-height: 1.4;
}
.topbar-title svg { width: 21px; height: 21px; color: var(--accent); }
.topbar-title span { overflow-wrap: anywhere; }
.topbar-link {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ---------- App 概要 ---------- */
.app-summary { padding: 28px 22px 22px; }
.app-identity { display: flex; align-items: center; gap: 18px; }
.app-logo {
  width: 82px; height: 82px;
  border-radius: 20px;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid #ffffff0d;
}
.app-heading { min-width: 0; }
.app-heading p { color: var(--accent); font-size: 12px; margin-bottom: 5px; }
.app-heading h1 {
  font-size: 29px;
  font-weight: 720;
  line-height: 1.18;
  letter-spacing: -0.6px;
  overflow-wrap: anywhere;
}

.app-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 25px 0 22px;
}
.app-facts > div {
  text-align: center;
  padding: 1px 8px;
  border-inline-end: 1px solid var(--border);
  min-width: 0;
}
.app-facts > div:first-child { padding-inline-start: 0; }
.app-facts > div:last-child { padding-inline-end: 0; border: 0; }
.app-facts b { display: block; font-size: 16px; line-height: 26px; font-weight: 650; }
.app-facts span {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.app-facts .age-fact b { font-size: 24px; letter-spacing: -0.5px; }

/* ---------- 下载按钮 ---------- */
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}
.download-btn svg { width: 21px; height: 21px; }
.download-btn:active { background: #8cdba8; }
.download-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }
.preview-note { font-size: 11px; color: #c0d5bc; text-align: center; margin-top: 7px; }

/* ---------- 图片预览 ---------- */
.gallery-section { padding-top: 9px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-inline: 22px;
}
.section-heading h2 { min-width: 0; overflow-wrap: anywhere; }
h2 { font-size: 20px; line-height: 1.3; letter-spacing: -0.35px; font-weight: 650; }
.photo-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  color: var(--muted);
  white-space: nowrap;
}
.section-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  padding-inline: 22px;
  margin-top: 7px;
}
.photo-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 22px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 18px 22px 4px;
  touch-action: pan-x pan-y;
}
.photo-strip::-webkit-scrollbar { display: none; }
.photo-card {
  display: block;
  flex: 0 0 min(67vw, 240px);
  width: min(67vw, 240px);
  padding: 0;
  border: 1px solid #485449;
  border-radius: 16px;
  background: #090b09;
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
}
.photo-card img {
  width: 100%;
  height: calc(min(67vw, 240px) * 1.333333);
  object-fit: contain;
}
.photo-card:focus-visible { outline-offset: -4px; }
.photo-card[aria-current="true"] { border-color: var(--accent); }
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 13px 22px 0;
}
.arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
}
.arrow svg { width: 18px; height: 18px; }
.dots { display: flex; gap: 6px; align-items: center; }
.dots i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 5px;
  background: #4b584e;
  transition: width 0.25s, background 0.25s;
}
.dots i.active { width: 17px; background: var(--accent); }

/* ---------- 通用区块 ---------- */
.section { padding: 26px 22px 0; }
.section > p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
  margin-top: 12px;
  overflow-wrap: anywhere;
}

/* ---------- 折叠项 ---------- */
.steps { margin-top: 15px; }
.steps, .help > details:first-of-type { border-top: 1px solid var(--border); }
details { border-bottom: 1px solid var(--border); }
summary {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  font-size: 14px;
  font-weight: 550;
  min-height: 60px;
  line-height: 1.5;
  padding: 16px 0;
  overflow-wrap: anywhere;
}
summary::-webkit-details-marker { display: none; }
.step-number {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #263e2e;
  color: var(--accent);
  font-size: 12px;
}
.plus {
  flex-shrink: 0;
  margin-inline-start: auto;
  font-size: 21px;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.15s;
}
details[open] .plus { transform: rotate(45deg); }
details > p {
  padding: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.section > .small-note { font-size: 12px; line-height: 1.7; margin-top: 13px; }
.help h2 { margin-bottom: 16px; }

/* ---------- 页脚 ---------- */
footer { margin: 30px 22px 0; padding-top: 23px; border-top: 1px solid var(--border); }
footer b { font-weight: 550; font-size: 14px; overflow-wrap: anywhere; }
footer p { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- 底部固定下载栏 ---------- */
.install-dock {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 10;
  max-width: 560px;
  width: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px max(18px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: #1c211dfc;
  border-top: 1px solid var(--border);
}
.dock-logo { width: 42px; height: 42px; border-radius: 11px; }
.dock-brand {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}
.dock-cta {
  flex: 0 1 auto;
  max-width: 52%;
  min-width: 95px;
  font-size: 14px;
  min-height: 46px;
  padding: 11px 15px;
  border-radius: 10px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- 全屏图片查看 ---------- */
#photo-viewer {
  padding: 0;
  margin: auto;
  border: 1px solid #354038;
  border-radius: 0;
  width: 100vw;
  max-width: 620px;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  background: #070a08;
  color: var(--ink);
  overflow: hidden;
}
#photo-viewer::backdrop { background: #000d; }
.viewer-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  flex-shrink: 0;
}
.viewer-top > span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.viewer-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: #222a24;
}
.viewer-close svg { width: 20px; height: 20px; }
.viewer-image {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  touch-action: pan-y;
}
.viewer-image img { width: 100%; height: 100%; object-fit: contain; }
.viewer-controls {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 24px 20px;
}
.viewer-arrow {
  display: grid;
  place-items: center;
  min-width: 80px;
  min-height: 48px;
  background: #222a24;
  border: 1px solid #3a483f;
  border-radius: 12px;
}
.viewer-arrow svg { width: 22px; height: 22px; }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 359px) {
  .topbar { padding-inline: 16px; gap: 8px; }
  .topbar-title { gap: 8px; font-size: 13px; }
  .app-summary, .section { padding-inline: 17px; }
  .app-identity { gap: 13px; }
  .app-logo { width: 70px; height: 70px; border-radius: 17px; }
  .app-heading h1 { font-size: 26px; }
  .app-facts { margin-block: 22px 19px; }
  .app-facts > div { padding-inline: 6px; }
  .photo-strip { padding-inline: 17px; gap: 10px; scroll-padding-inline: 17px; }
  .section-heading, .section-note { padding-inline: 17px; }
  .install-dock { gap: 8px; padding-inline: 12px; }
  .dock-logo { width: 36px; height: 36px; border-radius: 9px; }
  .dock-cta { font-size: 13px; padding-inline: 12px; }
  .dock-brand { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
