:root {
  --bg: #0b0b12;
  --bg-soft: #12121c;
  --card: #16161f;
  --card-2: #1c1c28;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f2f2f7;
  --muted: #a2a2b5;
  --dim: #74748a;
  --brand: #7c5cff;
  --brand-2: #ff7a59;
  --ok: #3ddc97;
  --warn: #f5c451;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.bg-glow {
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 720px;
  background:
    radial-gradient(600px 320px at 22% 30%, rgba(124, 92, 255, .30), transparent 70%),
    radial-gradient(520px 300px at 78% 18%, rgba(255, 122, 89, .22), transparent 72%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px max(20px, calc((100vw - var(--maxw)) / 2));
  background: rgba(11, 11, 18, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; flex: none; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--dim); letter-spacing: 1.6px; }

.nav-links { display: flex; gap: 4px; margin-left: 10px; flex-wrap: wrap; }
.nav-links a {
  padding: 7px 13px; border-radius: 999px; color: var(--muted);
  font-size: 14px; transition: .18s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav-links a.active { color: var(--text); background: rgba(124, 92, 255, .18); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }

.app { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 30px 20px 90px; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04); cursor: pointer;
  font-weight: 600; font-size: 14px; transition: .18s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #a17cff);
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 26px rgba(124, 92, 255, .32);
}
.btn-primary:hover { background: linear-gradient(135deg, #8b6dff, #b28bff); }
.btn-warm { background: linear-gradient(135deg, var(--brand-2), #ffab7a); border-color: transparent; color: #2a1409; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { color: #ff9b9b; border-color: rgba(255, 90, 90, .35); }
.btn-danger:hover { background: rgba(255, 90, 90, .12); }
.btn-block { width: 100%; }

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-body { padding: 20px; }

.section { margin-top: 46px; }
.section-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: .2px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.section-head .spacer { margin-left: auto; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, .07); color: var(--muted); border: 1px solid var(--line);
}
.badge-public { color: #9fe8c8; background: rgba(61, 220, 151, .12); border-color: rgba(61, 220, 151, .3); }
.badge-patron { color: #cbbcff; background: rgba(124, 92, 255, .16); border-color: rgba(124, 92, 255, .34); }
.badge-tier { color: #ffcf9b; background: rgba(255, 122, 89, .14); border-color: rgba(255, 122, 89, .32); }
.badge-locked { color: #ffd6a8; background: rgba(245, 196, 81, .13); border-color: rgba(245, 196, 81, .3); }
.badge-draft { color: var(--dim); }

.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- 首页 hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 26px;
  padding: 40px;
  background:
    radial-gradient(700px 320px at 88% -10%, rgba(255, 122, 89, .22), transparent 60%),
    linear-gradient(160deg, #191926, #101018 55%);
}
.hero-inner { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.avatar {
  width: 108px; height: 108px; border-radius: 30px; flex: none;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-size: 40px; font-weight: 700; color: #fff;
  box-shadow: 0 20px 44px rgba(124, 92, 255, .36);
  object-fit: cover; overflow: hidden;
}

/* 内容编辑器里的封面预览 */
.cover-preview {
  margin: 8px 0;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 9;
  max-width: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, .25);
  text-align: center;
  padding: 8px;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.hero h1 { margin: 0 0 6px; font-size: 34px; line-height: 1.2; letter-spacing: -.4px; }
.hero .tagline { color: var(--muted); max-width: 520px; margin: 0 0 18px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.stats { display: flex; gap: 26px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.stat b { display: block; font-size: 22px; letter-spacing: -.3px; }
.stat span { font-size: 12px; color: var(--dim); letter-spacing: .6px; }

/* ---------- 档位卡 ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 16px; }
.tier {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  transition: .2s;
}
.tier:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.tier.current { border-color: rgba(124, 92, 255, .6); box-shadow: 0 0 0 1px rgba(124, 92, 255, .35) inset; }
.tier .accent { position: absolute; inset: 0 0 auto; height: 3px; border-radius: 18px 18px 0 0; }
.tier h3 { margin: 6px 0 0; font-size: 17px; }
.tier .price { font-size: 30px; font-weight: 700; letter-spacing: -.6px; }
.tier .price small { font-size: 13px; font-weight: 500; color: var(--dim); letter-spacing: 0; }
.tier .tagline { color: var(--muted); font-size: 13px; min-height: 38px; }
.tier ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: #d9d9e6; }
.tier li { display: flex; gap: 8px; }
.tier li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.tier .btn { margin-top: auto; }
.tier .lvl { position: absolute; top: 16px; right: 16px; font-size: 11px; color: var(--dim); }

/* ---------- 视频卡 ---------- */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 20px; }
.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: var(--card);
  transition: .2s; cursor: pointer;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #0e0e16; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.locked img { filter: blur(14px) saturate(.7) brightness(.6); transform: scale(1.06); }
.thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .55));
}
.thumb .play svg { width: 46px; height: 46px; opacity: .92; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .6)); }
.thumb .lock-icon {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 6px;
  font-size: 12px; color: #fff; text-align: center; flex-direction: column;
}
.thumb .lock-icon .ico { font-size: 26px; }
.thumb .dur {
  position: absolute; right: 10px; bottom: 10px; padding: 2px 7px; border-radius: 6px;
  background: rgba(0, 0, 0, .72); font-size: 12px; font-variant-numeric: tabular-nums;
}
.post-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card h3 { margin: 0; font-size: 15.5px; line-height: 1.45; }
.post-card .summary { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .meta { margin-top: auto; display: flex; gap: 12px; align-items: center; font-size: 12.5px; color: var(--dim); }

/* ---------- 视频播放页 ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 940px) { .watch { grid-template-columns: 1fr; } }
.player { position: relative; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.player video, .player iframe { width: 100%; aspect-ratio: 16 / 9; display: block; border: 0; background: #000; }
.player .locked-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: rgba(8, 8, 14, .68); backdrop-filter: blur(8px); padding: 24px;
}
.locked-overlay .lockbox { max-width: 420px; display: grid; gap: 12px; justify-items: center; }
.locked-overlay .big-lock { font-size: 40px; }
.locked-overlay h3 { margin: 0; font-size: 19px; }
.locked-overlay p { margin: 0; color: var(--muted); font-size: 14px; }

.prose { white-space: pre-wrap; color: #dcdce8; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }

.comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.c-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-2)); font-size: 14px; font-weight: 700;
}
.comment .who { font-weight: 600; font-size: 13.5px; }
.comment .when { color: var(--dim); font-size: 12px; }
.comment .text { margin: 4px 0 0; white-space: pre-wrap; }

/* ---------- 表单 ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .28); outline: none;
  transition: .16s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 92, 255, .18); }
.textarea { min-height: 110px; resize: vertical; font-family: inherit; }
.hint { font-size: 12px; color: var(--dim); }
.form-narrow { max-width: 420px; margin: 40px auto; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.auth-switch a { color: #b3a0ff; }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; border: 1px solid; }
.notice-warn { background: rgba(245, 196, 81, .1); border-color: rgba(245, 196, 81, .3); color: #ffd88a; }
.notice-ok { background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .3); color: #9fe8c8; }
.notice-info { background: rgba(124, 92, 255, .1); border-color: rgba(124, 92, 255, .3); color: #cbbcff; }

/* ---------- 扫码收款 ---------- */
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pay-method {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  background: var(--card); text-align: center;
}
.pay-qr {
  width: 100%; max-width: 240px; margin: 0 auto; border-radius: 10px;
  background: #fff; padding: 6px;
}
.order-code {
  font-size: 22px; font-weight: 700; letter-spacing: 2px; color: var(--warn);
  font-variant-numeric: tabular-nums;
}

/* 后台订单核对 */
.order-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px;
  align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.order-row:last-child { border-bottom: 0; }
.order-row .who { font-weight: 600; }
.order-row .facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); margin-top: 6px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table th { color: var(--dim); font-weight: 600; font-size: 12px; letter-spacing: .4px; }
.table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.table-wrap { overflow-x: auto; }

/* ---------- 后台 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.stat-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--card); }
.stat-card b { display: block; font-size: 25px; letter-spacing: -.6px; }
.stat-card span { font-size: 12px; color: var(--dim); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 10px 16px; border: 0; background: none; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--brand); }
.admin-row {
  display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.admin-row .t { flex: 1; min-width: 0; }
.admin-row .t b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 90; }
.toast {
  padding: 12px 16px; border-radius: 12px; background: #1d1d2a; border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 14px; animation: pop .22s ease-out; max-width: 340px;
}
.toast.err { border-color: rgba(255, 90, 90, .5); color: #ffc0c0; }
.toast.ok { border-color: rgba(61, 220, 151, .45); color: #b6f2d8; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.skeleton { height: 120px; border-radius: 14px; background: linear-gradient(90deg, #16161f, #1e1e2b, #16161f); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.footer {
  position: relative; z-index: 1; border-top: 1px solid var(--line);
  padding: 28px 20px 40px; text-align: center; color: var(--dim); font-size: 13px;
}
.footer a { color: var(--muted); }
/* 合规文档链接：单独一行，链接之间留出间隔，不然会挤成一坨 */
.footer-legal { margin-top: 10px; }
.footer-legal a { margin: 0 2px; }

/* 合规文档：长文阅读体验，行宽收一点、行距放宽，段落别糊成一片 */
.legal-page { max-width: 820px; margin: 0 auto; }
.legal-body { padding: 28px 30px; }
.legal-block + .legal-block { margin-top: 26px; }
.legal-block h3 {
  margin: 0 0 12px; font-size: 16px; color: var(--text);
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.legal-body p { margin: 0 0 12px; line-height: 1.85; color: var(--muted); font-size: 14.5px; }
.legal-body ul { margin: 0 0 12px; padding-left: 22px; }
.legal-body li { line-height: 1.85; color: var(--muted); font-size: 14.5px; margin-bottom: 6px; }
.legal-body p:last-child, .legal-body ul:last-child { margin-bottom: 0; }

.empty { text-align: center; padding: 50px 20px; color: var(--dim); }
.empty .ico { font-size: 34px; margin-bottom: 8px; }

@media (max-width: 700px) {
  .hero { padding: 26px; }
  .hero h1 { font-size: 26px; }
  .avatar { width: 78px; height: 78px; border-radius: 22px; font-size: 30px; }
  /* 窄屏：第一行放品牌与登录按钮，导航链接另起一行并可横向滑动 */
  .nav { gap: 8px 10px; padding: 12px 16px; }
  .brand span { font-size: 15px; }
  .brand small { display: none; }
  .brand img { width: 26px; height: 26px; }
  .nav-links {
    order: 3;
    width: 100%;
    margin-left: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; padding: 6px 11px; font-size: 13.5px; }
  .nav-right .dim { display: none; }
  .app { padding: 20px 16px 70px; }
}
