:root {
    --brand: #f24a7a;
    --brand-soft: #ffe3ec;
    --brand-deep: #c92c5c;
    --ink: #1f1b22;
    --ink-sub: #6d6472;
    --line: #f0e4ea;
    --bg: #fff8fa;
    --card: #ffffff;
    --radius: 16px;
    --shadow: 0 6px 22px rgba(242, 74, 122, 0.10);
  }
  * { 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(--bg);
    color: var(--ink);
    line-height: 1.6;
    padding-bottom: 72px;
    -webkit-font-smoothing: antialiased;
  }
  img { display: block; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
  ul { list-style: none; }
  .wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

  /* ===== 顶部栏 ===== */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 248, 250, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
  }
  .brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .brand img { height: 30px; width: auto; border-radius: 8px; }
  .brand-name { font-size: 17px; font-weight: 800; letter-spacing: .5px; color: var(--brand-deep); white-space: nowrap; }
  .search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    min-width: 0;
  }
  .search input {
    border: none; outline: none; background: transparent;
    font-size: 13px; width: 100%; color: var(--ink);
    font-family: inherit;
  }
  .search input::placeholder { color: #b3a6ad; }
  .top-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .top-btn {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--ink-sub);
    background: #fff; border: 1px solid var(--line);
    border-radius: 999px; padding: 6px 10px;
    white-space: nowrap;
  }
  .top-btn.signin { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

  /* ===== 轮播 ===== */
  .hero { padding: 16px 0 8px; }
  .slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  .slider-track { position: relative; height: 300px; }
  .slide {
    position: absolute; inset: 0;
    opacity: 0; transform: scale(1.02);
    transition: opacity .5s ease, transform .5s ease;
    pointer-events: none;
  }
  .slide.active { opacity: 1; transform: scale(1); pointer-events: auto; }
  .slide img { width: 100%; height: 100%; object-fit: cover; }
  .slide-mask {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(20,8,14,.86) 0%, rgba(20,8,14,.28) 52%, rgba(20,8,14,0) 100%);
  }
  .slide-text {
    position: absolute; left: 16px; right: 16px; bottom: 16px;
    color: #fff;
  }
  .badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
  .badge {
    font-size: 11px; padding: 3px 9px; border-radius: 999px;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45);
    color: #fff; backdrop-filter: blur(4px);
  }
  .badge.hot { background: var(--brand); border-color: var(--brand); font-weight: 600; }
  .slide-title { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
  .slide-desc { font-size: 13px; opacity: .88; margin-top: 4px; }
  .slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 50%;
    border: none; cursor: pointer;
    background: rgba(255,255,255,.82); color: var(--brand-deep);
    font-size: 17px; line-height: 1; z-index: 3;
    display: flex; align-items: center; justify-content: center;
  }
  .slider-btn.prev { left: 10px; }
  .slider-btn.next { right: 10px; }
  .dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
  .dot {
    width: 7px; height: 7px; border-radius: 999px;
    background: #e6cfd8; border: none; padding: 0; cursor: pointer;
    transition: width .25s, background .25s;
  }
  .dot.active { width: 20px; background: var(--brand); }

  /* ===== 通用区块 ===== */
  section { padding: 26px 0 6px; }
  .sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
  .sec-title { font-size: 19px; font-weight: 800; }
  .sec-title span { color: var(--brand); }
  .sec-note { font-size: 12px; color: var(--ink-sub); }
  .more-link { font-size: 12px; color: var(--brand); font-weight: 600; }

  /* ===== 分类导航 ===== */
  .cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .cat-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 6px 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(242,74,122,.05);
    transition: transform .2s ease, border-color .2s ease;
  }
  .cat-item:hover { transform: translateY(-3px); border-color: var(--brand-soft); }
  .cat-ico {
    width: 42px; height: 42px; margin: 0 auto 7px;
    border-radius: 12px; overflow: hidden;
    background: var(--brand-soft);
  }
  .cat-ico img { width: 100%; height: 100%; object-fit: cover; }
  .cat-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; }

  /* ===== 推荐列表 ===== */
  .drama-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .drama-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 3px 14px rgba(31,27,34,.05);
    display: flex; flex-direction: column;
  }
  .drama-cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--brand-soft); }
  .drama-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
  .drama-card:hover .drama-cover img { transform: scale(1.04); }
  .ep-tag {
    position: absolute; left: 8px; bottom: 8px;
    font-size: 11px; color: #fff; font-weight: 600;
    background: rgba(20,8,14,.62); border-radius: 6px; padding: 2px 7px;
    backdrop-filter: blur(3px);
  }
  .corner-tag {
    position: absolute; right: 8px; top: 8px;
    font-size: 10.5px; color: #fff; font-weight: 700;
    background: var(--brand); border-radius: 6px; padding: 2px 7px;
  }
  .drama-body { padding: 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
  .drama-name { font-size: 14px; font-weight: 700; line-height: 1.35; }
  .tag-row { display: flex; gap: 5px; flex-wrap: wrap; }
  .tag {
    font-size: 10.5px; color: var(--brand-deep);
    background: var(--brand-soft); border-radius: 5px; padding: 1px 6px;
  }
  .drama-desc {
    font-size: 11.5px; color: var(--ink-sub); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .card-ops { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
  .op {
    flex: 1; font-size: 11.5px; text-align: center;
    border-radius: 8px; padding: 5px 0; font-family: inherit;
    border: 1px solid var(--line); background: #fff; color: var(--ink-sub); cursor: pointer;
  }
  .op.play { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }

  /* ===== AI 短剧横向滑动 ===== */
  .scroller {
    display: flex; gap: 12px; overflow-x: auto;
    padding-bottom: 10px; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .scroller::-webkit-scrollbar { height: 5px; }
  .scroller::-webkit-scrollbar-thumb { background: #f3c9d7; border-radius: 99px; }
  .ai-card {
    flex: 0 0 168px; scroll-snap-align: start;
    background: var(--card); border-radius: 14px; overflow: hidden;
    border: 1px solid var(--line);
  }
  .ai-card figure { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--brand-soft); }
  .ai-card img { width: 100%; height: 100%; object-fit: cover; }
  .ai-card figcaption { padding: 8px 9px 10px; }
  .ai-card h3 { font-size: 13px; font-weight: 700; line-height: 1.35; }
  .ai-card p { font-size: 11px; color: var(--ink-sub); margin-top: 3px; }
  .ai-flag {
    position: absolute; left: 7px; top: 7px;
    font-size: 10px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #7c5cff, #f24a7a);
    padding: 2px 7px; border-radius: 6px;
  }

  /* ===== 每日更新 ===== */
  .update-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .update-item { display: flex; gap: 11px; padding: 11px 12px; align-items: center; }
  .update-item + .update-item { border-top: 1px solid var(--line); }
  .update-thumb { width: 54px; height: 72px; border-radius: 9px; overflow: hidden; flex-shrink: 0; background: var(--brand-soft); }
  .update-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .update-info { flex: 1; min-width: 0; }
  .update-info strong { font-size: 13.5px; display: block; }
  .update-info small { font-size: 11.5px; color: var(--ink-sub); }
  .update-state {
    font-size: 11px; color: var(--brand-deep); font-weight: 700;
    background: var(--brand-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
  }

  /* ===== 排行榜 ===== */
  .rank-list { display: flex; flex-direction: column; gap: 9px; }
  .rank-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 13px; padding: 9px 11px;
  }
  .rank-num { font-size: 18px; font-weight: 900; width: 26px; text-align: center; color: #c9b8c0; font-style: italic; }
  .rank-item.top1 .rank-num,
  .rank-item.top2 .rank-num,
  .rank-item.top3 .rank-num { color: var(--brand); }
  .rank-face { width: 44px; height: 58px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--brand-soft); }
  .rank-face img { width: 100%; height: 100%; object-fit: cover; }
  .rank-meta { flex: 1; min-width: 0; }
  .rank-meta strong { font-size: 13.5px; display: block; }
  .rank-meta small { font-size: 11.5px; color: var(--ink-sub); }
  .rank-hot {
    font-size: 11px; color: var(--brand-deep); background: var(--brand-soft);
    border-radius: 999px; padding: 3px 9px; font-weight: 700; white-space: nowrap;
  }

  /* ===== 缓存卡 ===== */
  .cache-card {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(120deg, #ffeaf1 0%, #fff6f9 70%, #fdf1f6 100%);
    border: 1px solid #fbdfe9;
    border-radius: var(--radius);
    padding: 18px 16px;
  }
  .cache-ico {
    width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
    background: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 21px; box-shadow: 0 3px 10px rgba(242,74,122,.12);
  }
  .cache-text { flex: 1; min-width: 0; }
  .cache-text strong { font-size: 15px; }
  .cache-text p { font-size: 12px; color: var(--ink-sub); margin-top: 2px; }
  .cache-btn {
    border: none; font-family: inherit; cursor: pointer;
    background: var(--brand); color: #fff; font-weight: 700;
    font-size: 12.5px; border-radius: 999px; padding: 9px 15px; white-space: nowrap;
  }
  .cache-stat {
    display: inline-block; font-size: 11.5px; color: var(--brand-deep);
    background: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 6px;
  }

  /* ===== 图墙 ===== */
  .wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .wall-grid figure { border-radius: 10px; overflow: hidden; background: var(--brand-soft); aspect-ratio: 3 / 4; }
  .wall-grid img { width: 100%; height: 100%; object-fit: cover; }

  /* ===== 下载条 ===== */
  .download-bar {
    margin: 26px auto 8px;
    background: linear-gradient(120deg, #f24a7a, #ff8ba7);
    border-radius: 18px;
    padding: 20px 18px;
    color: #fff;
    display: flex; flex-direction: column; gap: 12px;
    box-shadow: 0 10px 26px rgba(242,74,122,.22);
  }
  .download-bar h2 { font-size: 18px; }
  .download-bar p { font-size: 12.5px; opacity: .94; }
  .download-btn {
    display: inline-block; align-self: flex-start;
    background: #fff; color: var(--brand-deep);
    font-weight: 800; font-size: 14px;
    border-radius: 999px; padding: 11px 26px;
    box-shadow: 0 4px 14px rgba(0,0,0,.10);
  }

  /* ===== 页脚 ===== */
  footer {
    margin-top: 30px; padding: 20px 0 26px;
    border-top: 1px solid var(--line);
    background: #fffafc;
    color: #a99aa2; font-size: 11.5px; line-height: 1.8;
    text-align: center;
  }
  footer a { color: #a99aa2; }
  footer a:hover { color: var(--brand); }
  footer .foot-line { max-width: 640px; margin: 0 auto 4px; }

  /* ===== 底部导航 ===== */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: grid; grid-template-columns: repeat(4, 1fr);
    backdrop-filter: blur(10px);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 7px; font-size: 11px; color: #b0a2a9;
  }
  .tab span.ico { font-size: 17px; line-height: 1; }
  .tab.active { color: var(--brand); font-weight: 700; }

  /* ===== 断点 768px ===== */
  @media (min-width: 768px) {
    body { padding-bottom: 0; }
    .topbar-inner { padding: 12px 0; gap: 18px; }
    .brand img { height: 36px; }
    .brand-name { font-size: 19px; }
    .search { max-width: 420px; }
    .top-btn { font-size: 13px; padding: 7px 14px; }
    .slider-track { height: 360px; }
    .slide-text { left: 30px; right: 30px; bottom: 28px; }
    .slide-title { font-size: 30px; }
    .slide-desc { font-size: 14px; }
    .slider-btn { width: 40px; height: 40px; font-size: 19px; }
    .cat-grid { grid-template-columns: repeat(8, 1fr); gap: 12px; }
    section { padding: 34px 0 10px; }
    .sec-title { font-size: 22px; }
    .drama-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .ai-card { flex: 0 0 200px; }
    .wall-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
    .download-bar { flex-direction: row; align-items: center; justify-content: space-between; padding: 26px 30px; }
    .download-bar h2 { font-size: 22px; }
    .tabbar { display: none; }
  }

  /* ===== 断点 1024px ===== */
  @media (min-width: 1024px) {
    .slider-track { height: 420px; }
    .slide-title { font-size: 36px; }
    .drama-grid { grid-template-columns: repeat(4, 1fr); }
    .two-col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: start; }
    .ai-card { flex: 0 0 216px; }
    .cache-card { padding: 24px 22px; }
  }