/* 喵趣漫画 · miaoquw.cn — 移动端优先 */
:root {
  --bg: #fff6f1;
  --bg-deep: #ffe8de;
  --surface: #ffffff;
  --ink: #1a1410;
  --muted: #6b5a52;
  --accent: #ff5a7a;
  --accent-deep: #e83d5f;
  --mint: #1a9b6c;
  --mint-soft: #e6f7ef;
  --line: rgba(26, 20, 16, 0.08);
  --shadow: 0 10px 30px rgba(232, 61, 95, 0.12);
  --radius: 18px;
  --nav-h: 56px;
  --float-h: 68px;
  --font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: "ZCOOL XiaoWei", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 60% at 10% -10%, #ffd6e0 0%, transparent 55%),
    radial-gradient(ellipse 90% 50% at 100% 0%, #ffe8c8 0%, transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, #fff 40%, var(--bg-deep) 100%);
  background-attachment: fixed;
  line-height: 1.65;
  padding-bottom: calc(var(--float-h) + env(safe-area-inset-bottom, 0px) + 12px);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
}

a {
  color: var(--accent-deep);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

.container {
  width: min(960px, 100% - 32px);
  margin-inline: auto;
}

/* —— 顶栏 —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  /* 不用 backdrop-filter，避免把 fixed 菜单困在顶栏里导致左右溢出 */
  background: rgba(255, 246, 241, 0.94);
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.site-header .inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(255, 90, 122, 0.25);
}

/* —— 汉堡按钮 —— */
.nav-toggle {
  position: relative;
  z-index: 260;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 90, 122, 0.1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.nav-toggle:active {
  background: rgba(255, 90, 122, 0.18);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-deep);
  transition: transform 0.28s ease, opacity 0.2s;
  transform-origin: center;
}

.nav-toggle span + span {
  margin-top: 5px;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* —— 遮罩 —— */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(26, 20, 16, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s;
  touch-action: none;
  overscroll-behavior: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-backdrop.is-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* —— 侧滑抽屉 —— */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 250;
  width: min(86vw, 320px);
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  transform: translate3d(100%, 0, 0);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.32s;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 0 calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  pointer-events: none;
  touch-action: pan-y;
  visibility: hidden;
}

.nav-drawer.is-open {
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  visibility: visible;
}

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 18px 16px;
  border-bottom: 1px solid var(--line);
}

.nav-drawer-head strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  padding: 14px 14px;
  border-radius: 14px;
  transition: background 0.2s, color 0.2s;
  min-height: 48px;
}

.nav-links a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffc2ce;
  flex-shrink: 0;
}

.nav-links a:active,
.nav-links a:hover {
  background: rgba(255, 90, 122, 0.08);
  color: var(--accent-deep);
}

.nav-links a.is-active {
  background: rgba(255, 90, 122, 0.12);
  color: var(--accent-deep);
  font-weight: 700;
}

.nav-links a.is-active::before {
  background: var(--accent);
}

.nav-drawer-cta {
  padding: 12px 18px 8px;
  border-top: 1px solid var(--line);
}

.nav-drawer-cta .btn {
  width: 100%;
}

html.nav-open,
html.nav-open body {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
}

body.nav-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

body.nav-open .site-header {
  z-index: 300;
}

/* 桌面：横排导航，隐藏汉堡与抽屉壳 */
@media (min-width: 768px) {
  .nav-toggle,
  .nav-backdrop,
  .nav-drawer-head,
  .nav-drawer-cta {
    display: none !important;
  }

  .nav-drawer {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    transform: none !important;
    box-shadow: none;
    background: transparent;
    padding: 0;
    overflow: visible;
    flex-direction: row;
    pointer-events: auto !important;
    visibility: visible !important;
    touch-action: auto;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    gap: 4px;
  }

  .nav-links a {
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 12px;
    min-height: 0;
    border-radius: 999px;
    color: var(--muted);
  }

  .nav-links a::before {
    display: none;
  }

  .nav-links a:hover,
  .nav-links a.is-active {
    background: rgba(255, 90, 122, 0.12);
    color: var(--accent-deep);
  }
}

/* —— Hero —— */
.hero {
  padding: 28px 0 20px;
  text-align: center;
}

.hero-logo {
  width: min(160px, 42vw);
  margin: 0 auto 16px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  animation: float-soft 4s ease-in-out infinite;
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 10px;
}

.hero .lead {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 28em;
  margin: 0 auto 18px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.tag {
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.tag.ok {
  background: var(--mint-soft);
  color: var(--mint);
  border-color: transparent;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 8px 22px rgba(232, 61, 95, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 12px 28px rgba(232, 61, 95, 0.42);
}

.btn-secondary {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.btn-android::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.6 9.48l1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24A11.46 11.46 0 0 0 12 8.1c-1.55 0-3.01.3-4.37.87L5.75 5.67c-.18-.28-.54-.37-.83-.22-.3.16-.42.54-.26.85L6.5 9.48C3.57 11.1 1.6 14.2 1.5 17.8h21c-.1-3.6-2.07-6.7-4.9-8.32zM7.2 14.7a1.2 1.2 0 1 1 0-2.4 1.2 1.2 0 0 1 0 2.4zm9.6 0a1.2 1.2 0 1 1 0-2.4 1.2 1.2 0 0 1 0 2.4z'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

.btn-ios::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a1410'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.79 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

.btn-primary.btn-ios::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.79 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z'/%3E%3C/svg%3E");
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* —— 区块 —— */
.section {
  padding: 28px 0;
}

.section-title {
  font-family: var(--display);
  font-size: 1.35rem;
  margin-bottom: 8px;
  text-align: center;
}

.section-desc {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.feature-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 16px;
  border: 1px solid var(--line);
  animation: rise-in 0.6s ease both;
}

.feature:nth-child(2) {
  animation-delay: 0.08s;
}

.feature:nth-child(3) {
  animation-delay: 0.16s;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.feature p {
  font-size: 0.88rem;
  color: var(--muted);
}

.feature .ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #ffe0e8, #fff0e0);
}

/* —— 封面墙（竖版漫画封面） —— */
.cover-section {
  overflow: visible;
}

.cover-wall {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cover-card {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #1c1816;
  box-shadow: 0 8px 22px rgba(26, 20, 16, 0.12);
  position: relative;
  aspect-ratio: 3 / 4;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.cover-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.cover-card figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 10px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  letter-spacing: 0.04em;
}

.cover-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.cover-card:active {
  transform: scale(0.98);
}

@media (min-width: 720px) {
  .cover-wall {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .cover-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(26, 20, 16, 0.18);
  }

  .cover-card figcaption {
    font-size: 0.85rem;
    padding: 32px 12px 12px;
  }
}

/* —— SEO 正文 —— */
.seo-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 18px;
  border: 1px solid var(--line);
}

.seo-block h2 {
  font-size: 1.15rem;
  margin: 18px 0 10px;
}

.seo-block h2:first-child {
  margin-top: 0;
}

.seo-block p,
.seo-block li {
  font-size: 0.92rem;
  color: #3d322c;
  margin-bottom: 10px;
}

.seo-block ul {
  padding-left: 1.1em;
  list-style: disc;
  margin-bottom: 12px;
}

.seo-block a {
  font-weight: 600;
}

/* —— FAQ —— */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.faq summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details[open] summary {
  margin-bottom: 8px;
  color: var(--accent-deep);
}

.faq p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* —— 相关链接 —— */
.related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.related a {
  font-size: 0.8rem;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.related a:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* —— 下载页专区 —— */
.download-panel {
  background: var(--surface);
  border-radius: 22px;
  padding: 24px 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.download-panel .logo-lg {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  border-radius: 22px;
  object-fit: cover;
}

.platform-grid {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

@media (min-width: 520px) {
  .platform-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.platform-card {
  padding: 18px 14px;
  border-radius: 16px;
  background: linear-gradient(160deg, #fff 0%, #fff5f7 100%);
  border: 1px solid var(--line);
}

.platform-card h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.platform-card p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.platform-card .btn {
  width: 100%;
}

/* —— 页脚 —— */
.site-footer {
  margin-top: 36px;
  padding: 28px 0 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--accent-deep);
}

/* —— 底部悬浮下载条 —— */
.float-download {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.1);
  transform: translate3d(0, calc(100% + 20px), 0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.float-download.is-show {
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.float-download .bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 960px;
  margin: 0 auto;
}

.float-download .info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.float-download .info img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
}

.float-download .info strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.float-download .info span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.float-download .actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.float-download .btn {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 0.86rem;
  border-radius: 12px;
  white-space: nowrap;
}

.float-download .btn-main {
  min-width: 108px;
  box-shadow: 0 6px 16px rgba(232, 61, 95, 0.3);
}

/* 小屏：单按钮，避免双按钮挤爆 */
@media (max-width: 640px) {
  .float-download .actions .btn-ios,
  .float-download .actions .btn-android + .btn-secondary {
    display: none;
  }

  .float-download .actions {
    flex: 0 0 auto;
  }

  .float-download .btn-main,
  .float-download .actions .btn-primary {
    min-width: 112px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .float-download .info span {
    display: none;
  }
}

@media (max-width: 360px) {
  .float-download .info strong {
    font-size: 0.82rem;
  }

  .float-download .btn-main,
  .float-download .actions .btn-primary {
    min-width: 96px;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 0.82rem;
  }
}

body.nav-open .float-download {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* —— 更新日期 / 面包屑 —— */
.update-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin: -6px 0 14px;
  text-align: center;
}

.seo-block .update-date {
  text-align: left;
  margin: 0 0 12px;
}

.breadcrumb {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 14px 0 0;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  margin: 0 6px;
  opacity: 0.5;
}

/* —— 桌面增强 —— */
@media (min-width: 768px) {
  .hero {
    padding: 48px 0 36px;
  }
  .nav-links a {
    font-size: 0.88rem;
  }
  .float-download .btn {
    min-width: 110px;
  }
  .float-download .actions .btn-ios {
    display: inline-flex;
  }
}
