: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;
}

.bazi-title { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.bazi-pillars { display: inline-flex; gap: 12px; letter-spacing: .04em; }
.bazi-gender { margin-left: 2px; font-size: .72em; font-weight: 400; white-space: nowrap; }

.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;
}

.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;
}

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

.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-coin 0.6s linear infinite;
}

@keyframes spin-coin {
  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%;
  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%;
  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;
}
.month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.calendar-grid .day-cell {
  border: 1px solid #eee;
  padding: 10px;
  text-align: center;
  cursor: pointer;
}

.calendar-grid .day-cell:hover {
  background: #f8f9fa;
}

.calendar-grid .day-cell.today {
  background-color: #fff7e6;
  border: 2px solid #fa8c16 !important;
  position: relative;
}

.calendar-grid .day-cell.today::after {
  content: "今";
  position: absolute;
  top: 0;
  right: 0;
  background: #fa8c16;
  color: #fff;
  font-size: 10px;
  padding: 0 4px;
}

.day-cell.active {
  background: #e6f7ff;
  border-color: #1890ff !important;
}

.lunar-text {
  font-size: 0.75em;
  color: #888;
  margin-top: 4px;
}

.almanac-detail {
  margin-top: 25px;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d9d9d9;
}

.almanac-row {
  display: flex;
  margin: 15px 0;
  gap: 10px;
}

.box {
  flex: 1;
  padding: 15px;
  border-radius: 8px;
}

.box-yi {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #52c41a;
}

.box-ji {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  color: #f5222d;
}

.label {
  font-weight: bold;
  font-size: 1.2em;
  display: block;
  margin-bottom: 5px;
}

.day-detail {
  border-bottom: 2px solid #333;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.sub-detail {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  font-size: 0.9em;
  display: flex;
  justify-content: space-between;
}

.today-bazi {
  margin: 5px 0;
  color: #666;
}

.row-box{
  display: flex;
  align-items: center;
}
/* 按钮基础样式 */
.btn-simple {
  margin-left: 10px;
  cursor: pointer;
  background: #fff;
  border: none;
  font-size: 14px;
  padding-top: 6px;
}

.day-nav{
  display: flex;
  justify-content: space-between;
}

    /* 卦象特有样式 */
    .gua-display { display: flex; justify-content: center; align-items: center; gap: 40px; margin: 30px 0; }
    .gua-box { text-align: center; }
    
    /* 卦画线条样式 */
    .gua-display .gua-lines { display: flex; flex-direction: column-reverse; gap: 4px; width: 60px; margin: 0 auto 10px; }
    .gua-display .line { width: 60px; height: 8px; background: #333; position: relative; }
    .gua-display .line.yin { display: flex; gap: 8px; background: transparent; }
    .gua-display .line.yin span { display: block; flex: 1 1 0; height: 8px; background: #333; }
    .gua-display .line.moving::after { content: "×"; position: absolute; right: -25px; top: -8px; color: #e74c3c; font-size: 24px; font-weight: bold; }
    
    .gua-name { font-size: 1.4em; font-weight: bold; color: #8e44ad; margin-top: 5px; }
    .gua-tag { font-size: 0.85em; color: #666; background: #eee; padding: 2px 8px; border-radius: 4px; }
    
    #loading-overlay { text-align: center; padding: 100px 20px; font-style: italic; color: #8e44ad; }
    .hidden { display: none; }
    .summary-box { background: #fdfaf4; border-left: 5px solid #8e44ad; padding: 15px; margin-top: 20px; font-weight: bold; }
        .card-flex { display: flex; justify-content: space-around; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
    .card-item { width: 100px; text-align: center; }
    .card-pic { 
        width: 100%; height: 150px; background: #2c3e50; border-radius: 6px; 
        border: 2px solid #d4af37; display: flex; align-items: center; 
        justify-content: center; color: #d4af37; font-size: 0.9em; margin-bottom: 5px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: transform 0.3s;
    }
    .reversed { transform: rotate(180deg); }
    .tag { display: inline-block; padding: 2px 8px; background: #f2eef7; color: #8e44ad; border-radius: 10px; font-size: 0.75em; }
    #loading-overlay { text-align: center; padding: 50px; font-style: italic; color: #8e44ad; }
    .hidden { display: none; }
     body { font-family: 'STKaiti', 'Kaiti', serif; background-color: #fdfaf4; padding: 10px; margin: 0; }
        .container { background: #fff; border: 2px solid #8e44ad; border-radius: 12px; padding: 20px; max-width: 900px; margin: auto; }
        
        /* 基础信息 */
        .header-info { gap: 8px; background: #f8f9fa; padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 1.2em; border-left: 5px solid #8e44ad; }
        .header-full { grid-column: 1 / -1; }
        
        /* 卦画线条样式 */
        .line-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; }
        .yang { width: 50px; height: 5px; background: #333; margin: 3px 0; }
        .yin { width: 50px; height: 5px; display: flex; justify-content: space-between; margin: 3px 0; }
        .yin span { width: 22px; height: 5px; background: #333; }

        /* 通用表格样式 */
        table { width: 100%; border-collapse: collapse; margin-bottom: 20px; text-align: center; }
        th { background: #f2eef7; color: #5b2c6f; padding: 8px; border: 1px solid #ddd; font-size: 0.9em; }
        td { padding: 10px 5px; border: 1px solid #eee; font-size: 1.1em; }
        .shi { color: #e74c3c; font-weight: bold; }
        .ying { color: #3498db; font-weight: bold; }
        .moving { color: #e67e22; font-weight: bold; font-size: 1.2em; }

        /* --- 响应式逻辑 --- */

        /* 1. 默认：隐藏移动端专用表 */
        .mobile-only { display: none; }
        .gua-title-mobile { display: none; }

        /* 2. PC端样式：并排显示 */
        .pc-table { display: table; }
        .gua-title-pc { 
            display: flex; justify-content: space-between; padding: 10px 30px; 
            background: #8e44ad; color: white; border-radius: 8px; margin-bottom: 15px; 
        }

        /* 3. 移动端适配：屏幕小于 768px 时切换 */
        @media (max-width: 768px) {
            .pc-table, .gua-title-pc { display: none; } /* 隐藏大表 */
            
            .mobile-only { display: table; margin-top: 10px; } /* 显示独立表 */
            .gua-title-mobile { 
                display: block; background: #8e44ad; color: white; 
                padding: 8px; border-radius: 6px; text-align: center; margin: 20px 0 10px 0;
            }
            td, th { font-size: 0.95em; padding: 8px 2px; }
            .line-wrap .yang, .line-wrap .yin { width: 40px; } /* 缩小线条 */
            .line-wrap .yin span { width: 18px; }
        }
        /* 变爻高亮样式 */
        .highlight-row {
            background-color: #fff9c4 !important; /* 浅黄色背景 */
        }
        /* 如果你想让变爻的纳甲文字也变色 */
        .highlight-row .lq-text {
            color: #d35400; 
        }
        body {
  margin: 0;
  padding: 0;
  background: #f5f6f8;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #222;
}

#app {
  max-width: 1000px;     /* ⭐ 主体最大宽度 */
  margin: 24px auto;     /* ⭐ 自动左右留白 */
  padding: 16px 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.section {
  margin-bottom: 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 8px;
}

th, td {
  border: 1px solid #ddd;
  padding: 8px 6px;
  text-align: center;
  font-size: 14px;
}

th {
  background: #f0f2f5;
  font-weight: 600;
}

.red {
  color: #c40000;
  font-weight: 600;
}

.blue {
  color: #165dff;
  font-weight: 600;
}

.small {
  font-size: 12px;
  line-height: 1.5;
}

.hidden-gan {
  font-size: 12px;
  line-height: 1.4;
  color: #555;
}

@media (max-width: 1200px) {
  #app {
    max-width: 95%;
    padding: 12px;
  }
}

@media (max-width: 768px) {
  th, td {
    font-size: 12px;
    padding: 6px 4px;
  }
}
.paipan{
  width: 100%;
}
.spinner{
  border-top: 6px solid #8e44ad;
}

/* Home page — scoped so these styles do not affect the tools pages. */
.home-page { --home-ink:#17151e; --home-muted:#716d7a; --home-paper:#f7f6f1; --home-line:rgba(35,29,45,.12); --home-violet:#6748c7; --home-gold:#e7b45f; margin:0; color:var(--home-ink); background:var(--home-paper); font-family:"Noto Serif SC", Georgia, serif; }
.home-page *, .home-page *::before, .home-page *::after { box-sizing:border-box; }
.home-page a { color:inherit; text-decoration:none; }
.home-shell { max-width:1240px; margin:auto; padding:0 28px; }
.home-topbar { height:78px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--home-line); }
.home-brand { display:flex; align-items:center; gap:11px; font:500 15px/1 "DM Mono", monospace; letter-spacing:.02em; }
.home-brand-mark { width:31px; height:31px; border:1.5px solid var(--home-ink); display:grid; place-items:center; border-radius:50%; font-size:18px; }
.home-nav { display:flex; align-items:center; gap:28px; font-size:14px; }
.home-nav a { color:#4c4853; transition:color .2s; } .home-nav a:hover { color:var(--home-violet); }
.home-nav .home-nav-cta { padding:10px 16px; color:#fff; background:var(--home-ink); border-radius:999px; }
.home-page .hero { position:relative; overflow:hidden; min-height:540px; padding:86px 0 64px; border-bottom:1px solid var(--home-line); background:none; border-radius:0; margin:0; text-align:left; }
.home-page .hero::before, .home-page .hero::after { content:""; position:absolute; pointer-events:none; border-radius:50%; filter:blur(1px); }
.home-page .hero::before { width:560px; height:560px; right:-175px; top:-125px; background:radial-gradient(circle at 50% 50%, #e3d6ff 0 14%, transparent 14.3% 22%, #f0e8d9 22.3% 33%, transparent 33.3% 42%, #dcd0f8 42.3% 52%, transparent 52.3%); opacity:.74; }
.home-page .hero::after { width:175px; height:175px; right:15%; bottom:8%; background:radial-gradient(circle, #ecc777 0 4%, transparent 4.5% 14%, #9e85df 14.5% 16%, transparent 16.5%); opacity:.75; }
.home-page .eyebrow { display:flex; align-items:center; gap:10px; margin:0 0 24px; color:var(--home-violet); font:500 11px/1 "DM Mono", monospace; letter-spacing:.15em; text-transform:uppercase; }
.home-page .eyebrow::before { content:""; width:28px; height:1px; background:currentColor; }
.home-page h1 { position:relative; z-index:1; max-width:790px; margin:0; font-size:clamp(46px,7vw,92px); font-weight:900; line-height:1.12; letter-spacing:-.075em; color:var(--home-ink); text-shadow:none; }
.home-page h1 em { color:var(--home-violet); font-style:normal; }
.home-page .hero-copy { max-width:500px; margin:27px 0 33px; color:var(--home-muted); font-size:16px; line-height:1.9; }
.home-page .hero-actions { display:flex; gap:12px; align-items:center; }
.home-page .button { display:inline-flex; align-items:center; justify-content:center; gap:11px; padding:14px 20px; border:1px solid var(--home-ink); border-radius:4px; font-size:14px; transition:transform .2s, box-shadow .2s; }
.home-page .button:hover { transform:translateY(-3px); box-shadow:5px 5px 0 var(--home-gold); }
.home-page .button.primary { color:#fff; background:var(--home-ink); }
.home-page .button .arrow { font:20px/0 Georgia, serif; }
.home-page .hero-note { position:absolute; z-index:1; right:3%; bottom:28px; writing-mode:vertical-rl; color:#8d8994; font:11px/1.6 "DM Mono", monospace; letter-spacing:.08em; }
.home-page .tools { padding:90px 0 108px; }
.home-page .section-head { display:flex; align-items:end; justify-content:space-between; gap:24px; margin-bottom:34px; }
.home-page .section-head h2 { margin:9px 0 0; font-size:clamp(30px,4vw,46px); letter-spacing:-.06em; line-height:1.15; color:var(--home-ink); }
.home-page .section-desc { max-width:310px; margin:0; color:var(--home-muted); font-size:13px; line-height:1.8; }
.home-page .grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:15px; }
.home-page .card { position:relative; min-height:286px; padding:25px; overflow:hidden; border:1px solid var(--home-line); background:#fff; transition:transform .25s ease, box-shadow .25s ease; }
.home-page .card:hover { z-index:1; transform:translateY(-7px); box-shadow:0 17px 35px rgba(35,25,50,.12); }
.home-page .card:nth-child(1) { background:#f1edfb; } .home-page .card:nth-child(2) { background:#f9f0e4; } .home-page .card:nth-child(3) { background:#edf4ee; }
.home-page .card:nth-child(4) { background:#eeeefa; } .home-page .card:nth-child(5) { background:#fbefee; } .home-page .card:nth-child(6) { background:#f6f2e7; }
.home-page .card-number { color:#80778c; font:11px/1 "DM Mono", monospace; }
.home-page .glyph { position:absolute; right:17px; top:13px; color:rgba(64,43,96,.18); font-size:90px; line-height:1; font-weight:500; transition:transform .3s; }
.home-page .card:hover .glyph { transform:rotate(12deg) scale(1.1); }
.home-page .card h3 { position:relative; margin:72px 0 9px; font-size:25px; letter-spacing:-.05em; color:var(--home-ink); }
.home-page .card p { position:relative; max-width:210px; margin:0; color:#706a76; font-size:13px; line-height:1.75; }
.home-page .card-link { position:absolute; left:25px; bottom:23px; display:flex; gap:7px; align-items:center; color:#3d3451; font:11px/1 "DM Mono", monospace; letter-spacing:.03em; }
.home-page .card-link::after { content:"→"; font-size:17px; transition:transform .2s; } .home-page .card:hover .card-link::after { transform:translateX(4px); }
.home-page .tool-guide { display:flex; align-items:center; flex-wrap:wrap; gap:10px 18px; margin-top:28px; padding:17px 20px; border:1px solid var(--home-line); background:#fff; color:var(--home-muted); font-size:13px; line-height:1.6; }
.home-page .tool-guide strong { color:var(--home-ink); }
.home-page .tool-guide a { color:var(--home-violet); text-decoration:underline; text-underline-offset:3px; }
.home-page .footer { padding:24px 0 38px; border-top:1px solid var(--home-line); display:flex; justify-content:space-between; color:#807b86; font:11px/1.5 "DM Mono", monospace; }
@media (max-width:760px) { .home-shell { padding:0 19px; } .home-topbar { height:66px; } .home-nav a:not(.home-nav-cta) { display:none; } .home-page .hero { min-height:520px; padding:75px 0 65px; } .home-page .hero::before { right:-295px; top:-70px; } .home-page .hero-note { display:none; } .home-page .hero-copy { font-size:14px; max-width:390px; } .home-page .button { padding:13px 15px; } .home-page .tools { padding:64px 0 76px; } .home-page .section-head { display:block; } .home-page .section-desc { margin-top:15px; } .home-page .grid { grid-template-columns:1fr; gap:10px; } .home-page .card { min-height:235px; } .home-page .card h3 { margin-top:52px; } .home-page .footer { gap:14px; flex-direction:column; } }

/* Tools pages — the same calm editorial system used by the home page. */
.tools-page { --ink:#17151e; --muted:#716d7a; --paper:#f7f6f1; --line:rgba(35,29,45,.12); --violet:#6748c7; --gold:#e7b45f; margin:0; padding:0; background:var(--paper); color:var(--ink); font-family:"Noto Serif SC", Georgia, serif; }
.tools-page *, .tools-page *::before, .tools-page *::after { box-sizing:border-box; }
.tools-page a { color:inherit; text-decoration:none; }
.tools-shell { width:min(100% - 40px, 1060px); margin:auto; }
.tools-topbar { min-height:78px; display:flex; align-items:center; justify-content:space-between; gap:24px; border-bottom:1px solid var(--line); }
.tools-brand { display:flex; flex:none; align-items:center; gap:11px; font:500 15px/1 "DM Mono", monospace; letter-spacing:.02em; }
.tools-brand-mark { width:31px; height:31px; display:grid; place-items:center; border:1.5px solid var(--ink); border-radius:50%; font-size:18px; }
.tools-nav { display:flex; align-items:center; justify-content:flex-end; gap:4px; }
.tools-nav .tab { display:inline-flex; align-items:center; padding:9px 12px; border:0; border-radius:0; background:transparent; box-shadow:none; color:#4c4853; font-size:13px; transition:color .2s, background .2s; }
.tools-nav .tab:hover { background:#eeeaf8; color:var(--violet); }
.tools-nav .tab.active { background:var(--ink); color:#fff; font-weight:500; box-shadow:none; }
.tool-main { padding:42px 0 72px; }
.tools-page .content { display:grid; gap:22px; }
.tools-page .content > .hero-block, .tools-page .content > .section { width:min(100%, 860px); margin-inline:auto; padding:clamp(28px,5vw,52px); border:1px solid var(--line); background:#fff; }
.tools-page .content > .hero-block { background:linear-gradient(120deg,#f0ebfb 0%,#fff 68%,#f7efdf 100%); }
.tools-page .content > .hero-block h1 { margin:0 0 14px; color:var(--ink); font-size:clamp(31px,4vw,50px); line-height:1.2; letter-spacing:-.05em; }
.tools-page .content > .section h2 { margin:0 0 16px; color:var(--ink); font-size:25px; letter-spacing:-.04em; }
.tools-page .hero, .tools-page .tool, .tools-page .hexagram-detail, .tools-page .almanac-detail, .tools-page .container { position:relative; display:block; overflow:hidden; margin:0; padding:clamp(28px,5vw,58px); border:1px solid var(--line); border-radius:2px; background:#fff; box-shadow:none; }
.tools-page .hero { min-height:230px; text-align:left; background:linear-gradient(120deg,#f0ebfb 0%,#fff 60%,#f7efdf 100%); }
.tools-page .hero::after { content:"☯"; position:absolute; right:5%; top:50%; color:rgba(103,72,199,.13); font-family:Georgia,serif; font-size:190px; line-height:1; transform:translateY(-50%); }
.tools-page .hero h1 { position:relative; z-index:1; max-width:620px; color:var(--ink); font-size:clamp(38px,5vw,65px); line-height:1.12; letter-spacing:-.06em; text-shadow:none; }
.tools-page .hero-sub { position:relative; z-index:1; max-width:500px; margin:17px 0 0; color:var(--muted); font-size:16px; line-height:1.8; }
.tools-page .report-email-action { position:relative; z-index:1; display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:26px; }
.tools-page .report-email-cta { display:inline-flex; align-items:center; gap:8px; min-height:42px; padding:11px 15px; border:1px solid var(--ink); border-radius:0; background:var(--ink); color:#fff; font:500 14px/1 "Noto Serif SC", Georgia, serif; letter-spacing:.02em; cursor:pointer; transition:transform .2s,box-shadow .2s; }
.tools-page .report-email-cta:hover { transform:translateY(-2px); box-shadow:4px 4px 0 var(--gold); }
.tools-page .report-email-cta span { font-family:Arial,sans-serif; font-size:15px; }
.tools-page .report-email-note { color:var(--muted); font:11px/1.5 "DM Mono", monospace; letter-spacing:.03em; }
.tools-page .report-email-modal { position:fixed; z-index:50; inset:0; display:grid; place-items:center; padding:20px; }
.tools-page .report-email-modal.hidden { display:none; }
.tools-page .report-email-backdrop { position:absolute; inset:0; background:rgba(23,21,30,.48); backdrop-filter:blur(3px); }
.tools-page .report-email-dialog { position:relative; width:min(100%,460px); padding:34px; border:1px solid var(--ink); background:#fff; box-shadow:8px 8px 0 var(--gold); }
.tools-page .report-email-kicker { margin:0 0 9px; color:var(--violet); font:11px/1.4 "DM Mono", monospace; letter-spacing:.1em; text-transform:uppercase; }
.tools-page .report-email-dialog h2 { margin:0; font-size:28px; line-height:1.25; letter-spacing:-.04em; }
.tools-page .report-email-description { margin:13px 0 23px; color:var(--muted); font-size:14px; line-height:1.8; }
.tools-page .report-email-dialog label[for="report-email-input"] { display:block; margin-bottom:8px; font-size:14px; font-weight:600; }
.tools-page .report-email-dialog input[type="email"] { width:100%; padding:12px; border:1px solid var(--ink); }
.tools-page .report-email-consent { display:flex; align-items:flex-start; gap:8px; margin:15px 0 0; color:var(--muted); font-size:12px; line-height:1.6; }
.tools-page .report-email-consent input { width:auto; margin:3px 0 0; }
.tools-page .report-email-status { min-height:19px; margin:13px 0 0; color:var(--violet); font-size:12px; line-height:1.6; }
.tools-page .report-email-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:17px; }
.tools-page .report-email-cancel, .tools-page .report-email-submit, .tools-page .report-email-close { border-radius:0; font:500 13px/1 "Noto Serif SC", Georgia, serif; cursor:pointer; }
.tools-page .report-email-cancel { padding:11px 13px; border:1px solid var(--line); background:#fff; color:var(--ink); }
.tools-page .report-email-submit { padding:11px 15px; border:1px solid var(--ink); background:var(--ink); color:#fff; }
.tools-page .report-email-close { position:absolute; top:12px; right:12px; width:30px; height:30px; border:0; background:transparent; color:var(--muted); font-size:25px; }
.tools-page .tool h2, .tools-page .knowledge h2, .tools-page .knowledge h3 { margin:0 0 14px; color:var(--ink); font-size:clamp(27px,3vw,38px); line-height:1.2; letter-spacing:-.05em; }
.tools-page .intro { max-width:700px; margin:0 0 27px; color:var(--muted); font-size:15px; line-height:1.9; }
.tools-page .knowledge { padding:clamp(28px,5vw,52px); border-top:1px solid var(--line); background:#f0edfb; }
.tools-page .knowledge:empty { display:none; }
.tools-page .knowledge-links { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin:18px 0 32px; }
.tools-page .knowledge-card { display:flex; align-items:center; min-height:62px; padding:14px 16px; border:1px solid var(--line); border-radius:0; background:rgba(255,255,255,.72); color:var(--ink); transition:transform .2s,box-shadow .2s,background .2s; }
.tools-page .knowledge-card:hover { z-index:1; background:#fff; transform:translateY(-3px); box-shadow:4px 4px 0 var(--gold); }
.tools-page .card-title { font-size:14px; line-height:1.5; }
.tools-page .hexagram-grid, .tools-page .tarot-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:12px; margin:20px 0 0; }
.tools-page .hexagram-grid a, .tools-page .tarot-grid a { display:block; overflow:hidden; border:1px solid var(--line); background:#fff; color:var(--ink); text-align:center; transition:transform .2s,box-shadow .2s; }
.tools-page .hexagram-grid a:hover, .tools-page .tarot-grid a:hover { transform:translateY(-4px); box-shadow:4px 4px 0 var(--gold); }
.tools-page .hexagram-grid img, .tools-page .tarot-grid img { display:block; width:100%; margin:0; object-fit:contain; background:#fff; }
.tools-page .tarot-grid img { object-fit:cover; }
.tools-page .hexagram-name, .tools-page .tarot-name { min-height:44px; padding:7px 5px; color:var(--ink); font-size:12px; line-height:1.35; }
.tools-page .primary-btn { padding:12px 22px; border:1px solid var(--ink); border-radius:0; background:var(--ink); box-shadow:none; color:#fff; font:500 14px/1 "Noto Serif SC", Georgia, serif; transition:transform .2s,box-shadow .2s; }
.tools-page .primary-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:4px 4px 0 var(--gold); }
.tools-page input, .tools-page select { border:1px solid var(--line); border-radius:0; background:#fff; color:var(--ink); font:14px inherit; }
.tools-page .footer { display:flex; justify-content:space-between; gap:18px; margin:0; padding:25px 0 36px; border-top:1px solid var(--line); background:transparent; color:#807b86; font:11px/1.5 "DM Mono", monospace; text-align:left; }
.tools-page .footer p { margin:0; }
.tools-page .footer a { color:#807b86 !important; }
.tools-page .ad.bottom { display:flex; width:100%; min-height:90px; height:auto; margin:0; padding:24px 0; border-top:1px solid var(--line); border-radius:0; background:transparent; backdrop-filter:none; }
.tools-page .ad.bottom .adsbygoogle { width:100%; }
.tools-page #app { max-width:none; margin:0; padding:0; border-radius:0; box-shadow:none; }
.ad-rail { position:fixed; top:118px; z-index:2; width:140px; }
.ad-rail-left { left:max(18px, calc(50% - 680px)); }
.ad-rail-right { right:max(18px, calc(50% - 680px)); }
.ad-rail-slot { display:grid; min-height:280px; place-items:center; border:1px dashed rgba(35,29,45,.22); color:#9a95a0; font:11px/1 "DM Mono", monospace; letter-spacing:.14em; writing-mode:vertical-rl; }

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

@media (max-width:760px) {
  .tools-shell { width:min(100% - 32px, 1060px); }
  .tools-topbar { min-height:66px; align-items:flex-start; flex-direction:column; gap:12px; padding:15px 0; }
  .tools-nav { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); width:100%; gap:5px; }
  .tools-nav .tab { justify-content:center; padding:9px 5px; font-size:12px; white-space:nowrap; }
  .tools-page .report-email-action { align-items:flex-start; flex-direction:column; gap:8px; margin-top:21px; }
  .tool-main { padding:26px 0 48px; }
  .tools-page .hero, .tools-page .tool, .tools-page .hexagram-detail, .tools-page .almanac-detail, .tools-page .container { padding:26px 20px; }
  .tools-page .hero::after { right:-28px; font-size:150px; }
  .tools-page .knowledge { padding:28px 20px; }
  .tools-page .knowledge-links { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tools-page .hexagram-grid, .tools-page .tarot-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .tools-page .footer { flex-direction:column; }
}
@media (max-width:440px) { .tools-nav { grid-template-columns:repeat(2, minmax(0,1fr)); } }
