:root {
  --bg: #120d09; --surface: #1c1510; --overlay: #241b13; --line: #3a2c1f;
  --amber: #f4a261; --gold: #ffd166; --ember: #e76f51;
  --blue: #5b6ee1; --green: #79c99e; --warn: #e9c46a; --danger: #ff5d73; --info: #6fb3d8;
  --text: #f5ead9; --muted: #a89680; --cool: #8fa0b3;
  --disp: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --kai: 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text); font-family: var(--disp);
  font-size: 15px; line-height: 1.65; overflow-x: hidden;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--amber); }
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ember { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; opacity: .16; }
.ember-a { width: 520px; height: 520px; background: var(--ember); top: -160px; right: -120px; animation: drift 16s ease-in-out infinite alternate; }
.ember-b { width: 420px; height: 420px; background: var(--gold); bottom: -180px; left: -140px; animation: drift 20s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 50px) scale(1.15); } }

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: 62px;
  display: flex; align-items: center; gap: 26px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.seal {
  width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ember), var(--amber)); color: #1a0e08;
  font-family: var(--kai); font-size: 22px; font-weight: 700; box-shadow: 0 0 18px #e76f5166;
}
.brand-t { font-weight: 700; letter-spacing: 1px; display: flex; flex-direction: column; line-height: 1.2; }
.brand-t small { font-size: 9px; letter-spacing: 3px; color: var(--muted); font-weight: 400; }
.top nav { display: flex; gap: 20px; margin-left: auto; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 2px; border-bottom: 2px solid transparent; transition: .2s; }
.top nav a:hover, .top nav a.on { color: var(--gold); border-color: var(--gold); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border: none; border-radius: 10px; padding: 9px 18px; font-size: 14px; font-weight: 600;
  font-family: var(--disp); text-decoration: none; transition: .18s;
}
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--amber)); color: #221306; box-shadow: 0 4px 18px #f4a26133; }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 24px #f4a26155; }
.btn-gold:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-line { background: transparent; color: var(--amber); border: 1px solid var(--line); }
.btn-line:hover { border-color: var(--amber); }
.btn.big { width: 100%; padding: 13px; font-size: 16px; margin-top: 14px; }

main { position: relative; z-index: 1; padding-top: 62px; }
section { scroll-margin-top: 76px; }
.hero {
  max-width: 1240px; margin: 0 auto; padding: 70px 28px 40px;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; align-items: center;
}
.kicker { color: var(--amber); letter-spacing: 4px; font-size: 12px; margin-bottom: 16px; animation: rise .7s .1s both; }
h1 { font-size: clamp(38px, 5vw, 62px); line-height: 1.15; font-weight: 800; letter-spacing: 2px; animation: rise .7s .2s both; }
h1 em { font-style: normal; color: var(--gold); text-shadow: 0 0 34px #ffd16644; }
.lede { color: var(--muted); margin: 20px 0 22px; max-width: 560px; animation: rise .7s .3s both; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; animation: rise .7s .4s both; }
.chip { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid; }
.c-amber { color: var(--amber); border-color: #f4a26155; background: #f4a26112; }
.c-blue { color: #9daef2; border-color: #5b6ee155; background: #5b6ee112; }
.c-green { color: var(--green); border-color: #79c99e55; background: #79c99e12; }
.c-gold { color: var(--gold); border-color: #ffd16655; background: #ffd16612; }
.pipe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; animation: rise .7s .5s both; }
.pipe-step {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px;
}
.pipe-step i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--overlay); color: var(--gold); font-size: 11px; }
.pipe-step.hot { border-color: var(--amber); color: var(--text); box-shadow: 0 0 14px #f4a26133; }
.pipe-step.hot i { background: var(--amber); color: #221306; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.phone-wrap { position: relative; display: flex; justify-content: center; align-items: center; gap: 14px; animation: rise .8s .35s both; }
.rail { width: 16px; height: 480px; border-radius: 4px; background: repeating-linear-gradient(to bottom, var(--overlay) 0 14px, transparent 14px 26px); border: 1px solid var(--line); }
.phone {
  width: 292px; height: 520px; border-radius: 34px; border: 3px solid #3d2f21; position: relative;
  background: #000; box-shadow: 0 24px 70px #00000099, 0 0 0 1px #ffd16622, 0 0 44px #e76f5122;
  overflow: hidden; flex: none;
}
.notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 84px; height: 16px; border-radius: 9px; background: #000; z-index: 3; border: 1px solid #222; }
.screen { position: absolute; inset: 0; }
.screen > img { width: 100%; height: 100%; object-fit: cover; }
.pv-scrim { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 42%, #0a0806d9 60%, #0a0806f2 100%); }
.pv-rule { position: absolute; left: 50%; transform: translateX(-50%); top: 55%; width: 56px; height: 3px; background: var(--gold); border-radius: 2px; }
.pv-title { position: absolute; top: 58%; width: 100%; text-align: center; font-size: 30px; font-weight: 800; letter-spacing: 3px; text-shadow: 0 2px 14px #000; }
.pv-sub { position: absolute; top: 68%; width: 100%; text-align: center; color: var(--amber); font-size: 13px; font-weight: 600; }
.pv-brand { position: absolute; top: 75%; width: 100%; text-align: center; color: var(--gold); font-size: 11px; }
.pv-sub-line { position: absolute; bottom: 5%; width: 100%; text-align: center; font-size: 11px; font-weight: 600; text-shadow: 0 1px 4px #000, 0 0 8px #000; }
.pv-outro { position: absolute; inset: 0; background: #1a1410; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.pv-outro img { width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 0 2px #ffffffd9; }
.pv-o1 { font-size: 24px; font-weight: 800; }
.pv-o2 { color: var(--gold); font-size: 14px; font-weight: 600; }
.pv-banner { position: absolute; top: 6%; left: 50%; transform: translateX(-50%); width: 86%; background: #f5f1e8; padding: 5px; border-radius: 6px; box-shadow: 0 8px 24px #00000088; }
.pv-banner img { width: 100%; display: block; border-radius: 3px; }
.pv-tabs { position: absolute; bottom: -44px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.pv-tab { background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 5px 14px; font-size: 12px; cursor: pointer; transition: .2s; }
.pv-tab.on { color: #221306; background: var(--amber); border-color: var(--amber); font-weight: 700; }

.bench { max-width: 1240px; margin: 30px auto; padding: 0 28px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: start; }
.panel, .side {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px;
  box-shadow: 0 14px 44px #00000055;
}
.panel h2, .tasks h2, .rules h2 { font-size: 22px; letter-spacing: 1px; margin-bottom: 16px; }
.panel h2 small, .tasks h2 small, .rules h2 small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 4px; }
.drop {
  border: 2px dashed var(--line); border-radius: 14px; padding: 26px 18px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; transition: .2s; margin-bottom: 16px; background: var(--overlay);
}
.drop:hover, .drop.over { border-color: var(--amber); background: #f4a26110; }
.drop strong { font-size: 15px; }
.drop span { color: var(--muted); font-size: 12px; }
.drop.has { border-style: solid; border-color: var(--green); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label small { font-size: 11px; }
input:not([type=range]):not([type=checkbox]), textarea, select {
  background: var(--overlay); border: 1px solid var(--line); color: var(--text); border-radius: 9px;
  padding: 9px 12px; font-size: 14px; font-family: var(--disp); outline: none; transition: .2s; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--amber); box-shadow: 0 0 0 3px #f4a26122; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 12px; }
.switch { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; margin: 0; color: var(--text); font-size: 13px; }
.switch input { display: none; }
.switch i { width: 38px; height: 21px; border-radius: 999px; background: var(--line); position: relative; transition: .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + i { background: var(--amber); }
.switch input:checked + i::after { left: 20px; background: #221306; }
.vol { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.vol input { width: 110px; accent-color: var(--amber); }
.sel { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.sel select { width: auto; }
.prod { border-top: 1px solid var(--line); padding-top: 14px; }
.prod-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; }
.prod-thumbs { display: flex; gap: 8px; flex-wrap: wrap; min-height: 52px; }
.prod-thumbs .empty { color: var(--muted); font-size: 12px; align-self: center; }
.prod-thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }
.side { position: sticky; top: 80px; }
.side h3 { font-size: 14px; color: var(--gold); letter-spacing: 2px; margin: 6px 0 10px; }
.assure { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.assure li { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.assure b { color: var(--amber); flex: none; font-size: 12px; border: 1px solid #f4a26144; border-radius: 6px; padding: 1px 7px; }
.active-card { background: var(--overlay); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 13px; }
.active-card.empty { color: var(--muted); }

.tasks { max-width: 1240px; margin: 40px auto; padding: 0 28px; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.task {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px; transition: .2s; animation: rise .5s both;
}
.task:hover { border-color: #f4a26166; transform: translateY(-2px); }
.task-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.task-name { font-weight: 700; font-size: 15px; }
.task-time { color: var(--muted); font-size: 11px; }
.pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px; flex: none; }
.p-done { color: var(--green); background: #79c99e18; border: 1px solid #79c99e55; }
.p-run { color: var(--gold); background: #ffd16618; border: 1px solid #ffd16655; animation: pulse 1.4s infinite; }
.p-err { color: var(--danger); background: #ff5d7318; border: 1px solid #ff5d7355; }
.p-draft { color: var(--cool); background: #6fb3d818; border: 1px solid #6fb3d855; }
.p-del { color: var(--muted); background: var(--overlay); border: 1px solid var(--line); }
@keyframes pulse { 50% { opacity: .55; } }
.bar { height: 6px; border-radius: 3px; background: var(--overlay); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); border-radius: 3px; transition: width .6s; }
.task-stage { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.task-actions .btn { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: transparent; border: 1px solid #ff5d7344; color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }

.rules { max-width: 1240px; margin: 50px auto; padding: 0 28px; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rule { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 12px; padding: 16px; font-size: 13px; color: var(--muted); }
.rule i { display: block; font-style: normal; color: var(--gold); font-weight: 700; letter-spacing: 2px; margin-bottom: 6px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 34px 20px 44px; border-top: 1px solid var(--line); margin-top: 30px; }

.modal { position: fixed; inset: 0; z-index: 40; background: #000000cc; backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; max-width: 420px; width: 100%; position: relative; }
.modal-box video { width: 100%; border-radius: 12px; background: #000; max-height: 70vh; }
.modal-x { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--overlay); color: var(--text); font-size: 18px; cursor: pointer; z-index: 2; }
.modal-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--overlay); border: 1px solid var(--amber); color: var(--text); border-radius: 12px;
  padding: 10px 18px; display: flex; gap: 14px; align-items: center; font-size: 13px; box-shadow: 0 10px 34px #00000088;
}
.toast button { background: var(--amber); border: none; color: #221306; font-weight: 700; border-radius: 8px; padding: 5px 12px; cursor: pointer; }

.rev.in { animation: rise .7s both; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; gap: 70px; }
  .bench { grid-template-columns: 1fr; }
  .side { position: static; }
  .top nav { display: none; }
  .rail { display: none; }
}
/* P2: auth / user / upgrade / admin */
.userbox { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 13px; }
.userbox + .btn-gold { margin-left: 0; }
.top nav { margin-left: 0; }
.credits { color: var(--gold); font-weight: 700; }
.p-gold { color: var(--gold); background: #ffd16618; border: 1px solid #ffd16655; }
body.logged-out main, body.logged-out footer { display: none; }
.auth { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 40px 20px; position: relative; z-index: 1; }
.auth-box { width: 380px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: 0 24px 70px #00000077; display: flex; flex-direction: column; gap: 4px; }
.seal.big { width: 52px; height: 52px; font-size: 30px; margin: 0 auto 12px; }
.auth-box h2 { text-align: center; font-size: 20px; letter-spacing: 2px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.auth-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.auth-err { color: var(--danger); font-size: 12px; }
.modal-box.wide { max-width: 560px; }
.m-title { font-size: 18px; letter-spacing: 1px; margin-bottom: 6px; }
.m-sub { font-size: 13px; color: var(--gold); margin: 14px 0 8px; letter-spacing: 1px; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.pack { background: var(--overlay); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; align-items: start; }
.pack.hot { border-color: var(--gold); box-shadow: 0 0 24px #ffd16622; }
.pack b { font-size: 16px; }
.pack-c { color: var(--muted); font-size: 12px; }
.pack-p { color: var(--gold); font-size: 24px; font-weight: 800; }
.order-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow: auto; }
.order { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--overlay); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12px; }
.order .st-pending { color: var(--warn); }
.order .st-paid { color: var(--green); }
.admin-grant { display: flex; gap: 8px; margin: 10px 0; }
.admin-grant input { width: auto; flex: 1; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.admin-table th, .admin-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--muted); font-weight: 400; }
@media (max-width: 960px) { .userbox { gap: 6px; } .userbox .btn { padding: 5px 8px; font-size: 11px; } .packs { grid-template-columns: 1fr; } }
