:root {
  /* 主色：偏红的紫（重点） */
  --primary: #9d4edd;        /* 红紫，最关键 */
  --primary-dark: #7b2cbf;

  /* 点缀：暖金，不抢戏 */
  --accent: #f2c94c;

  /* 背景：带红感的紫灰 */
  --bg-dark: #2a1437;        /* 紫红夜色 */
  --bg-mid:  #3d1b5a;        /* 法阵紫 */
  --bg-light:#faf7fd;        /* 带粉气的白 */

  /* 卡片 / 字体 */
  --card: #ffffff;
  --text: #2a1f33;           /* 带紫调的深灰 */
  --muted: #7a6e85;
}



/* Reset */
* {
  box-sizing: border-box;
}

body {
  user-select: none;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);

  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(124,58,237,.35), transparent 60%),
    linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 40%, var(--bg-light) 100%);
}

/* ================= 布局 ================= */

.page {
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 1000px;
  padding: 24px;
}

.hero {
  padding: 64px 24px 48px;
  text-align: center;

  background:
    radial-gradient(circle at top, rgba(181,23,158,.25), transparent 60%),
    linear-gradient(180deg, var(--bg-mid), var(--bg-light));

  border-radius: 18px;
  margin-bottom: 24px;   /* 关键：给 TabBar 留空间 */
}

.hero h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
}

.hero-sub {
  margin-top: 12px;
  font-size: 18px;
  color: var(--primary);
}

.hero-sub span {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  opacity: .8;
}


/* ================= 广告位 ================= */

.ad {
  width: 120px;
  margin: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.05));
  backdrop-filter: blur(6px);
  border-radius: 14px;
  color: #aaa;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad.bottom {
  width: 100%;
  height: 90px;
  margin: 40px 0;
}

/* ================= Header ================= */

.site-header {
  text-align: center;
  padding: 70px 20px 50px;
}

.site-header h1 {
  margin: 0;
  font-size: 56px;
  letter-spacing: 4px;
  color: #f5f3ff;
  text-shadow: 0 12px 40px rgba(124,58,237,.6);
}

.subtitle {
  margin-top: 16px;
  font-size: 18px;
  color: #e9d5ff;
}

/* ================= TabBar ================= */

.tabbar {
  position: relative;   /* 防止被覆盖 */
  z-index: 1;

  display: flex;
  gap: 10px;
  justify-content: space-between;

  padding: 10px;
  margin-bottom: 20px;

  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(157,78,221,.15);
}


.tab {
  padding: 10px 22px;
  border-radius: 999px;
  color: var(--primary);
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
}

.tab:hover {
  background: rgba(255,255,255,.12);
}

.tab.active {
  background: linear-gradient(135deg, #f5c542, #fbbf24);
  color: #3b0764;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(245,197,66,.5);
}

/* ================= 内容区 ================= */

.content {
  position: relative;
}

.tool {
  display: none;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.95));
  border-radius: 22px;
  padding: 40px;
  box-shadow:
    0 30px 60px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.6);
}

.tool.active {
  display: block;
}

.tool h2 {
  margin-top: 0;
  font-size: 26px;
  color: var(--primary-dark);
}

.intro {
  margin: 14px 0 24px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

/* ================= 八字表单 ================= */

.bazi-form .row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.label {
  font-weight: 600;
  color: #4c1d95;
}

.datetime-row,
.gender-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Inputs */

input[type="date"],
input[type="time"] {
  padding: 8px 12px;
  font-size: 15px;
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  background: #fff;
  color: #111;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(124,58,237,.18);
}

/* Gender radio */

.gender-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ede9fe;
  cursor: pointer;
  font-size: 14px;
  color: #4c1d95;
}

.gender-option input {
  accent-color: var(--primary);
}

/* ================= 按钮 ================= */

.primary-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(124,58,237,.45);
  transition: all .2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(124,58,237,.55);
}

/* ================= Footer ================= */

.footer {
  margin: 40px 0 20px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

/* ================= 响应式 ================= */

@media (max-width: 900px) {
  .ad {
    display: none;
  }

  .site-header h1 {
    font-size: 42px;
  }

  .tabbar {
    flex-wrap: wrap;
    border-radius: 20px;
  }
}

/* ===== 摇卦 ===== */

.gua-question {
  margin-bottom: 16px;
}

.gua-question label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.gua-question input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.coins {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 24px 0;
}

.coin {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(145deg, #facc15, #eab308);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(0,0,0,.2);
  transition: transform .3s;
}

.coin.flip {
  transform: rotateY(180deg);
}

.gua-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.secondary-btn {
  padding: 8px 20px;
  border-radius: 8px;
  background: #e5e7eb;
  border: none;
  cursor: pointer;
}

.gua-result {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.8;
  text-align: center;
}

/* ===== 摇卦增强 ===== */

.question-row {
  display: flex;
  gap: 10px;
}

.question-row select,
.question-row input {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.coins {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 20px 0;
}

.coin {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at top, #fde68a, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 6px 14px rgba(0,0,0,.2);
  transition: transform .3s;
}

.coin.spin {
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}

.gua-tip {
  text-align: center;
  color: #6b7280;
  margin-bottom: 10px;
}

.gua-lines {
  margin-top: 16px;
  text-align: center;
}

.gua-line {
  font-size: 22px;
  letter-spacing: 6px;
  margin: 4px 0;
}

.yang { color: #7c2d12; }   /* 阳爻 */
.yin  { color: #1e3a8a; }   /* 阴爻 */
.change {
  background: #fde68a;
  border-radius: 6px;
  padding: 2px 6px;
}

.gua-result {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}
/* ===== 每爻铜钱展示 ===== */

.gua-coin-record {
  margin-top: 12px;
  font-size: 14px;
}

.gua-coin-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 6px 0;
}

.yao-index {
  width: 64px;
  color: #6b7280;
  font-size: 13px;
  text-align: right;
  margin-right: 10px;
}

.gua-coin-row .coin-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at top, #fde68a, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.coin-back {
  background: radial-gradient(circle at top, #e5e7eb, #9ca3af);
}

.gua-coin-row .yao-desc {
  margin-left: 8px;
  font-weight: 500;
}

.gua-coin-row .change {
  color: #b45309;
}

/* 卦线放在一行里的样式 */
.gua-line-inline {
  width: 42px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin-right: 4px;
}

.gua-line-inline.yang {
  color: #7c3aed;
}

.gua-line-inline.yin {
  color: #7c3aed;
}

.gua-line-inline.change {
  color: #b45309;
}
.tarot-form {
  margin-bottom: 16px;
}

.tarot-form select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.tarot-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.tarot-cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.tarot-card {
  width: 110px;
  height: 180px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  transition: transform 0.5s;
}

.tarot-card.back::after {
  content: "🂠";
  font-size: 42px;
}

.tarot-card.front {
  background: #fff;
  color: #333;
  border: 2px solid #d946ef;
}

.tarot-result {
  font-size: 15px;
  color: #444;
  margin: 12px 0;
  min-height: 40px;
}

.primary-btn:disabled {
  background: #c4b5fd;   /* 浅紫 */
  color: #fff;
  cursor: not-allowed;
  opacity: 0.6;
}

.primary-btn:not(:disabled):hover {
  opacity: 0.9;
}

.liuyao-panel {
  margin-top: 16px;
}

.liuyao-panel label {
  font-weight: 600;
  margin-right: 8px;
}

.liuyao-method,
.liuyao-time {
  margin-bottom: 12px;
}

.liuyao-panel select,
.liuyao-panel input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.liuyao-result {
  margin-top: 20px;
  background: #fafafa;
  border-radius: 10px;
  padding: 16px;
  font-size: 15px;
}

.liuyao-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.liuyao-line {
  font-family: monospace;
  font-size: 18px;
}

.liuyao-line.yang {
  color: #b91c1c;
}

.liuyao-line.yin {
  color: #1e3a8a;
}

.liuyao-line.change {
  font-weight: bold;
}

.liuyao-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.yao-box {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.yao-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.yao-line {
  font-size: 20px;
  letter-spacing: 2px;
  width: 80px;
}

.yao-desc {
  font-size: 14px;
  color: #555;
}

.yao-select {
  padding: 4px 8px;
}

.knowledge-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: radial-gradient(circle at top, rgba(181,23,158,.25), transparent 60%),
    linear-gradient(180deg, var(--bg-mid), var(--bg-light));;
  border-radius: 12px;
  margin-bottom: 20px;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-logo {
  font-size: 28px;
  font-weight: 600;
  text-decoration: none;
  color: #7b2cbf;
}

.topbar-links a {
  margin-left: 16px;
  text-decoration: none;
  font-size: 16px;
  color: #7b2cbf;
  font-weight: bold;
}

.topbar-links a:hover {
  text-decoration: underline;
}

.hexagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

.hexagram-grid a {
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.hexagram-grid img {
  width: 100%;
  max-width: 100px;
  margin-bottom: 8px;
}

.hexagram-name {
  font-size: 14px;
}

.hexagram-name:hover {
  color: red;
  font-weight: bold;
}

.hexagram-detail {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.95));
  border-radius: 22px;
  padding: 40px;
  box-shadow:
    0 30px 60px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.6);

  display: block;
}

.tarot-grid {
  display: grid;
  /* 自动填充，每张卡片最小 100px */
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
  padding: 20px;
}

.tarot-grid a {
  text-decoration: none;
  color: #333;
  text-align: center;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tarot-grid a:hover {
  transform: translateY(-5px);
}

.tarot-grid img {
  width: 100%;
  max-width: 100px; /* 控制图片不要太大 */
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tarot-name {
  margin-top: 10px;
  font-size: 14px;
  font-weight: bold;
}

.tarot-detail {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.95));
  border-radius: 22px;
  padding: 40px;
  box-shadow:
    0 30px 60px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.6);

  display: block;
}