/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* ---------- 按钮 ---------- */
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  border-radius: 8px;
  background: var(--text);
  color: #F8F1E3;
  font-size: 15px;
  font-weight: 600;
}

.primary-btn:active {
  opacity: 0.85;
}

.primary-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-deep);
  background: transparent;
  font-size: 12px;
}

/* ---------- Chip ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(255, 252, 244, 0.72);
  font-size: 12.5px;
}

.chip.active {
  border-color: var(--accent);
  background: rgba(184, 146, 74, 0.12);
  color: var(--accent-deep);
  font-weight: 600;
}

.chip-row,
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Hexagram glyph ---------- */
.hexagram {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
}

.hexagram.sm {
  width: 36px;
  gap: 3px;
}

.hexagram.md {
  width: 60px;
  gap: 4.5px;
}

.hexagram.lg {
  width: 84px;
  gap: 6px;
}

.hexagram .line {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
}

.hexagram.sm .line {
  height: 4px;
}

.hexagram.md .line {
  height: 6px;
}

.hexagram.lg .line {
  height: 9px;
}

.hexagram .solid,
.hexagram .half {
  height: 100%;
  border-radius: 1px;
  background: var(--text);
}

.hexagram .solid {
  width: 100%;
}

.hexagram .half {
  width: 42%;
}

.hexagram .line.changing .solid,
.hexagram .line.changing .half {
  background: var(--warn);
}

/* ---------- Modal mask (免责弹窗) ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(31, 58, 52, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.modal-title {
  font-size: 19px;
  margin: 0 0 12px;
}

.modal-body {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.modal-body + .modal-body {
  margin-top: 8px;
}

.modal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  color: var(--text);
  font-size: 13px;
}

.modal-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.modal-btn {
  margin-top: 8px;
}

/* ---------- Toast ---------- */
.gy-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20% + var(--safe-bottom));
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(31, 58, 52, 0.9);
  color: #F8F1E3;
  font-size: 13px;
  letter-spacing: 1px;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.gy-toast.show {
  opacity: 1;
}

/* ---------- Bottom Sheet (结果页"解析"浮层) ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(31, 58, 52, 0.42);
  display: flex;
  align-items: flex-end;
}

.sheet {
  width: 100%;
  max-height: 78vh;
  padding: 12px 18px;
  padding-bottom: calc(20px + var(--safe-bottom));
  border-radius: 14px 14px 0 0;
  background: var(--bg-sheet);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet-bar {
  width: 40px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--border);
}

.sheet-title {
  font-size: 19px;
  margin: 0 0 10px;
}

.sheet-body {
  white-space: pre-line;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 14px;
}

.sheet-btn {
  margin-top: 16px;
}
