:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #fafbff;
  --ink: #16131f;
  --ink-2: #423d54;
  --muted: #807a92;
  --line: #ecebf4;
  --line-2: #f3f2f9;
  --primary: #6c4cf1;
  --primary-700: #5736d6;
  --primary-50: #efeaff;
  --gold: #f5b53d;
  --gold-700: #e09e1f;
  --gold-50: #fdf3df;
  --success: #1faa6b;
  --success-50: #e3f6ed;
  --danger: #e0556b;
  --danger-50: #fce8ec;
  --info: #3b82f6;
  --info-50: #e7f0fe;
  --r: 18px;
  --r-sm: 12px;
  --r-xs: 9px;
  --shadow: 0 10px 30px rgba(28, 22, 53, 0.08);
  --shadow-sm: 0 4px 14px rgba(28, 22, 53, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Layout ── */
#app { max-width: 1080px; margin: 0 auto; min-height: 100%; padding-bottom: 84px; }
#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #9b7bff);
  display: grid; place-items: center; color: #fff; font-size: 18px;
  box-shadow: 0 6px 16px rgba(108,76,241,.35);
}
.brand .sub { color: var(--muted); font-weight: 500; font-size: 12px; }
.spacer { flex: 1; }
.top-user { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #ffd27a);
  display: grid; place-items: center; color: #5a3d00; font-weight: 700; font-size: 13px;
}
.link-btn { background: none; border: none; color: var(--muted); font-size: 14px; padding: 6px 4px; }
.link-btn:hover { color: var(--primary); }

#view { padding: 20px 20px 56px; }

/* ── Bottom nav ── */
#bottomnav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 40px; z-index: 40;
  display: flex; gap: 4px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow);
  max-width: 94vw;
}
#bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 16px; border-radius: 999px; color: var(--muted);
  font-size: 12px; min-width: 64px; transition: .2s;
}
#bottomnav a .ic { font-size: 18px; line-height: 1; }
#bottomnav a.active { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(108,76,241,.35); }
#bottomnav a.admin { color: var(--gold-700); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--r-sm); padding: 13px 20px;
  font-size: 15px; font-weight: 700; transition: .18s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #8a6bff); color: #fff; box-shadow: 0 8px 20px rgba(108,76,241,.3); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:disabled { background: #d9d6e8; color: #fff; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #ffce7a); color: #5a3d00; box-shadow: 0 8px 20px rgba(245,181,61,.35); }
.btn-gold:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }
.btn-danger-soft { background: var(--danger-50); color: var(--danger); }
.btn-success-soft { background: var(--success-50); color: var(--success); }

/* ── Inputs ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 15px; background: var(--surface-2);
  transition: .15s; outline: none;
}
.input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-50); }
textarea.input { resize: vertical; min-height: 84px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ── Card ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }

/* ── Hero (login) ── */
.auth-wrap { min-height: calc(100vh - 40px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 32px 28px; }
.auth-hero {
  text-align: center; margin-bottom: 22px;
}
.auth-hero .mark {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #9b7bff);
  display: grid; place-items: center; font-size: 30px; color: #fff;
  box-shadow: 0 10px 26px rgba(108,76,241,.4);
}
.auth-hero h1 { font-size: 22px; font-weight: 800; }
.auth-hero p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.tabs { display: flex; background: var(--line-2); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; border: none; background: none; padding: 10px; border-radius: 999px; font-weight: 700; color: var(--muted); font-size: 14px; }
.tabs button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.6; }

/* ICP 备案 footer (登录页底部，合规展示) */
.icp-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}
.icp-footer a { color: var(--muted); text-decoration: none; }
.icp-footer a:hover { color: var(--primary); }
.icp-sep { margin: 0 5px; opacity: 0.45; }

/* 站点级 ICP 备案条 (固定底部，全站可见，工信部合规) */
.site-icp {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  text-align: center; font-size: 11px; line-height: 1;
  padding: 8px 0; background: rgba(21,19,31,.92);
  color: var(--muted); border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.site-icp a { color: var(--muted); text-decoration: none; }
.site-icp a:hover { color: var(--primary); }


/* ── Badges / pills ── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-funding { background: var(--info-50); color: var(--info); }
.pill-funded { background: var(--gold-50); color: var(--gold-700); }
.pill-filming { background: var(--primary-50); color: var(--primary-700); }
.pill-finished { background: var(--success-50); color: var(--success); }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.tag-gold { background: var(--gold-50); color: var(--gold-700); }

/* ── Drama grid ── */
.hero-band {
  background: linear-gradient(135deg, #1c1530, #3a2a6b 60%, #6c4cf1);
  border-radius: var(--r); padding: 26px 24px; color: #fff; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.hero-band h2 { font-size: 22px; font-weight: 800; }
.hero-band p { color: #cfc6f0; font-size: 13px; margin-top: 6px; max-width: 560px; }
.hero-stat { display: flex; gap: 26px; margin-top: 18px; }
.hero-stat div span { display: block; font-size: 12px; color: #b9aee6; }
.hero-stat div b { font-size: 20px; font-weight: 800; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { max-width: 240px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); transition: .2s; cursor: pointer; display: flex; flex-direction: column; }
.dcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cover { position: relative; aspect-ratio: 3/4; display: grid; place-items: center; color: #fff; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ph { font-size: 34px; font-weight: 800; text-align: center; padding: 0 14px; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.cover .pill { position: absolute; top: 10px; left: 10px; backdrop-filter: blur(4px); }
.cover .ep { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,.45); color:#fff; font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.dcard .body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dcard h3 { font-size: 16px; font-weight: 800; line-height: 1.35; }
.dcard .slogan { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard .meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.dcard .cost b { color: var(--primary-700); font-size: 15px; }
.dcard .cost span { font-size: 11px; color: var(--muted); }

/* ── Progress bar ── */
.progress { height: 9px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffd27a); border-radius: 999px; transition: width .5s; }
.progress.primary > i { background: linear-gradient(90deg, var(--primary), #9b7bff); }
.prog-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.prog-row b { color: var(--ink); }

/* ── Detail ── */
.detail-hero { position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 16/7; display: grid; place-items: center; color: #fff; margin-bottom: 18px; }
.detail-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-hero .ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.6)); }
.detail-hero .txt { position: relative; text-align: center; padding: 20px; }
.detail-hero .txt h1 { font-size: 26px; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.detail-hero .txt p { color: #eee; margin-top: 8px; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .detail-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); }
.panel h3 { font-size: 16px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--ink); }
.info-block { margin-top: 14px; }
.info-block h4 { font-size: 13px; color: var(--primary-700); margin-bottom: 4px; font-weight: 700; }
.info-block p { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.risk { background: var(--danger-50); color: #a33347; font-size: 12.5px; padding: 10px 12px; border-radius: var(--r-xs); margin-top: 12px; line-height: 1.6; }

/* 认筹 panel */
.subscribe-box { position: sticky; top: 84px; }
.amount-input { position: relative; }
.amount-input .cur { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.amount-input .input { padding-left: 30px; font-size: 18px; font-weight: 800; }
.quick-amts { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.quick-amts button { padding: 7px 12px; border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.quick-amts button:hover { border-color: var(--primary); color: var(--primary); }
.big-num { font-size: 26px; font-weight: 800; color: var(--primary-700); }

/* Episode stepper */
.episodes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ep-dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--muted); }
.ep-dot.done { background: linear-gradient(135deg, var(--primary), #9b7bff); color: #fff; }
.ep-dot.cur { box-shadow: 0 0 0 2px var(--gold); }

/* Ranking */
.rank-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.rank-item:last-child { border-bottom: none; }
.rank-no { width: 24px; height: 24px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.rank-no.top1 { background: var(--gold); color: #5a3d00; }
.rank-no.top2 { background: #d9d4ea; color: #4a3d8a; }
.rank-no.top3 { background: #f3d9b0; color: #7a531a; }
.rank-name { flex: 1; font-weight: 600; }
.rank-amt { color: var(--primary-700); font-weight: 800; }

/* ── Admin ── */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-tabs button { padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--ink-2); font-size: 14px; }
.admin-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 700; padding: 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); }
.table tr:hover td { background: var(--surface-2); }
.section-title { font-size: 18px; font-weight: 800; margin: 6px 0 14px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; box-shadow: var(--shadow);
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }

/* spinner */
.spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.center-load { text-align: center; color: var(--muted); padding: 50px 0; }
.video-frame { width: 100%; border-radius: var(--r-sm); margin-top: 10px; background: #000; aspect-ratio: 16/9; }
