/* =========================================================
   GolfTrace — premium minimal · black + gold
   ========================================================= */

:root {
  --bg:            #0a0a0c;
  --bg-elev:       #131318;
  --bg-elev-2:     #1a1a21;
  --border:        #24242c;
  --border-strong: #34343f;
  --text:          #f4f4f6;
  --text-muted:    #93939c;
  --text-dim:      #62626b;
  --gold:          #d4a857;
  --gold-soft:     #e8c684;
  --gold-glow:     rgba(212, 168, 87, 0.18);
  --danger:        #e25c54;
  --success:       #5fc78b;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --container:     1140px;

  --shadow-sm:     0 1px 2px rgba(0,0,0,.5);
  --shadow-md:     0 8px 24px rgba(0,0,0,.4);
  --shadow-lg:     0 24px 60px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

/* 全局: hidden 属性永远赢过 display:flex / grid */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ============== CONTAINER ============== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}
.container-narrow { max-width: 780px; }

/* ============== NAV ============== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand svg { color: var(--gold); }
.brand-name { font-size: 17px; }
.nav-links {
  display: flex;
  gap: 30px;
  font-size: 14px;
  color: var(--text-muted);
}
.nav-links a {
  transition: color .15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.lang-toggle:hover {
  border-color: var(--gold);
  color: var(--text);
}
.lang-toggle .lang-current { color: var(--gold); font-weight: 600; }
.lang-toggle .lang-divider { opacity: .4; }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--gold);
  color: #1a1206;
  font-weight: 600;
}
.btn-primary:hover { background: var(--gold-soft); transform: translateY(-1px); box-shadow: 0 8px 24px var(--gold-glow); }
.btn-primary:disabled { background: var(--border); color: var(--text-dim); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ============== HERO ============== */
.hero {
  position: relative;
  padding: 110px 0 130px;
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(212, 168, 87, 0.08);
  border: 1px solid rgba(212, 168, 87, 0.18);
  color: var(--gold);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.hero-title {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
}
.hero-title .accent {
  display: block;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 640px;
  margin: 0 auto 40px;
  font-size: 19px;
  color: var(--text-muted);
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.hero-trust {
  color: var(--text-dim);
  font-size: 13px;
}
.hero-blur {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, var(--gold-glow) 0%, transparent 60%);
  filter: blur(60px);
  z-index: 1;
  pointer-events: none;
}

/* ============== SECTIONS ============== */
.section {
  padding: 110px 0;
  position: relative;
}
.section-alt {
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.015) 50%, transparent 100%);
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.section-head { text-align: center; margin-bottom: 72px; }
.section-label {
  display: inline-block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ============== STEPS ============== */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  counter-reset: step;
}
.step {
  padding: 36px 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  transition: border-color .2s ease, transform .2s ease;
}
.step:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.step-num {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}
.step h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ============== FEATURES ============== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature {
  padding: 32px 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s ease;
}
.feature:hover {
  border-color: rgba(212, 168, 87, 0.3);
  background: var(--bg-elev-2);
}
.feature-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 168, 87, 0.08);
  color: var(--gold);
  border-radius: 10px;
  margin-bottom: 20px;
}
.feature h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ============== ANALYZER ============== */
.section-analyze {
  padding: 110px 0;
}
.analyzer {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.analyzer-left { display: flex; flex-direction: column; gap: 20px; }

/* dropzone */
.dropzone {
  display: block;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: rgba(255,255,255,0.015);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--gold);
  background: rgba(212, 168, 87, 0.05);
}
.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}
.dropzone-content svg { color: var(--gold); opacity: 0.9; }
.dropzone-title { color: var(--text); font-size: 16px; font-weight: 500; }
.dropzone-sub { font-size: 13px; color: var(--text-dim); }
.dropzone-selected {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}
.dropzone-selected svg { color: var(--gold); flex-shrink: 0; }
.dropzone-selected > div { flex: 1; min-width: 0; }
.selected-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.selected-size { color: var(--text-dim); font-size: 12px; }

/* advanced */
.advanced {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
}
.advanced > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-muted);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 300;
  color: var(--text-dim);
}
.advanced[open] > summary::after { content: '−'; }
.advanced[open] > summary { color: var(--text); border-bottom: 1px solid var(--border); }
.adv-row { padding: 14px 18px; }
.adv-row + .adv-row { border-top: 1px solid var(--border); }
.adv-row label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.adv-row select, .adv-row input {
  width: 100%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}
.adv-row select:focus, .adv-row input:focus {
  outline: none;
  border-color: var(--gold);
}
.adv-hint { margin-top: 6px; color: var(--text-dim); font-size: 11.5px; }
.adv-optional { color: var(--text-dim); font-weight: 400; font-size: 11px; }

.sample-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--gold);
  padding: 10px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: -4px;
  transition: all .15s ease;
}
.sample-btn:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 87, 0.06);
}
.sample-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* status */
.status { display: flex; flex-direction: column; gap: 8px; }
.status-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.status-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  width: 0%;
  transition: width .4s ease;
  border-radius: 2px;
}
.status-text { color: var(--text-muted); font-size: 13px; }

/* analyzer right */
.analyzer-right {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-dim);
}
.empty-state p { margin: 0; font-size: 14px; }

.result-head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.result-head h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.result-meta { font-size: 12px; color: var(--text-dim); }

.annotated-figure {
  margin: 0 0 22px;
  padding: 0;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.annotated-video {
  width: 100%;
  max-height: 480px;
  display: block;
  background: #000;
}
.annotated-figure figcaption {
  padding: 8px 14px;
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  text-align: center;
}

/* ============== 关键帧网格 ============== */
.phase-frames { margin-bottom: 22px; }
.phase-frames-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 500;
}
.phase-frames-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.phase-frame {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.phase-frame:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.phase-frame-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #000;
}
.phase-frame-caption {
  padding: 6px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.phase-frame-time {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .phase-frames-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============== 杆头轨迹图 ============== */
.swing-path-figure {
  margin: 0 0 22px;
  padding: 0;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.swing-path-video {
  display: block;
  width: 100%;
  max-height: 480px;
  background: #000;
}
.swing-path-figure figcaption {
  padding: 8px 14px;
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  text-align: center;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.metric {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.metric-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.metric-unit { font-size: 12px; color: var(--text-dim); margin-left: 2px; font-weight: 400; }

.report-body {
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.75;
}
.report-body h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 22px 0 10px;
  color: var(--gold);
  letter-spacing: 0;
}
.report-body h3 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.report-body p { margin: 0 0 12px; color: var(--text-muted); }
.report-body strong { color: var(--text); font-weight: 600; }
.report-body ul, .report-body ol { padding-left: 22px; color: var(--text-muted); margin: 0 0 14px; }
.report-body li { margin-bottom: 6px; }
.report-body code {
  background: var(--bg-elev);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.raw-json {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.raw-json summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}
.raw-json pre {
  margin: 14px 0 0;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  max-height: 320px;
  overflow: auto;
  color: var(--text-muted);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* ============== FAQ ============== */
.faq { display: flex; flex-direction: column; gap: 4px; }
.faq details {
  border-bottom: 1px solid var(--border);
}
.faq summary {
  cursor: pointer;
  padding: 22px 0;
  font-size: 16.5px;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: color .15s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '';
  width: 12px;
  height: 12px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform .2s ease;
  flex-shrink: 0;
  margin-right: 6px;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--gold); }
.faq p { margin: 0 0 22px; color: var(--text-muted); font-size: 15px; line-height: 1.7; padding-right: 30px; }

/* ============== FOOTER ============== */
.footer {
  border-top: 1px solid var(--border);
  padding: 50px 0 60px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-tag { margin: 0; color: var(--text-dim); font-size: 13px; }
.footer-meta { color: var(--text-dim); font-size: 13px; }

/* ============== TOAST ============== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px 22px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-width: 90vw;
  animation: toast-in .25s ease-out;
}
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }
@keyframes toast-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

/* ============== RESPONSIVE ============== */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-inner { gap: 16px; }
  .steps, .feature-grid { grid-template-columns: 1fr; }
  .analyzer { grid-template-columns: 1fr; padding: 22px; }
  .hero { padding: 70px 0 80px; }
  .section { padding: 70px 0; }
  .section-head { margin-bottom: 48px; }
}

@media (max-width: 520px) {
  .nav-actions .btn { display: none; }
  .container { padding: 0 20px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
}
