/* ===== 基础变量 ===== */
:root {
  --primary: #6b4c2a;
  --primary-light: #8b6340;
  --primary-dark: #4a3520;
  --accent: #d4a853;
  --accent-light: #e8c878;
  --bg-dark: #1a1410;
  --bg-card: #2a2018;
  --bg-card-hover: #352a20;
  --text: #f5f0e8;
  --text-muted: #a09080;
  --border: #3d3028;
  --gold: #d4a853;
  --success: #4caf50;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ===== 头部 ===== */
.site-header {
  background: rgba(26, 20, 16, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.logo {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent);
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--bg-card);
}

.ad-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--success);
}

.ad-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ===== 英雄区 ===== */
.hero {
  position: relative;
  padding: 80px 0;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(107,76,42,0.3) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.3;
  margin-bottom: 16px;
  font-weight: 700;
}

.highlight { color: var(--accent); }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--text);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,168,83,0.3);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-large { padding: 16px 36px; font-size: 1.1rem; }

/* ===== 统计栏 ===== */
.stats-bar {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}

.stat-num { font-size: 1.8rem; font-weight: bold; color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ===== 分类区块 ===== */
.category-section {
  padding: 40px 0 0;
}

.section-title {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 8px;
  color: var(--accent);
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px 20px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn:hover { color: var(--text); }

/* ===== 占卜区块 ===== */
.fortune-section {
  display: none;
  padding: 32px 0 48px;
}

.fortune-section.active { display: block; }

/* ===== 表单 ===== */
.divination-form, .ziwei-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 600px;
  margin: 0 auto 24px;
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

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

.chip {
  padding: 6px 14px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.chip.active, .chip:hover {
  background: var(--primary);
  border-color: var(--accent);
  color: var(--text);
}

.btn-coin {
  width: 100%;
  font-size: 1.2rem;
  padding: 18px;
  background: linear-gradient(135deg, #6b4c2a, #8b6340);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 10px rgba(212,168,83,0.2); }
  to { box-shadow: 0 0 25px rgba(212,168,83,0.5); }
}

/* ===== 硬币动画 ===== */
.coin-area {
  text-align: center;
  padding: 32px 0;
  max-width: 600px;
  margin: 0 auto;
}

.coin-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.coin {
  width: 70px; height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--bg-dark);
  transition: all 0.3s;
  cursor: default;
}

.coin_heads { background: linear-gradient(135deg, #d4a853, #8b6340); }
.coin_tails { background: linear-gradient(135deg, #888, #555); }

.coin.flipping {
  animation: coinFlip 0.6s ease-out;
}

@keyframes coinFlip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(900deg); }
  100% { transform: rotateY(1800deg); }
}

.coin-hint {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.hexagram-result {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ===== 广告区 ===== */
.ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ad-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 400px;
  width: 100%;
  overflow: hidden;
}

.ad-header {
  background: var(--primary-dark);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.ad-content { padding: 24px; text-align: center; }

.ad-sim-box {
  background: linear-gradient(135deg, #2a1a10, #3a2a18);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.ad-banner {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.ad-timer {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
  margin-top: 12px;
}

.ad-card .btn { width: calc(100% - 48px); margin: 0 24px 24px; }

/* ===== 结果区 ===== */
.result-area {
  max-width: 600px;
  margin: 0 auto;
}

.result-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  max-height: 200px;
  overflow: hidden;
  position: relative;
}

.result-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-card));
}

.result-locked {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.lock-icon { font-size: 2.5rem; margin-bottom: 12px; }

.result-full {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
  line-height: 1.9;
  font-size: 0.95rem;
}

.result-full h3 { color: var(--accent); margin-bottom: 12px; font-size: 1.2rem; }
.result-full h4 { color: var(--accent-light); margin: 16px 0 8px; font-size: 1rem; }
.result-full p { margin-bottom: 8px; }

/* ===== 每日运势卡片 ===== */
.daily-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 24px;
}

.daily-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
  text-align: left;
}

.daily-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.daily-icon { font-size: 2rem; }

.daily-name { font-weight: 600; font-size: 1rem; }
.daily-desc { font-size: 0.85rem; color: var(--text-muted); }

/* ===== 专项占卜卡片 ===== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 24px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
  gap: 8px;
}

.topic-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.topic-icon { font-size: 2.2rem; }
.topic-name { font-weight: 600; font-size: 0.95rem; }
.topic-desc { font-size: 0.8rem; color: var(--text-muted); }

.topic-form {
  max-width: 600px;
  margin: 0 auto 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ===== 占卜记录 ===== */
.records-section { padding: 32px 0 48px; }

.records-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.records-empty {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
}

.records-empty p { margin-bottom: 16px; }

.record-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.record-item:last-child { border-bottom: none; }
.record-icon { font-size: 1.8rem; }
.record-info { flex: 1; }
.record-type { font-weight: 600; font-size: 0.95rem; }
.record-question { font-size: 0.85rem; color: var(--text-muted); }
.record-time { font-size: 0.8rem; color: var(--text-muted); }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-disclaimer { font-size: 0.8rem; color: #706050; margin-top: 4px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 0.95rem;
  z-index: 2000;
  box-shadow: var(--shadow);
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 20px; gap: 10px; }
  .main-nav { order: 3; width: 100%; }
  .ad-badge { margin-left: 0; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-row .form-group:last-child { grid-column: span 2; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .daily-options { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 48px 0; }
  .hero-actions { flex-direction: column; align-items: center; }
}
