/* style.css — 今日玄机：深紫金神秘主题 */

:root {
  --bg: #0d0a1a;
  --bg-2: #141024;
  --card: rgba(24, 18, 44, 0.72);
  --card-solid: #1a1430;
  --line: rgba(212, 175, 55, 0.28);
  --line-strong: rgba(212, 175, 55, 0.55);
  --gold: #d4af37;
  --gold-bright: #f0d878;
  --gold-dim: #8a7634;
  --ink: #e8dfc8;
  --ink-2: #b8ac91;
  --ink-3: #8d8398;
  --danger: #c96a6a;
  --serif: "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "SimSun", "Songti SC", serif;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#stars {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, transparent 40%, rgba(5, 3, 12, 0.75) 100%);
}

#app { position: relative; z-index: 2; }

/* ── 屏幕切换 ─────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 40px;
  max-width: 640px;
  margin: 0 auto;
}
.screen.active { display: flex; animation: screenIn 0.55s ease both; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 开屏 ─────────────────────────────────────────────── */
.intro-emblem { width: 210px; height: 210px; margin-bottom: 26px; }
.intro-emblem svg { animation: spin 60s linear infinite; filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.25)); }

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

.brand {
  font-size: 44px;
  letter-spacing: 14px;
  text-indent: 14px; /* 平衡字距 */
  font-weight: 600;
  color: var(--gold);
  text-shadow: 0 0 26px rgba(212, 175, 55, 0.35);
}
.brand-sub {
  margin-top: 14px;
  font-size: 15px;
  letter-spacing: 5px;
  color: var(--ink-2);
}
.brand-tag {
  margin-top: 8px;
  font-size: 12.5px;
  letter-spacing: 2px;
  color: var(--ink-3);
}
#btn-start { margin-top: 44px; }
.privacy-note {
  margin-top: 26px;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--ink-3);
}

/* ── 屏幕标题 ─────────────────────────────────────────── */
.screen-title {
  font-size: 26px;
  letter-spacing: 10px;
  text-indent: 10px;
  color: var(--gold);
  margin-bottom: 10px;
}
.screen-desc { font-size: 13.5px; color: var(--ink-2); letter-spacing: 1px; margin-bottom: 26px; text-align: center; }

/* ── 按钮 ─────────────────────────────────────────────── */
.btn {
  font-family: var(--serif);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  letter-spacing: 4px;
  text-indent: 4px;
  transition: all 0.25s ease;
  border-radius: 3px;
}
.btn-lg { padding: 14px 46px; font-size: 17px; }
.btn-primary {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(212, 175, 55, 0.06));
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.12), inset 0 0 12px rgba(212, 175, 55, 0.05);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.12));
  box-shadow: 0 0 26px rgba(212, 175, 55, 0.3);
  transform: translateY(-1px);
}
.btn-gold {
  background: linear-gradient(135deg, #d4af37, #b3902a);
  color: #17110a;
  font-weight: 600;
  padding: 12px 30px;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.35);
}
.btn-block { width: 100%; padding: 13px; font-size: 16px; margin-top: 6px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.link-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--serif);
  color: var(--ink-3);
  font-size: 12.5px;
  letter-spacing: 1px;
  border-bottom: 1px dashed transparent;
  padding: 2px 0;
}
.link-btn:hover { color: var(--gold); border-bottom-color: var(--line); }
.link-btn.danger:hover { color: var(--danger); }

/* ── 档案表单 ─────────────────────────────────────────── */
.profile-existing { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}
.form-card { width: 100%; padding: 26px 24px; }

.field { flex: 1; display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { margin-bottom: 0; }
.field-row { margin-bottom: 16px; }
.field label {
  font-size: 12.5px;
  letter-spacing: 3px;
  color: var(--ink-2);
}
.field label .opt { font-style: normal; font-size: 10.5px; color: var(--ink-3); letter-spacing: 1px; }
.field input, .field select {
  font-family: var(--serif);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 15px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus, .field select:focus { border-color: var(--line-strong); }
.field select option { background: var(--card-solid); }
.field-hint { font-size: 11px; color: var(--ink-3); letter-spacing: 0.5px; margin: 4px 0 18px; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg-btn {
  flex: 1; padding: 10px 0;
  background: transparent; border: none;
  color: var(--ink-3); font-family: var(--serif);
  font-size: 14px; cursor: pointer; letter-spacing: 2px;
  transition: all 0.2s;
}
.seg-btn.active { background: rgba(212, 175, 55, 0.18); color: var(--gold); }

/* ── 体系选择 ─────────────────────────────────────────── */
.system-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; margin-bottom: 18px; }
.system-card {
  font-family: var(--serif);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 8px 16px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: all 0.25s ease;
  color: var(--ink-2);
  backdrop-filter: blur(8px);
}
.system-card .sys-glyph { width: 74px; height: 74px; opacity: 0.55; transition: opacity 0.25s; }
.system-card .sys-glyph svg { width: 100%; height: 100%; }
.sys-name { font-size: 19px; letter-spacing: 6px; text-indent: 6px; color: var(--ink); }
.sys-sub { font-size: 10px; letter-spacing: 1px; color: var(--ink-3); }
.system-card[aria-pressed="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.22), inset 0 0 16px rgba(212, 175, 55, 0.08);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.10), rgba(24, 18, 44, 0.72));
}
.system-card[aria-pressed="true"] .sys-glyph { opacity: 1; }
.system-card[aria-pressed="true"] .sys-name { color: var(--gold); }
#btn-systems { margin-top: 4px; }
#systems-hint.error { color: var(--danger); }

/* ── 抽牌 ─────────────────────────────────────────────── */
.draw-row { display: flex; gap: 18px; justify-content: center; margin-top: 8px; }
.tarot-back {
  width: 108px; height: 182px;
  background: none; border: none; padding: 0;
  cursor: pointer;
  perspective: 700px;
  border-radius: 10px;
  transition: transform 0.25s ease;
}
.tarot-back:not(.opened):hover { transform: translateY(-8px); }
.tarot-back-face, .tarot-front-face {
  display: none; /* 已由 .inner/.face 结构取代 */
}
.tarot-back .inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.1, 0.2, 1);
}
.tarot-back.opened .inner { transform: rotateY(180deg); }
.tarot-back .face {
  position: absolute; inset: 0;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}
.tarot-back .face-front svg { display: block; width: 100%; height: 100%; }
.tarot-back .face-back { transform: rotateY(180deg); }
.tarot-back .face-back svg, .tarot-back .face-back img { display: block; width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.tarot-back.voided { opacity: 0.3; pointer-events: none; }
.tarot-back.chosen { transform: scale(1.06); }

/* ── 结果页 ───────────────────────────────────────────── */
.screen-result { justify-content: flex-start; padding-top: 54px; }
.result-head { text-align: center; margin-bottom: 26px; }
.result-date { font-size: 13px; letter-spacing: 3px; color: var(--ink-2); }
.result-emblem { width: 120px; height: 120px; margin: 16px auto 12px; }
.result-emblem svg { animation: spin 80s linear infinite; filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.2)); }
.r-gz { font-size: 14px; letter-spacing: 3px; color: var(--ink-2); }
.r-overall { margin-top: 16px; font-size: 26px; letter-spacing: 3px; color: var(--gold); text-shadow: 0 0 18px rgba(212, 175, 55, 0.4); }
.r-message { margin-top: 12px; font-size: 14px; color: var(--ink-2); letter-spacing: 1px; max-width: 420px; line-height: 1.8; }

.module { width: 100%; padding: 22px 20px; margin-bottom: 18px; }
.module-title {
  font-size: 15px; letter-spacing: 6px; color: var(--gold);
  margin-bottom: 16px; font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.module-reason { margin-top: 14px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; letter-spacing: 0.5px; }

/* 体系模块通用 */
.module .sys-tag {
  display: inline-block; font-size: 10.5px; letter-spacing: 2px;
  color: var(--gold-dim); border: 1px solid var(--line);
  border-radius: 3px; padding: 2px 8px; margin-bottom: 12px;
}

/* 塔罗牌结果 */
.tarot-result { display: flex; gap: 20px; align-items: center; }
.tarot-result .card-img { width: 108px; height: 182px; flex-shrink: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.tarot-result .card-img img, .tarot-result .card-img svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.tarot-result .card-info { flex: 1; }
.tarot-result .card-name { font-size: 21px; letter-spacing: 4px; color: var(--gold); }
.tarot-result .card-ori { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; letter-spacing: 2px; }
.tarot-result .card-kw { font-size: 13px; color: var(--ink); margin-top: 10px; letter-spacing: 1px; }
.tarot-result .card-txt { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.75; }

/* 星座/周易 */
.zhouyi-pillars { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pillar {
  text-align: center; min-width: 58px;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 6px;
  background: rgba(212, 175, 55, 0.04);
}
.pillar .p-label { font-size: 10px; color: var(--ink-3); letter-spacing: 2px; }
.pillar .p-gz { font-size: 18px; color: var(--gold); margin-top: 4px; letter-spacing: 2px; }
.pillar .p-wx { font-size: 10px; color: var(--ink-3); margin-top: 3px; }
.zhouyi-info { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.zhouyi-info b { color: var(--gold); font-weight: 600; }

.astro-line { font-size: 15px; color: var(--ink); letter-spacing: 2px; }
.astro-line .sym { font-size: 22px; color: var(--gold); margin-right: 6px; }
.astro-detail { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.astro-detail b { color: var(--gold); font-weight: 600; }

/* 四维 */
.dims-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dim-cell { border: 1px solid var(--line); border-radius: 8px; padding: 14px 14px 12px; background: rgba(212, 175, 55, 0.03); }
.dim-name { font-size: 13px; letter-spacing: 4px; color: var(--ink-2); }
.dim-stars { margin-top: 8px; font-size: 15px; letter-spacing: 3px; }
.dim-stars .on { color: var(--gold); }
.dim-stars .off { color: rgba(212, 175, 55, 0.22); }
.dim-txt { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* 穿衣 */
.color-row { display: flex; gap: 14px; }
.color-chip { flex: 1; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.color-swatch {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.08), inset 0 0 8px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.color-meta .c-role { font-size: 10px; letter-spacing: 2px; color: var(--ink-3); }
.color-meta .c-name { font-size: 16px; color: var(--ink); margin-top: 3px; letter-spacing: 1px; }
.color-meta .c-wx { font-size: 10.5px; color: var(--gold-dim); margin-top: 2px; }

/* 食物 */
.food-item { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px dashed rgba(212, 175, 55, 0.15); }
.food-item:last-child { border-bottom: none; }
.food-name { font-size: 16.5px; color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
.food-type { font-size: 10px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; white-space: nowrap; }
.food-desc { font-size: 12px; color: var(--ink-2); line-height: 1.6; }

/* 宜忌 */
.yiji-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.yiji-col ul { list-style: none; margin-top: 10px; }
.yiji-col li { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; padding: 5px 0; letter-spacing: 0.5px; }
.yiji-badge {
  display: inline-block; font-size: 15px; letter-spacing: 6px; text-indent: 6px;
  color: #9ec99b; border: 1px solid rgba(158, 201, 155, 0.4);
  border-radius: 4px; padding: 3px 10px;
}
.ji-badge { color: #c99b9b; border-color: rgba(201, 155, 155, 0.4); }

/* 吉数 */
.lucky-row { display: flex; gap: 14px; }
.lucky-num {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: var(--gold);
  background: radial-gradient(circle at 35% 30%, rgba(212, 175, 55, 0.15), transparent);
}

/* 页脚 */
.result-footer { text-align: center; padding: 10px 0 30px; }
.result-footer .dot { color: var(--ink-3); margin: 0 10px; font-size: 12px; }
.result-footer .privacy-note { margin-top: 16px; }

/* ── 响应式 ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .brand { font-size: 34px; letter-spacing: 10px; text-indent: 10px; }
  .intro-emblem { width: 170px; height: 170px; }
  .system-grid { gap: 10px; }
  .sys-name { font-size: 16px; letter-spacing: 3px; text-indent: 3px; }
  .system-card .sys-glyph { width: 58px; height: 58px; }
  .tarot-back { width: 88px; height: 150px; }
  .dims-grid { grid-template-columns: 1fr; }
  .field-row { flex-wrap: wrap; }
  .field-row .field { min-width: calc(50% - 6px); }
  .draw-row { gap: 12px; }
}
