:root {
  color-scheme: dark;
  --bg: #070a10;
  --panel: #101722;
  --panel-2: #151f2d;
  --text: #eef5ff;
  --muted: #93a4ba;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #57d7ff;
  --accent-2: #ff5d73;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(87, 215, 255, 0.16), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(255, 93, 115, 0.12), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button {
  font: inherit;
}

.app {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
  align-items: stretch;
}

.hero,
.panel,
.compass-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(21, 31, 45, 0.94), rgba(9, 13, 20, 0.96));
  box-shadow: var(--shadow);
}

.hero {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.95;
}

.intro {
  max-width: 32rem;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

/* ---------- 罗盘 ---------- */

.compass-card {
  grid-row: span 2;
  display: grid;
  place-items: center;
  gap: 26px;
  padding: 34px;
}

.compass {
  position: relative;
  width: min(72vw, 400px);
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(87, 215, 255, 0.08) 0 18%, transparent 19%),
    radial-gradient(circle, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01) 56%, rgba(0, 0, 0, 0.28) 57%),
    var(--panel-2);
}

/* 固定指示器——顶部三角 */
.indicator {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--accent-2);
  filter: drop-shadow(0 0 8px rgba(255, 93, 115, 0.6));
  z-index: 3;
}

/* 旋转表盘 */
.dial {
  position: absolute;
  inset: 6%;
  border-radius: 999px;
  transform: rotate(0deg);
  transition: transform 200ms ease-out;
}

.ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(87, 215, 255, 0.35);
  border-radius: inherit;
  box-shadow: inset 0 0 38px rgba(87, 215, 255, 0.09), 0 0 28px rgba(87, 215, 255, 0.08);
}

.ticks {
  position: absolute;
  inset: 6%;
  border-radius: inherit;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(238, 245, 255, 0.55) 0deg 1.5deg,
    transparent 1.5deg 15deg
  );
  mask: radial-gradient(circle, transparent 0 76%, #000 77% 100%);
}

/* 方向标记 */
.mark {
  position: absolute;
  font-weight: 800;
  font-size: clamp(14px, 3vw, 18px);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.north {
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-2);
  font-size: clamp(16px, 3.5vw, 22px);
}

.east {
  right: 7%;
  top: 50%;
  transform: translateY(-50%);
}

.south {
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
}

.west {
  left: 7%;
  top: 50%;
  transform: translateY(-50%);
}

/* 中心轴 */
.pivot {
  width: 24px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--text);
  border: 5px solid #2b3747;
  z-index: 2;
}

/* ---------- 读数 ---------- */

.readout {
  display: grid;
  gap: 6px;
  text-align: center;
}

.readout strong {
  font-size: clamp(42px, 9vw, 72px);
  line-height: 1;
}

.readout span,
.status,
dd {
  color: var(--muted);
}

/* ---------- 控制面板 ---------- */

.panel {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.primary,
.secondary {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  background: linear-gradient(135deg, var(--accent), #7dffdc);
  color: #031018;
}

.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.7;
}

.status {
  margin: 0;
  line-height: 1.6;
}

.details {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.details div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

dt {
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 700;
}

dd {
  margin: 0;
}

.debug-row {
  opacity: 0.5;
  font-size: 11px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 760px) {
  body {
    padding: 18px;
    place-items: start center;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .compass-card {
    grid-row: auto;
    padding: 22px;
  }

  .details {
    grid-template-columns: 1fr;
  }
}
