:root {
  color-scheme: dark;
  --bg: #111316;
  --panel: #191d21;
  --panel-2: #20262b;
  --line: #313942;
  --text: #eef3f7;
  --muted: #9ba8b5;
  --cyan: #54d2d2;
  --lime: #b8e46b;
  --amber: #f2b84b;
  --red: #ff6f61;
  --blue: #79a7ff;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(520px, 1fr) 300px;
  gap: 16px;
  padding: 16px;
}

.control-panel,
.result-panel,
.stage-panel {
  border: 1px solid var(--line);
  background: rgba(25, 29, 33, 0.94);
  border-radius: 8px;
}

.control-panel,
.result-panel {
  padding: 18px;
  overflow: auto;
}

.stage-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-block;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 22px rgba(84, 210, 210, 0.28);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: var(--cyan);
}

.brand-mark::before {
  width: 22px;
  height: 2px;
  top: 18px;
  left: 8px;
}

.brand-mark::after {
  width: 2px;
  height: 22px;
  top: 8px;
  left: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.15;
}

h2 {
  font-size: 15px;
  margin-bottom: 12px;
}

.brand-block p,
.status-text,
.note-list,
.metric-card span,
.recommendation span,
.stage-header p {
  color: var(--muted);
}

.panel-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.panel-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

input,
select {
  width: 100%;
  height: 40px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
}

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

.mode-button,
.primary-button,
.ghost-button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
}

.mode-button.active {
  border-color: var(--cyan);
  background: rgba(84, 210, 210, 0.16);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}

.primary-button {
  border-color: transparent;
  color: #071113;
  background: var(--cyan);
  font-weight: 700;
}

.ghost-button:hover,
.mode-button:hover {
  border-color: var(--cyan);
}

.status-text {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.55;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.stage-header h2 {
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 24px;
}

.timer-box {
  min-width: 96px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  line-height: 1;
}

.timer-box span {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.timer-box small {
  color: var(--muted);
}

#aimCanvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0c1012;
  cursor: crosshair;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.metric-card {
  min-height: 78px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.result-summary {
  border-top: 0;
  padding-top: 0;
}

.verdict {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  line-height: 1.55;
}

.recommendation {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
}

.recommendation strong {
  font-size: 20px;
}

.score-row {
  display: grid;
  grid-template-columns: 42px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

meter {
  width: 100%;
  height: 12px;
}

.sample-stack {
  display: grid;
  gap: 10px;
}

.sample-stack div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.sample-stack strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 260px minmax(420px, 1fr);
  }

  .result-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .mode-list,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .stage-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
