:root {
  --bg: #1a1625;
  --bg-card: #241f33;
  --fg: #e8e2d5;
  --fg-dim: #a89f8c;
  --accent: #c9a227;
  --accent-dim: #8a7119;
  --line: #3a3350;
  --error: #e07a5f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

header { text-align: center; margin-bottom: 24px; }
header h1 { font-size: 28px; letter-spacing: 8px; color: var(--accent); }

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.step-dot {
  padding: 2px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  font-size: 13px;
}
.step-dot.active {
  border-color: var(--accent);
  color: var(--accent);
}
.step-line { width: 32px; height: 1px; background: var(--line); }

.step { display: none; }
.step.active { display: block; }
.step h2 {
  font-size: 20px;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h3 { color: var(--accent); font-size: 15px; margin: 12px 0 6px; }
.card h3:first-child { margin-top: 0; }
.card p { color: var(--fg); font-size: 14px; }
.toss-notes { margin: 6px 0 12px; padding-left: 20px; }
.toss-notes li { color: var(--fg); font-size: 14px; margin: 4px 0; }

.rule-options { margin: 8px 0; }
.rule-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14px;
}
.rule-option:has(input:checked) { border-color: var(--accent); background: rgba(201, 162, 39, 0.08); }
.rule-option input { margin-top: 5px; accent-color: var(--accent); }

textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }

.hint { color: var(--fg-dim); font-size: 13px; margin-bottom: 14px; }

.toss-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.toss-item.done { border-color: var(--accent-dim); }
.toss-title { font-size: 14px; margin-bottom: 8px; }
.toss-title .yao-tag { color: var(--accent); margin-left: 8px; font-size: 13px; }
.toss-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 560px) { .toss-options { grid-template-columns: repeat(2, 1fr); } }
.toss-option {
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 13px;
  cursor: pointer;
  color: var(--fg);
}
.toss-option input { display: none; }
.toss-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(201, 162, 39, 0.12);
  color: var(--accent);
}

.gua-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}
.gua-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
  min-width: 180px;
}
.gua-box h3 { color: var(--fg-dim); font-size: 14px; margin-bottom: 10px; }
.gua-arrow { color: var(--accent); font-size: 22px; }
.gua-lines { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.gua-line-row { display: flex; align-items: center; gap: 8px; }
.yao { display: flex; gap: 10px; width: 96px; }
.yao .bar { height: 10px; background: var(--fg); border-radius: 2px; flex: 1; }
.yao.yang .bar { background: var(--accent); }
.gua-line-row .mark { width: 16px; color: var(--error); font-size: 13px; }
.gua-name { margin-top: 12px; font-size: 17px; color: var(--accent); letter-spacing: 2px; }

.loading { color: var(--fg-dim); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.interpret-text { white-space: pre-wrap; font-size: 14px; }

.error-tip { color: var(--error); font-size: 13px; margin-top: 8px; }
.hidden { display: none !important; }

.actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.btn {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--accent-dim); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1625;
  font-weight: bold;
}
.btn.primary:hover { background: #d9b23a; }
