/* golftrack · 深色玻璃拟态主题（零构建，纯 CSS） */

:root {
  --bg: #0b0f14;
  --bg-soft: #111823;
  --card: rgba(20, 28, 40, 0.72);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.18);
  --text: #e9eef6;
  --muted: #8f9bab;
  --accent: #ffd400;
  --accent-soft: rgba(255, 212, 0, 0.14);
  --danger: #ff6b81;
  --radius: 18px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(1200px 700px at 12% -10%, #16233a 0%, transparent 60%),
              radial-gradient(900px 600px at 100% 0%, #1a2b23 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.glow-a { width: 420px; height: 420px; background: #ffd40033; top: -160px; left: -80px; }
.glow-b { width: 520px; height: 520px; background: #00e5ff22; bottom: -220px; right: -160px; }

/* ── 顶部 ── */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 8px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
  flex: 0 0 auto;
}
.brand h1 { font-size: 20px; margin: 0; letter-spacing: 0.4px; }
.brand p { margin: 0; font-size: 13px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 10px; }

.pill {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.pill.ok { color: #7ee2a8; border-color: rgba(126, 226, 168, 0.35); }
.pill.bad { color: var(--danger); border-color: rgba(255, 107, 129, 0.35); }

/* ── 布局 ── */
main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 22px;
}

.card h2 { margin: 0 0 6px; font-size: 18px; }
.card h3 { margin: 0 0 4px; font-size: 15px; }
.muted { color: var(--muted); margin: 0; font-size: 13px; }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 34px; text-align: right; }
.hidden { display: none !important; }

/* ── 上传 ── */
.dropzone {
  border: 1.5px dashed var(--stroke-strong);
  border-radius: 16px;
  padding: 34px 20px;
  text-align: center;
  transition: 0.18s ease;
  background: rgba(255, 255, 255, 0.015);
}
.dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.drop-icon {
  width: 52px; height: 52px; line-height: 48px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 1px solid var(--stroke-strong);
  font-size: 26px;
  color: var(--accent);
}
.drop-title { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.drop-sub { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.hint { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

.tips {
  margin: 16px 0 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.tips li { margin: 2px 0; }

/* ── 按钮 ── */
.btn {
  appearance: none;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: 0.15s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: scale(0.985); }
.btn.primary {
  background: var(--accent);
  color: #16120a;
  border-color: transparent;
  font-weight: 700;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; min-height: 34px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ── 进度 ── */
.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ring {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--stroke-strong);
  border-radius: 50%;
  width: 72px; height: 72px;
  display: flex; align-items: baseline; justify-content: center;
  padding-top: 20px;
  flex: 0 0 auto;
}
.ring small { font-size: 11px; color: var(--muted); margin-left: 2px; }

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin: 16px 0 14px;
}
.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd400, #ffe873);
  transition: width 0.4s ease;
}

.stages {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}
.stages li {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px 10px;
}
.stages li.active { color: #16120a; background: var(--accent); border-color: transparent; font-weight: 600; }
.stages li.done { color: #7ee2a8; border-color: rgba(126, 226, 168, 0.35); }
.warn { margin: 12px 0 0; font-size: 12.5px; color: #ffd28a; }

/* ── 结果 ── */
#step-result { display: flex; flex-direction: column; gap: 18px; }

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 6px; }
.compare.portrait { grid-template-columns: 1fr; }
.pane {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: #000;
  position: relative;
}
.pane video { display: block; width: 100%; height: auto; background: #000; }
.pane figcaption {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--stroke);
  color: var(--text);
  backdrop-filter: blur(6px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.panel {
  margin-top: 16px;
  border-top: 1px solid var(--stroke);
  padding-top: 16px;
}
.panel .row { margin: 12px 0; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.label { font-size: 13px; color: var(--muted); min-width: 40px; }

input[type="range"] {
  flex: 1;
  min-width: 80px;
  height: 28px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -6.5px;
  border: none;
  box-shadow: 0 0 12px rgba(255, 212, 0, 0.5);
}
input[type="range"]::-moz-range-track {
  height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.14);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--accent);
}

.swatches { display: flex; gap: 10px; margin: 14px 0 10px; }
.swatch {
  width: 36px; height: 36px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  padding: 0;
  transition: 0.15s ease;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14); }

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--text);
}
.checks label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checks input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ── 失败态 ── */
.fail-msg {
  font-size: 15px;
  color: #ffd28a;
  background: rgba(255, 210, 138, 0.09);
  border: 1px solid rgba(255, 210, 138, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

/* ── 浮层 ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 7, 11, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: auto;
}
.sheet {
  width: min(760px, 100%);
  background: var(--bg-soft);
  border: 1px solid var(--stroke-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
  max-height: 94vh;
  overflow: auto;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sheet h2 { margin: 0; font-size: 17px; }

.canvas-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--stroke);
  margin-bottom: 12px;
  touch-action: manipulation;
}
#marker-canvas { display: block; width: 100%; height: auto; cursor: crosshair; }
.canvas-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.55);
}
.canvas-loading.hidden { display: none; }

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 4px;
  min-height: 30px;
}
.role-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  color: var(--muted);
}
.role-chip.filled { color: #16120a; background: var(--accent); border-color: transparent; font-weight: 600; }

/* ── Toast ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(20, 28, 40, 0.96);
  border: 1px solid var(--stroke-strong);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  max-width: 92vw;
  text-align: center;
}
.toast.err { border-color: rgba(255, 107, 129, 0.5); color: #ffb3be; }

/* ── 底部 ── */
.foot {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 8px auto 0;
  padding: 0 20px;
  color: var(--muted);
  font-size: 12.5px;
}
.foot details {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.foot summary { cursor: pointer; color: var(--text); font-size: 13px; }
.foot-body p { margin: 8px 0; }
.tiny { text-align: center; margin: 14px 0 0; opacity: 0.7; }

/* ── 移动端 ── */
@media (max-width: 720px) {
  .topbar { padding: 20px 14px 4px; }
  main { padding: 12px 14px 8px; gap: 14px; }
  .card { padding: 16px; border-radius: 16px; }
  .compare { grid-template-columns: 1fr; }
  .ring { width: 62px; height: 62px; font-size: 19px; padding-top: 16px; }
  .brand p { display: none; }
  .actions .btn { flex: 1 1 46%; }
  .sheet { padding: 15px; border-radius: 16px; }
  .foot { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* 结果页：精度提示条 */
.hint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 196, 0, 0.32);
  background: linear-gradient(90deg, rgba(255, 196, 0, 0.10), rgba(255, 196, 0, 0.03));
}
.hint-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hint-text strong { font-size: 14px; color: #ffd24a; }
.hint-text span { font-size: 12px; line-height: 1.5; opacity: 0.72; }
.btn.accent {
  border-color: rgba(255, 196, 0, 0.55);
  color: #ffd24a;
  background: rgba(255, 196, 0, 0.10);
  white-space: nowrap;
}
.btn.accent:hover { background: rgba(255, 196, 0, 0.18); }
@media (max-width: 720px) {
  .hint-bar { flex-direction: column; align-items: stretch; }
  .btn.accent { width: 100%; min-height: 44px; }
}
