/* 哔咔漫画 pi-ka.lol — 墨彩分镜视觉体系 */
@import url("https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Sans+SC:wght@400;500;700;900&family=ZCOOL+XiaoWei&display=swap");

:root {
  --ink: #12141c;
  --ink-soft: #2a2e3a;
  --paper: #f7f0e8;
  --paper-deep: #ebe2d6;
  --coral: #ff4d6d;
  --coral-deep: #d62850;
  --teal: #2ec4b6;
  --gold: #e8b86d;
  --mist: rgba(247, 240, 232, 0.72);
  --glass: rgba(18, 20, 28, 0.55);
  --line: rgba(18, 20, 28, 0.12);
  --shadow: 0 18px 48px rgba(18, 20, 28, 0.18);
  --radius: 22px;
  --font-brand: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  --font-display: "ZCOOL XiaoWei", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", sans-serif;
  --max: 1080px;
  --dock-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 77, 109, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(46, 196, 182, 0.16), transparent 50%),
    linear-gradient(180deg, #fff9f3 0%, var(--paper) 40%, #f3ebe1 100%);
  line-height: 1.85;
  font-size: 16px;
  padding-bottom: var(--dock-h);
  overflow-x: hidden;
}

body.tome-dock-open {
  --dock-h: 118px;
}

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

a {
  color: var(--coral-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

.tome-wrap {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

/* 顶部推广轨 */
.tome-promo {
  background: linear-gradient(90deg, #1a1d28, #2a2030 50%, #1a2428);
  border-bottom: 1px solid rgba(232, 184, 109, 0.25);
  padding: 10px 0 6px;
}

.tome-promo-rail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  width: min(100% - 20px, var(--max));
  margin: 0 auto;
}

.tome-ad-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  text-decoration: none;
  color: #f3ebe1;
  font-size: 11px;
  gap: 4px;
}

.tome-ad-chip img {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tome-ad-chip:hover img {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.tome-ad-chip span {
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

/* 导航 */
.tome-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(247, 240, 232, 0.82);
  border-bottom: 1px solid var(--line);
}

.tome-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.tome-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.tome-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(255, 77, 109, 0.25);
}

.tome-brand strong {
  font-family: var(--font-brand);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, var(--coral), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tome-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tome-nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.92rem;
}

.tome-nav-links a:hover,
.tome-nav-links a.is-active {
  color: var(--coral-deep);
}

.tome-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
}

.tome-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
  transition: 0.2s ease;
}

/* Hero — 全幅分镜 */
.tome-hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(18, 20, 28, 0.55) 0%, rgba(18, 20, 28, 0.2) 45%, rgba(18, 20, 28, 0.72) 100%),
    url("shot-comic-serial.jpg") center / cover no-repeat;
  color: #fff9f3;
  isolation: isolate;
}

.tome-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.03) 18px 19px
    );
  pointer-events: none;
  z-index: 1;
}

.tome-hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -60px;
  top: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 196, 182, 0.35), transparent 70%);
  filter: blur(8px);
  z-index: 1;
  animation: tome-float 7s ease-in-out infinite;
}

.tome-hero-body {
  position: relative;
  z-index: 2;
  padding: 72px 0 64px;
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.tome-hero-mark {
  font-family: var(--font-brand);
  font-size: clamp(3.2rem, 12vw, 5.6rem);
  line-height: 1.05;
  margin: 0 0 18px;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  animation: tome-rise 0.9s ease both;
}

.tome-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  font-weight: 400;
  margin: 0 0 14px;
  max-width: 18em;
  animation: tome-rise 1s 0.12s ease both;
}

.tome-hero-lead {
  margin: 0;
  max-width: 32em;
  font-size: 1.02rem;
  opacity: 0.92;
  animation: tome-rise 1.05s 0.22s ease both;
}

.tome-hero-glow {
  position: absolute;
  left: 8%;
  bottom: 18%;
  width: 160px;
  height: 160px;
  border-radius: 40% 60% 55% 45%;
  background: radial-gradient(circle, rgba(255, 77, 109, 0.45), transparent 68%);
  filter: blur(4px);
  z-index: 1;
  animation: tome-float 5.5s 0.4s ease-in-out infinite reverse;
}

/* 固定下载坞 */
.tome-sticky-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  background: rgba(18, 20, 28, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(232, 184, 109, 0.28);
  padding: 10px 8px 12px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
}

.tome-sticky-dock.is-visible {
  transform: translateY(0);
}

.tome-dock-label {
  text-align: center;
  color: var(--gold);
  font-size: 12px;
  margin: 0 0 8px;
  letter-spacing: 0.08em;
}

.tome-dock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 6px;
  width: min(100% - 12px, var(--max));
  margin: 0 auto;
  justify-items: center;
}

.tome-dock-grid .tome-ad-chip {
  width: 100%;
  max-width: 72px;
}

@media (min-width: 900px) {
  .tome-dock-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

/* 面包屑 */
.tome-crumb {
  padding: 18px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.tome-crumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tome-crumb li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  opacity: 0.45;
}

.tome-crumb a {
  text-decoration: none;
  color: var(--ink-soft);
}

.tome-crumb a:hover {
  color: var(--coral-deep);
}

/* 章节通用 */
.tome-section {
  padding: 56px 0;
}

.tome-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.5vw, 2.1rem);
  font-weight: 400;
  margin: 0 0 12px;
  line-height: 1.35;
}

.tome-section h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 28px 0 10px;
  color: var(--ink-soft);
}

.tome-section p {
  margin: 0 0 1.05em;
  color: var(--ink-soft);
}

.tome-kicker {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
  font-weight: 700;
}

/* 图文交错 */
.tome-split {
  display: grid;
  gap: 28px;
  align-items: center;
}

@media (min-width: 860px) {
  .tome-split {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 42px;
  }
  .tome-split.is-flip {
    grid-template-columns: 0.95fr 1.05fr;
  }
  .tome-split.is-flip .tome-shot {
    order: -1;
  }
}

.tome-shot {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--ink);
}

.tome-shot img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top center;
  max-height: 560px;
}

.tome-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: inherit;
  pointer-events: none;
}

.tome-shot-wide img {
  aspect-ratio: 16 / 10;
  max-height: 420px;
  object-position: center;
}

/* 卡片矩阵 */
.tome-card-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

@media (min-width: 700px) {
  .tome-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tome-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  padding: 22px 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(18, 20, 28, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tome-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(18, 20, 28, 0.12);
}

.tome-card h3 {
  margin-top: 0;
  color: var(--ink);
}

.tome-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.tome-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.18), rgba(46, 196, 182, 0.18));
  color: var(--coral-deep);
  font-weight: 900;
  font-size: 0.85rem;
}

/* 纯文本长文块 */
.tome-prose {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
  border: 1px solid rgba(18, 20, 28, 0.06);
  border-radius: 28px;
  padding: 28px 22px;
}

@media (min-width: 760px) {
  .tome-prose {
    padding: 36px 40px;
  }
}

.tome-prose-band {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 40px 24px;
  background:
    linear-gradient(135deg, rgba(18, 20, 28, 0.92), rgba(42, 32, 48, 0.9)),
    url("shot-anime-home.jpg") center / cover;
  color: #f7f0e8;
}

.tome-prose-band h2,
.tome-prose-band h3,
.tome-prose-band p {
  color: #f7f0e8;
}

.tome-prose-band p {
  opacity: 0.9;
}

.tome-prose-band .tome-kicker {
  color: var(--gold);
}

/* 混排 mosaic */
.tome-mosaic {
  display: grid;
  gap: 16px;
}

@media (min-width: 800px) {
  .tome-mosaic {
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-rows: auto auto;
  }
  .tome-mosaic .tome-card:first-child {
    grid-row: span 2;
  }
}

.tome-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 8px;
}

.tome-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(46, 196, 182, 0.12);
  color: #0f766e;
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid rgba(46, 196, 182, 0.22);
}

/* CTA 区（非 hero） */
.tome-cta {
  margin: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tome-btn-main {
  background: linear-gradient(120deg, var(--coral), var(--coral-deep));
  color: #fff;
  box-shadow: 0 12px 28px rgba(214, 40, 80, 0.28);
}

.tome-btn-main:hover {
  color: #fff;
  transform: translateY(-2px);
}

.tome-btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border: 1px solid var(--line);
}

.tome-btn-ghost:hover {
  color: var(--coral-deep);
}

/* 页脚 */
.tome-foot {
  margin-top: 40px;
  padding: 42px 0 36px;
  background: var(--ink);
  color: rgba(247, 240, 232, 0.78);
}

.tome-foot a {
  color: #f7f0e8;
  text-decoration: none;
}

.tome-foot a:hover {
  color: var(--gold);
}

.tome-foot-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 720px) {
  .tome-foot-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.tome-foot h2 {
  font-family: var(--font-brand);
  font-size: 1.8rem;
  font-weight: 400;
  margin: 0 0 10px;
  color: #fff;
}

.tome-foot h3 {
  font-size: 0.95rem;
  margin: 0 0 12px;
  color: var(--gold);
  font-weight: 700;
}

.tome-foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tome-foot-copy {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.86rem;
  opacity: 0.7;
}

/* 法律页 */
.tome-legal {
  padding: 28px 0 64px;
}

.tome-legal article {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(18, 20, 28, 0.06);
  border-radius: 28px;
  padding: 28px 22px;
}

@media (min-width: 760px) {
  .tome-legal article {
    padding: 40px 44px;
  }
}

.tome-legal h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  margin: 0 0 16px;
}

/* 错误页 */
.tome-error {
  min-height: 58vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 16px;
}

.tome-error strong {
  font-family: var(--font-brand);
  font-size: clamp(4rem, 18vw, 7rem);
  line-height: 1;
  background: linear-gradient(120deg, var(--coral), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
}

.tome-error h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 8px 0 12px;
}

/* 动效 */
.tome-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.tome-reveal.is-in {
  opacity: 1;
  transform: none;
}

@keyframes tome-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes tome-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}

@media (max-width: 760px) {
  .tome-nav-toggle {
    display: block;
  }
  .tome-nav-links {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 6px);
    background: rgba(247, 240, 232, 0.96);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    flex-direction: column;
    box-shadow: var(--shadow);
  }
  .tome-nav-links.is-open {
    display: flex;
  }
  .tome-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
  }
  .tome-nav-inner {
    position: relative;
  }
  body {
    padding-top: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
