:root {
  --bg: #081b1a;
  --bg2: #0d2624;
  --panel: #12302c;
  --panel2: #174039;
  --line: rgba(217, 184, 119, 0.22);
  --gold: #d9b877;
  --gold2: #f0d9a4;
  --ink: #f5eddc;
  --muted: #a2b2a8;
  --danger: #e0796a;
  --ok: #7fc8a3;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #05100f;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }

.phone {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 27, 26, 0.88);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: 2px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--gold2), #a97f3f);
  color: #17302a; display: grid; place-items: center;
  font-size: 17px; font-weight: 800;
}
.brand small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1px; font-weight: 400; }
.topbar .sub { font-size: 12px; color: var(--muted); }

.wrap { padding: 18px; padding-bottom: 92px; }

.hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}
.hero img.cover { display: block; width: 100%; height: 340px; object-fit: cover; }
.hero-shade {
  position: absolute; inset: auto 0 0 0; height: 55%;
  background: linear-gradient(180deg, rgba(6, 24, 23, 0), rgba(6, 24, 23, 0.96));
}
.hero-text { position: absolute; left: 20px; right: 20px; bottom: 18px; }
.hero-text h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: 3px; }
.hero-text p { margin: 0; color: #d8ddcf; font-size: 13px; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.tag {
  padding: 4px 10px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); color: var(--gold2);
  background: rgba(217, 184, 119, 0.07);
}
.tag.muted { color: var(--muted); border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); }

.card {
  background: linear-gradient(145deg, var(--panel), rgba(10, 32, 30, 0.9));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 10px; font-size: 17px; color: var(--gold2); letter-spacing: 1px; }
.card p { margin: 6px 0; color: #d5dfd4; font-size: 13px; }
.muted { color: var(--muted); font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 12px; padding: 12px 20px;
  background: linear-gradient(135deg, var(--gold2), #c79c55);
  color: #102724; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(199, 156, 85, 0.2);
}
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.ghost {
  background: transparent; color: var(--gold2);
  border: 1px solid var(--line); box-shadow: none;
}
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn.danger { background: linear-gradient(135deg, #e7907f, #c96354); color: #fff; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }

.ep-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.ep-item {
  position: relative; aspect-ratio: 1; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.04);
  display: grid; place-items: center; font-weight: 700; color: var(--ink);
  cursor: pointer;
}
.ep-item.locked { color: var(--muted); background: rgba(0,0,0,0.22); }
.ep-item.current { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217,184,119,0.25) inset; }
.ep-item .lock { position: absolute; right: 5px; top: 4px; font-size: 10px; }

.notice {
  border-left: 3px solid var(--gold);
  background: rgba(217, 184, 119, 0.08);
  padding: 10px 12px; border-radius: 0 8px 8px 0;
  font-size: 12px; color: #e0d7bd; line-height: 1.65;
}
.notice.warn { border-color: var(--danger); background: rgba(224, 121, 106, 0.09); color: #f0c8bf; }

.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(6, 22, 21, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.nav a { text-align: center; color: var(--muted); font-size: 11px; }
.nav a.on { color: var(--gold2); }
.nav a span { display: block; font-size: 19px; line-height: 1.2; }

/* 播放器 */
.player { position: relative; width: 100%; height: 100vh; min-height: 100vh; background: #000; overflow: hidden; }
.player video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.player-mask { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 22%, transparent 62%, rgba(0,0,0,0.82) 100%); }
.player-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; gap: 12px; z-index: 4; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.35); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 17px; }
.player-title { flex: 1; min-width: 0; }
.player-title b { display: block; font-size: 15px; color: #fff; }
.player-title small { color: rgba(255,255,255,0.7); font-size: 11px; }
.play-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; }
.play-btn { width: 74px; height: 74px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.5);
  background: rgba(10,30,28,0.45); color: #fff; font-size: 30px; display: grid; place-items: center; cursor: pointer; }
.player-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); z-index: 4; }
.progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.25); overflow: hidden; margin-bottom: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold2); transition: width 0.2s linear; }
.player-actions { display: flex; gap: 9px; }
.player-actions .btn { flex: 1; padding: 11px 6px; font-size: 13px; }
.player-tip { color: rgba(255,255,255,0.62); font-size: 10px; text-align: center; margin-top: 9px; }

/* 抽屉 / 弹窗 */
.drawer, .modal {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.6);
}
.drawer.show, .modal.show { display: flex; }
.sheet {
  width: 100%; max-width: 480px; max-height: 78vh; overflow-y: auto;
  background: #0e2b28; border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--line); padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
}
.modal .sheet { align-self: center; border-radius: 18px; max-height: 86vh; }
.sheet h3 { margin: 0 0 12px; color: var(--gold2); font-size: 19px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head h3 { margin: 0; }

/* 表单 */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.25); color: var(--ink);
  outline: none;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); }

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed rgba(255,255,255,0.09); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; }

.code-box {
  display: block; width: 100%; word-break: break-all;
  background: rgba(0,0,0,0.3); border: 1px dashed var(--line);
  border-radius: 10px; padding: 11px; color: var(--gold2); font-size: 12px;
}
canvas.poster { width: 100%; max-width: 340px; display: block; margin: 0 auto; border-radius: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: rgba(6,24,22,0.95); border: 1px solid var(--line);
  color: var(--ink); padding: 10px 18px; border-radius: 999px; z-index: 99;
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.spinner { text-align: center; color: var(--muted); padding: 30px 0; font-size: 13px; }
