:root {
  --bg: #f7f8fc;
  --text: #0f1733;
  --muted: #74798a;
  --line: #eceef4;
  --purple: #664cff;
  --orange: #ff6b00;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }

.app { min-height: 100vh; background: #fff; overflow-x: hidden; }
.page { min-height: 100vh; background: #fff; padding-bottom: 28px; }
.page-tab { padding-bottom: 92px; }

.nav-bar, .search-nav { height: 52px; padding: 0 18px; display: grid; grid-template-columns: 34px 1fr 60px; align-items: center; }
.nav-title { text-align: center; font-size: 18px; font-weight: 900; }
.nav-back, .search-nav > button:first-child { font-size: 30px; line-height: 1; text-align: left; }
.nav-right { text-align: right; color: var(--purple); font-weight: 800; font-size: 13px; }
.text-link { color: var(--purple); font-weight: 800; }

.home-head { padding: 10px 18px 10px; display: flex; align-items: center; }
.home-head h1 { margin: 0; font-size: 22px; font-weight: 900; }
.search-pill { margin: 0 18px 12px; height: 40px; border-radius: 999px; background: #f2f3f7; display: flex; align-items: center; gap: 10px; padding: 0 14px; color: #8c91a0; }
.home-banner { margin: 0 18px 18px; height: 170px; border-radius: 12px; overflow: hidden; background-size: cover; background-position: center; position: relative; color: #fff; display: flex; align-items: flex-end; padding: 18px; }
.banner-copy h2 { margin: 0; max-width: 210px; font-size: 24px; line-height: 1.18; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.banner-copy p { margin: 10px 0 0; font-size: 13px; }
.dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.6); }
.dots i.active { background: var(--purple); }

.section-head { padding: 0 18px; margin: 16px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 900; }
.section-head button { color: #6f7480; font-size: 13px; }

.hot-row { padding: 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hot-card { position: relative; min-width: 0; }
.hot-cover { height: 136px; border-radius: 10px; background-size: cover; background-position: center; }
.rank { position: absolute; right: 0; top: 0; width: 28px; height: 28px; border-radius: 0 10px 0 10px; display: grid; place-items: center; background: var(--purple); color: #fff; font-weight: 900; }
.hot-card:nth-child(3) .rank { background: var(--orange); }
.hot-card h3 { margin: 8px 0 4px; font-size: 13px; line-height: 1.25; }
.hot-card p, .recommend-card p, .theater-card p { margin: 0; color: var(--muted); font-size: 12px; }
.card-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 6px; background: #f1f2f6; color: #6e7280; font-size: 11px; white-space: nowrap; }
.tag.purple, .tag.active { background: #ede9ff; color: var(--purple); }

.recommend-grid { padding: 0 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.recommend-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 12px rgba(15,23,42,.04); display: flex; flex-direction: column; gap: 8px; }
.rec-cover { width: 100%; height: 112px; border-radius: 10px; background-size: cover; background-position: center; }
.recommend-card h3 { margin: 0; font-size: 14px; line-height: 1.25; }

.category-tabs, .sort-tabs {
  padding: 0 18px 14px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-tabs::-webkit-scrollbar,
.sort-tabs::-webkit-scrollbar,
.word-row::-webkit-scrollbar,
.theater-grid::-webkit-scrollbar {
  display: none;
}
.category-tabs button { position: relative; color: #363b4a; font-size: 15px; font-weight: 700; white-space: nowrap; }
.category-tabs .active { color: var(--purple); }
.category-tabs .active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -8px; height: 3px; border-radius: 99px; background: var(--purple); }
.sort-tabs { gap: 10px; }
.sort-tabs button { min-width: 68px; height: 30px; border-radius: 999px; background: #f3f4f8; color: #3d4352; font-size: 13px; }
.sort-tabs .active { background: var(--purple); color: #fff; }
.theater-grid { padding: 0 18px 98px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
.theater-cover { height: 172px; border-radius: 8px; background-size: cover; background-position: center; }
.theater-card h3 { margin: 8px 0 6px; font-size: 14px; }
.theater-card p { display: flex; justify-content: space-between; gap: 8px; }

.search-nav { grid-template-columns: 34px 1fr 50px; gap: 8px; }
.search-nav label { height: 40px; border-radius: 999px; background: #f1f2f6; display: flex; align-items: center; gap: 8px; padding: 0 14px; color: #8b90a0; }
.search-nav input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.search-submit { color: var(--purple); font-weight: 900; font-size: 15px; }
.search-block { padding: 10px 18px 12px; }
.block-title { display: flex; align-items: center; justify-content: space-between; }
.search-block h2, .search-result-block h2 { margin: 0 0 12px; font-size: 18px; }
.word-row { display: flex; flex-wrap: wrap; gap: 10px; overflow: hidden; }
.word-row button { min-height: 32px; padding: 0 14px; border-radius: 999px; background: #f3f4f8; color: #333846; font-size: 13px; }
.word-row b, .word-row em { margin-left: 6px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 6px; color: #fff; background: #ff3030; font-style: normal; font-size: 12px; }
.word-row em { background: #27c06d; }
.search-result-block { padding: 18px 18px 100px; border-top: 1px solid var(--line); }
.search-result { display: grid; grid-template-columns: 92px 1fr 20px; gap: 12px; align-items: center; padding: 12px 0; }
.result-cover { width: 92px; height: 112px; border-radius: 8px; background-size: cover; background-position: center; }
.search-result h3 { margin: 0 0 8px; font-size: 16px; }
.search-result p { margin: 10px 0 0; color: var(--muted); }
.search-result > span { font-size: 34px; color: #697080; }

.video-hero { height: 330px; background: #080d1b; color: #fff; position: relative; overflow: hidden; }
.video-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.65)); }
.video-hero > * { position: relative; z-index: 1; }
.video-top { padding: 18px 18px; display: flex; justify-content: space-between; }
.video-top button { color: #fff; font-size: 30px; }
.video-top button:last-child { font-size: 13px; border: 2px solid rgba(255,255,255,.75); border-radius: 7px; padding: 2px 5px; height: 30px; }
.video-player { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; background: #080d1b; }
.video-locked { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; background-size: cover; background-position: center; }
.video-locked::before { content: ""; position: absolute; inset: 0; background: rgba(5,10,24,.72); }
.video-locked div { position: relative; z-index: 1; display: grid; gap: 10px; justify-items: center; }
.video-locked b { font-size: 20px; }
.video-locked span { color: rgba(255,255,255,.78); font-size: 13px; }
.video-locked button { height: 36px; padding: 0 18px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #ff8a00, #ff5c00); font-weight: 800; }
.video-controls { position: absolute; left: 18px; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.video-controls div { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.45); }
.video-controls i { display: block; width: 42%; height: 100%; border-radius: 99px; background: var(--purple); }
.detail-actions { height: 88px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; border-bottom: 1px solid var(--line); }
.detail-actions button { display: grid; gap: 4px; place-items: center; font-size: 24px; }
.detail-actions span { font-size: 12px; }
.detail-body { padding: 18px 18px 102px; }
.detail-body h1 { margin: 0 0 10px; font-size: 22px; letter-spacing: 0; }
.detail-count { margin: 12px 0 14px; color: #5f6472; }
.intro { margin: 0; color: #303442; line-height: 1.75; font-size: 14px; }
.intro button { float: right; color: var(--purple); font-weight: 800; }
.episode-title { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; }
.episode-title h2, .preview-title { margin: 0; font-size: 18px; }
.episode-title button { color: #737887; font-size: 13px; }
.detail-episodes { margin-top: 12px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.detail-episodes button { height: 62px; border-radius: 10px; background: #f4f5f8; font-size: 18px; position: relative; border: 1px solid transparent; }
.detail-episodes .active { background: #f7f5ff; border-color: var(--purple); color: var(--purple); }
.detail-episodes .locked { color: #8f95a3; }
.detail-episodes small { position: absolute; right: -2px; top: -6px; padding: 1px 6px; border-radius: 5px; background: #28c25d; color: #fff; font-size: 11px; }
.detail-episodes .locked small { background: #aeb3bf; }
.full-unlock-btn { width: 100%; height: 44px; margin-top: 14px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #ff8a00, #ff5c00); font-weight: 900; }
.clip-row { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.clip-row article div { height: 74px; border-radius: 8px; background-size: cover; background-position: center; position: relative; color: #fff; overflow: hidden; }
.clip-row article div::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.45)); }
.clip-row span, .clip-row b { position: absolute; z-index: 1; bottom: 8px; }
.clip-row span { left: 8px; }
.clip-row b { right: 8px; font-size: 12px; }
.clip-row p { margin: 8px 0 0; font-size: 13px; }

.episode-page { padding: 16px 18px 28px; }
.episode-page h2 { margin: 0 0 16px; font-size: 18px; }
.episode-page h2 span { color: var(--muted); font-weight: 600; font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; color: #5b6070; font-size: 13px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; background: #ddd; }
.legend .free { background: #21ba4b; }
.legend .paid, .legend .playing { background: var(--purple); }
.legend .locked { background: #c8cbd3; }
.episode-large-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.episode-large-grid button { height: 66px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; gap: 2px; background: #fff; }
.episode-large-grid b { font-size: 18px; }
.episode-large-grid span { font-size: 12px; color: #8a8f9d; }
.episode-large-grid .free span { color: #00a52e; }
.episode-large-grid .paid span { color: var(--purple); }
.episode-large-grid .playing { background: var(--purple); color: #fff; }
.episode-large-grid .playing span { color: #fff; }
.episode-large-grid .locked { color: #7d8390; }
.load-more, .bottom-note { text-align: center; color: #9a9fad; margin: 16px 0 0; font-size: 12px; }

.sheet-mask { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.62); display: flex; align-items: flex-end; }
.unlock-sheet { width: 100%; min-height: 56vh; border-radius: 28px 28px 0 0; background: #fff; padding: 22px 22px 30px; text-align: center; position: relative; }
.sheet-close { position: absolute; right: 18px; top: 18px; width: 40px; height: 40px; border-radius: 50%; background: #f1f2f5; font-size: 24px; color: #555; }
.sheet-drama { display: flex; gap: 16px; align-items: center; text-align: left; }
.sheet-drama div { width: 82px; height: 82px; border-radius: 14px; background-size: cover; background-position: center; }
.sheet-drama h2 { margin: 0; font-size: 20px; }
.unlock-sheet h1 { margin: 28px 0 12px; font-size: 22px; }
.unlock-sheet h1 em { color: var(--purple); font-style: normal; }
.unlock-sheet > p { color: #6f7480; font-size: 14px; }
.unlock-sheet > p b { color: var(--purple); }
.price { margin: 18px 0; color: var(--orange); font-size: 36px; font-weight: 900; }
.hint { color: #777 !important; }
.save { display: inline-block; margin-bottom: 18px; padding: 8px 14px; border-radius: 12px; background: #ffe8dc; color: var(--orange); font-size: 13px; }
.unlock-sheet ul { width: max-content; margin: 0 auto 22px; text-align: left; color: #3e4350; line-height: 1.8; font-size: 13px; }
.primary-pay, .confirm-pay, .service-button { width: 100%; height: 54px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #ff8a00, #ff5c00); font-size: 18px; font-weight: 900; }
.primary-pay:disabled, .confirm-pay:disabled { opacity: .65; cursor: not-allowed; }
.sheet-link { margin-top: 16px; color: var(--purple); font-size: 14px; font-weight: 900; }

.recharge-balance, .mine-balance { margin: 14px 18px 24px; padding: 20px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #7357ff, #653df4); position: relative; overflow: hidden; }
.recharge-balance::after, .mine-balance::after { content: "◇"; position: absolute; right: 24px; top: 16px; font-size: 72px; opacity: .25; }
.recharge-balance p, .mine-balance p { margin: 0 0 14px; opacity: .9; font-size: 13px; }
.recharge-balance h1, .mine-balance h2 { margin: 0; font-size: 34px; }
.recharge-main { padding: 0 18px 32px; }
.recharge-main h2 { margin: 20px 0 12px; font-size: 18px; }
.recharge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.recharge-grid button { position: relative; height: 102px; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; background: #fff; }
.recharge-grid .active { border: 2px solid var(--purple); background: #fbfaff; }
.recharge-grid b { font-size: 18px; }
.recharge-grid span { color: var(--orange); font-size: 18px; font-weight: 900; }
.recharge-grid i { position: absolute; top: -1px; right: -1px; padding: 3px 8px; border-radius: 0 10px 0 10px; background: var(--orange); color: #fff; font-style: normal; font-size: 12px; }
.recharge-grid em { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--purple); color: #fff; font-style: normal; font-size: 12px; }
.recharge-main ol { margin: 0 0 24px 18px; padding: 0; color: #737887; line-height: 1.8; font-size: 13px; }
.agreement { text-align: center; color: #7a7f8d; font-size: 12px; }

.mine-page { background: #fbfbfd; }
.mine-head { padding: 28px 18px 22px; display: grid; grid-template-columns: 88px 1fr 42px; gap: 14px; align-items: center; }
.mine-head img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.mine-head h1 { margin: 0; font-size: 20px; }
.mine-head h1 span { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 999px; background: #222; color: #ffe9a4; font-size: 12px; vertical-align: 3px; }
.mine-head p { margin: 10px 0 0; color: #666b76; font-size: 13px; }
.mine-head button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-weight: 900; }
.mine-balance { display: flex; align-items: center; justify-content: space-between; }
.mine-balance button { width: 96px; height: 40px; border-radius: 999px; background: linear-gradient(135deg, #ff9a00, #ff6800); color: #fff; font-size: 13px; font-weight: 900; }
.mine-menu { margin: 0 18px 22px; background: #fff; border-radius: 14px; box-shadow: 0 6px 24px rgba(15,23,42,.06); overflow: hidden; }
.mine-menu button { width: 100%; height: 64px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.mine-menu button:last-child { border-bottom: 0; }
.mine-menu span { color: #9ca3af; font-size: 24px; }
.mine-menu.single { margin-top: 0; }

.watch-list, .bill-card, .diamond-list { padding: 14px 18px 36px; }
.watch-list article { display: grid; grid-template-columns: 82px 1fr 92px; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.watch-list article > div { width: 82px; height: 98px; border-radius: 8px; background-size: cover; background-position: center; }
.watch-list h2, .diamond-list h2 { margin: 0 0 10px; font-size: 16px; }
.watch-list p, .diamond-list p { margin: 8px 0 0; color: #676c78; font-size: 13px; }
.watch-list b { color: var(--purple); }
.watch-list article button { height: 38px; border-radius: 10px; background: var(--purple); color: #fff; font-weight: 800; font-size: 13px; }
.bill-card { margin: 14px 18px 0; padding: 18px 16px; border: 1px solid var(--line); border-radius: 14px; }
.bill-card article { display: grid; grid-template-columns: 46px 1fr 92px; gap: 12px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.bill-card article:first-child { padding-top: 0; }
.bill-card article:last-child { border-bottom: 0; }
.diamond-icon { font-size: 30px; }
.bill-card h2, .bill-card h3 { margin: 0 0 10px; font-size: 16px; }
.bill-card p { margin: 0; color: #7a7f8b; font-size: 12px; }
.bill-card .right { text-align: right; }
.bill-card .right p { color: #20a941; }
.diamond-list article { display: grid; grid-template-columns: 70px 1fr 84px; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.diamond-list article > div { width: 70px; height: 70px; border-radius: 9px; background-size: cover; background-position: center; }
.diamond-list b { text-align: right; font-size: 16px; }

.customer-page { background: #f7f8fb; }
.service-card { margin: 18px 18px 24px; padding: 20px; border-radius: 18px; background: #fff; display: grid; grid-template-columns: 104px 1fr; gap: 18px; align-items: center; box-shadow: 0 8px 28px rgba(15,23,42,.06); }
.service-card img { width: 104px; height: 104px; border-radius: 18px; object-fit: cover; }
.service-card h1 { margin: 0 0 10px; font-size: 18px; }
.service-card p { margin: 8px 0; color: #666b78; font-size: 13px; }
.faq-title { margin: 0 18px 14px; font-size: 18px; }
.faq-card { margin: 0 18px 40px; border-radius: 18px; background: #fff; overflow: hidden; box-shadow: 0 8px 28px rgba(15,23,42,.05); }
.faq-card button { width: 100%; height: 58px; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); font-size: 14px; }
.faq-card button:last-child { border-bottom: 0; }
.faq-card span { color: #9ca3af; font-size: 22px; }
.service-button { width: calc(100% - 36px); margin: 0 18px; background: linear-gradient(135deg, #7d3dff, #6b48ff); }
.service-note { text-align: center; color: #7b808d; margin-top: 18px; font-size: 12px; }

.empty-state { grid-column: 1 / -1; padding: 34px 12px; text-align: center; color: #8e94a3; background: #f7f8fb; border-radius: 14px; }
.toast { position: fixed; left: 50%; bottom: 92px; z-index: 90; transform: translateX(-50%); max-width: calc(100vw - 48px); padding: 10px 16px; border-radius: 999px; color: #fff; background: rgba(12,18,36,.88); box-shadow: 0 10px 28px rgba(12,18,36,.2); font-size: 13px; white-space: nowrap; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: 72px; display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); border-top: 1px solid var(--line); z-index: 40; }
.tabbar button { display: grid; place-items: center; gap: 2px; color: #727784; font-weight: 700; font-size: 12px; }
.tabbar button span { font-size: 24px; line-height: 1; }
.tabbar .active { color: var(--purple); }
