/* ============================================================
   一折手游盒子 · 下载站样式
   ============================================================ */

:root {
  --blue: #2563eb;
  --blue-d: #1d4ed8;
  --blue-50: #eff4ff;
  --blue-100: #dbe6ff;
  --ink: #0e1628;
  --ink-2: #1a2438;
  --text: #26314a;
  --muted: #5b6478;
  --muted-2: #8b94a8;
  --line: #e6eaf2;
  --bg: #f5f7fb;
  --red: #ef4444;
  --red-50: #fff1f0;
  --gold: #f59e0b;
  --green: #10b981;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px -2px rgba(14, 22, 40, .08);
  --shadow: 0 10px 30px -12px rgba(14, 22, 40, .16);
  --shadow-lg: 0 24px 60px -24px rgba(14, 22, 40, .28);
  --max: 1120px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-d); }
img { max-width: 100%; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.35; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.hd-inner { display: flex; align-items: center; gap: 22px; height: 62px; }

.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--ink); white-space: nowrap; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.logo small { display: block; font-size: 10px; font-weight: 500; color: var(--muted-2); letter-spacing: .14em; }

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 8px 13px; border-radius: 9px; font-size: 14.5px; color: var(--muted); transition: background .18s, color .18s; }
.nav a:hover { background: var(--blue-50); color: var(--blue); }

.hd-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none; width: 38px; height: 38px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 16px; height: 1.6px; background: var(--ink); border-radius: 2px; content: ""; position: relative;
}
.nav-toggle span::before { position: absolute; top: -5px; }
.nav-toggle span::after { position: absolute; top: 5px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 20px; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #3b82f6, var(--blue)); color: #fff; box-shadow: 0 10px 24px -12px rgba(37, 99, 235, .8); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 30px -12px rgba(37, 99, 235, .95); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue-100); color: var(--blue); background: var(--blue-50); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 13px; }

/* ---------- crumb ---------- */
.crumb { padding: 18px 0 4px; font-size: 13px; color: var(--muted-2); }
.crumb a { color: var(--muted-2); }
.crumb a:hover { color: var(--blue); }
.crumb span { margin: 0 7px; opacity: .6; }

/* ---------- app hero ---------- */
.app-hero { padding: 12px 0 0; }
.app-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 26px;
  display: grid; grid-template-columns: 116px 1fr; gap: 24px;
}
.app-icon {
  width: 116px; height: 116px; border-radius: 24px; overflow: hidden;
  box-shadow: 0 14px 30px -14px rgba(14, 22, 40, .5); background: #eef2fa;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.app-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-name h1 { font-size: 27px; font-weight: 700; }
.tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--blue-50); color: var(--blue); }
.tag-red { background: var(--red-50); color: var(--red); }
.tag-gold { background: #fff7e8; color: #b45309; }

.app-sub { margin-top: 7px; color: var(--muted); font-size: 14.5px; }

.app-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 15px; font-size: 13px; color: var(--muted); }
.app-meta b { color: var(--ink); font-weight: 600; }

.app-rate { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 15px; }
.app-rate b { color: var(--ink); font-size: 18px; }

.app-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.app-actions .note { font-size: 12.5px; color: var(--muted-2); }

/* ---------- download panel ---------- */
.dl-panel {
  margin-top: 18px; border-radius: var(--radius-lg); padding: 24px 26px;
  background: linear-gradient(135deg, #0f1a33 0%, #16233f 55%, #1a2b4d 100%);
  color: #fff; position: relative; overflow: hidden;
}
.dl-panel::after {
  content: ""; position: absolute; right: -90px; top: -110px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, .38), transparent 68%);
}
.dl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; position: relative; }
.dl-head h2 { color: #fff; font-size: 17px; }
.dl-head span { font-size: 12.5px; color: rgba(255, 255, 255, .5); }

.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; position: relative; }
.dl-item {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 15px; padding: 18px 20px; display: flex; align-items: center; gap: 15px;
  transition: background .2s, border-color .2s, transform .15s;
}
.dl-item:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); transform: translateY(-2px); }
.dl-item .di { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none; background: rgba(59, 130, 246, .22); color: #7fb0ff; }
.dl-item .di svg { width: 22px; height: 22px; }
.dl-item b { display: block; color: #fff; font-size: 15px; }
.dl-item span { display: block; color: rgba(255, 255, 255, .55); font-size: 12.5px; margin-top: 2px; }
.dl-item .go { margin-left: auto; flex: none; color: #7fb0ff; font-size: 13px; font-weight: 600; }

.dl-tip { margin-top: 14px; font-size: 12.5px; color: rgba(255, 255, 255, .5); position: relative; }
.dl-tip b { color: #ffd479; }

/* ---------- shots ---------- */
.shots { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 0 20px 24px; box-shadow: var(--shadow-sm); }
.shots-head { display: flex; align-items: center; justify-content: space-between; padding-right: 24px; margin-bottom: 14px; }
.shots-head h2 { font-size: 16px; }
.shots-head span { font-size: 12.5px; color: var(--muted-2); }
.shot-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.shot-row::-webkit-scrollbar { height: 5px; }
.shot-row::-webkit-scrollbar-thumb { background: #d5dce9; border-radius: 3px; }
.shot { flex: none; width: 104px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #f7f9fd; }
.shot img { width: 100%; height: 104px; object-fit: cover; display: block; }
.shot b { display: block; font-size: 11.5px; font-weight: 600; padding: 7px 8px; color: var(--ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- section ---------- */
.section { padding: 36px 0 4px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { font-size: 20px; }
.sec-head span { font-size: 12.5px; color: var(--muted-2); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.panel p + p { margin-top: 12px; }
.panel h3 { font-size: 16.5px; margin: 22px 0 10px; }
.panel h3:first-child { margin-top: 0; }
.panel li { margin: 7px 0; }
.panel strong { color: var(--ink); }

.answer-box {
  background: linear-gradient(180deg, #f4f8ff, #fff); border: 1px solid var(--blue-100);
  border-left: 3px solid var(--blue); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px;
}
.answer-box b { color: var(--blue); }

/* ---------- features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.feature .fi { width: 38px; height: 38px; border-radius: 11px; background: var(--blue-50); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.feature .fi svg { width: 19px; height: 19px; }
.feature b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 5px; }
.feature p { font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* ---------- game grid ---------- */
.game-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.game { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 10px; text-align: center; box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .2s; }
.game:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.game img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 11px; display: block; }
.game b { display: block; font-size: 12.5px; color: var(--ink); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game span { display: block; font-size: 11px; color: var(--red); font-weight: 600; margin-top: 1px; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; position: relative; box-shadow: var(--shadow-sm); }
.step::before {
  counter-increment: s; content: counter(s);
  position: absolute; top: -12px; left: 20px; width: 26px; height: 26px; border-radius: 8px;
  background: var(--blue); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step b { display: block; margin: 8px 0 5px; font-size: 14.5px; color: var(--ink); }
.step p { font-size: 13.5px; color: var(--muted); }

/* ---------- faq ---------- */
.faq { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 17px 22px; font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; font-family: inherit;
}
.faq-q::after { content: "+"; font-size: 20px; font-weight: 400; color: var(--muted-2); transition: transform .2s; flex: none; }
.faq-item.is-open .faq-q::after { transform: rotate(45deg); color: var(--blue); }
.faq-a { display: none; padding: 0 22px 18px; font-size: 14px; color: var(--muted); line-height: 1.85; }
.faq-item.is-open .faq-a { display: block; }
.faq-a strong { color: var(--ink); }

/* ---------- related ---------- */
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); transition: transform .16s, border-color .2s; }
.rel:hover { transform: translateY(-2px); border-color: var(--blue-100); }
.rel b { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 4px; }
.rel span { font-size: 13px; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { margin-top: 44px; background: #0d1526; color: rgba(255, 255, 255, .55); padding: 34px 0 26px; font-size: 13px; }
.ft-top { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.ft-brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 600; font-size: 16px; }
.ft-brand img { width: 26px; height: 26px; border-radius: 7px; }
.ft-links { display: flex; gap: 20px; flex-wrap: wrap; }
.ft-links a { color: rgba(255, 255, 255, .55); }
.ft-links a:hover { color: #fff; }
.ft-bottom { padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; }
.ft-bottom a { color: rgba(255, 255, 255, .55); }

/* ---------- 404 ---------- */
.nf { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 60px 20px; }
.nf-code { font-size: 84px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, #3b82f6, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf h1 { font-size: 22px; margin: 10px 0 8px; }
.nf p { color: var(--muted); margin-bottom: 22px; font-size: 14px; }

/* ---------- 显现动画：默认可见，只有脚本把视口外的元素标记为 pending 才淡入 ---------- */
.reveal { opacity: 1; transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .3, 1); }
.reveal.pending { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.pending { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .game-grid { grid-template-columns: repeat(5, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav {
    position: fixed; left: 0; right: 0; top: 62px; background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 10px 16px 16px; gap: 2px; margin: 0;
    transform: translateY(-10px); opacity: 0; pointer-events: none; transition: all .2s; box-shadow: var(--shadow);
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px; }
  .nav-toggle { display: flex; }
  .hd-inner { height: 56px; gap: 12px; }
  .logo { font-size: 16px; }
  .logo small { display: none; }
  .hd-right .btn { display: none; }

  .app-card { grid-template-columns: 84px 1fr; gap: 16px; padding: 18px; }
  .app-icon { width: 84px; height: 84px; border-radius: 19px; }
  .app-name h1 { font-size: 21px; }
  .app-sub { font-size: 13.5px; }
  .app-meta { gap: 6px 14px; font-size: 12.5px; }
  .app-actions .btn { width: 100%; }
  .app-actions .note { width: 100%; }

  .dl-panel { padding: 20px 18px; }
  .dl-grid { grid-template-columns: 1fr; }
  .dl-item { padding: 15px 16px; }
  .dl-item .go { display: none; }

  .shots { padding: 18px 0 18px 18px; }
  .shots-head { padding-right: 18px; }
  .shot { width: 88px; }
  .shot img { height: 88px; }

  .panel { padding: 20px 18px; }
  .section { padding: 28px 0 4px; }
  .sec-head h2 { font-size: 18px; }

  .feature-grid { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .related { grid-template-columns: 1fr; }

  .faq-q { font-size: 14.5px; padding: 15px 18px; }
  .faq-a { padding: 0 18px 16px; font-size: 13.5px; }

  .ft-top { flex-direction: column; gap: 16px; }
  .ft-bottom { flex-direction: column; gap: 8px; }

  input, textarea, select { font-size: 16px; }
  body { overflow-x: hidden; }
}

@media (max-width: 400px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ 移动端：应用信息区收紧 ============ */
@media (max-width: 860px) {
  .app-card { grid-template-columns: 74px 1fr; gap: 14px; padding: 16px; }
  .app-icon { width: 74px; height: 74px; border-radius: 17px; }
  .app-name { gap: 6px; }
  .app-name h1 { font-size: 19px; }
  .tag { font-size: 10.5px; padding: 2px 7px; border-radius: 5px; }
  .app-sub { font-size: 12.5px; margin-top: 5px; line-height: 1.6; }

  /* 信息项改为两列网格，避免每项单独占一行 */
  .app-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-top: 11px; font-size: 12px; }
  .app-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* 评价行改为独立两行，左对齐 */
  .app-rate { display: block; margin-top: 10px; font-size: 12px; line-height: 1.7; }
  .app-rate .stars { display: inline-block; font-size: 13px; margin-right: 6px; }
  .app-rate > span:last-child { display: block; color: var(--muted); }

  .app-actions { margin-top: 14px; gap: 8px; }
  .app-actions .btn-lg { height: 46px; font-size: 15px; border-radius: 12px; }
  .app-actions .note { font-size: 11.5px; }

  .dl-panel { margin-top: 14px; }
  .dl-head { margin-bottom: 12px; }
  .dl-head h2 { font-size: 15.5px; }
  .dl-head span { font-size: 11.5px; }
  .dl-item .di { width: 40px; height: 40px; border-radius: 11px; }
  .dl-item b { font-size: 14px; }
  .dl-item span { font-size: 11.5px; }
  .dl-tip { font-size: 11.5px; line-height: 1.7; }

  .shots { margin-top: 14px; }
  .shot b { font-size: 11px; padding: 6px 6px; }
}

/* 品类导航 */
.cat-nav { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; }
.cat-nav a {
  background: #fff; border: 0.5px solid var(--line); border-radius: 12px;
  padding: 16px 12px; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform .16s, border-color .2s, box-shadow .2s;
}
.cat-nav a:hover { transform: translateY(-2px); border-color: var(--blue-100); box-shadow: var(--shadow); }
.cat-nav b { display: block; font-size: 14.5px; color: var(--ink); }
.cat-nav span { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
@media (max-width: 860px) {
  .cat-nav { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
  .cat-nav a { padding: 12px 8px; border-radius: 10px; }
  .cat-nav b { font-size: 13.5px; }
}
@media (max-width: 400px) {
  .cat-nav { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
