:root {
  --bg: #0c0a09;
  --card: #17130f;
  --card-2: #1e1915;
  --line: #312a22;
  --line-soft: #241e18;
  --text: #f3ebe0;
  --muted: #9c9082;
  --dim: #6f6559;
  --amber: #e0a856;
  --amber-soft: rgba(224, 168, 86, 0.12);
  --green: #6cbf8f;
  --red: #d9736a;
  --radius: 18px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { padding-bottom: env(safe-area-inset-bottom); overflow-x: hidden; }

.glow {
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 420px;
  background: radial-gradient(60% 60% at 50% 0%, rgba(224, 168, 86, 0.16), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 20px 8px;
}

.brand { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 0.06em; color: var(--muted); }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}

.date { font-size: 12px; color: var(--dim); letter-spacing: 0.04em; }

main { position: relative; z-index: 1; padding: 0 16px; }

.hero { padding: 12px 4px 4px; }

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sub { margin: 6px 0 18px; color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
}

.gate-card { padding: 18px 16px; }

.gate-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.gate-num { display: flex; align-items: baseline; gap: 6px; }
.gate-num b { font-size: 34px; font-weight: 600; color: var(--amber); line-height: 1; letter-spacing: -0.02em; }
.gate-num span { font-size: 13px; color: var(--dim); }

.gate-hint { margin-top: 6px; font-size: 13px; color: var(--muted); }

.gate-ring { position: relative; width: 56px; height: 56px; flex: none; }
.gate-ring svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 4; }
.ring-fg {
  fill: none; stroke: var(--amber); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 113; stroke-dashoffset: 113;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.gate-ring span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; color: var(--muted); letter-spacing: 0.02em;
}

.gate-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-soft); }

.gchip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  color: var(--dim); border: 1px solid var(--line-soft); background: transparent;
  transition: all 0.25s ease;
}
.gchip.on { color: var(--amber); border-color: rgba(224, 168, 86, 0.4); background: var(--amber-soft); }

.upload-card { margin-top: 12px; }

.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.label-row > span:first-child { font-size: 13px; color: var(--muted); }
.hint { font-size: 11px; color: var(--dim); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none; font-size: 13px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card-2); color: var(--muted);
  transition: all 0.2s ease;
}
.chip.on { background: var(--amber); border-color: var(--amber); color: #201505; font-weight: 600; }

.pick { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin-top: 2px; }

.pick-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; border-radius: 14px; font-size: 15px; font-weight: 500;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text);
  transition: transform 0.12s ease, background 0.2s ease;
  cursor: pointer;
}
.pick-btn:active { transform: scale(0.97); }
.pick-btn.primary { background: linear-gradient(180deg, #e8b466, #d29a44); border-color: transparent; color: #1d1305; font-weight: 600; }
.pick-btn .ico { font-size: 17px; }

.tip { margin: 12px 0 0; font-size: 11.5px; color: var(--dim); line-height: 1.5; }

.queue { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.queue:not(:empty) { margin-top: 12px; }

.qitem { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.qname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbar { width: 90px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; flex: none; }
.qbar i { display: block; height: 100%; width: 0; background: var(--amber); transition: width 0.2s ease; }
.qitem.ok .qbar i { background: var(--green); }
.qitem.err { color: var(--red); }

.section { margin-top: 26px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; padding: 0 4px; }
h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }
.count { font-size: 12px; color: var(--dim); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.tile {
  position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
  background: var(--card-2); border: 1px solid var(--line-soft);
}
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile .tag {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 10px; padding: 2px 7px; border-radius: 6px;
  background: rgba(12, 10, 9, 0.72); color: var(--amber);
  backdrop-filter: blur(6px);
}
.tile .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--dim); font-size: 22px; }
.tile.rejected { opacity: 0.38; }
.tile.rejected::after { content: "废片"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--red); }

.empty {
  padding: 30px 16px; text-align: center; font-size: 13px; color: var(--dim);
  border: 1px dashed var(--line); border-radius: 14px;
}
.empty[hidden] { display: none; }

.lock {
  display: flex; align-items: center; gap: 14px; padding: 18px 16px;
  border: 1px dashed var(--line); border-radius: 14px; background: rgba(23, 19, 15, 0.5);
}
.lock[hidden] { display: none; }
.lock-ico { font-size: 20px; opacity: 0.7; }
.lock-title { font-size: 14px; }
.lock-title b { color: var(--amber); }
.lock-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }

.topics { display: flex; flex-direction: column; gap: 10px; }

.topic {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px;
  overflow: hidden;
}

.topic-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.topic-idx {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px;
  border: 1px solid rgba(224, 168, 86, 0.35); color: var(--amber);
}
.topic-name { font-size: 15px; font-weight: 600; }
.topic-meta { margin-left: auto; font-size: 11px; color: var(--dim); }

.topic-body { padding: 0 16px 16px; border-top: 1px dashed var(--line-soft); margin-top: -1px; padding-top: 14px; }

.hook {
  font-size: 16px; line-height: 1.5; color: var(--amber);
  padding: 10px 12px; border-radius: 10px; background: var(--amber-soft);
  margin-bottom: 12px;
}

.beats { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.beat { display: flex; gap: 12px; font-size: 13px; color: var(--muted); padding: 6px 0; }
.beat span:first-child { flex: none; width: 48px; color: var(--dim); font-variant-numeric: tabular-nums; font-size: 11.5px; padding-top: 2px; }

.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { font-size: 12px; padding: 4px 12px; border-radius: 999px; color: var(--dim); border: 1px solid var(--line-soft); }
.tab.on { color: var(--text); border-color: var(--line); background: var(--card-2); }

.copy-box { position: relative; }
.copy-text {
  font-size: 13px; line-height: 1.75; color: var(--muted);
  white-space: pre-wrap; word-break: break-word;
  background: var(--card-2); border-radius: 10px; padding: 12px 12px 40px;
  border: 1px solid var(--line-soft);
}
.copy-btn {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 11px; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(12, 10, 9, 0.8); color: var(--muted);
}
.copy-btn:active { color: var(--amber); }

.risk { margin-top: 12px; font-size: 11.5px; color: var(--red); opacity: 0.8; line-height: 1.6; }

footer {
  position: relative; z-index: 1;
  margin-top: 34px; padding: 22px 20px calc(26px + env(safe-area-inset-bottom));
  text-align: center; font-size: 11.5px; color: var(--dim); line-height: 1.8;
}
.foot-note { opacity: 0.6; letter-spacing: 0.08em; }

.guide-link {
  display: inline-block; margin: 6px 0 10px;
  font-size: 12.5px; color: var(--amber); text-decoration: none;
  border-bottom: 1px dashed rgba(224, 168, 86, 0.35); padding-bottom: 2px;
}

.viewer {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 4, 3, 0.96);
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(8px);
}
.viewer[hidden] { display: none; }
.viewer-body { max-width: 100%; max-height: 80vh; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 80vh; border-radius: 12px; display: block; }
.viewer-close {
  position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 18px;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(23, 19, 15, 0.9); color: var(--text); font-size: 14px;
}

.skeleton { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }

.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: calc(100% - 40px);
  padding: 12px 18px; border-radius: 999px;
  background: rgba(30, 25, 21, 0.96); color: var(--amber);
  border: 1px solid rgba(224, 168, 86, 0.28);
  font-size: 13px; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(10px);
  z-index: 60;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
