:root {
  --bg: #071018;
  --ink: #e7f2fb;
  --muted: #8ea6bd;
  --line: rgba(126, 196, 220, 0.18);
  --cyan: #6ae7ff;
  --cyan-dim: rgba(106, 231, 255, 0.12);
  --gold: #f0b45a;
  --gold-dim: rgba(240, 180, 90, 0.12);
  --danger: #ff8b98;
  --card: rgba(12, 28, 42, 0.88);
  --input: #0c2233;
  --ok: #8ef0c2;
  color-scheme: dark;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(106, 231, 255, 0.16), transparent 60%),
    #05080d;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.6; cursor: wait; }

#stage {
  width: min(430px, 100%);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background:
    linear-gradient(180deg, rgba(106, 231, 255, 0.05), transparent 180px),
    var(--bg);
  overflow: hidden;
}

#stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(106, 231, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 231, 255, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(#000 0%, transparent 72%);
}

@media (min-width: 760px) {
  #stage {
    height: min(900px, calc(100vh - 36px));
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  }
}

#top, #view, #tab { position: relative; z-index: 1; }
#top { padding: 18px 18px 0; }
#view {
  flex: 1;
  overflow: auto;
  padding: 14px 18px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(106, 231, 255, 0.28) transparent;
}
#view::-webkit-scrollbar { width: 8px; }
#view::-webkit-scrollbar-thumb { background: rgba(106, 231, 255, 0.28); border-radius: 8px; }
#tab {
  display: flex;
  gap: 6px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(7, 16, 24, 0.92);
}
#tab[hidden] { display: none; }

.brand, .topbar, .tab-btn, .credit, .row, .task, .pack, .user, .shot, .style, .chip-row {
  display: flex;
}
.brand { align-items: center; gap: 10px; }
.topbar { align-items: center; justify-content: space-between; gap: 12px; }
.mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 12px rgba(106, 231, 255, 0.25);
}
.mark i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  box-shadow: 8px 0 0 -2px var(--cyan);
}
.brand b { display: block; font-size: 16px; letter-spacing: 0.12em; }
.brand small, .kicker, .meta, .hint, .task small, .credit small { color: var(--muted); }
.kicker {
  margin: 18px 0 6px;
  letter-spacing: 0.18em;
  font-size: 11px;
}
h1 { margin: 0; font-size: 30px; line-height: 1.25; font-weight: 650; }
h2 { margin: 16px 0 8px; font-size: 20px; line-height: 1.45; font-weight: 650; }
.sub { margin: 10px 0 0; color: var(--muted); line-height: 1.6; font-size: 14px; }
.chip, .status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--cyan);
  white-space: nowrap;
}
.status.done { color: var(--ok); }
.status.failed { color: var(--danger); }
.status.wait { color: var(--gold); }

.credits, .styles, .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.credit, .card, .task, .pack, .user, .shot, .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.credit, .stat { padding: 14px; flex-direction: column; gap: 4px; }
.credit b, .stat b { font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.credit.paid { background: var(--gold-dim); border-color: rgba(240, 180, 90, 0.28); }
.credit.paid b, .gold { color: var(--gold); }
.credit span, .stat span { font-size: 12px; color: var(--muted); }

.cta, .primary, .ghost, .tab-btn, .mini {
  border-radius: 14px;
  border: 1px solid transparent;
}
.cta, .primary {
  width: 100%;
  margin-top: 14px;
  min-height: 50px;
  background: linear-gradient(180deg, #8df1ff, #3ec8e4);
  color: #04222b;
  font-weight: 700;
}
.ghost, .mini {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  min-height: 42px;
}
.mini { padding: 0 12px; }
.mini.on { color: var(--cyan); border-color: var(--cyan); }
button.task { width: 100%; text-align: left; }
.ghost { width: 100%; margin-top: 8px; }
.cost { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.section { margin-top: 22px; }
.section h2, .block h2 { margin: 0 0 10px; font-size: 15px; font-weight: 650; }
.steps { display: grid; gap: 8px; }
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.step i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-style: normal;
}

.tab-btn {
  flex: 1;
  min-height: 46px;
  background: transparent;
  color: var(--muted);
}
.tab-btn.on { color: var(--cyan); background: var(--cyan-dim); }

.back {
  border: 0;
  background: transparent;
  color: var(--cyan);
  padding: 0;
  min-height: 32px;
}

label { display: block; margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  outline: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(106, 231, 255, 0.7); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chip-row { flex-wrap: wrap; gap: 8px; }
.angle, .style {
  border: 1px solid var(--line);
  background: rgba(8, 24, 36, 0.7);
  border-radius: 12px;
  color: var(--ink);
}
.angle { padding: 8px 10px; }
.angle.on, .style.on { border-color: var(--cyan); background: var(--cyan-dim); color: var(--cyan); }
.styles { grid-template-columns: 1fr; }
.style { text-align: left; padding: 12px; flex-direction: column; gap: 4px; }
.style b { font-size: 14px; }
.style span { color: var(--muted); font-size: 12px; }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input);
}
.file {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
}
.file img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 12px; }

.task, .pack, .user, .shot { padding: 12px; margin-bottom: 10px; gap: 8px; }
.task, .user { flex-direction: column; }
.task .row, .user .row, .pack { justify-content: space-between; align-items: center; }
.task b, .pack b, .user b { font-size: 15px; }
.shot { flex-direction: column; }
.shot em { color: var(--cyan); font-style: normal; font-size: 12px; }
.voice {
  line-height: 1.7;
  font-size: 15px;
  margin: 0 0 10px;
}
video {
  width: 100%;
  border-radius: 16px;
  background: #000;
  max-height: 460px;
}
.empty { color: var(--muted); text-align: center; padding: 28px 10px; line-height: 1.6; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.filters button { flex: 1; }

.admin-tabs { display: flex; gap: 6px; overflow: auto; padding-bottom: 8px; }
.admin-tabs button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  white-space: nowrap;
}
.admin-tabs button.on { color: #04222b; background: var(--cyan); border-color: var(--cyan); }
.user input, .pack input { padding: 8px; }
.inline { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.check input { width: auto; }
.danger { color: var(--danger); border-color: rgba(255, 139, 152, 0.4); }

#toast {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 78px;
  transform: translateY(8px);
  background: #123246;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 5;
}
#toast.show { opacity: 1; transform: translateY(0); }

details { margin-top: 12px; color: var(--muted); font-size: 13px; }
details pre {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--ink);
  font-family: inherit;
}
.banner {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--gold-dim);
  color: #f6d7a4;
  font-size: 12px;
  line-height: 1.5;
}
