:root {
  --brand: #6B5BFF;
  --brand-deep: #4A3DD9;
  --brand-light: #B8AEFF;
  --paper: #F6F4FB;
  --paper-deep: #EFEAF8;
  --ink: #1A1535;
  --ink-soft: #4B4566;
  --ink-mute: #8B86A8;
  --accent-blue: #7BB7FF;
  --accent-pink: #FF9FCB;
  --glass-bg: rgba(255,255,255,0.7);
  --glass-border: rgba(255,255,255,0.9);
  --glass-shadow: 0 24px 60px rgba(107,91,255,0.12), 0 8px 20px rgba(74,61,217,0.06);
  --radius: 24px;
  --radius-sm: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 1400px 900px at 80% 10%, rgba(123,183,255,0.16), transparent 60%),
    radial-gradient(ellipse 1200px 800px at 10% 80%, rgba(255,159,203,0.12), transparent 60%),
    radial-gradient(ellipse 800px 600px at 50% 50%, rgba(107,91,255,0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: 80px 0 48px;
}
.hero .brand-en {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 28px;
  color: var(--brand);
  letter-spacing: 0.02em;
}
.hero h1 {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 16px;
  line-height: 1.15;
}
.hero h1 .accent { color: var(--brand); }
.hero .subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto;
}

/* ========== Glass Card ========== */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 36px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--glass-shadow);
  margin-bottom: 28px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.section-title .accent { color: var(--brand); }
.section-sub {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
  display: block;
}

/* ========== Input Form ========== */
.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 120px;
}
.form-group label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.form-group input,
.form-group select {
  padding: 12px 16px;
  border: 1.5px solid rgba(107,91,255,0.2);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.8);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(107,91,255,0.12);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(107,91,255,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(107,91,255,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1.5px dashed rgba(107,91,255,0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--brand);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  margin-bottom: 16px;
  transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(107,91,255,0.06); }

#partnerInput {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
#partnerInput.show { max-height: 600px; }

/* ========== Result Sections ========== */
#resultSection, #compatSection {
  display: none;
}
#resultSection.show, #compatSection.show {
  display: block;
  animation: fadeUp 0.5s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Pillars (连体 Grid · 紫色玻璃风 · B 结构 + A 动效) ========== */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 16px 48px rgba(107, 91, 255, 0.1);
  overflow: hidden;
}

.pillar-col {
  padding: 36px 20px 28px;
  text-align: center;
  position: relative;
  transition: background 0.3s;
}
.pillar-col:not(:last-child) {
  border-right: 1px solid rgba(107, 91, 255, 0.08);
}
.pillar-col:hover {
  background: rgba(107, 91, 255, 0.03);
}
.pillar-col:hover .pillar-gan {
  text-shadow: 0 0 24px currentColor;
}

/* 日柱 — 只用顶部紫色条区分，不改背景 */
.pillar-day {
  position: relative;
}
.pillar-day::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
}
.pillar-day-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  background: rgba(107, 91, 255, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(107, 91, 255, 0.2);
}

.pillar-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.pillar-day .pillar-name { color: var(--ink-mute); }

/* 时间标注 — 阳历+农历双行 */
.pillar-time {
  margin-bottom: 14px;
  line-height: 1.4;
}
.pillar-time-solar {
  display: block;
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.pillar-time-lunar {
  display: block;
  font-family: 'Noto Serif SC', serif;
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
}

.pillar-ganZhi {
  margin-bottom: 20px;
  position: relative;
}
.pillar-gan {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 80px;
  font-weight: 400;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
  transition: text-shadow 0.4s;
}
.pillar-zhi {
  font-family: 'Noto Serif SC', serif;
  font-size: 52px;
  font-weight: 900;
  color: var(--ink);
  display: block;
  letter-spacing: 0.08em;
}

/* 信息区 */
.pillar-info {
  border-top: 1px solid rgba(107, 91, 255, 0.1);
  padding-top: 14px;
  margin-bottom: 8px;
}
.pillar-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
}
.pillar-info-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.pillar-info-value {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}
.pillar-info-value[data-element="木"] { color: #2E7D32; }
.pillar-info-value[data-element="火"] { color: #C75B39; }
.pillar-info-value[data-element="土"] { color: #7A5C3A; }
.pillar-info-value[data-element="金"] { color: #8B6914; }
.pillar-info-value[data-element="水"] { color: #2B5F7E; }
.pillar-ss { color: var(--brand) !important; }
.pillar-day .pillar-ss { color: var(--brand) !important; }

.pillar-nayin {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: 4px;
}

/* 人话翻译 — 核心差异化 */
.pillar-oneliner {
  margin-top: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(107, 91, 255, 0.06) 0%, rgba(184, 174, 255, 0.08) 100%);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  border-left: 2px solid var(--brand-light);
}
/* 日柱 oneliner 跟其他柱一致，不特殊强调 */

/* ========== Profile ========== */
.profile-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
}
.profile-icon-box {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: 0 16px 36px rgba(107,91,255,0.3);
}
.profile-style {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 4px;
}
.profile-element-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: inline-block;
}
.profile-desc {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 16px;
  line-height: 1.65;
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.profile-tag {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.profile-tag.need { background: rgba(76,175,80,0.12); color: #2E7D32; }
.profile-tag.risk { background: rgba(255,152,0,0.12); color: #E65100; }
.profile-tag.strength { background: rgba(107,91,255,0.12); color: var(--brand-deep); }
.spousal-note {
  font-size: 14px;
  color: var(--ink-soft);
  padding: 12px 16px;
  background: rgba(107,91,255,0.06);
  border-left: 3px solid var(--brand);
  border-radius: 4px 12px 12px 4px;
  margin-top: 8px;
}

/* ========== K-Line ========== */
.chart-wrapper {
  position: relative;
  height: 320px;
  margin: 20px 0;
}
.kline-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.kline-stat {
  padding: 12px 20px;
  background: rgba(107,91,255,0.08);
  border-radius: var(--radius-sm);
  text-align: center;
  flex: 1;
  min-width: 120px;
}
.kline-stat.high { background: rgba(76,175,80,0.1); }
.kline-stat.attention { background: rgba(255,152,0,0.1); }
.kline-stat-num {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
}
.kline-stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

/* ========== Da Yun ========== */
.dayun-timeline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.dayun-item {
  flex-shrink: 0;
  text-align: center;
  padding: 12px 18px;
  background: rgba(244,240,255,0.6);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(107,91,255,0.1);
  min-width: 80px;
}
.dayun-age {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.dayun-gz {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

/* ========== Paywall ========== */
.paywall-overlay {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(180deg, rgba(246,244,251,0) 0%, rgba(246,244,251,0.95) 30%, var(--paper) 100%);
  margin-top: -60px;
  position: relative;
  z-index: 2;
}
.paywall-overlay h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}
.paywall-overlay .price {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 48px;
  color: var(--brand);
  margin-bottom: 8px;
}
.paywall-overlay .includes {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.btn-unlock {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 48px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(107,91,255,0.35);
  transition: transform 0.15s;
}
.btn-unlock:hover { transform: translateY(-2px); }

#premiumContent {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  transition: filter 0.4s;
}
#premiumContent.unlocked {
  filter: none;
  pointer-events: auto;
  user-select: auto;
}

/* ========== Compatibility ========== */
.compat-score-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
}
.compat-score-inner {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.compat-score-num {
  font-size: 42px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}
.compat-score-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.compat-summary-text {
  text-align: center;
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.compat-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 14px;
  color: var(--ink-soft);
}
.compat-detail.positive .compat-icon { color: #4CAF50; }
.compat-detail.negative .compat-icon { color: #FF9800; }
.compat-detail.neutral .compat-icon { color: var(--brand); }
.compat-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }

/* ========== Disclaimer ========== */
.disclaimer {
  text-align: center;
  padding: 48px 24px 64px;
  font-size: 13px;
  color: var(--ink-mute);
  max-width: 600px;
  margin: 0 auto;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 12px 40px rgba(107,91,255,0.4);
  z-index: 1000;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== Da Yun Cards (new) ========== */
.dayun-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dayun-card {
  padding: 20px 24px;
  background: rgba(244,240,255,0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(107,91,255,0.1);
  border-left: 3px solid rgba(107,91,255,0.2);
  transition: all 0.25s;
}
.dayun-card:hover { transform: translateX(4px); }
.dayun-current {
  background: linear-gradient(135deg, rgba(107,91,255,0.1) 0%, rgba(184,174,255,0.15) 100%);
  border-left: 4px solid var(--brand);
  box-shadow: 0 8px 24px rgba(107,91,255,0.12);
}
.dayun-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.dayun-age-range {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.dayun-gz-tag {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
}
.dayun-now-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--brand);
  padding: 3px 10px;
  border-radius: 999px;
}
.dayun-keyword {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}
.dayun-current .dayun-keyword { color: var(--brand-deep); }
.dayun-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ========== AI Report ========== */
.ai-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0;
  color: var(--brand);
  font-weight: 600;
}
.ai-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(107,91,255,0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ai-report-content {
  line-height: 1.75;
  color: var(--ink-soft);
  font-size: 15px;
}
.ai-report-content h3.ai-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 28px 0 10px;
  padding-left: 16px;
  border-left: 3px solid var(--brand);
}
.ai-report-content h3.ai-section-title:first-child { margin-top: 0; }
.ai-report-content p { margin-bottom: 12px; }
.ai-report-content strong { color: var(--brand-deep); }

.ai-error {
  padding: 20px;
  background: rgba(255,152,0,0.08);
  border-left: 3px solid #FF9800;
  border-radius: 4px 12px 12px 4px;
  font-size: 14px;
  color: var(--ink-soft);
}
.ai-error code {
  display: inline-block;
  background: rgba(0,0,0,0.06);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  margin: 8px 0;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .hero { padding: 56px 0 32px; }
  .hero h1 { font-size: 32px; }
  .hero .subtitle { font-size: 16px; }
  .glass-card { padding: 24px 20px; border-radius: 18px; }
  .section-title { font-size: 22px; }
  .pillars-grid { grid-template-columns: 1fr 1fr; }
  .pillars-grid { grid-template-columns: 1fr 1fr; }
  .pillar-col:nth-child(2) { border-right: none; }
  .pillar-col:nth-child(1), .pillar-col:nth-child(2) { border-bottom: 1px solid rgba(107, 91, 255, 0.08); }
  .pillar-col { padding: 28px 16px 22px; }
  .pillar-gan { font-size: 56px; }
  .pillar-zhi { font-size: 38px; }
  .pillar-oneliner { font-size: 11px; padding: 8px 10px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-icon-box { width: 72px; height: 72px; font-size: 36px; border-radius: 18px; }
  .chart-wrapper { height: 240px; }
  .form-row { flex-direction: column; }
  .form-group { min-width: 100%; }
  .kline-summary { flex-direction: column; }
  .dayun-timeline { gap: 8px; }
  .dayun-item { min-width: 64px; padding: 10px 12px; }
  .compat-score-ring { width: 130px; height: 130px; }
  .compat-score-inner { width: 100px; height: 100px; }
  .compat-score-num { font-size: 34px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 26px; }
  .pillar-gan { font-size: 28px; }
  .pillar-zhi { font-size: 24px; }
}
