/* NOVA LIVE — 暗夜粉视觉（沿用原型设计语言并扩展） */
:root {
  --bg: #0b0d13; --panel: #151923; --panel2: #10141d; --line: #292f3d;
  --text: #f4f5fb; --muted: #9ca5b5; --pink: #ff4f87; --purple: #905bff;
  --gold: #f4d49c; --green: #4fd08a; --red: #ff5f5f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif; font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: white; border: 0; background: #252b39; }
a { color: #ff91b6; text-decoration: none; }
img { max-width: 100%; }

/* ---------- 顶栏 ---------- */
header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 5%; background: #0b0d13ee; backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 22px; font-weight: 900; white-space: nowrap; cursor: pointer; }
.logo span { color: var(--pink); }
header input.search {
  flex: 1; min-width: 0; max-width: 430px;
  padding: 11px 15px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); color: white; outline: none;
}
header input.search:focus { border-color: var(--pink); }
.spacer { flex: 1; }
.balance-chip {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px;
  background: #2a2136; border: 1px solid #4a3a63; border-radius: 10px; font-weight: bold;
}
.balance-chip b { color: var(--gold); }
.userchip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--panel); }
.userchip:hover { background: #202633; }

/* ---------- 布局 ---------- */
.layout { max-width: 1400px; margin: auto; padding: 22px 5%; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
nav { position: sticky; top: 84px; align-self: start; }
nav button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 13px 14px; margin-bottom: 6px; border-radius: 10px; color: var(--muted);
}
nav button:hover, nav button.active { background: #202633; color: white; }
nav .navtag { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 6px; background: #3a2f18; color: var(--gold); }
main { min-width: 0; }
.page { display: none; }
.page.active { display: block; }

/* ---------- 通用 ---------- */
.btn { padding: 10px 16px; border-radius: 10px; background: #252b39; margin: 3px; }
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: linear-gradient(120deg, #ff4f87, #905bff); font-weight: bold; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.danger { background: #47262c; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hero {
  padding: 34px; min-height: 240px; border-radius: 20px;
  display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(circle at 80% 15%, #ff4f8770, transparent 35%),
    linear-gradient(125deg, #272b47, #181523 65%, #392039);
}
.hero h1 { font-size: clamp(28px, 4vw, 46px); margin: 12px 0; }
.hero p { color: #c1c6d2; line-height: 1.8; }
.pink { color: #ff91b6; font-weight: bold; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 14px; gap: 10px; }
.section-head h2 { margin: 0; font-size: 20px; }
.muted { color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.panel { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; margin-bottom: 15px; }
.panel h3 { margin-top: 0; }
.notice { padding: 13px; background: #332a1b; color: var(--gold); border-radius: 10px; font-size: 13px; line-height: 1.7; }
.notice.blue { background: #1b2b3a; color: #9ccbf4; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vip-badge {
  display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: bold;
  background: linear-gradient(120deg, #f7c945, #f59b45); color: #3a2a05;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 15px;
  overflow: hidden; cursor: pointer; transition: transform 0.2s; position: relative;
}
.card:hover { transform: translateY(-3px); }
.thumb {
  height: 155px; display: grid; place-items: center; font-size: 42px; position: relative;
  background: linear-gradient(135deg, #533453, #243c54);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .live {
  position: absolute; top: 10px; left: 10px; background: #fa386f; border-radius: 5px;
  padding: 4px 7px; font-size: 11px; font-weight: bold;
}
.thumb .price {
  position: absolute; right: 10px; bottom: 10px; background: #000c; border-radius: 6px;
  padding: 3px 8px; font-size: 12px; color: var(--gold); font-weight: bold;
}
.thumb .free { color: #9fe8bb; }
.info { padding: 13px; }
.info h3 { font-size: 15px; margin: 0 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info p { color: var(--muted); font-size: 12px; margin: 0; }
.book-cover { height: 150px; display: grid; place-items: center; font-size: 44px; background: linear-gradient(135deg, #34565b, #262043); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 播放器 / 直播间 ---------- */
.player-box { background: #000; border-radius: 15px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.player-box video, .player-box iframe { width: 100%; aspect-ratio: 16/9; display: block; background: #000; }
.demo-signal {
  aspect-ratio: 16/9; display: grid; place-items: center; text-align: center; color: var(--muted);
  background:
    radial-gradient(circle at 25% 30%, #ff4f8740, transparent 40%),
    radial-gradient(circle at 75% 70%, #905bff40, transparent 45%),
    linear-gradient(135deg, #131722, #1b1225);
}
.demo-signal .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.live-meta { display: flex; align-items: center; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #fa386f; margin-right: 6px; animation: blink 1.2s infinite; }

/* ---------- 聊天 ---------- */
.chat { min-height: 320px; display: flex; flex-direction: column; }
.messages { flex: 1; padding: 10px 0; max-height: 430px; overflow-y: auto; }
.message {
  background: #252b39; padding: 9px 13px; border-radius: 12px; margin: 8px 0;
  width: fit-content; max-width: 90%; overflow-wrap: anywhere; font-size: 13px;
}
.message .who { color: #ff91b6; font-weight: bold; margin-right: 6px; }
.message.gift { background: linear-gradient(120deg, #3d2b52, #55366d); border: 1px solid #7b4fa8; }
.message.mine { margin-left: auto; background: #55366d; }
.chatbar { display: flex; gap: 8px; margin-top: 14px; }
.chatbar input {
  flex: 1; min-width: 0; background: #0e1118; border: 1px solid var(--line);
  border-radius: 10px; padding: 11px; color: white; outline: none;
}
.chatbar input:focus { border-color: var(--pink); }

/* ---------- 礼物动效 ---------- */
#giftLayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.gift-fly {
  position: absolute; bottom: 12px; left: 24px; font-size: 34px;
  animation: flyUp 2.2s ease-out forwards; text-shadow: 0 0 18px #ff4f87;
}
.gift-fly small { font-size: 13px; color: #ffd1e2; margin-left: 6px; }
@keyframes flyUp {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  15% { opacity: 1; transform: translateY(-30px) scale(1.15); }
  100% { transform: translateY(-260px) scale(1); opacity: 0; }
}
.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gift-item {
  padding: 12px 6px; border-radius: 12px; text-align: center; background: var(--panel2);
  border: 1px solid var(--line); cursor: pointer;
}
.gift-item:hover, .gift-item.sel { border-color: var(--pink); background: #2a1f33; }
.gift-item .gi { font-size: 30px; }
.gift-item .gn { font-size: 12px; margin: 6px 0 2px; }
.gift-item .gp { font-size: 11px; color: var(--gold); }

/* ---------- 表格 / 列表 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: normal; font-size: 12px; }
.tbl tr:hover td { background: #1a1f2b; }
.pos { color: var(--green); font-weight: bold; }
.neg { color: var(--red); font-weight: bold; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.tag.pending { background: #3a3220; color: var(--gold); }
.tag.published { background: #1d3a2b; color: #8fe0b0; }
.tag.rejected { background: #3a2020; color: #f19a9a; }
.tag.paid { background: #1d3a2b; color: #8fe0b0; }
.tag.banned { background: #3a2020; color: #f19a9a; }

/* ---------- 套餐 ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.plan { text-align: center; padding: 26px 18px; position: relative; }
.plan.best { border-color: var(--pink); }
.plan .pname { font-size: 18px; font-weight: bold; }
.plan .pdays { color: var(--muted); margin: 6px 0 10px; }
.plan .pprice { font-size: 30px; font-weight: 900; color: var(--gold); }
.plan .pprice small { font-size: 13px; color: var(--muted); font-weight: normal; }
.plan ul { text-align: left; color: #c1c6d2; line-height: 2; padding-left: 18px; margin: 14px 0; }

/* ---------- 阅读器 ---------- */
.reader {
  background: #161a24; border-radius: 15px; padding: 30px clamp(16px, 5vw, 48px);
  line-height: 2.2; font-size: 16px; color: #dfe3ec; white-space: pre-wrap;
}
.reader h2 { margin: 0 0 18px; font-size: 20px; }
.chapter-list { display: flex; flex-direction: column; gap: 0; }
.chapter-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 10px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px;
}
.chapter-row:hover { background: #1c2230; }
.chapter-row .lock { color: var(--gold); font-size: 12px; }

/* ---------- 上传 ---------- */
.drop {
  border: 2px dashed var(--line); border-radius: 15px; padding: 34px; text-align: center;
  color: var(--muted); cursor: pointer; transition: 0.2s;
}
.drop:hover, .drop.over { border-color: var(--pink); background: #1a1420; }
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.field input[type="text"], .field input[type="number"], .field input[type="url"], .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: #0e1118; color: white; outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--pink); }
.progress { height: 9px; background: #0e1118; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--purple)); transition: width 0.2s; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-bg {
  display: none; position: fixed; inset: 0; z-index: 20; background: #000b;
  align-items: center; justify-content: center; padding: 18px;
}
.modal-bg.show { display: flex; }
.modal { width: 100%; max-width: 460px; background: #181d28; border: 1px solid var(--line); border-radius: 18px; padding: 22px; max-height: 88vh; overflow-y: auto; }
.modal.wide { max-width: 620px; }
.modal h2 { margin: 0 0 14px; font-size: 19px; }
.modal p { color: #c0c6d2; line-height: 1.7; }
.toast {
  display: none; position: fixed; z-index: 60; bottom: 25px; left: 50%; transform: translateX(-50%);
  background: white; color: #111; padding: 13px 18px; border-radius: 10px; max-width: 90%; text-align: center;
}
.toast.show { display: block; }
.qr-pay { display: grid; place-items: center; gap: 8px; padding: 14px; background: white; border-radius: 12px; }
.qr-pay img { width: 200px; height: 200px; object-fit: contain; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { flex: 1; padding: 10px; border-radius: 10px; background: transparent; color: var(--muted); border: 1px solid var(--line); }
.tabs button.active { background: var(--panel); color: white; border-color: var(--pink); }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 10px 0; }
.amounts button { padding: 13px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.amounts button.sel { border-color: var(--pink); background: #2a1f33; }
.payway { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.payway button { flex: 1; min-width: 90px; padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); }
.payway button.sel { border-color: var(--pink); background: #2a1f33; }

/* ---------- 年龄门 / 页脚 ---------- */
.age { position: fixed; inset: 0; z-index: 40; background: #090b10f5; display: flex; align-items: center; justify-content: center; padding: 20px; }
.agebox { max-width: 440px; width: 100%; text-align: center; padding: 28px; border: 1px solid var(--line); background: var(--panel); border-radius: 18px; }
.agebox p { color: var(--muted); line-height: 1.8; }
footer { border-top: 1px solid var(--line); padding: 24px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.9; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px 4%; }
  nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  nav button { width: auto; flex-shrink: 0; white-space: nowrap; }
  .grid, .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gift-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  header { padding: 12px 4%; gap: 8px; }
  .logo { font-size: 17px; }
  header input.search { width: 110px; padding: 10px; }
  .grid, .plans { gap: 9px; }
  .thumb { height: 120px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 30px; }
  .info { padding: 10px; }
  .balance-chip { padding: 8px 10px; }
}
