:root {
  --bg: #0a0b10;
  --bg-soft: #101219;
  --card: rgba(22, 25, 36, 0.72);
  --card-solid: #161924;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f8;
  --muted: #8d94a8;
  --muted-2: #6a7185;
  --brand: #7c6cff;
  --brand-2: #35d0ff;
  --ok: #2fd6a0;
  --warn: #ffb454;
  --danger: #ff6b81;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 108, 255, 0.18), transparent 60%),
    radial-gradient(700px 500px at 95% 0%, rgba(53, 208, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #0a0b10 0%, #080910 100%);
  z-index: -3;
}

.orb {
  position: fixed;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  z-index: -2;
  pointer-events: none;
}
.orb-a { background: #5b46ff; top: -180px; left: -140px; }
.orb-b { background: #00a3ff; bottom: -220px; right: -160px; opacity: 0.22; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { opacity: 0.85; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: 6px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 22px 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: 0.2px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #b06bff 60%, var(--brand-2));
  box-shadow: 0 6px 18px rgba(124, 108, 255, 0.45);
}

.topnav { display: flex; gap: 6px; }
.topnav a {
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
}
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); opacity: 1; }
.topnav a.active { color: var(--text); background: rgba(255, 255, 255, 0.08); }

/* ---------- 布局 ---------- */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 22px 64px;
}
.wrap.narrow { max-width: 820px; }

.hero { padding: 26px 0 22px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4.4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.5px;
  background: linear-gradient(100deg, #ffffff 20%, #b9b2ff 55%, #7fe4ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub { margin: 0; color: var(--muted); font-size: 15px; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge {
  font-size: 12.5px;
  color: #cfd5e6;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card-title { margin: 0 0 6px; font-size: 17px; }
.card-sub { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }

/* ---------- 拖拽区 ---------- */
.dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  background: rgba(255, 255, 255, 0.02);
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: rgba(124, 108, 255, 0.65);
  background: rgba(124, 108, 255, 0.07);
  outline: none;
}
.dropzone.drag {
  border-color: var(--brand-2);
  background: rgba(53, 208, 255, 0.08);
  transform: scale(1.005);
}
.dz-icon {
  font-size: 24px;
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #cfd6ff;
  background: linear-gradient(160deg, rgba(124, 108, 255, 0.28), rgba(53, 208, 255, 0.12));
  border: 1px solid var(--line-strong);
}
.dz-title { font-weight: 600; }
.dz-hint { color: var(--muted-2); font-size: 12.5px; margin-top: 4px; }

/* ---------- 文件卡 ---------- */
.filecard {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}
.fc-head { display: flex; align-items: center; gap: 10px; }
.fc-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.fc-est { color: var(--ok); font-size: 13px; margin-top: 6px; }
.fc-est.warn { color: var(--warn); }

.icon-btn {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }

/* ---------- 表单 ---------- */
.field { margin-top: 18px; }
.label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.seg span { font-weight: 400; font-size: 11.5px; color: var(--muted-2); }
.seg:hover { border-color: var(--line-strong); color: var(--text); }
.seg.active {
  border-color: rgba(124, 108, 255, 0.75);
  background: linear-gradient(180deg, rgba(124, 108, 255, 0.22), rgba(124, 108, 255, 0.08));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(124, 108, 255, 0.25) inset;
}
.seg.active span { color: #c3bcff; }
.seg:disabled { opacity: 0.45; cursor: not-allowed; }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
}
.check input { accent-color: var(--brand); width: 15px; height: 15px; }

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.input::placeholder { color: var(--muted-2); }
.input:focus {
  outline: none;
  border-color: rgba(124, 108, 255, 0.7);
  background: rgba(124, 108, 255, 0.07);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}
.btn:hover { transform: translateY(-1px); opacity: 1; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--brand), #9d6bff 55%, #4b8bff);
  box-shadow: 0 12px 30px rgba(124, 108, 255, 0.35);
  color: #fff;
}
.btn.primary:hover { box-shadow: 0 14px 36px rgba(124, 108, 255, 0.48); }
.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn.lg { width: 100%; margin-top: 20px; padding: 13px 18px; font-size: 15px; }
.btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }

/* ---------- 进度 ---------- */
.progress { margin-top: 18px; }
.prog-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.25s ease;
  box-shadow: 0 0 16px rgba(53, 208, 255, 0.5);
}
.prog-note { color: var(--muted-2); font-size: 12.5px; margin-top: 8px; min-height: 18px; }

/* ---------- 结果 ---------- */
.result { margin-top: 20px; }
.result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ok);
  margin-bottom: 12px;
}
.ok-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 12px var(--ok);
}

.receipt-box {
  border: 1px dashed rgba(124, 108, 255, 0.45);
  background: rgba(124, 108, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
}
.receipt-label { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.receipt-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(20px, 4.6vw, 26px);
  font-weight: 700;
  letter-spacing: 2px;
  margin: 4px 0 8px;
  color: #dcd8ff;
  word-break: break-all;
}
.receipt-actions { display: flex; justify-content: center; gap: 8px; }

.kv { margin-top: 14px; display: grid; gap: 8px; }
.kv-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}
.kv-row > span { color: var(--muted); flex: 0 0 62px; }
.kv-row > a {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- 查询 ---------- */
.lookup-form { display: flex; gap: 10px; }
.lookup-form .input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.lookup-msg { margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 20px; }
.lookup-msg.error { color: var(--danger); }
.lookup-msg.ok { color: var(--ok); }

/* ---------- 播放页 ---------- */
.player-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.player-shell {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.player-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.65));
  pointer-events: none;
}
.player-mask.hidden { display: none; }
.player-mask.error { color: var(--danger); }

.player-info { padding: 16px 6px 4px; }
.player-info h1 {
  margin: 0 0 8px;
  font-size: clamp(18px, 3.2vw, 24px);
  line-height: 1.35;
  word-break: break-word;
}
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-chips span {
  font-size: 12px;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 16px);
  background: rgba(30, 34, 48, 0.95);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 50;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot {
  text-align: center;
  color: var(--muted-2);
  font-size: 12.5px;
  padding: 8px 0 0;
}

.hidden { display: none !important; }

@media (max-width: 560px) {
  .wrap { padding: 6px 14px 48px; }
  .topbar { padding: 16px 14px 4px; }
  .card { padding: 16px; border-radius: 16px; }
  .segmented { gap: 6px; }
  .seg { font-size: 13px; padding: 9px 6px; }
  .seg span { font-size: 10.5px; }
  .kv-row { flex-direction: column; gap: 4px; }
  .kv-row > span { flex: none; }
}
