/* ==========================================================================
   物语漫画官网 · wuyumanhua.cn
   主题：深夜画室（深墨蓝 + 青玉 + 琥珀）像素风
   设计要点：硬边阴影（retro 像素感）、锐角边框、克制动效、响应式
   ========================================================================== */

/* ---------- 字体 ---------- */
@import url('https://miaoda.feishu.cn/fonts/css2?family=Press+Start+2P&family=Noto+Sans+SC:wght@400;500;700;900&display=swap');

/* ---------- 设计变量 ---------- */
:root {
  --bg:        #0d131f;
  --bg-2:      #101a2b;
  --panel:     #141f31;
  --panel-2:   #182436;
  --line:      #263752;
  --line-hi:   #33496b;
  --ink:       #e8eef7;
  --muted:     #93a4be;
  --teal:      #38d6c1;
  --teal-ink:  #0e4f47;
  --amber:     #ffb338;
  --amber-ink: #4a2c00;
  --coral:     #ff6b5e;
  --font-pixel: 'Press Start 2P', 'Courier New', monospace;
  --font-body:  'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --shadow-hard: 5px 5px 0 rgba(0, 0, 0, 0.35);
  --shadow-hard-sm: 3px 3px 0 rgba(0, 0, 0, 0.35);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

ul { list-style: none; }

/* ---------- 通用容器 ---------- */
.section {
  padding: 96px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-alt { max-width: none; background: var(--bg-2); }

.section-alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

.section-head {
  text-align: center;
  margin-bottom: 56px;
}

.section-eyebrow {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--teal);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.section-desc {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 14px 34px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  user-select: none;
}

.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35); }

.btn-download { background: var(--amber); color: var(--amber-ink); border-color: #ffd38a; }
.btn-download:hover { background: #ffc256; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-hi); }
.btn-ghost:hover { background: var(--panel); border-color: var(--ink); }

.btn-sm { padding: 9px 20px; font-size: 14px; box-shadow: var(--shadow-hard-sm); }
.btn-lg { padding: 18px 48px; font-size: 19px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 19, 31, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-logo { width: 42px; height: 42px; image-rendering: pixelated; }

.brand-name { font-size: 21px; font-weight: 900; letter-spacing: 2px; }

.brand-tag {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1px;
  align-self: flex-end;
  padding-bottom: 5px;
}

.main-nav { display: flex; gap: 6px; margin-left: auto; }

.nav-link {
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color .15s ease, background .15s ease;
}

.nav-link:hover { color: var(--ink); background: var(--panel); }

.nav-link.is-active { color: var(--teal); border-color: var(--line-hi); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line-hi); flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); transition: transform .15s ease, opacity .15s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; max-width: none; padding: 88px 24px 100px; overflow: hidden; }

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 78% 30%, rgba(56, 214, 193, 0.10), transparent 70%),
    radial-gradient(50% 45% at 12% 75%, rgba(255, 179, 56, 0.08), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 1px, transparent 1px 40px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--teal);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(46px, 7vw, 86px);
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 1.05;
  margin-bottom: 22px;
  text-shadow: 4px 4px 0 rgba(56, 214, 193, 0.35);
}

.hero-sub {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 36px;
}

.hero-cta { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 52px; }

.hero-stats { display: flex; gap: 48px; }

.stat dt {
  font-family: var(--font-pixel);
  font-size: 26px;
  color: var(--amber);
  margin-bottom: 6px;
}

.stat dd { font-size: 14px; color: var(--muted); letter-spacing: 1px; }

.hero-visual { position: relative; display: flex; justify-content: center; }

.game-window {
  position: relative;
  width: min(320px, 78vw);
  padding: 10px;
  background: var(--panel);
  border: 2px solid var(--line-hi);
  box-shadow: var(--shadow-hard), 0 0 0 4px rgba(56, 214, 193, 0.12);
}

.game-window img { width: 100%; height: auto; image-rendering: pixelated; }

.window-badge {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 64px;
  height: 64px;
  background: var(--panel);
  border: 2px solid var(--amber);
  box-shadow: var(--shadow-hard-sm);
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-6deg);
}

.window-badge img { width: 46px; height: 46px; image-rendering: pixelated; }

.game-window figcaption {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--amber);
  padding-top: 10px;
  letter-spacing: 1px;
}

.hero-spark { position: absolute; width: 90px; height: 90px; top: -34px; right: 4%; opacity: .85; }
.hero-spark-b { top: auto; bottom: -30px; right: 30%; width: 70px; height: 70px; opacity: .7; }

/* ---------- 产品展示 ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hard-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, border-color .15s ease;
}

.product-card:hover { transform: translateY(-4px); border-color: var(--teal); }

.product-num {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--teal);
  margin-bottom: 12px;
}

.product-shot { border: 1px solid var(--line); margin-bottom: 16px; overflow: hidden; }
.product-shot img { width: 100%; height: auto; transition: transform .2s ease; }
.product-card:hover .product-shot img { transform: scale(1.04); }

.product-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.product-card p { font-size: 14px; color: var(--muted); }

/* ---------- 玩法特色 ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hard-sm);
  padding: 32px 24px;
  text-align: center;
  transition: transform .15s ease, border-color .15s ease;
}

.feature-card:hover { transform: translateY(-4px); border-color: var(--amber); }

.feature-icon { width: 56px; height: 56px; margin: 0 auto 20px; }

.feature-card h3 { font-size: 21px; font-weight: 900; letter-spacing: 1px; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--muted); }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }

.chip {
  padding: 11px 22px;
  min-height: 44px;
  font-size: 15px;
  border: 1px solid var(--line-hi);
  color: var(--muted);
  background: transparent;
  transition: all .15s ease;
}

.chip:hover { color: var(--ink); border-color: var(--ink); }

.chip.is-active { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); font-weight: 700; }

/* ---------- 漫画工坊 ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.work-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hard-sm);
  transition: transform .15s ease, border-color .15s ease;
}

.work-card:hover { transform: translateY(-4px); border-color: var(--teal); }

.work-card.is-hidden { display: none; }

.work-cover { padding: 16px 16px 0; }

.pixel-cover {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line-hi);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.25);
}

.work-info { padding: 18px; }

.work-title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.work-author { font-size: 14px; color: var(--muted); margin-bottom: 12px; }

.work-meta { display: flex; align-items: center; justify-content: space-between; }

.tag {
  display: inline-block;
  font-size: 13px;
  padding: 3px 10px;
  border: 1px solid var(--teal);
  color: var(--teal);
}

.hot { font-size: 14px; color: var(--amber); font-weight: 700; }

/* ---------- 热门排行 ---------- */
.rank-list { display: flex; flex-direction: column; gap: 20px; }

.rank-item {
  display: grid;
  grid-template-columns: 64px 72px 1fr minmax(160px, 220px) 90px;
  gap: 20px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hard-sm);
  padding: 18px 22px;
}

.rank-no {
  font-family: var(--font-pixel);
  font-size: 22px;
  text-align: center;
}

.rank-1 { color: var(--amber); }
.rank-2 { color: #cfd8e6; }
.rank-3 { color: #c98a4b; }

.rank-cover {
  width: 72px;
  height: 90px;
  border: 1px solid var(--line-hi);
  background-size: 9px 9px;
}

.rank-cover-red {
  background-color: #2c2838;
  background-image:
    linear-gradient(135deg, transparent 0 42%, #ff5a3c 42% 62%, transparent 62%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 9px);
}

.rank-cover-pink {
  background-color: #241a30;
  background-image:
    radial-gradient(circle at 60% 45%, #ff6fa5 0 28%, transparent 30%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 9px);
}

.rank-cover-green {
  background-color: #1a2418;
  background-image:
    radial-gradient(circle at 45% 50%, #7fdc6a 0 30%, transparent 32%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 9px);
}

.rank-info h3 { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.rank-info p { font-size: 14px; color: var(--muted); }

.rank-bar { height: 14px; background: var(--bg-2); border: 1px solid var(--line-hi); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--amber)); }

.rank-hot { font-family: var(--font-pixel); font-size: 13px; color: var(--amber); text-align: right; }

/* ---------- 作品详情 ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: start;
}

.detail-story h3, .detail-side h3 { font-size: 22px; font-weight: 900; letter-spacing: 1px; margin-bottom: 18px; }

.detail-story p { color: var(--muted); margin-bottom: 16px; }

.story-points { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }

.story-points li {
  position: relative;
  padding-left: 26px;
  font-size: 15px;
}

.story-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 12px; height: 12px;
  background: var(--teal);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.info-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid var(--line);
  margin-bottom: 36px;
}

.info-table th, .info-table td {
  padding: 11px 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.info-table th { background: var(--panel-2); color: var(--teal); font-weight: 500; width: 34%; }
.info-table td { color: var(--ink); }

.faq-title { margin-top: 8px; }

.faq-item { border: 1px solid var(--line); background: var(--panel); margin-bottom: 12px; }

.faq-item summary {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: color .15s ease;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--teal);
  font-family: var(--font-pixel);
  font-size: 13px;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item[open] summary { color: var(--teal); }

.faq-item p { padding: 0 18px 16px; font-size: 14px; color: var(--muted); }

/* ---------- 下载 CTA ---------- */
.section-download { max-width: none; padding: 96px 24px; }

.section-download > .download-panel { max-width: 1200px; margin: 0 auto; }

.download-panel {
  background: var(--panel);
  border: 2px solid var(--line-hi);
  box-shadow: var(--shadow-hard);
  padding: 72px 24px;
  text-align: center;
  position: relative;
}

.download-panel::before, .download-panel::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  background: var(--amber);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

.download-panel::before { top: -9px; left: -9px; }
.download-panel::after { bottom: -9px; right: -9px; background: var(--teal); }

.download-logo { width: 88px; height: 88px; margin: 0 auto 22px; image-rendering: pixelated; }

.download-title { font-size: clamp(26px, 4vw, 38px); font-weight: 900; letter-spacing: 2px; margin-bottom: 12px; }
.download-desc { color: var(--muted); margin-bottom: 36px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); }

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }

.footer-logo { width: 46px; height: 46px; image-rendering: pixelated; }

.footer-name { font-size: 18px; font-weight: 900; letter-spacing: 2px; }
.footer-sub { font-family: var(--font-pixel); font-size: 8px; color: var(--muted); letter-spacing: 1px; }

.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { display: inline-block; padding: 8px 4px; font-size: 14px; color: var(--muted); transition: color .15s ease; }
.footer-nav a:hover { color: var(--teal); }

.footer-copy { font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 46px;
  height: 46px;
  background: var(--panel);
  border: 2px solid var(--teal);
  box-shadow: var(--shadow-hard-sm);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: transform .15s ease;
}

.to-top:hover { transform: translateY(-3px); }
.to-top svg { width: 20px; height: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .product-grid, .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { order: -1; }
  .rank-item { grid-template-columns: 48px 64px 1fr 90px; }
  .rank-bar { display: none; }
  .detail-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .section { padding: 72px 18px; }

  .main-nav {
    position: fixed;
    top: 71px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 18px 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
  }

  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

  .nav-link { padding: 12px 8px; font-size: 16px; }
  .nav-toggle { display: flex; }
  .header-actions .btn-download { display: none; }

  .hero { padding: 64px 0 80px; }
  .hero-stats { gap: 28px; flex-wrap: wrap; }
  .feature-grid, .works-grid { grid-template-columns: 1fr; }
  .rank-item { grid-template-columns: 40px 56px 1fr; }
  .rank-hot { grid-column: 3; text-align: left; }
  .rank-cover { width: 56px; height: 70px; }
  .footer-nav { gap: 14px; }
}

@media (max-width: 640px) {
  .filter-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .chip { width: 100%; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand-tag { display: none; }
  .hero-title { letter-spacing: 3px; }
  .btn { padding: 13px 26px; }
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
