:root {
    --brand: #e5304f;
    --brand-dark: #b31b35;
    --ink: #1a1a1c;
    --ink-soft: #52525c;
    --paper: #fbf8f4;
    --paper-dim: #f0e9e1;
    --line: #ddd2c5;
    --gold: #c29a45;
    --radius: 10px;
    --max: 1180px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  img { max-width: 100%; display: block; }
  a { color: inherit; text-decoration: none; }
  h1, h2, h3 { line-height: 1.3; font-weight: 700; }
  .wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

  /* 顶部进度条 + 选集条 */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(251, 248, 244, 0.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .progress-track { height: 4px; background: var(--paper-dim); }
  .progress-fill { height: 100%; width: 4%; background: var(--brand); transition: width 0.1s linear; }
  .topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    max-width: var(--max);
    margin: 0 auto;
  }
  .brand-lock { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .brand-lock img { height: 32px; width: auto; }
  .brand-lock span { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }
  .episode-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0;
  }
  .episode-nav::-webkit-scrollbar { display: none; }
  .episode-nav a {
    flex-shrink: 0;
    font-size: 13px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    white-space: nowrap;
    transition: all 0.2s;
  }
  .episode-nav a:hover,
  .episode-nav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
  .act-badge { font-size: 12px; color: var(--brand); font-weight: 700; flex-shrink: 0; }

  /* 第一幕 */
  .act-hero {
    padding: 72px 0 40px;
    text-align: center;
    position: relative;
  }
  .hero-kicker {
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 18px;
  }
  .act-hero h1 {
    font-size: clamp(30px, 5vw, 54px);
    letter-spacing: 1px;
    margin-bottom: 20px;
    color: var(--ink);
  }
  .act-hero h1 em { font-style: normal; color: var(--brand); }
  .hero-sub {
    max-width: 640px;
    margin: 0 auto 32px;
    font-size: 16px;
    color: var(--ink-soft);
  }
  .btn-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 34px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(229, 48, 79, 0.28);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .btn-main:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(229, 48, 79, 0.36); }
  .hero-note { margin-top: 14px; font-size: 13px; color: #8a8177; }

  /* 跑马灯 */
  .marquee {
    margin-top: 48px;
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    background: var(--paper-dim);
  }
  .marquee-track {
    display: flex;
    gap: 12px;
    width: max-content;
    animation: slide 42s linear infinite;
  }
  .marquee:hover .marquee-track { animation-play-state: paused; }
  .marquee-track img {
    width: 78px;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
  }
  @keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

  /* 幕通用 */
  .act { padding: 68px 0; }
  .act-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .act-head { margin-bottom: 34px; }
  .act-no { font-size: 12px; letter-spacing: 3px; color: var(--brand); font-weight: 700; }
  .act-head h2 { font-size: clamp(22px, 3.2vw, 32px); margin-top: 6px; }
  .act-head p { color: var(--ink-soft); margin-top: 10px; max-width: 620px; font-size: 15px; }

  /* 第二幕 登场人物 */
  .cast-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
  .cast-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    gap: 12px;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
  }
  .cast-card:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0,0,0,0.08); }
  .cast-card img {
    width: 68px;
    height: 96px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
  }
  .cast-info h3 { font-size: 15px; margin-bottom: 4px; }
  .cast-info .heat { font-size: 12px; color: var(--brand); font-weight: 700; margin-bottom: 6px; }
  .tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
  .tag {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 3px;
    background: var(--paper-dim);
    color: var(--ink-soft);
  }

  /* 第三幕 剧情冲突 */
  .script-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .script-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.4s ease;
    transform-origin: left center;
  }
  .script-card:hover { transform: rotateY(-3deg) rotateX(1deg); }
  .script-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    border-bottom: 2px solid var(--brand);
    padding-bottom: 2px;
    margin-bottom: 16px;
  }
  .frame-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
  .frame-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 5px; }
  .script-line { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
  .script-line strong { color: var(--ink); }

  /* 第四幕 拍立得 */
  .polaroid-wall {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px 18px;
  }
  .polaroid {
    background: #fff;
    padding: 8px 8px 30px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    width: 132px;
    position: relative;
    transition: transform 0.3s ease;
  }
  .polaroid:nth-child(odd) { transform: rotate(-2deg); }
  .polaroid:nth-child(even) { transform: rotate(1.6deg); }
  .polaroid:nth-child(3n) { transform: rotate(-1deg); }
  .polaroid:hover { transform: rotate(0) scale(1.05); z-index: 3; }
  .polaroid.top3 {
    width: 168px;
    padding-bottom: 34px;
    border: 2px solid var(--gold);
    box-shadow: 0 8px 22px rgba(194,154,69,0.35);
  }
  .polaroid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
  .polaroid .rank {
    position: absolute;
    bottom: 6px;
    left: 10px;
    font-size: 13px;
    color: var(--brand);
    font-weight: 700;
    font-style: italic;
    font-family: "Kaiti SC", "STKaiti", serif;
  }
  .polaroid .tape {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    width: 46px;
    height: 16px;
    background: rgba(210, 190, 160, 0.6);
  }
  .polaroid .critique {
    font-size: 11px;
    color: var(--ink-soft);
    font-family: "Kaiti SC", "STKaiti", serif;
    line-height: 1.5;
    padding: 6px 2px 0;
  }

  /* 第五幕 追更预告 */
  .premiere-panel {
    background: var(--brand);
    color: #fff;
    border-radius: 14px;
    padding: 36px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
  }
  .premiere-panel h3 { font-size: 26px; margin-bottom: 8px; }
  .premiere-panel p { font-size: 14px; opacity: 0.92; }
  .countdown { display: flex; gap: 10px; }
  .countdown .flip {
    background: rgba(0,0,0,0.22);
    border-radius: 8px;
    padding: 10px 14px;
    text-align: center;
    min-width: 62px;
  }
  .countdown .flip b { display: block; font-size: 24px; line-height: 1.1; }
  .countdown .flip span { font-size: 11px; opacity: 0.8; }
  .premiere-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 22px 0 6px;
    scrollbar-width: thin;
  }
  .premiere-strip img {
    width: 82px;
    height: 116px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
  }
  .btn-book {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--brand);
    font-weight: 700;
    font-size: 15px;
    padding: 12px 26px;
    border-radius: 999px;
    transition: transform 0.2s;
  }
  .btn-book:hover { transform: translateY(-2px); }

  /* 第六幕 手机样机 */
  .device-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
  }
  .phone {
    width: 236px;
    border: 10px solid #24242a;
    border-radius: 30px;
    background: #24242a;
    padding: 6px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.22);
    overflow: hidden;
  }
  .phone-screen {
    height: 420px;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    position: relative;
  }
  .phone-scroll {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: phoneUp 26s linear infinite;
  }
  .phone-scroll img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
  @keyframes phoneUp {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
  }
  .download-side { max-width: 400px; }
  .download-side h3 { font-size: 22px; margin-bottom: 10px; }
  .download-side > p { color: var(--ink-soft); font-size: 15px; margin-bottom: 20px; }
  .dl-list { display: flex; flex-direction: column; gap: 10px; }
  .dl-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 700;
    font-size: 15px;
    transition: border-color 0.2s, transform 0.2s;
  }
  .dl-btn:hover { border-color: var(--brand); transform: translateX(4px); color: var(--brand); }
  .dl-btn span.next { color: var(--brand); font-size: 13px; }

  /* 弹幕层 */
  .danmaku-layer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42px;
    background: rgba(26, 26, 28, 0.86);
    overflow: hidden;
    z-index: 50;
    display: flex;
    align-items: center;
  }
  .danmaku-track {
    display: flex;
    gap: 34px;
    width: max-content;
    animation: slide 60s linear infinite;
    padding-left: 20px;
  }
  .danmaku-layer:hover .danmaku-track { animation-play-state: paused; }
  .danmaku-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f4f0e8;
    font-size: 13px;
    white-space: nowrap;
  }
  .danmaku-item img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
  }

  /* 第七幕 片尾字幕 */
  .footer {
    background: #141416;
    color: #9c9aa4;
    padding: 52px 0 80px;
    font-size: 13px;
    line-height: 1.9;
  }
  .credits-roll {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    padding-bottom: 30px;
    border-bottom: 1px solid #2b2b30;
  }
  .credits-roll h2 {
    color: #e8e5df;
    font-size: 18px;
    letter-spacing: 6px;
    margin-bottom: 18px;
    font-weight: 400;
  }
  .credits-roll p { margin-bottom: 4px; }
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    margin: 22px 0 16px;
  }
  .footer-links a:hover { color: var(--brand); }
  .footer-copy { text-align: center; font-size: 12px; color: #71707a; }
  .footer-copy a { color: #8f8e97; text-decoration: underline; }
  .footer-copy a:hover { color: var(--brand); }
  .updated-text { display: block; margin-top: 8px; font-size: 11px; color: #5f5e68; }

  /* 响应式 */
  @media (max-width: 1200px) {
    .cast-grid { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 992px) {
    .act { padding: 52px 0; }
    .cast-grid { grid-template-columns: repeat(2, 1fr); }
    .script-grid { grid-template-columns: 1fr; }
    .premiere-panel { flex-direction: column; align-items: flex-start; }
  }
  @media (max-width: 768px) {
    .topbar-inner { flex-wrap: wrap; }
    .episode-nav { order: 3; width: 100%; }
    .act-hero { padding: 48px 0 28px; }
    .hero-sub { font-size: 15px; }
    .marquee-track img { width: 66px; height: 92px; }
    .cast-grid { grid-template-columns: 1fr; }
    .polaroid { width: 112px; }
    .polaroid.top3 { width: 138px; }
    .danmaku-layer { height: 36px; }
    .danmaku-item { font-size: 12px; }
    /* 手机端弹幕改为纵向列表，避免溢出 */
    .danmaku-layer {
      position: static;
      height: auto;
      background: #1a1a1c;
      padding: 14px 0;
      overflow: hidden;
    }
    .danmaku-track {
      flex-direction: column;
      flex-wrap: nowrap;
      animation: none;
      width: 100%;
      max-width: 100%;
      gap: 8px;
      padding: 0 20px;
      max-height: 180px;
      overflow-y: auto;
    }
    .danmaku-item { white-space: normal; }
    .device-area { gap: 30px; }
    .download-side { width: 100%; max-width: 100%; }
  }
  @media (max-width: 480px) {
    .act-hero h1 { font-size: 28px; }
    .btn-main { width: 100%; justify-content: center; }
    .cast-card { padding: 10px; }
    .frame-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .premiere-panel { padding: 24px 18px; }
    .premiere-panel h3 { font-size: 21px; }
    .countdown { flex-wrap: wrap; }
    .polaroid { width: 100px; }
    .polaroid.top3 { width: 120px; }
    .polaroid .critique { font-size: 10px; }
  }