/* ==========================================================================
   星座匹配度测验 · 极简设计系统
   原则：无 blur、无 filter、无多余渐变，动画只用 transform/opacity
   ========================================================================== */

:root {
  --bg: #0d0d0f;
  --surface: #151517;
  --surface-2: #1b1b1e;
  --border: #26262a;
  --border-strong: #3a3a40;
  --text: #e9e7e3;
  --muted: #8f8d88;
  --faint: #605e5a;
  --accent: #d4a574;
  --accent-hover: #e0b689;
  --accent-ink: #14120e;
  --accent-soft: rgba(212, 165, 116, 0.12);
  --ok: #8fae85;
  --warn: #d9a86c;
  --err: #cf8080;
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1020px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

::selection { background: var(--accent-soft); color: var(--text); }

h1, h2, h3, h4 { margin: 0 0 14px; line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
h3 { font-size: 15.5px; }
p { margin: 0 0 14px; }

/* 布局 ------------------------------------------------------------------- */
.wrap {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 20px 88px;
}
.wrap.narrow { max-width: 680px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
}
.brand .dot {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 1.8px;
  line-height: 1.4;
}

.center { text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; color: var(--faint); line-height: 1.7; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.hide { display: none !important; }

/* 卡片 ------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.card.tight { padding: 20px; }
.card + .card { margin-top: 16px; }

/* 按钮 ------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { background: var(--surface); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }

.btn.danger { border-color: var(--border-strong); color: var(--err); }
.btn.danger:hover { background: rgba(207, 128, 128, 0.1); border-color: var(--err); }

.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.block { width: 100%; }

.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  border-top-color: var(--accent-ink);
  animation: spin 0.7s linear infinite;
}
.btn:not(.primary).loading::after {
  border-color: var(--border-strong);
  border-top-color: var(--accent);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 表单 ------------------------------------------------------------------- */
label.field { display: block; margin-bottom: 18px; }
label.field > span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.input,
select.input,
textarea.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--faint); }
select.input option { background: var(--surface-2); color: var(--text); }

.code-input {
  text-align: center;
  letter-spacing: 6px;
  font-size: 19px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
}

.date-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }

/* 提示条 ----------------------------------------------------------------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.7;
}
.alert.info { border-left: 2px solid var(--accent); color: var(--text); }
.alert.warn { border-left: 2px solid var(--warn); }
.alert.error { border-left: 2px solid var(--err); color: var(--err); }
.alert.ok { border-left: 2px solid var(--ok); color: var(--ok); }
.alert b { color: var(--text); font-weight: 600; }

/* 徽标 ------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.badge.ok { color: var(--ok); border-color: rgba(143, 174, 133, 0.35); }
.badge.no { color: var(--warn); border-color: rgba(217, 168, 108, 0.35); }
.badge.purple { color: var(--accent); border-color: rgba(212, 165, 116, 0.35); }

/* 进度条 ----------------------------------------------------------------- */
.progress { height: 2px; border-radius: 2px; background: var(--border); overflow: hidden; }
.progress > i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 答题选项 --------------------------------------------------------------- */
.option {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.7;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  margin-bottom: 10px;
}
.option:hover { border-color: var(--border-strong); background: var(--surface-2); }
.option .idx {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.option.selected .idx {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* 分数环 ----------------------------------------------------------------- */
.score-ring { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.score-ring .val {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-ring .val b { font-size: 48px; line-height: 1; font-weight: 500; letter-spacing: -0.02em; }
.score-ring .val span {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 3px;
  margin-top: 8px;
}

/* 维度条 ----------------------------------------------------------------- */
.dim { margin-bottom: 16px; }
.dim .head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.dim .head b { font-weight: 500; }
.dim .head em { font-style: normal; color: var(--faint); font-size: 12px; }

.track {
  position: relative;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
}
.track .me {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 2px;
  background: var(--accent);
}
.track .tick {
  position: absolute;
  top: -4px;
  width: 1.5px;
  height: 11px;
  border-radius: 1px;
  background: var(--text);
  opacity: 0.75;
}

/* 表格 ------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 780px; }
th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td .code {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--accent);
}

/* 统计卡 ----------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.stat .k { font-size: 12px; color: var(--faint); margin-bottom: 6px; }
.stat .v { font-size: 25px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.stat .v small { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: 3px; }

/* 柱状图 ----------------------------------------------------------------- */
.chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 140px;
  padding: 10px 4px 0;
}
.chart .bar {
  flex: 1 1 0;
  max-width: 56px;
  min-width: 5px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.chart .bar i {
  display: block;
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0.85;
  min-height: 2px;
}
.chart .bar.gold i { background: var(--text); opacity: 0.55; }
.chart .bar span { font-size: 11px; color: var(--faint); white-space: nowrap; }
.chart .bar em { font-size: 11px; font-style: normal; color: var(--muted); }

/* Tabs ------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.tabs button {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Toast ------------------------------------------------------------------ */
#toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--err); color: var(--err); }

/* 弹窗 ------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 8, 0.82);
  display: grid;
  place-items: center;
  z-index: 500;
  padding: 20px;
}
.modal .box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
}

/* 免责声明 --------------------------------------------------------------- */
.disclaimer {
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}
.disclaimer b { color: var(--accent); font-weight: 600; }

/* 加载动画 --------------------------------------------------------------- */
.loader { display: grid; place-items: center; gap: 16px; padding: 48px 0; text-align: center; }
.orbit { width: 40px; height: 40px; position: relative; }
.orbit i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.orbit i:nth-child(2) { display: none; }
.orbit b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--accent); }

.skeleton {
  height: 12px;
  border-radius: 4px;
  background: var(--surface-2);
  animation: pulse 1.4s ease-in-out infinite;
  margin-bottom: 10px;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* 阅读块 ----------------------------------------------------------------- */
.reading-block { padding-left: 18px; border-left: 1px solid var(--border); margin: 0 0 24px; }
.reading-block h3 { font-size: 13px; color: var(--accent); margin-bottom: 8px; letter-spacing: 0.04em; }
.reading-block p { color: var(--text); font-size: 14.5px; line-height: 1.9; }

.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.8;
}
.list-clean li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.kw { display: flex; gap: 8px; flex-wrap: wrap; }

/* 渐变文字 → 纯色 ------------------------------------------------------- */
.gradient-text { color: var(--accent); }

.foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 48px; }

/* 动效偏好 --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 响应式 ----------------------------------------------------------------- */
@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .wrap { padding: 22px 16px 64px; }
  .card { padding: 20px; }
  .score-ring { width: 150px; height: 150px; }
  .score-ring .val b { font-size: 40px; }
  .stat .v { font-size: 22px; }
  .date-grid { grid-template-columns: 1fr 1fr 1fr; }
}
