@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Cinzel:wght@400;500&family=Noto+Serif+SC:wght@300;400&display=swap');

:root {
  /* ── 从图片提取的紫色系 ── */
  --bg-deep:    #9B97CA;   /* 主背景：图片紫 #9B97CA 压暗55% */
  --bg-mid:     #A8ABCA;   /* 卡片底层 */
  --bg-card:    rgba(255,255,255,0.18);   /* 卡片 */
  --bg-hover:   rgba(255,255,255,0.25);   /* 悬浮/激活 */
  --purple-rim: #9B97CA;   /* 图片原色，用于装饰线 */

  /* ── 金色系（保留原有） ── */
  --gold:       #C9A84C;
  --gold-light: #E2C97E;
  --gold-dim:   #8B6E32;
  --gold-mist:  rgba(201,168,76,0.10);

  /* ── 文字色（对比度保证） ── */
  --text-primary:   #FFFFFF;   /* 淡紫白，对比度 9.2:1 ✅ */
  --text-secondary: rgba(255,255,255,0.75);   /* 中紫灰，对比度 4.8:1 ✅ */
  --text-dim:       rgba(255,255,255,0.45);   /* 弱提示，对比度 2.8:1 */

  /* ── 边框 ── */
  --border:      rgba(255,255,255,0.20);   /* 图片原色透明 */
  --border-gold: rgba(201,168,76,0.20);

  /* ── 通用 ── */
  --radius:    14px;
  --radius-lg: 22px;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Serif SC', serif;
  background: #9B97CA;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 哑光质感背景：微噪点 + 柔和渐变 */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: transparent;
  pointer-events: none;
}

/* 噪点纹理 */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
  background-size: 200px;
  pointer-events: none;
}

/* ── Layout ─────────────────────────────────────────── */
.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto;
  padding: 0 0 48px;
}

/* ── Header ─────────────────────────────────────────── */
.header {
  display: flex; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(155,151,202,0.90);
  backdrop-filter: blur(20px) saturate(0.85);
  position: sticky; top: 0; z-index: 100;
}
.header-back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(155,151,202,0.06);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer; color: var(--gold);
  font-size: 18px; text-decoration: none;
  transition: all 0.2s;
}
.header-back:hover { border-color: var(--gold); background: var(--gold-mist); }
.header-title {
  flex: 1; text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 12px; letter-spacing: 3.5px;
  color: var(--gold-light); font-weight: 400;
}
.header-spacer { width: 36px; }

/* ── Divider ────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; margin: 20px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155,151,202,0.25), transparent);
}
.divider-symbol { color: var(--gold); font-size: 13px; flex-shrink: 0; opacity: 0.65; }

/* ── Cards ──────────────────────────────────────────── */
.card {
  margin: 0 16px 14px;
  background: rgba(255,255,255,0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  backdrop-filter: blur(16px) saturate(0.9);
  transition: border-color 0.3s;
}
.card:hover { border-color: var(--border-gold); }
.card-label {
  font-family: 'Cinzel', serif;
  font-size: 9px; letter-spacing: 3px;
  color: #ffffff; text-transform: uppercase; margin-bottom: 6px;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 400;
  color: var(--gold-light); margin-bottom: 4px; letter-spacing: 0.5px;
}
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }

/* ── Info Grid ──────────────────────────────────────── */
.info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 0 16px;
}
.info-item {
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s;
}
.info-item:hover { border-color: var(--border-gold); }
.info-item-label {
  font-size: 9px; letter-spacing: 2px;
  color: #ffffff; text-transform: uppercase; margin-bottom: 5px;
}
.info-item-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; font-weight: 400;
  color: var(--gold-light); line-height: 1.3;
}
.info-item-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ── Nav Buttons ────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 32px); margin: 0 16px 10px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  color: var(--text-primary);
  transition: all 0.25s;
  backdrop-filter: blur(12px);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover, .btn:active {
  border-color: var(--gold);
  background: var(--gold-mist);
  transform: translateY(-1px);
}
.btn-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(155,151,202,0.06);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.btn-text { flex: 1; padding: 0 14px; text-align: left; }
.btn-label {
  font-family: 'Cinzel', serif;
  font-size: 9px; letter-spacing: 2px;
  color: var(--gold-dim); text-transform: uppercase;
}
.btn-name { font-size: 14px; color: var(--text-primary); margin-top: 3px; }
.btn-arrow { color: var(--gold); font-size: 18px; opacity: 0.6; flex-shrink: 0; }
.btn-sub { padding: 13px 16px; }
.btn-sub .btn-name { font-size: 13px; }

/* ── Primary Button ─────────────────────────────────── */
.btn-primary {
  display: block;
  width: calc(100% - 32px); margin: 0 16px;
  padding: 17px;
  background: linear-gradient(135deg, #7A6020 0%, var(--gold) 50%, var(--gold-light) 100%);
  border: none; border-radius: var(--radius);
  font-family: 'Cinzel', serif;
  font-size: 12px; letter-spacing: 3px;
  color: #2A2050;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  font-weight: 500;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); opacity: 1; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ── Forms ──────────────────────────────────────────── */
.form-group { padding: 0 16px; margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 9px; letter-spacing: 2.5px;
  color: #ffffff; text-transform: uppercase;
  margin-bottom: 8px; font-family: 'Cinzel', serif;
}
.form-input {
  width: 100%; padding: 13px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 15px; outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  backdrop-filter: blur(8px);
}
.form-input:focus { border-color: rgba(201,168,76,0.45); }
.form-input::placeholder { color: #ffffff; }

/* ── 滑动选择器 ─────────────────────────────────────── */
.picker-row {
  display: flex; gap: 8px;
  padding: 0 16px; margin-bottom: 14px;
}
.picker-group { flex: 1; min-width: 0; }
.picker-group.wide { flex: 1.6; }

.picker-label {
  display: block;
  font-size: 9px; letter-spacing: 2px;
  color: #ffffff; text-transform: uppercase;
  margin-bottom: 6px; text-align: center;
  font-family: 'Cinzel', serif;
}

.picker-wrap {
  position: relative;
  height: 132px;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

/* 上下渐隐 */
.picker-wrap::before,
.picker-wrap::after {
  content: ''; position: absolute;
  left: 0; right: 0; z-index: 2;
  height: 44px; pointer-events: none;
}
.picker-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(155,151,202,0.95) 0%, transparent 100%);
}
.picker-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(155,151,202,0.95) 0%, transparent 100%);
}

/* 选中高亮区 */
.picker-highlight {
  position: absolute; left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  height: 44px; pointer-events: none; z-index: 1;
  border-top: 1px solid rgba(201,168,76,0.28);
  border-bottom: 1px solid rgba(201,168,76,0.28);
  background: rgba(201,168,76,0.05);
}

.picker-scroll {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 44px 0;
}
.picker-scroll::-webkit-scrollbar { display: none; }

.picker-item {
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; font-weight: 300;
  color: #ffffff;
  transition: color 0.12s, font-size 0.12s;
  cursor: pointer; letter-spacing: 1px;
  user-select: none;
}
.picker-item.selected {
  color: var(--text-primary);
  font-size: 21px;
  font-weight: 400;
}

/* ── Dasha Badge ─────────────────────────────────────── */
.dasha-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(155,151,202,0.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11px; color: var(--gold);
  font-family: 'Cinzel', serif; letter-spacing: 1px;
}

/* ── Analysis Content ───────────────────────────────── */
.analysis-content {
  padding: 4px 16px 16px;
  font-size: 14px; line-height: 2;
  color: var(--text-primary);
}
.analysis-content h1, .analysis-content h2 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--gold-light); margin: 24px 0 10px;
  font-size: 18px; font-weight: 400; letter-spacing: 1px;
}
.analysis-content h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold); margin: 18px 0 8px;
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
}
.analysis-content p { margin-bottom: 12px; color: var(--text-secondary); line-height: 1.95; }
.analysis-content strong { color: var(--text-primary); font-weight: 500; }
.analysis-content em { color: var(--gold-light); font-style: italic; }
.analysis-content blockquote {
  border-left: 2px solid var(--gold);
  padding: 10px 16px; margin: 16px 0;
  background: var(--gold-mist);
  font-style: italic; color: var(--text-secondary);
  border-radius: 0 8px 8px 0;
}
.analysis-content table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 12px; display: block; overflow-x: auto; }
.analysis-content th {
  background: rgba(155,151,202,0.08);
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-family: 'Cinzel', serif; color: var(--gold);
  font-size: 10px; letter-spacing: 1px; white-space: nowrap;
}
.analysis-content td { border: 1px solid var(--border); padding: 8px 10px; color: var(--text-secondary); }

/* ── Loading ─────────────────────────────────────────── */
.loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 56px 20px; gap: 18px;
  min-height: 200px;
}
.spinner {
  width: 38px; height: 38px;
  border: 1.5px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  color: #ffffff !important;
  font-size: 16px !important;
  letter-spacing: 3px;
  font-family: 'Cinzel', serif;
  font-size: 14px; letter-spacing: 3px; color: #2a1a4a;
  font-weight: 600;
}

/* ── Streaming cursor ───────────────────────────────── */
.streaming-cursor {
  display: inline-block; width: 1.5px; height: 1em;
  background: var(--gold); opacity: 0.7;
  animation: blink 0.9s ease-in-out infinite;
  vertical-align: text-bottom; margin-left: 2px;
}
@keyframes blink { 0%,100%{opacity:0.7} 50%{opacity:0} }

/* ── Hero ────────────────────────────────────────────── */
.hero { text-align: center; padding: 44px 20px 28px; }
.hero-mandala { width: 96px; height: 96px; margin: 0 auto 22px; }
.hero-mandala svg { width: 100%; height: 100%; }
.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px; font-weight: 300; font-style: italic;
  color: var(--gold-light); letter-spacing: 6px;
  margin-bottom: 8px;
}
.hero-subtitle { font-size: 11px; color: var(--text-secondary); letter-spacing: 3px; }

/* ── Step Nav ────────────────────────────────────────── */
.step-nav {
  display: flex; gap: 6px; padding: 10px 16px;
  overflow-x: auto; scrollbar-width: none;
}
.step-nav::-webkit-scrollbar { display: none; }
.step-pill {
  flex-shrink: 0; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 100px;
  font-size: 10px; letter-spacing: 1px;
  color: #ffffff; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
  background: rgba(255,255,255,0.10);
  font-family: 'Cinzel', serif;
}
.step-pill.active {
  border-color: var(--gold); color: var(--gold);
  background: var(--gold-mist);
}

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(201,168,76,0.88);
  backdrop-filter: blur(10px);
  color: #2A2050;
  padding: 10px 22px; border-radius: 100px;
  font-family: 'Cinzel', serif;
  font-size: 11px; letter-spacing: 2px;
  transition: transform 0.3s ease; z-index: 999;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Fade in ─────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.45s ease forwards; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

/* ── Error card ─────────────────────────────────────── */
.error-card {
  margin: 20px 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(180,80,80,0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
}

@media (max-width: 360px) {
  .hero-title { font-size: 24px; }
  .info-grid { grid-template-columns: 1fr; }
  .picker-item { font-size: 15px; }
  .picker-item.selected { font-size: 18px; }
}
