/* ============================================================
   青阙 · 下载页 V2 —— 「墨夜鎏金」主题
   与旧版（浅灰底/竹绿渐变/App Store 卡片/胶囊按钮）完全区分：
   · 暗色墨夜背景 + 鎏金强调色，衬线标题营造东方质感
   · 顶栏 + 横向应用头部 + 信息瓦片网格 + 时间线教程
   · 方角金渐变按钮（非胶囊），桌面端双栏布局
   ============================================================ */
:root {
  --bg: #101116;
  --panel: #171a21;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --gold: #e6b45c;
  --gold-bright: #f3d491;
  --gold-deep: #cf8f33;
  --gold-grad: linear-gradient(135deg, #f3d491 0%, #e0a94e 55%, #cf8f33 100%);
  --text: #f2f3f6;
  --text2: #9aa1ad;
  --text3: #6f7480;
  --radius: 18px;
  --serif: 'Songti SC', 'STSong', 'Noto Serif SC', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background:
    radial-gradient(720px 340px at 15% -6%, rgba(230, 180, 92, 0.10), transparent 60%),
    radial-gradient(560px 300px at 88% 4%, rgba(120, 140, 220, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.page { max-width: 720px; margin: 0 auto; padding: 0 16px 8px; }

/* 微信/QQ环境下默认隐藏页面内容，防止闪烁 */
body.wechat-env .page,
html.wechat-env body .page { display: none !important; }

/* ===== Top Bar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 2px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--border);
  display: block;
}
.brand-name {
  font-family: var(--serif);
  font-size: 18px; font-weight: 700; letter-spacing: 5px;
  color: var(--text);
}
.brand-tag {
  font-size: 11px; letter-spacing: 3px;
  color: var(--gold);
  border: 1px solid rgba(230, 180, 92, 0.45);
  border-radius: 999px;
  padding: 4px 12px 4px 15px;
}

/* ===== Layout ===== */
.layout { display: flex; flex-direction: column; gap: 14px; }

/* ===== Panel 通用 ===== */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
.panel-label {
  font-size: 12px; font-weight: 600; letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 14px;
}

/* ===== Hero Panel：横向应用头部 ===== */
.panel-hero { padding: 22px; }
.app-head { display: flex; align-items: center; gap: 18px; }
.app-icon {
  width: 88px; height: 88px; flex-shrink: 0;
  border-radius: 22px; overflow: hidden;
  border: 1px solid rgba(230, 180, 92, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(230, 180, 92, 0.10);
  background: #fff;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-meta { min-width: 0; }
.app-name {
  font-family: var(--serif);
  font-size: 28px; font-weight: 700; letter-spacing: 6px;
  line-height: 1.2;
}
.app-sub { font-size: 12px; color: var(--text2); margin-top: 6px; letter-spacing: 0.5px; }
.rating-line {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.stars { color: var(--gold); font-size: 13px; letter-spacing: 2px; }
.rating-num { font-size: 18px; font-weight: 800; color: var(--text); }
.rating-cap { font-size: 11px; color: var(--text3); }

/* ===== Action：方角金渐变按钮 ===== */
.action { margin-top: 20px; }
.btn-download {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 54px;
  background: var(--gold-grad);
  color: #241703; border: none;
  border-radius: 12px;
  font-size: 17px; font-weight: 800; letter-spacing: 0.5em; text-indent: 0.5em;
  cursor: pointer; text-decoration: none;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(207, 143, 51, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(207, 143, 51, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-download:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(207, 143, 51, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-download::before {
  content: ''; position: absolute;
  top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-18deg);
  animation: sheen 2.8s ease-in-out infinite;
}
@keyframes sheen {
  0%, 55% { left: -120%; }
  80%, 100% { left: 160%; }
}

/* 下载进度条（点击安装后才显示，进度块循环滑动） */
.dl-progress { margin-top: 14px; display: none; }
.dl-progress.active { display: block; }
.dl-track { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.10); overflow: hidden; }
.dl-bar {
  width: 40%; height: 100%; border-radius: 3px;
  background: var(--gold-grad);
  animation: dl-slide 1.3s ease-in-out infinite;
}
@keyframes dl-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}
.dl-meta {
  display: flex; justify-content: space-between;
  margin-top: 7px; font-size: 11px; color: var(--text2); letter-spacing: 0.5px;
}

/* ===== Info Panel：信息瓦片网格 ===== */
.panel-info { padding: 20px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.stat-wide { grid-column: 1 / -1; }
.stat-label { font-size: 11px; color: var(--text3); letter-spacing: 2px; }
.stat-value {
  font-size: 15px; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere;
}
.stat-free { color: var(--gold); font-weight: 800; letter-spacing: 2px; }

/* ===== Guide Panel：时间线步骤 ===== */
.panel-guide { padding: 20px 20px 14px; }
.steps {
  list-style: none;
  counter-reset: step;
  position: relative;
  padding-bottom: 10px;
}
/* 逐项连接线：从上一个序号方块底部连到下一个，最后一步不带线，保证时间线完整 */
.step-item:not(:last-child)::after {
  content: ''; position: absolute;
  left: 14px; top: 34px; bottom: 4px; width: 2px;
  background: linear-gradient(180deg, rgba(230, 180, 92, 0.55), rgba(230, 180, 92, 0.15));
  border-radius: 1px;
}
.step-item {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 48px;
}
.step-item::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid rgba(230, 180, 92, 0.6);
  color: var(--gold);
  font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px rgba(230, 180, 92, 0.08);
}
.step-item:last-child { padding-bottom: 14px; }
.step-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; color: var(--text); letter-spacing: 0.5px; }
.step-desc { font-size: 12px; color: var(--text2); line-height: 1.65; }
.step-desc strong { color: var(--gold); font-weight: 600; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 14px 4px 22px;
  font-size: 10px; color: var(--text3); line-height: 1.7;
  text-align: justify;
}

/* ===== QQ/WeChat 引导页(样式与蜜分发平台引导页一致) ===== */
.overlay-mask {
  position: fixed; inset: 0;
  background: #fff;
  z-index: 9999; display: none;
  flex-direction: column;
  overflow: hidden;
}
.overlay-mask.show { display: flex; }

/* 顶部蓝色引导插画(70% 高度，文字叠加在图上) */
.top-bar-guidance {
  font-size: 15px; color: #fff;
  height: 70%;
  line-height: 1.8;
  padding-left: 20px; padding-top: 20px;
  background: url('../img/tiptop.png?v=1') center top/contain no-repeat;
  flex-shrink: 0;
  box-sizing: border-box;
}
.top-bar-guidance .icon-safari {
  width: 25px; height: 25px;
  vertical-align: middle; margin: 0 0.2em;
}

/* 复制提示(蓝色文字 + 两侧横线装饰) */
.app-download-tip {
  margin: 0 auto; width: 290px;
  text-align: center; font-size: 15px; color: #2466f4;
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAcAQMAAACak0ePAAAABlBMVEUAAAAdYfh+GakkAAAAAXRSTlMAQObYZgAAAA5JREFUCNdjwA8acEkAAAy4AIE4hQq/AAAAAElFTkSuQmCC') left center / auto 15px repeat-x;
  max-width: 86%;
}
.app-download-tip .guidance-desc { background-color: #fff; padding: 0 5px; }

/* 复制网址按钮 */
.app-download-btn {
  display: block; width: 214px; height: 40px;
  line-height: 40px; margin: 18px auto 0 auto;
  text-align: center; font-size: 18px;
  color: #2466f4;
  border-radius: 20px;
  border: 0.5px #2466f4 solid;
  text-decoration: none;
  background: #fff;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.app-download-btn.success { background-color: #2466f4; color: #fff; }

/* ===== Browser Prompt Overlay (iPhone non-Safari) ===== */
.browser-prompt {
  position: fixed; inset: 0;
  background: rgba(5, 6, 10, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999; display: none;
  align-items: center; justify-content: center;
}
.browser-prompt.show { display: flex; }
.browser-prompt-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px; text-align: center;
  max-width: 340px; width: 90%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(230, 180, 92, 0.12);
}
.browser-prompt-box img {
  width: 80px; height: 80px; margin-bottom: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
}
.browser-prompt-box h3 {
  font-size: 18px; margin-bottom: 8px; color: var(--text);
}
.browser-prompt-box p {
  font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 20px;
}
.browser-prompt-box p strong { color: var(--gold); }
.browser-prompt-box .btn-ok {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold-grad);
  color: #241703; border: none;
  border-radius: 12px; padding: 11px 36px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(207, 143, 51, 0.35);
}
.browser-prompt-box .btn-ok:active { transform: scale(0.96); }

/* ===== Copy Toast ===== */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(23, 26, 33, 0.95);
  border: 1px solid rgba(230, 180, 92, 0.4);
  color: #fff;
  padding: 10px 24px; border-radius: 12px;
  font-size: 14px; z-index: 99999;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
  max-width: 86%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.show { opacity: 1; }

/* ===== 平板（481–919px）：单栏加宽 ===== */
@media (min-width: 481px) and (max-width: 919px) {
  .page { max-width: 640px; padding: 0 20px 8px; }
  .topbar { padding-top: 24px; }
  .brand-name { font-size: 20px; }
  .panel { padding: 24px; }
  .panel-hero { padding: 26px; }
  .app-icon { width: 100px; height: 100px; border-radius: 24px; }
  .app-name { font-size: 32px; }
  .app-sub { font-size: 13px; }
  .btn-download { height: 58px; font-size: 18px; }
  .stat-value { font-size: 16px; }
  .step-desc { font-size: 13px; }
  .footer { font-size: 12px; }
}

/* ===== 桌面端（≥920px）：双栏布局 ===== */
@media (min-width: 920px) {
  .page { max-width: 960px; padding: 0 24px 12px; }
  .topbar { padding: 28px 4px 26px; }
  .brand-logo { width: 38px; height: 38px; border-radius: 11px; }
  .brand-name { font-size: 22px; letter-spacing: 6px; }
  .brand-tag { font-size: 12px; padding: 5px 14px 5px 17px; }

  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  .panel-hero { grid-column: 1; padding: 28px; }
  .panel-info { grid-column: 2; padding: 24px; }
  .panel-guide, .footer { grid-column: 1 / -1; }
  .panel-guide { padding: 24px 28px 16px; }

  .app-icon { width: 112px; height: 112px; border-radius: 26px; }
  .app-name { font-size: 36px; letter-spacing: 8px; }
  .app-sub { font-size: 14px; margin-top: 8px; }
  .rating-line { margin-top: 12px; }
  .stars { font-size: 15px; }
  .rating-num { font-size: 22px; }
  .rating-cap { font-size: 12px; }

  .btn-download { height: 60px; font-size: 19px; border-radius: 14px; }
  .dl-progress { margin-top: 16px; }
  .dl-meta { font-size: 12px; }

  .stat-grid { gap: 12px; }
  .stat { padding: 14px 16px; border-radius: 14px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 17px; }

  .step-item { padding-left: 54px; padding-bottom: 20px; }
  .step-item::before { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
  .step-item:not(:last-child)::after { left: 16px; top: 38px; }
  .step-title { font-size: 16px; }
  .step-desc { font-size: 14px; }

  .footer { font-size: 12px; padding: 16px 8px 28px; }
}

/* ===== 手机（≤480px） ===== */
@media (max-width: 480px) {
  .page { padding: 0 12px 8px; }
  .topbar { padding: 12px 2px 14px; }
  .brand-logo { width: 28px; height: 28px; border-radius: 8px; }
  .brand-name { font-size: 16px; letter-spacing: 4px; }
  .brand-tag { font-size: 10px; padding: 3px 10px 3px 13px; letter-spacing: 2px; }

  .layout { gap: 10px; }
  .panel { padding: 16px; border-radius: 16px; }
  .panel-hero { padding: 18px 16px; }
  .app-head { gap: 14px; }
  .app-icon { width: 72px; height: 72px; border-radius: 18px; }
  .app-name { font-size: 22px; letter-spacing: 4px; }
  .app-sub { font-size: 11px; margin-top: 4px; }
  .rating-line { margin-top: 8px; gap: 6px; }
  .stars { font-size: 12px; }
  .rating-num { font-size: 15px; }
  .rating-cap { font-size: 10px; }

  .action { margin-top: 16px; }
  .btn-download { height: 50px; font-size: 16px; border-radius: 10px; }
  .dl-progress { margin-top: 12px; }

  .stat-grid { gap: 8px; }
  .stat { padding: 10px 12px; border-radius: 10px; }
  .stat-label { font-size: 10px; letter-spacing: 1.5px; }
  .stat-value { font-size: 13px; }

  .panel-guide { padding: 16px 16px 12px; }
  .panel-label { font-size: 11px; letter-spacing: 3px; margin-bottom: 12px; }
  .step-item { padding-left: 42px; padding-bottom: 15px; }
  .step-item::before { width: 27px; height: 27px; border-radius: 8px; font-size: 12px; }
  .step-item:not(:last-child)::after { left: 12.5px; top: 31px; }
  .step-title { font-size: 13px; }
  .step-desc { font-size: 11px; }

  .footer { padding: 12px 2px 18px; font-size: 9px; }

  .browser-prompt-box { padding: 24px 20px; max-width: 300px; }
  .browser-prompt-box img { width: 64px; height: 64px; }
  .browser-prompt-box h3 { font-size: 16px; }
  .browser-prompt-box p { font-size: 13px; margin-bottom: 16px; }
  .browser-prompt-box .btn-ok { padding: 9px 28px; font-size: 14px; }

  .toast { font-size: 13px; padding: 9px 20px; bottom: 70px; }
}
