:root {
  --bg: #0a0e1a;
  --bg-soft: #121a2e;
  --bg-card: #161f38;
  --line: #243150;
  --txt: #e8eefc;
  --txt-dim: #9fb0d0;
  --brand: #2dd4ff;
  --brand2: #7c5cff;
  --accent: #ffcf5c;
  --ok: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #18233f 0%, var(--bg) 55%) fixed;
  color: var(--txt);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- Header / Nav ---------- */
#site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10,14,26,.78);
  border-bottom: 1px solid var(--line);
}
.nav { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: .5px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: grid; place-items: center; color: #061021; font-weight: 900;
  box-shadow: 0 0 18px rgba(45,212,255,.5);
}
.nav-links { display: flex; gap: 6px; margin-left: 10px; flex-wrap: wrap; }
.nav-links a { padding: 8px 14px; border-radius: 10px; color: var(--txt-dim); font-weight: 600; font-size: 14px; transition: .15s; }
.nav-links a:hover { color: var(--txt); background: var(--bg-soft); }
.nav-links a.active { color: #061021; background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn {
  cursor: pointer; border: 1px solid var(--line); background: var(--bg-card); color: var(--txt);
  padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #061021; border: none; }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(45,212,255,.35); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,.12); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); font-size: 14px; }
.vip-badge { background: linear-gradient(135deg, #ffd66b, #ff9d2f); color: #3a2400; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }
.page-title { font-size: 28px; font-weight: 800; margin: 6px 0 4px; }
.page-sub { color: var(--txt-dim); margin: 0 0 22px; }
.section { margin: 34px 0; }
.section h2 { font-size: 22px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.section h2::before { content: ""; width: 5px; height: 22px; border-radius: 3px; background: linear-gradient(var(--brand), var(--brand2)); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 56px 40px; margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(45,212,255,.14), rgba(124,92,255,.16)), var(--bg-soft);
  border: 1px solid var(--line); }
.hero h1 { font-size: 42px; margin: 0 0 10px; line-height: 1.15; }
.hero p { color: var(--txt-dim); max-width: 620px; font-size: 16px; }
.hero .cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-orb { position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(45,212,255,.5), transparent 60%); filter: blur(8px); }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 920px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } .hero h1 { font-size: 30px; } }

.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .18s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--shadow); }
.card .thumb { position: relative; aspect-ratio: 2/1; background: #0c1222 center/cover no-repeat; display: grid; place-items: center; }
.card .thumb .play { width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.5); border: 2px solid #fff; display: grid; place-items: center; color: #fff; font-size: 20px; }
.card .thumb .tag { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .body h3 { margin: 0; font-size: 16px; }
.card .body p { margin: 0; color: var(--txt-dim); font-size: 13px; flex: 1; }
.card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--txt-dim); }
.price { color: var(--accent); font-weight: 800; font-size: 18px; }
.price small { color: var(--txt-dim); font-weight: 500; font-size: 12px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--txt-dim); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--txt); font-size: 14px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 80px; }
.form-card { max-width: 440px; margin: 30px auto; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--txt-dim); font-weight: 700; cursor: pointer; }
.tabs button.active { color: #061021; background: linear-gradient(135deg, var(--brand), var(--brand2)); border: none; }

/* ---------- Misc ---------- */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 140px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .n { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat .l { color: var(--txt-dim); font-size: 13px; }
.empty { color: var(--txt-dim); text-align: center; padding: 40px; border: 1px dashed var(--line); border-radius: var(--radius); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg-soft); border: 1px solid var(--line); }
.tag-cat { background: rgba(124,92,255,.18); border-color: rgba(124,92,255,.4); color: #c3b6ff; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: #11192e; border: 1px solid var(--line); color: var(--txt); padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); z-index: 200; opacity: 0; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; bottom: 42px; }
.toast.err { border-color: var(--danger); }
.toast.ok { border-color: var(--ok); }
footer { border-top: 1px solid var(--line); color: var(--txt-dim); font-size: 13px; text-align: center; padding: 24px; }

/* ---------- Viewer ---------- */
#viewer-page { position: fixed; inset: 0; background: #000; }
#panorama { position: absolute; inset: 0; }
.viewer-bar { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 8px; background: rgba(10,14,26,.7); border: 1px solid var(--line); padding: 8px; border-radius: 12px; backdrop-filter: blur(8px); flex-wrap: wrap; max-width: 94vw; }
.viewer-bar .title { font-weight: 700; align-self: center; padding: 0 8px; }
.scene-list { position: fixed; left: 14px; top: 80px; z-index: 30; width: 210px; max-height: 70vh; overflow: auto; background: rgba(10,14,26,.8); border: 1px solid var(--line); border-radius: 12px; padding: 8px; backdrop-filter: blur(8px); }
.scene-list h4 { margin: 4px 6px 8px; font-size: 13px; color: var(--txt-dim); }
.scene-list button { display: block; width: 100%; text-align: left; background: var(--bg-soft); border: 1px solid var(--line); color: var(--txt); padding: 8px 10px; border-radius: 9px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.scene-list button:hover { border-color: var(--brand); }
.scene-list button.cur { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #061021; border: none; }
.edit-hint { position: fixed; right: 14px; bottom: 14px; z-index: 30; background: rgba(10,14,26,.8); border: 1px solid var(--accent); color: var(--accent); padding: 8px 12px; border-radius: 10px; font-size: 12px; max-width: 260px; }

/* ---------- Modal ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: none; place-items: center; padding: 20px; }
.modal-mask.show { display: grid; }
.modal { width: 100%; max-width: 460px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.modal h3 { margin: 0 0 14px; }
.modal .close { float: right; cursor: pointer; color: var(--txt-dim); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--txt-dim); font-weight: 700; font-size: 13px; }
table.tbl tr:hover td { background: rgba(255,255,255,.02); }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.img { background: rgba(45,212,255,.15); color: var(--brand); }
.pill.vid { background: rgba(124,92,255,.18); color: #c3b6ff; }
