:root {
  color-scheme: dark;
  --bg: #171717;
  --panel: #202020;
  --panel-2: #262626;
  --panel-3: #2d2d2d;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #a3a3a3;
  --muted-2: #737373;
  --text: #f5f5f5;
  --accent: #ff9900;
  --accent-soft: rgba(255, 153, 0, 0.16);
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: #000; scroll-behavior: smooth; }
body { width: 100%; max-width: 100%; min-width: 0; margin: 0; overflow-x: hidden; background: #000; color: var(--text); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.shell {
  width: 100vw;
  max-width: 560px;
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(255,255,255,.03);
  overflow-x: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(23,23,23,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 0 10px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: var(--accent); font-size: 18px; font-weight: 1000; letter-spacing: 0; line-height: 1; }
.brand-wordmark { display: inline-block; }
.brand-accent { width: 5px; height: 17px; display: inline-block; background: var(--accent); }
.brand-mark { display: none; }
.brand small { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: 0; }
.top-nav { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; justify-content: space-between; gap: 2px; }
.top-nav a { min-width: 0; flex: 1 1 0; padding: 4px 5px; border-radius: 3px; color: var(--muted); font-size: 11px; line-height: 1; text-align: center; white-space: nowrap; }
.top-nav a.active, .top-nav a:hover { color: var(--accent); background: var(--accent-soft); }

.category-strip { display: flex; gap: 4px; overflow-x: auto; padding: 4px 10px 5px; border-top: 1px solid rgba(255,255,255,.04); scrollbar-width: none; }
.category-strip::-webkit-scrollbar, .tag-scroll::-webkit-scrollbar { display: none; }
.pill { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 22px; padding: 3px 9px; border: 1px solid transparent; border-radius: 3px; color: #d3d3d3; font-size: 10px; background: transparent; }
.pill.active, .pill:hover { color: #171717; background: var(--accent); }
.home-pill { font-weight: 800; }

.catalog-panel { position: relative; margin: 3px 0 21px; padding: 0 10px 7px; background: #202020; }
.catalog-row, .catalog-footer { display: grid; grid-template-columns: 47px minmax(0, 1fr); align-items: start; min-height: 22px; }
.catalog-label { padding-top: 3px; color: var(--accent); font-size: 10px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.catalog-links { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; column-gap: 18px; row-gap: 2px; }
.catalog-links a { display: inline-block; padding: 3px 0; color: #c5c5c5; font-size: 9px; line-height: 1.25; white-space: nowrap; }
.catalog-links a:hover { color: var(--accent); }
.catalog-links a.active { padding: 3px 7px; border-radius: 4px; color: #171717; background: var(--accent); }
.catalog-footer { margin-top: 2px; padding-top: 3px; border-top: 1px solid rgba(255,255,255,.045); }
.catalog-search { justify-self: end; min-width: 42px; padding: 4px 10px; border-radius: 4px; color: #171717; background: var(--accent); font-size: 10px; font-weight: 800; text-align: center; }
.catalog-hidden { display: none; }
.catalog-hidden.is-open { display: block; }
.catalog-toggle { position: absolute; right: 10px; bottom: 7px; min-width: 48px; min-height: 24px; padding: 4px 8px; border-radius: 4px; color: #171717; background: var(--accent); font-size: 10px; font-weight: 800; line-height: 1; }
.catalog-panel:has(.catalog-hidden.is-open) { padding-bottom: 35px; }

.page { min-width: 0; padding: 14px 12px 80px; }
.notice { padding: 10px 12px; margin-bottom: 12px; border-left: 3px solid var(--accent); color: var(--muted); background: rgba(255,153,0,.08); font-size: 12px; line-height: 1.6; }
.section { margin-top: 20px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title { font-size: 16px; font-weight: 800; }
.section-title::before { content: ""; display: inline-block; width: 3px; height: 15px; margin-right: 7px; vertical-align: -2px; background: var(--accent); }
.section-more { color: var(--accent); font-size: 12px; }

.tag-box { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0 7px; }
.selected-tag { margin-bottom: 8px; color: var(--accent); font-size: 11px; font-weight: 800; }
.tag-scroll { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.tag { display: inline-flex; flex: 0 0 auto; padding: 5px 9px; border-radius: 5px; color: #d4d4d4; background: rgba(255,255,255,.06); font-size: 11px; }
.tag:hover, .tag.active { color: var(--accent); background: var(--accent-soft); }
.clear-filter { display: inline-flex; margin: -2px 0 10px; color: var(--accent); font-size: 11px; }

.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.card { overflow: hidden; border-radius: var(--radius); background: rgba(255,255,255,.055); transition: transform .18s ease, background .18s ease; }
.card:hover { transform: translateY(-2px); background: rgba(255,255,255,.09); }
.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.5)); pointer-events: none; }
.play-badge { position: absolute; left: 9px; bottom: 7px; z-index: 1; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #171717; background: var(--accent); font-size: 13px; }
.card-title { min-height: 38px; padding: 8px 9px 9px; color: #ededed; font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card-meta { display: flex; justify-content: space-between; gap: 7px; padding: 0 9px 8px; color: var(--muted-2); font-size: 10px; }

.hero-card { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 12px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #202020; }
.hero-card .thumb, .hero-media { border-radius: 6px; }
.hero-media { position: relative; min-width: 0; overflow: hidden; aspect-ratio: 16 / 9; background: #071017; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, rgba(0,0,0,.42)); pointer-events: none; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-card > * { min-width: 0; }
.hero-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 8px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; }
.hero-copy h1 { min-width: 0; margin: 0; overflow-wrap: anywhere; word-break: break-all; font-size: 18px; line-height: 1.3; }
.hero-copy p { margin: 0; overflow-wrap: anywhere; word-break: break-all; color: var(--muted); font-size: 12px; line-height: 1.55; }
.campaign-hero .hero-copy h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.campaign-hero .button-row { margin-top: 2px; }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; }
.button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 11px; border-radius: 5px; color: #171717; background: var(--accent); font-size: 12px; font-weight: 800; }
.button.secondary { color: var(--text); background: rgba(255,255,255,.08); }
.button.ghost { color: var(--accent); background: transparent; border: 1px solid rgba(255,153,0,.35); }

.search-box { display: flex; gap: 7px; margin-bottom: 12px; }
.input { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; outline: 0; color: var(--text); background: var(--panel-2); }
.input:focus { border-color: rgba(255,153,0,.7); box-shadow: 0 0 0 3px rgba(255,153,0,.08); }
.search-btn { width: 44px; flex: 0 0 44px; border-radius: 5px; color: #171717; background: var(--accent); font-size: 18px; }

.list-page { padding-bottom: 8px; }
.list-page .video-grid { gap: 9px; }
.pagination { width: 100%; max-width: 100%; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 16px auto 0; padding: 7px 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 2px; background: #202020; }
.page-btn, .page-info { min-height: 31px; display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.06); font-size: 11px; }
.page-btn:hover { color: var(--accent); }
.page-btn.disabled { color: #555; background: rgba(255,255,255,.025); cursor: default; pointer-events: none; }
.page-info { background: transparent; }
.page-jump { display: inline-flex; gap: 5px; }
.page-jump input { width: 58px; min-height: 31px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--panel-2); text-align: center; }

.novel-list { display: grid; gap: 8px; }
.novel-card { display: block; padding: 11px 12px; border-left: 3px solid transparent; border-radius: 6px; background: rgba(255,255,255,.055); }
.novel-card:hover { border-left-color: var(--accent); background: rgba(255,255,255,.085); }
.novel-card-title { margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.novel-card-meta { display: flex; gap: 8px; color: var(--accent); font-size: 10px; }
.novel-card-intro { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.gallery-card { overflow: hidden; border-radius: var(--radius); background: rgba(255,255,255,.055); }
.gallery-thumb { aspect-ratio: 3 / 4; overflow: hidden; background: var(--panel-2); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-title { min-height: 38px; padding: 8px; font-size: 11px; line-height: 1.45; }

.detail-head { min-width: 0; margin-bottom: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--accent); }
.detail-title { min-width: 0; margin: 0 0 8px; overflow-wrap: anywhere; word-break: break-all; font-size: 18px; line-height: 1.38; }
.detail-description { min-width: 0; margin: 0; overflow-wrap: anywhere; word-break: break-all; color: var(--muted); font-size: 12px; line-height: 1.65; }
.video-player { position: relative; width: 100%; min-width: 0; overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #090909; }
.video-player video { width: 100%; max-width: 100%; min-width: 0; height: 100%; object-fit: contain; background: #090909; }
.player-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; pointer-events: none; }
.route-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 9px 0 2px; scrollbar-width: none; }
.route-tab { flex: 0 0 auto; padding: 6px 10px; border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.07); font-size: 11px; }
.route-tab.active, .route-tab:hover { color: #171717; background: var(--accent); }
.action-bar { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.action-btn { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 5px; color: var(--text); background: rgba(255,255,255,.08); font-size: 11px; }
.action-btn:hover { color: var(--accent); background: var(--accent-soft); }
.tag-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.tag-badge { padding: 4px 7px; border-radius: 4px; color: var(--accent); background: var(--accent-soft); font-size: 10px; }

.info-table { display: grid; gap: 1px; overflow: hidden; border-radius: 6px; background: var(--line); }
.info-row { display: grid; grid-template-columns: 78px 1fr; gap: 9px; padding: 9px 10px; background: var(--panel); font-size: 11px; }
.info-row dt { color: var(--muted-2); }
.info-row dd { margin: 0; color: #dedede; }

.reader-toolbar { position: sticky; top: 105px; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 12px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: rgba(32,32,32,.96); }
.reader-toolbar .button { min-height: 29px; padding: 5px 8px; font-size: 11px; }
.reader-content { padding: 16px 14px; border-radius: 6px; color: #292929; background: #f3efe3; font-size: 16px; line-height: 2.05; }
.reader-content h2 { margin-top: 0; color: #171717; font-size: 19px; line-height: 1.45; }
.reader-content p { margin: 0 0 15px; text-indent: 2em; }
.chapter-list { max-height: 230px; overflow: auto; padding: 8px; border-radius: 6px; background: rgba(255,255,255,.05); }
.chapter-list a { display: block; padding: 7px 8px; border-radius: 4px; color: var(--muted); font-size: 11px; }
.chapter-list a:hover, .chapter-list a.active { color: var(--accent); background: var(--accent-soft); }

.gallery-detail { display: grid; gap: 12px; }
.gallery-viewer { overflow: hidden; border-radius: var(--radius); background: #0a0a0a; }
.gallery-viewer img { width: 100%; max-height: 74vh; object-fit: contain; }
.episode-strip { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.episode { flex: 0 0 auto; padding: 7px 10px; border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.07); font-size: 11px; }
.episode.active, .episode:hover { color: #171717; background: var(--accent); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; padding: 12px; background: rgba(0,0,0,.68); }
.modal { width: min(100%, 560px); max-height: 82vh; overflow: auto; padding: 15px; border: 1px solid var(--line); border-radius: 8px 8px 0 0; background: var(--panel); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 15px; }
.close { width: 30px; height: 30px; border-radius: 50%; color: var(--muted); background: rgba(255,255,255,.08); }
.feedback-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 10px; }
.feedback-option { display: block; padding: 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 11px; }
.feedback-option input { margin-right: 5px; accent-color: var(--accent); }
.episode-modal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.episode-modal-link { display: flex; min-height: 34px; align-items: center; justify-content: center; padding: 7px 6px; border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.06); font-size: 11px; text-align: center; }
.episode-modal-link:hover { color: #171717; background: var(--accent); }

.empty { padding: 35px 10px; color: var(--muted-2); text-align: center; font-size: 12px; }
.status { margin: 10px 0; color: var(--muted); font-size: 12px; }
.footer { padding: 22px 12px 28px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 10px; line-height: 1.7; text-align: center; }

@media (max-width: 430px) {
  .hero-card { grid-template-columns: 1fr; gap: 10px; }
  .hero-copy h1 { font-size: 17px; }
  .campaign-hero .hero-copy { padding: 2px 2px 1px; }
}
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 70; transform: translateX(-50%); max-width: calc(100% - 30px); padding: 10px 13px; border-radius: 5px; color: #171717; background: var(--accent); font-size: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.35); }

@media (max-width: 420px) {
  .pagination { gap: 5px; }
  .pagination .page-jump { flex: 1 0 100%; justify-content: center; }
}

@media (min-width: 700px) {
  .shell { max-width: 720px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
