/* =========================================================
   梦漫漫画 · 单页官网样式
   主题：深夜漫游 · 红月之心
   移动优先（375px 起步，桌面在 min-width 断点扩展）
   ========================================================= */

:root {
  --bg: #0b0912;
  --bg-deep: #07060d;
  --bg-card: #161124;
  --bg-card-2: #1d1630;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2eefb;
  --text-soft: #c9c1e0;
  --muted: #8f86ad;
  --accent: #ff3d5a;
  --accent-2: #ff7a2f;
  --gold: #ffc15e;
  --grad: linear-gradient(120deg, #ff3d5a 0%, #ff7a2f 100%);
  --grad-soft: linear-gradient(120deg, rgba(255, 61, 90, 0.16), rgba(255, 122, 47, 0.1));
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
}

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

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

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(255, 61, 90, 0.12), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, rgba(124, 80, 255, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

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

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

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn-sm {
  font-size: 13px;
  padding: 8px 18px;
}

.btn-lg {
  font-size: 16px;
  padding: 13px 30px;
}

.btn-xl {
  font-size: 17px;
  padding: 16px 46px;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 61, 90, 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(255, 61, 90, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 9, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
}

.brand-name {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, #ff5c74, #ff9a5e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-nav {
  display: none;
}

.nav-link {
  font-size: 15px;
  color: var(--text-soft);
  font-weight: 600;
  padding: 6px 2px;
  position: relative;
  transition: color 0.18s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: #fff;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

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

/* 移动端导航（下拉面板） */
.main-nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(13, 10, 22, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px 20px;
  gap: 4px;
}

.main-nav.open .nav-link {
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 56px 0 64px;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  align-items: center;
}

.hero-eyebrow,
.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  font-size: 52px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-top: 14px;
  background: linear-gradient(120deg, #ff5c74, #ffb35e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-slogan {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-top: 10px;
  letter-spacing: 0.06em;
}

.hero-desc {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 36px;
  max-width: 460px;
}

.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}

.stat dt {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat dd {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Hero 手机样机 */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 560px;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.glow-red {
  width: 300px;
  height: 300px;
  background: rgba(255, 61, 90, 0.28);
  top: 10%;
  right: -40px;
}

.glow-gold {
  width: 220px;
  height: 220px;
  background: rgba(255, 176, 84, 0.16);
  bottom: 4%;
  left: -20px;
}

.phone {
  position: relative;
  border-radius: 34px;
  border: 6px solid #241b36;
  background: #000;
  overflow: hidden;
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 18px;
  border-radius: 12px;
  background: #16101f;
  z-index: 2;
}

.phone-main {
  width: 250px;
  height: 520px;
  z-index: 1;
}

.phone-main img {
  object-position: top;
}

.phone-float {
  display: none;
}

/* ---------- 功能亮点 ---------- */
.features {
  padding: 20px 0 8px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.feature-card {
  background: linear-gradient(160deg, var(--bg-card), rgba(29, 22, 48, 0.6));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 80, 110, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid rgba(255, 80, 110, 0.3);
  color: var(--accent);
}

.feature-card h3 {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 800;
}

.feature-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 通用区块 ---------- */
.section {
  padding: 64px 0 8px;
}

.section-head {
  margin-bottom: 30px;
}

.section-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-top: 8px;
}

.section-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 今日精选 ---------- */
.picks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.pick-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pick-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 80, 110, 0.4);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}

.pick-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.pick-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.pick-card:hover .pick-cover img {
  transform: scale(1.05);
}

.pick-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(7, 6, 13, 0.82));
}

.pick-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: var(--grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.pick-chapter {
  position: absolute;
  bottom: 10px;
  left: 12px;
  z-index: 2;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 10px;
  border-radius: 999px;
}

.pick-info {
  padding: 14px 16px 18px;
}

.pick-name {
  font-size: 17px;
  font-weight: 800;
}

.pick-meta {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.pick-info .btn {
  width: 100%;
}

/* ---------- 漫画分类 ---------- */
.genre-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.genre-card {
  display: block;
  background: linear-gradient(160deg, var(--bg-card), rgba(29, 22, 48, 0.55));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.genre-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 80, 110, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.genre-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--grad-soft);
  border: 1px solid rgba(255, 80, 110, 0.28);
  color: var(--accent);
}

.genre-card h3 {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 800;
}

.genre-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 人气榜 ---------- */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: rgba(255, 80, 110, 0.4);
}

.rank-num {
  font-size: 26px;
  font-weight: 900;
  font-style: italic;
  color: var(--bg-card-2);
  -webkit-text-stroke: 1px var(--muted);
  min-width: 52px;
  text-align: center;
  line-height: 1;
}

.rank-1 {
  -webkit-text-stroke: 1px var(--gold);
  color: transparent;
  background: linear-gradient(120deg, #ffd58a, #ff9a3d);
  -webkit-background-clip: text;
  background-clip: text;
}

.rank-2 {
  -webkit-text-stroke: 1px #cdd3e6;
  color: transparent;
}

.rank-3 {
  -webkit-text-stroke: 1px #e0936a;
  color: transparent;
}

.rank-body {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-type {
  font-size: 12px;
  color: var(--muted);
}

.rank-hot {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ---------- 界面预览 ---------- */
.app-showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  justify-items: center;
}

.app-item {
  text-align: center;
  max-width: 240px;
}

.app-item h3 {
  margin-top: 16px;
  font-size: 17px;
  font-weight: 800;
}

.app-item p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.phone-inline {
  width: 210px;
  height: 440px;
  border-width: 5px;
}

/* ---------- 更新动态（时间轴） ---------- */
.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 28px 26px;
  border-left: 2px solid var(--line-strong);
}

.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--grad);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(255, 61, 90, 0.4);
}

.timeline-date {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.timeline-body {
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.timeline-body h3 {
  font-size: 16px;
  font-weight: 800;
}

.timeline-body p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 下载引导 ---------- */
.download {
  padding-bottom: 72px;
}

.download-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(520px 240px at 50% 0%, rgba(255, 61, 90, 0.22), transparent 70%),
    linear-gradient(160deg, #1d1430, #120d1f);
  border: 1px solid rgba(255, 80, 110, 0.35);
  border-radius: 26px;
  padding: 56px 24px;
}

.download-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255, 122, 47, 0.14);
  filter: blur(70px);
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.download-title {
  font-size: 30px;
  font-weight: 900;
  margin-top: 14px;
  letter-spacing: 0.02em;
}

.download-desc {
  margin: 14px auto 30px;
  color: var(--text-soft);
  font-size: 15px;
  max-width: 32em;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

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

.footer-brand .brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.footer-brand .brand-name {
  font-size: 17px;
}

.footer-slogan {
  color: var(--text-soft);
  font-size: 14px;
}

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

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(255, 61, 90, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================================================
   断点扩展：平板 ≥640px
   ========================================================= */
@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .picks-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .genre-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-showcase {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }

  .hero-title {
    font-size: 60px;
  }
}

/* =========================================================
   断点扩展：桌面 ≥992px
   ========================================================= */
@media (min-width: 992px) {
  .main-nav {
    display: flex;
    gap: 30px;
  }

  .nav-toggle {
    display: none;
  }

  .hero {
    padding: 84px 0 96px;
  }

  .hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 30px;
  }

  .hero-title {
    font-size: 66px;
  }

  .hero-slogan {
    font-size: 24px;
  }

  .hero-visual {
    min-height: 600px;
  }

  .phone-main {
    width: 272px;
    height: 560px;
  }

  .phone-float {
    display: block;
    position: absolute;
    width: 200px;
    height: 420px;
    right: 0;
    bottom: 6px;
    z-index: 0;
    border-width: 5px;
    transform: rotate(6deg);
  }

  .phone-float img {
    object-position: center;
  }

  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .picks-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .genre-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .app-showcase {
    grid-template-columns: repeat(4, 1fr);
  }

  .section {
    padding: 80px 0 12px;
  }

  .section-title {
    font-size: 34px;
  }

  .section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
  }

  .section-note {
    margin-top: 0;
    text-align: right;
  }

  .rank-num {
    font-size: 30px;
    min-width: 60px;
  }

  .download-card {
    padding: 72px 40px;
  }

  .download-title {
    font-size: 38px;
  }
}

/* ---------- 无障碍：尊重减少动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
