/* ==========================================================================
   卜筮三术 · 深空紫金仙韵主题样式
   Palette: #0a0618 底色 / #d4af37 金色 / #7b2fbf 紫色 / #00e5cc 青色
   ========================================================================== */

:root {
  --bg-deep: #0a0618;
  --bg-mid: #130a2a;
  --bg-surface: rgba(19, 12, 42, 0.72);
  --bg-surface-strong: rgba(15, 9, 34, 0.88);
  --gold: #d4af37;
  --gold-bright: #f7df8f;
  --gold-dim: rgba(212, 175, 55, 0.32);
  --purple: #7b2fbf;
  --purple-bright: #c58aff;
  --orchid: #e066b8;
  --cyan: #00e5cc;
  --cyan-blue: #38bdf8;
  --crimson: #e84c7c;
  --text-main: #f4efe4;
  --text-sub: #b8aec9;
  --text-muted: #84789c;
  --border-subtle: rgba(212, 175, 55, 0.2);
  --font-brush: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', 'Kaiti SC', serif;
  --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --shadow-deep: 0 22px 55px rgba(3, 1, 12, 0.72);
  --ease-mystic: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-serif);
  color: var(--text-main);
  background:
    radial-gradient(ellipse 80% 55% at 15% 10%, rgba(123, 47, 191, 0.28), transparent 62%),
    radial-gradient(ellipse 70% 50% at 86% 18%, rgba(0, 229, 204, 0.14), transparent 58%),
    radial-gradient(ellipse 65% 55% at 50% 92%, rgba(212, 175, 55, 0.14), transparent 65%),
    linear-gradient(165deg, #070312 0%, #0a0618 42%, #120929 75%, #090517 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 全屏星空 Canvas + 星云光晕 + 细微噪点纹理 */
#starfield-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.cosmic-nebula {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 35%, rgba(123, 47, 191, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 78% 68%, rgba(0, 229, 204, 0.1) 0%, transparent 42%),
    radial-gradient(circle at 52% 16%, rgba(212, 175, 55, 0.08) 0%, transparent 38%);
  animation: nebulaDrift 22s ease-in-out infinite alternate;
}

.cosmic-noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

@keyframes nebulaDrift {
  0% { transform: scale(1) translate3d(0, 0, 0); opacity: 0.85; }
  100% { transform: scale(1.07) translate3d(-1.5%, 1.5%, 0); opacity: 1; }
}

/* ==========================================================================
   顶部导航栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(10, 6, 24, 0.68);
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 10px;
  transition: transform 0.25s var(--ease-mystic);
}

.brand-mini:hover {
  transform: translateY(-1px);
}

.brand-seal {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-brush);
  font-size: 1.25rem;
  color: #160c02;
  background: linear-gradient(135deg, #fbe59b 0%, #d4af37 55%, #9c741b 100%);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.45);
}

.brand-text {
  font-family: var(--font-brush);
  font-size: 1.45rem;
  letter-spacing: 0.12em;
  background: linear-gradient(90deg, #fff2c2, #d4af37, #e4c6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.quick-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-pill {
  position: relative;
  overflow: hidden;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.28s var(--ease-mystic);
  white-space: nowrap;
}

.nav-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.07);
}

.nav-pill.active {
  color: #140b24;
  font-weight: 600;
  background: linear-gradient(135deg, #f7df8f, #d4af37);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.42);
}

.nav-pill--orchid.active {
  background: linear-gradient(135deg, #f8b3e6, #c068eb);
  box-shadow: 0 0 18px rgba(224, 102, 184, 0.45);
}

.nav-pill--cyan.active {
  background: linear-gradient(135deg, #9ffef3, #00e5cc);
  box-shadow: 0 0 18px rgba(0, 229, 204, 0.45);
}

.history-toggle-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: rgba(26, 15, 54, 0.72);
  color: var(--gold-bright);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.28s var(--ease-mystic);
}

.history-toggle-btn:hover {
  border-color: rgba(247, 223, 143, 0.75);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.icon-svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.history-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.22);
  color: var(--gold-bright);
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   历史记录抽屉
   ========================================================================== */
.history-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.history-drawer.open {
  pointer-events: auto;
  opacity: 1;
}

.history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 2, 12, 0.66);
  backdrop-filter: blur(4px);
}

.history-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(410px, 92vw);
  height: 100%;
  border-radius: 22px 0 0 22px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s var(--ease-mystic);
  border-left: 1px solid rgba(212, 175, 55, 0.32);
  background: rgba(14, 8, 34, 0.94);
}

.history-drawer.open .history-panel {
  transform: translateX(0);
}

.history-header {
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-title {
  margin: 0;
  font-family: var(--font-brush);
  font-size: 1.6rem;
  color: var(--gold-bright);
  letter-spacing: 0.08em;
}

.history-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-close:hover {
  color: #fff;
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.18);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-empty {
  text-align: center;
  padding: 48px 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.history-item {
  position: relative;
  padding: 13px 38px 13px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: all 0.25s var(--ease-mystic);
  text-align: left;
}

.history-item:hover {
  background: rgba(212, 175, 55, 0.09);
  border-color: rgba(212, 175, 55, 0.42);
  transform: translateX(-3px);
}

.history-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.history-type-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.history-type-tag--liuyao {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-bright);
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.history-type-tag--meihua {
  background: rgba(224, 102, 184, 0.2);
  color: #ffb8e8;
  border: 1px solid rgba(224, 102, 184, 0.4);
}

.history-type-tag--qimen {
  background: rgba(0, 229, 204, 0.16);
  color: #84fff2;
  border: 1px solid rgba(0, 229, 204, 0.4);
}

.history-item-time {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.history-item-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
}

.history-item-sub {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 2px;
}

.history-item-del {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.history-item-del:hover {
  background: rgba(232, 76, 124, 0.22);
  color: #ff9ab8;
}

/* ==========================================================================
   主布局与页面淡入淡出切换
   ========================================================================== */
.app-main {
  position: relative;
  z-index: 10;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 72px;
}

.page-view {
  display: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.36s var(--ease-mystic), transform 0.36s var(--ease-mystic);
}

.page-view.active {
  display: block;
  animation: pageFadeIn 0.45s var(--ease-mystic) forwards;
}

.page-view.leaving {
  display: block;
  animation: pageFadeOut 0.22s ease forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pageFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ==========================================================================
   玻璃拟态 + 边缘流光旋转卡片
   ========================================================================== */
.glass-card {
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-deep);
}

.glow-border-card {
  --border-glow-a: #d4af37;
  --border-glow-b: #7b2fbf;
  --border-glow-c: #f7df8f;
  position: relative;
  border-radius: var(--radius-lg);
  padding: 1.5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: none;
}

.glow-border-card::before {
  content: '';
  position: absolute;
  inset: -60%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--border-glow-a) 60deg,
    var(--border-glow-c) 95deg,
    transparent 150deg,
    var(--border-glow-b) 240deg,
    transparent 310deg,
    transparent 360deg
  );
  animation: borderFlowSpin 7.5s linear infinite;
  z-index: 0;
  opacity: 0.72;
  transition: opacity 0.35s ease;
}

.glow-border-card:hover::before {
  opacity: 1;
}

.glow-border-card > .portal-card-inner,
.glow-border-card > .control-card-inner {
  position: relative;
  z-index: 1;
  border-radius: calc(var(--radius-lg) - 1.5px);
  background: linear-gradient(155deg, rgba(21, 13, 46, 0.92), rgba(11, 7, 28, 0.95));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.theme-gold,
.portal-card--gold {
  --border-glow-a: #d4af37;
  --border-glow-b: #8a56d4;
  --border-glow-c: #fff1b8;
}

.theme-orchid,
.portal-card--orchid {
  --border-glow-a: #e066b8;
  --border-glow-b: #7b2fbf;
  --border-glow-c: #ffd0f2;
}

.theme-cyan,
.portal-card--cyan {
  --border-glow-a: #00e5cc;
  --border-glow-b: #38bdf8;
  --border-glow-c: #b8fff7;
}

@keyframes borderFlowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   首页标题与三张入口卡片
   ========================================================================== */
.hero-header {
  text-align: center;
  padding: 20px 10px 42px;
  position: relative;
}

.hero-emblem {
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
}

.hero-bagua-ring {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.42));
  animation: slowRotate 28s linear infinite;
}

@keyframes slowRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.site-title {
  margin: 0;
  font-family: var(--font-brush);
  font-size: clamp(3.3rem, 7.6vw, 5.4rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  line-height: 1.15;
  background: linear-gradient(180deg, #fff8de 0%, #f5d97e 38%, #d4af37 72%, #b07cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(212, 175, 55, 0.52)) drop-shadow(0 0 54px rgba(123, 47, 191, 0.42));
  animation: titleShimmer 4.5s ease-in-out infinite alternate;
}

@keyframes titleShimmer {
  0% { filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.45)) drop-shadow(0 0 46px rgba(123, 47, 191, 0.35)); }
  100% { filter: drop-shadow(0 0 32px rgba(247, 223, 143, 0.72)) drop-shadow(0 0 64px rgba(123, 47, 191, 0.58)); }
}

.site-subtitle {
  margin: 12px 0 8px;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  letter-spacing: 0.28em;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

.site-subtitle .dot {
  color: var(--purple-bright);
  margin: 0 6px;
}

.site-tagline {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.32em;
  color: var(--text-muted);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  align-items: stretch;
}

.portal-card {
  cursor: pointer;
  transition: transform 0.4s var(--ease-mystic), box-shadow 0.4s var(--ease-mystic);
  animation: cardBreathe 5.2s ease-in-out infinite;
  outline: none;
}

.portal-card:nth-child(2) {
  animation-delay: -1.7s;
}

.portal-card:nth-child(3) {
  animation-delay: -3.4s;
}

@keyframes cardBreathe {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 16px 40px rgba(4, 2, 14, 0.65), 0 0 22px rgba(123, 47, 191, 0.14);
  }
  50% {
    transform: translateY(-5px);
    box-shadow: 0 22px 48px rgba(4, 2, 14, 0.72), 0 0 34px rgba(212, 175, 55, 0.2);
  }
}

.portal-card:hover,
.portal-card:focus-visible {
  animation-play-state: paused;
  transform: translateY(-10px) scale(1.015);
}

.portal-card--gold:hover {
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.75), 0 0 42px rgba(212, 175, 55, 0.42);
}

.portal-card--orchid:hover {
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.75), 0 0 42px rgba(224, 102, 184, 0.42);
}

.portal-card--cyan:hover {
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.75), 0 0 42px rgba(0, 229, 204, 0.38);
}

.portal-card-inner {
  height: 100%;
  padding: 28px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.portal-tag {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 18px;
}

.portal-icon-wrap {
  width: 112px;
  height: 112px;
  margin-bottom: 14px;
  transition: transform 0.45s var(--ease-mystic);
}

.portal-card:hover .portal-icon-wrap {
  transform: scale(1.08) rotate(3deg);
}

.portal-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.35));
}

.portal-card--orchid .portal-svg {
  filter: drop-shadow(0 0 18px rgba(224, 102, 184, 0.45));
}

.portal-card--cyan .portal-svg {
  filter: drop-shadow(0 0 18px rgba(0, 229, 204, 0.42));
}

.portal-title {
  margin: 4px 0 12px;
  font-family: var(--font-brush);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.portal-card--gold .portal-title {
  background: linear-gradient(90deg, #fff2bf, #d4af37);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(212, 175, 55, 0.3);
}

.portal-card--orchid .portal-title {
  background: linear-gradient(90deg, #ffd4f4, #e066b8, #b67cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.portal-card--cyan .portal-title {
  background: linear-gradient(90deg, #c2fff8, #00e5cc, #60c8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.portal-desc {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--text-sub);
  line-height: 1.75;
  flex: 1;
}

.portal-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-bottom: 20px;
}

.portal-meta span {
  font-size: 0.76rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-sub);
}

.portal-cta {
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portal-card--orchid .portal-cta { color: #ffb9ec; }
.portal-card--cyan .portal-cta { color: #8afff2; }

.portal-cta .arrow {
  transition: transform 0.3s ease;
}

.portal-card:hover .portal-cta .arrow {
  transform: translateX(5px);
}

.home-footer {
  text-align: center;
  margin-top: 46px;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  opacity: 0.8;
}

/* ==========================================================================
   子视图头部与控制面板
   ========================================================================== */
.view-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.back-btn {
  position: relative;
  overflow: hidden;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(20, 12, 42, 0.72);
  color: var(--gold-bright);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s var(--ease-mystic);
}

.back-btn:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.32);
  transform: translateX(-2px);
}

.view-title-group {
  display: flex;
  flex-direction: column;
}

.view-title {
  margin: 0;
  font-family: var(--font-brush);
  font-size: clamp(2rem, 4.2vw, 2.75rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.15;
  background: linear-gradient(90deg, #fff3c4, #d4af37);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.38));
}

.view-header--orchid .view-title {
  background: linear-gradient(90deg, #ffd9f6, #e066b8, #b67cff);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(224, 102, 184, 0.42));
}

.view-header--cyan .view-title {
  background: linear-gradient(90deg, #c6fff8, #00e5cc, #5bc5ff);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(0, 229, 204, 0.42));
}

.view-subtitle {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-sub);
  letter-spacing: 0.14em;
}

.control-card {
  margin-bottom: 28px;
}

.control-card-inner {
  padding: 24px 26px 26px;
}

/* Mode Tabs */
.mode-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mode-tab {
  position: relative;
  overflow: hidden;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  padding: 8px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s var(--ease-mystic);
}

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

.mode-tab.active {
  color: #160c02;
  font-weight: 600;
  background: linear-gradient(135deg, #fbe59b, #d4af37);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.42);
}

.theme-orchid .mode-tab.active {
  background: linear-gradient(135deg, #ffc4ef, #d06ce0);
  box-shadow: 0 0 16px rgba(224, 102, 184, 0.42);
}

/* Form Inputs */
.form-row-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 0.84rem;
  color: var(--text-sub);
  letter-spacing: 0.06em;
}

.cosmic-input,
.cosmic-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 175, 55, 0.24);
  background: rgba(9, 5, 23, 0.72);
  color: var(--text-main);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.cosmic-input:focus,
.cosmic-select:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
}

.theme-orchid .cosmic-input:focus {
  border-color: #f39be0;
  box-shadow: 0 0 0 3px rgba(224, 102, 184, 0.18);
}

.theme-cyan .cosmic-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.18);
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn .cosmic-input {
  flex: 1;
}

.btn-mini,
.btn-ghost-sm {
  position: relative;
  overflow: hidden;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 175, 55, 0.34);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-bright);
  font-family: var(--font-serif);
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s ease;
}

.btn-ghost-sm {
  padding: 6px 12px;
}

.btn-mini:hover,
.btn-ghost-sm:hover {
  background: rgba(212, 175, 55, 0.24);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.28);
}

.pane-hint {
  margin: 8px 0 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.liuyao-pane,
.meihua-pane {
  display: none;
}

.liuyao-pane.active,
.meihua-pane.active {
  display: block;
  animation: pageFadeIn 0.3s ease;
}

.num-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.inline-helper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.lunar-preview-box {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: rgba(224, 102, 184, 0.08);
  border: 1px solid rgba(224, 102, 184, 0.25);
  color: #f4d6f0;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

/* ==========================================================================
   发光按钮与按下涟漪动画
   ========================================================================== */
.action-center {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 999px;
  padding: 13px 34px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: transform 0.25s var(--ease-mystic), box-shadow 0.28s ease, filter 0.25s ease;
}

.btn-xl {
  padding: 15px 46px;
  font-size: 1.15rem;
}

.btn-gold {
  color: #1c1002;
  background: linear-gradient(135deg, #fff0b3 0%, #d4af37 52%, #b5851e 100%);
  box-shadow: 0 8px 28px rgba(212, 175, 55, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-gold:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 38px rgba(247, 223, 143, 0.62), 0 0 26px rgba(212, 175, 55, 0.55);
}

.btn-orchid {
  color: #1c0524;
  background: linear-gradient(135deg, #ffd4f5 0%, #e066b8 50%, #9b4ce0 100%);
  box-shadow: 0 8px 28px rgba(224, 102, 184, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-orchid:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 38px rgba(224, 102, 184, 0.65), 0 0 28px rgba(155, 76, 224, 0.5);
}

.btn-cyan {
  color: #031d1f;
  background: linear-gradient(135deg, #c2fff8 0%, #00e5cc 52%, #2ca9e8 100%);
  box-shadow: 0 8px 28px rgba(0, 229, 204, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-cyan:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 38px rgba(0, 229, 204, 0.64), 0 0 28px rgba(56, 189, 248, 0.48);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

.btn-primary:disabled {
  opacity: 0.58;
  cursor: wait;
}

.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.46);
  transform: scale(0);
  animation: btnRipple 0.62s ease-out forwards;
  pointer-events: none;
}

@keyframes btnRipple {
  to {
    transform: scale(3.8);
    opacity: 0;
  }
}

/* ==========================================================================
   六爻：三枚铜钱 3D 翻转摇卦台 + 六次摇动进度 + 手动装卦
   ========================================================================== */
.coin-stage {
  padding: 20px 18px 16px;
  border-radius: var(--radius-md);
  background: radial-gradient(ellipse at 50% 35%, rgba(212, 175, 55, 0.12), rgba(9, 5, 22, 0.64) 72%);
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.coin-arena {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(18px, 5vw, 48px);
  padding: 14px 0 22px;
}

.coin-slot {
  perspective: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.coin-3d {
  width: 84px;
  height: 84px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.42s var(--ease-mystic);
}

.coin-3d.landed-back {
  transform: rotateY(180deg);
}

.coin-3d.flipping-front {
  animation: coinFlipToFront 0.54s cubic-bezier(0.28, 0.84, 0.42, 1) forwards;
}

.coin-3d.flipping-back {
  animation: coinFlipToBack 0.54s cubic-bezier(0.28, 0.84, 0.42, 1) forwards;
}

@keyframes coinFlipToFront {
  0% { transform: translateY(0) rotateX(0deg) rotateY(0deg) scale(1); }
  45% { transform: translateY(-42px) rotateX(540deg) rotateY(180deg) scale(1.12); }
  80% { transform: translateY(4px) rotateX(1040deg) rotateY(350deg) scale(0.96); }
  100% { transform: translateY(0) rotateX(1080deg) rotateY(360deg) scale(1); }
}

@keyframes coinFlipToBack {
  0% { transform: translateY(0) rotateX(0deg) rotateY(0deg) scale(1); }
  45% { transform: translateY(-42px) rotateX(540deg) rotateY(270deg) scale(1.12); }
  80% { transform: translateY(4px) rotateX(1040deg) rotateY(530deg) scale(0.96); }
  100% { transform: translateY(0) rotateX(1080deg) rotateY(540deg) scale(1); }
}

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 28%, #f8e296 0%, #c99d2e 42%, #8c6416 82%, #63440c 100%);
  border: 3px solid #f2d57c;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.6),
    inset 0 2px 6px rgba(255, 248, 214, 0.55),
    inset 0 -3px 8px rgba(58, 36, 4, 0.72),
    0 0 18px rgba(212, 175, 55, 0.32);
}

.coin-back {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 65% 30%, #ebd07c 0%, #b08222 48%, #734f10 88%, #523608 100%);
}

.coin-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px solid rgba(82, 52, 8, 0.52);
  pointer-events: none;
}

.coin-hole {
  width: 22px;
  height: 22px;
  background: #100824;
  border: 2px solid #e6c462;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
  border-radius: 2px;
}

.coin-char {
  position: absolute;
  font-family: var(--font-brush);
  font-size: 0.92rem;
  color: #3d2403;
  text-shadow: 0 1px 0 rgba(255, 242, 189, 0.5);
  line-height: 1;
}

.coin-char-t { top: 8px; left: 50%; transform: translateX(-50%); }
.coin-char-b { bottom: 8px; left: 50%; transform: translateX(-50%); }
.coin-char-r { right: 9px; top: 50%; transform: translateY(-50%); }
.coin-char-l { left: 9px; top: 50%; transform: translateY(-50%); }

.coin-back-mark {
  position: absolute;
  font-size: 0.85rem;
  color: #462b05;
  top: 50%;
  transform: translateY(-50%);
}
.coin-back-l { left: 9px; }
.coin-back-r { right: 9px; }

.coin-back-tag {
  position: absolute;
  top: 8px;
  font-family: var(--font-brush);
  font-size: 0.88rem;
  color: #422704;
}

.coin-label {
  font-size: 0.78rem;
  color: var(--text-sub);
  letter-spacing: 0.08em;
}

.shake-live-panel {
  text-align: center;
}

.shake-status-text {
  font-size: 0.92rem;
  color: var(--gold-bright);
  margin-bottom: 12px;
  min-height: 1.5em;
}

.shake-progress-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 14px;
}

.shake-step {
  font-size: 0.78rem;
  padding: 6px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-muted);
  transition: all 0.28s ease;
}

.shake-step.active {
  color: #160c02;
  font-weight: 600;
  background: linear-gradient(135deg, #fbe59b, #d4af37);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.5);
}

.shake-step.done {
  color: var(--gold-bright);
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.14);
}

.shake-preview-yaos {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 7px;
  min-height: 18px;
  margin-top: 6px;
}

.preview-yao-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(300px, 100%);
}

.preview-yao-lbl {
  width: 40px;
  font-size: 0.78rem;
  color: var(--text-sub);
  text-align: right;
}

.preview-yao-meta {
  width: 72px;
  font-size: 0.76rem;
  color: var(--gold-bright);
  text-align: left;
}

/* Manual Yao Grid */
.manual-yao-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.manual-yao-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.yao-pos-tag {
  font-size: 0.82rem;
  color: var(--gold-bright);
  font-weight: 600;
}

/* ==========================================================================
   结果出图区 ("仙气"粒子背景 + 金色发光卦象 + 羊皮纸断语)
   ========================================================================== */
.result-stage {
  position: relative;
  border-radius: 26px;
  padding: 26px 26px 32px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.12), transparent 55%),
    radial-gradient(ellipse at 18% 85%, rgba(123, 47, 191, 0.18), transparent 52%),
    radial-gradient(ellipse at 85% 75%, rgba(0, 229, 204, 0.1), transparent 50%),
    rgba(13, 8, 32, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 26px 65px rgba(3, 1, 14, 0.8), inset 0 0 40px rgba(123, 47, 191, 0.14);
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: pageFadeIn 0.55s var(--ease-mystic);
}

.result-stage.hidden {
  display: none;
}

/* 仙气流动雾霭层 */
.result-stage::before,
.result-stage::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.24;
  animation: spiritMist 11s ease-in-out infinite alternate;
}

.result-stage::before {
  top: -110px;
  left: -80px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.65), transparent 70%);
}

.result-stage::after {
  bottom: -120px;
  right: -70px;
  background: radial-gradient(circle, rgba(123, 47, 191, 0.72), transparent 70%);
  animation-delay: -5.5s;
}

@keyframes spiritMist {
  0% { transform: translate(0, 0) scale(1); opacity: 0.2; }
  100% { transform: translate(35px, -25px) scale(1.18); opacity: 0.34; }
}

.aura-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.result-toolbar,
.result-body {
  position: relative;
  z-index: 2;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  flex-wrap: wrap;
}

.result-badge {
  font-family: var(--font-brush);
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(212, 175, 55, 0.45);
}

.result-badge--orchid {
  color: #ffc2f0;
  text-shadow: 0 0 18px rgba(224, 102, 184, 0.5);
}

.result-badge--cyan {
  color: #93fff4;
  text-shadow: 0 0 18px rgba(0, 229, 204, 0.5);
}

.btn-save-img {
  position: relative;
  overflow: hidden;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid rgba(247, 223, 143, 0.55);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(123, 47, 191, 0.28));
  color: #fff3c9;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.28s var(--ease-mystic);
}

.btn-save-img:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.45);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.38), rgba(123, 47, 191, 0.4));
}

/* 干支信息横幅 */
.meta-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.2);
  margin-bottom: 22px;
  font-size: 0.9rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-pill strong {
  color: var(--gold-bright);
  font-weight: 600;
}

.question-quote {
  width: 100%;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px dashed rgba(212, 175, 55, 0.22);
  color: #f6e7c1;
  font-size: 0.95rem;
}

/* ==========================================================================
   卦象爻线动画 (从两侧展开 + 金色发光 + 卦名淡入)
   ========================================================================== */
.hex-trio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.hex-card {
  position: relative;
  padding: 20px 18px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(28, 17, 58, 0.72), rgba(12, 7, 29, 0.84));
  border: 1px solid rgba(212, 175, 55, 0.26);
  text-align: center;
  transition: transform 0.3s var(--ease-mystic), box-shadow 0.3s ease;
}

.hex-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 24px rgba(212, 175, 55, 0.2);
}

.hex-card--primary {
  border-color: rgba(247, 223, 143, 0.52);
  box-shadow: 0 0 28px rgba(212, 175, 55, 0.16);
}

.hex-card-role {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.hex-card-name {
  font-family: var(--font-brush);
  font-size: 1.95rem;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.58);
  margin: 0 0 4px;
  opacity: 0;
  animation: guaNameFade 0.65s var(--ease-mystic) 0.22s forwards;
}

.hex-card-sub {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-bottom: 16px;
}

@keyframes guaNameFade {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hex-lines {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 196px;
  margin: 0 auto 14px;
}

.hex-lines--lg {
  max-width: 215px;
  gap: 11px;
}

.yao-line-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 12px;
  flex: 1;
}

.hex-lines--lg .yao-line-wrap {
  height: 14px;
}

.yao-bar-yang {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b8891f, #fae396 35%, #fff7d4 50%, #fae396 65%, #b8891f);
  box-shadow: 0 0 12px rgba(247, 223, 143, 0.65), 0 0 24px rgba(212, 175, 55, 0.35);
  transform: scaleX(0);
  transform-origin: center;
  animation: yaoExpandCenter 0.55s var(--ease-mystic) var(--delay, 0s) forwards;
}

.yao-bar-yin {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  gap: 18%;
}

.yao-seg-left,
.yao-seg-right {
  flex: 1;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b8891f, #fae396 50%, #e4bd53);
  box-shadow: 0 0 12px rgba(247, 223, 143, 0.6), 0 0 22px rgba(212, 175, 55, 0.32);
  transform: scaleX(0);
}

.yao-seg-left {
  transform-origin: left center;
  animation: yaoExpandSide 0.55s var(--ease-mystic) var(--delay, 0s) forwards;
}

.yao-seg-right {
  transform-origin: right center;
  animation: yaoExpandSide 0.55s var(--ease-mystic) var(--delay, 0s) forwards;
}

.yao-line-wrap.is-moving .yao-bar-yang,
.yao-line-wrap.is-moving .yao-seg-left,
.yao-line-wrap.is-moving .yao-seg-right {
  background: linear-gradient(90deg, #ff9966, #fff099 50%, #ff6b9d);
  box-shadow: 0 0 16px rgba(255, 198, 102, 0.85), 0 0 28px rgba(232, 76, 124, 0.45);
}

.yao-moving-mark {
  position: absolute;
  right: -24px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffb86c;
  text-shadow: 0 0 10px rgba(255, 184, 108, 0.85);
}

@keyframes yaoExpandCenter {
  from { transform: scaleX(0); opacity: 0.25; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes yaoExpandSide {
  from { transform: scaleX(0); opacity: 0.25; }
  to { transform: scaleX(1); opacity: 1; }
}

.hex-trigram-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trigram-pill {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-sub);
}

.trigram-pill--ti {
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(247, 223, 143, 0.55);
  color: var(--gold-bright);
  font-weight: 600;
}

.trigram-pill--yong {
  background: rgba(224, 102, 184, 0.2);
  border-color: rgba(240, 134, 212, 0.55);
  color: #ffc5f0;
  font-weight: 600;
}

/* ==========================================================================
   六爻完整排盘表 + 用神建议
   ========================================================================== */
.section-subhead {
  margin: 0 0 14px;
  font-family: var(--font-brush);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subhead::before {
  content: '◈';
  font-size: 0.95rem;
  color: var(--gold);
}

.liuyao-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.24);
  background: rgba(11, 7, 26, 0.76);
  margin-bottom: 24px;
}

.liuyao-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 0.9rem;
}

.liuyao-table th {
  padding: 12px 10px;
  text-align: center;
  font-weight: 600;
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.1);
  border-bottom: 1px solid rgba(212, 175, 55, 0.24);
  white-space: nowrap;
}

.liuyao-table td {
  padding: 11px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.liuyao-table tbody tr:last-child td {
  border-bottom: none;
}

.liuyao-table tbody tr {
  transition: background 0.22s ease;
}

.liuyao-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.07);
}

.liuyao-table tbody tr.row-moving {
  background: rgba(232, 76, 124, 0.08);
}

.liuyao-table tbody tr.row-xunkong td:first-child {
  box-shadow: inset 3px 0 0 #b884ff;
}

.liuyao-table tbody tr.row-yuepo td:first-child {
  box-shadow: inset 3px 0 0 #ff5f8d;
}

.table-yao-graphic {
  width: 82px;
  margin: 0 auto;
}

.table-yao-graphic .yao-line-wrap {
  height: 9px;
}

.badge-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  margin: 1px 2px;
  white-space: nowrap;
}

.badge-shi {
  background: linear-gradient(135deg, #f7df8f, #d4af37);
  color: #1c1002;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
}

.badge-ying {
  background: rgba(0, 229, 204, 0.18);
  color: #84fff2;
  border: 1px solid rgba(0, 229, 204, 0.45);
}

.badge-moving {
  background: rgba(255, 168, 76, 0.2);
  color: #ffd089;
  border: 1px solid rgba(255, 168, 76, 0.5);
}

.badge-static {
  color: var(--text-muted);
  font-weight: 400;
}

.badge-xunkong {
  background: rgba(164, 102, 255, 0.24);
  color: #e2c7ff;
  border: 1px dashed rgba(197, 138, 255, 0.8);
  box-shadow: 0 0 10px rgba(164, 102, 255, 0.35);
}

.badge-yuepo {
  background: rgba(232, 76, 124, 0.26);
  color: #ffadc4;
  border: 1px solid rgba(232, 76, 124, 0.8);
  box-shadow: 0 0 12px rgba(232, 76, 124, 0.4);
}

.badge-richong {
  background: rgba(255, 138, 76, 0.2);
  color: #ffc39e;
  border: 1px solid rgba(255, 138, 76, 0.45);
}

.badge-rihe {
  background: rgba(56, 217, 169, 0.18);
  color: #93ffdc;
  border: 1px solid rgba(56, 217, 169, 0.45);
}

.ws-tag {
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.78rem;
}
.ws-旺 { color: #ffe38e; background: rgba(212, 175, 55, 0.2); }
.ws-相 { color: #8afff2; background: rgba(0, 229, 204, 0.16); }
.ws-平, .ws-休 { color: #cbd5e1; background: rgba(255, 255, 255, 0.08); }
.ws-衰, .ws-囚, .ws-死 { color: #f8a4c0; background: rgba(232, 76, 124, 0.16); }

.liushen-青龙 { color: #67f0c2; }
.liushen-朱雀 { color: #ff8095; }
.liushen-勾陈 { color: #f2cb72; }
.liushen-腾蛇 { color: #d69bff; }
.liushen-白虎 { color: #e2e8f0; }
.liushen-玄武 { color: #7cc5ff; }

.yongshen-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.yongshen-item {
  padding: 12px 11px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.yongshen-name {
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.yongshen-desc {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.55;
}

/* ==========================================================================
   羊皮纸风格断语区 (暖色渐变 + 圆角 + 内阴影 + 朱印)
   ========================================================================== */
.parchment-card {
  position: relative;
  padding: 24px 26px 24px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 12% 15%, rgba(255, 252, 240, 0.65), transparent 55%),
    radial-gradient(ellipse at 88% 85%, rgba(196, 152, 82, 0.25), transparent 52%),
    linear-gradient(145deg, #f8eed8 0%, #f0e1be 52%, #e4cd9d 100%);
  color: #362210;
  border: 1.5px solid rgba(186, 141, 61, 0.68);
  box-shadow:
    inset 0 0 34px rgba(126, 84, 24, 0.24),
    inset 0 1px 0 rgba(255, 252, 242, 0.85),
    0 14px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.parchment-card::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(154, 108, 38, 0.28);
  border-radius: 12px;
  pointer-events: none;
}

.parchment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.parchment-title {
  margin: 0;
  font-family: var(--font-brush);
  font-size: 1.65rem;
  color: #4f2809;
  letter-spacing: 0.08em;
}

.parchment-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 6px;
  border: 2px solid #a82828;
  color: #a82828;
  font-family: var(--font-brush);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  background: rgba(168, 40, 40, 0.07);
  transform: rotate(-3deg);
}

.parchment-seal--good {
  border-color: #9e2a1c;
  color: #9e2a1c;
}

.parchment-seal--warn {
  border-color: #7c2d6e;
  color: #7c2d6e;
}

.parchment-text {
  margin: 0 0 10px;
  font-size: 0.97rem;
  line-height: 1.85;
  color: #3d2613;
}

.parchment-text:last-child {
  margin-bottom: 0;
}

.parchment-note {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(138, 92, 28, 0.1);
  border-left: 3px solid #9e6b22;
  font-size: 0.9rem;
  color: #4c3118;
  margin-top: 10px;
}

/* ==========================================================================
   梅花易数：体用五行生克环形图 + 应期 + 万物类象
   ========================================================================== */
.meihua-analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 22px;
  margin-bottom: 24px;
  align-items: stretch;
}

.tiyong-diagram-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 50% 50%, rgba(123, 47, 191, 0.16), rgba(11, 7, 28, 0.85) 72%);
  border: 1px solid rgba(224, 102, 184, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tiyong-svg {
  width: 100%;
  max-width: 340px;
  height: auto;
  overflow: visible;
}

.tiyong-energy-line {
  stroke-dasharray: 8 6;
  animation: energyFlow 1.4s linear infinite;
}

.tiyong-energy-line--reverse {
  animation-direction: reverse;
}

@keyframes energyFlow {
  from { stroke-dashoffset: 28; }
  to { stroke-dashoffset: 0; }
}

.tiyong-pulse-ring {
  transform-origin: center;
  transform-box: fill-box;
  animation: pulseRing 2.6s ease-in-out infinite;
}

@keyframes pulseRing {
  0%, 100% { opacity: 0.35; transform: scale(0.96); }
  50% { opacity: 0.85; transform: scale(1.06); }
}

.meihua-right-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yingqi-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(35, 18, 68, 0.78), rgba(14, 9, 34, 0.88));
  border: 1px solid rgba(212, 175, 55, 0.28);
}

.yingqi-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.yingqi-chip {
  font-size: 0.82rem;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.34);
  color: var(--gold-bright);
}

.yingqi-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.7;
}

/* 八卦类象展开区 */
.leixiang-section {
  border-radius: var(--radius-md);
  border: 1px solid rgba(224, 102, 184, 0.26);
  background: rgba(14, 9, 34, 0.68);
  overflow: hidden;
}

.leixiang-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: rgba(224, 102, 184, 0.08);
  transition: background 0.2s ease;
}

.leixiang-header:hover {
  background: rgba(224, 102, 184, 0.15);
}

.leixiang-header-title {
  font-family: var(--font-brush);
  font-size: 1.35rem;
  color: #ffc5f0;
  letter-spacing: 0.08em;
}

.leixiang-caret {
  font-size: 0.85rem;
  color: var(--text-sub);
  transition: transform 0.28s ease;
}

.leixiang-section.expanded .leixiang-caret {
  transform: rotate(180deg);
}

.leixiang-body {
  display: none;
  padding: 16px 18px 20px;
}

.leixiang-section.expanded .leixiang-body {
  display: block;
  animation: pageFadeIn 0.3s ease;
}

.leixiang-subtabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 14px;
}

.leixiang-subtab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  font-family: var(--font-serif);
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.22s ease;
}

.leixiang-subtab.active {
  background: linear-gradient(135deg, #f9c1eb, #c366e0);
  color: #180624;
  font-weight: 600;
  border-color: transparent;
}

.leixiang-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.leixiang-cell {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.leixiang-key {
  font-size: 0.78rem;
  color: #ffb8e8;
  font-weight: 600;
  margin-bottom: 3px;
}

.leixiang-val {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* ==========================================================================
   奇门遁甲：值符值使条 + 3×3 九宫格 + 罗盘 + 格局联动列表
   ========================================================================== */
.zhifu-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.zhifu-tile {
  padding: 12px 15px;
  border-radius: var(--radius-md);
  background: rgba(0, 229, 204, 0.07);
  border: 1px solid rgba(0, 229, 204, 0.24);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.zhifu-tile--gold {
  background: rgba(212, 175, 55, 0.09);
  border-color: rgba(212, 175, 55, 0.32);
}

.zhifu-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.zhifu-val {
  font-size: 1.02rem;
  font-weight: 700;
  color: #93fff4;
}

.zhifu-tile--gold .zhifu-val {
  color: var(--gold-bright);
}

.zhifu-sub {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.wubuyushi-alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: rgba(232, 76, 124, 0.18);
  border: 1px solid rgba(232, 76, 124, 0.6);
  color: #ffc1d3;
  font-size: 0.88rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 3x3 奇门九宫格 */
.qimen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.qimen-palace {
  position: relative;
  min-height: 188px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(16, 22, 48, 0.82), rgba(10, 8, 28, 0.92));
  border: 1px solid rgba(0, 229, 204, 0.24);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s var(--ease-mystic), box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: default;
  overflow: hidden;
}

.qimen-palace:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 229, 204, 0.72);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55), 0 0 26px rgba(0, 229, 204, 0.28);
  z-index: 3;
}

.qimen-palace.is-jifang {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: inset 0 0 22px rgba(212, 175, 55, 0.08);
}

.qimen-palace.is-highlighted {
  transform: translateY(-6px) scale(1.015);
  border-color: #f7df8f !important;
  box-shadow: 0 0 0 2px rgba(247, 223, 143, 0.45), 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 34px rgba(212, 175, 55, 0.52) !important;
  z-index: 4;
}

/* 中五宫特殊标记 */
.qimen-palace.is-center {
  background:
    radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.22) 0%, rgba(123, 47, 191, 0.16) 52%, rgba(12, 8, 30, 0.94) 100%);
  border: 1.5px solid rgba(247, 223, 143, 0.58);
  box-shadow: inset 0 0 32px rgba(212, 175, 55, 0.16), 0 0 22px rgba(212, 175, 55, 0.16);
}

.center-taiji-bg {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 118px;
  height: 118px;
  transform: translate(-50%, -50%);
  opacity: 0.16;
  pointer-events: none;
  animation: slowRotate 26s linear infinite;
}

.palace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.78rem;
}

.palace-god {
  color: #c8a2ff;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.palace-flags {
  display: flex;
  align-items: center;
  gap: 4px;
}

.flag-mini {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.flag-zf { background: rgba(212, 175, 55, 0.26); color: #ffe799; border: 1px solid rgba(212, 175, 55, 0.5); }
.flag-zs { background: rgba(0, 229, 204, 0.22); color: #8cfff3; border: 1px solid rgba(0, 229, 204, 0.5); }

.palace-mid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.palace-star-door {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.palace-star {
  font-size: 0.94rem;
  font-weight: 600;
  color: #dbeafe;
}

.palace-star-ji {
  font-size: 0.76rem;
  color: var(--gold-bright);
  margin-left: 3px;
}

.palace-door {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.door-吉 { color: #67f5cf; text-shadow: 0 0 10px rgba(0, 229, 204, 0.35); }
.door-中 { color: #f6d57a; }
.door-凶 { color: #f48fb1; }

.palace-stems {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 58px;
}

.stem-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1.1;
}

.stem-tian {
  font-family: var(--font-brush);
  font-size: 1.95rem;
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(212, 175, 55, 0.52);
}

.stem-ji {
  font-family: var(--font-brush);
  font-size: 1.05rem;
  color: #93fff4;
}

.stem-divider {
  width: 28px;
  height: 1px;
  background: rgba(212, 175, 55, 0.32);
  margin: 2px 0;
}

.stem-di {
  font-family: var(--font-brush);
  font-size: 1.55rem;
  color: #9ad8ff;
}

.palace-center-core {
  text-align: center;
  padding: 8px 0;
  position: relative;
  z-index: 1;
}

.center-gan {
  font-family: var(--font-brush);
  font-size: 2.35rem;
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(212, 175, 55, 0.65);
  line-height: 1.1;
}

.center-note {
  font-size: 0.78rem;
  color: #e4c982;
  margin-top: 4px;
}

.palace-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.palace-loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.palace-geju-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.geju-chip {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.geju-chip--ji {
  background: linear-gradient(135deg, rgba(247, 223, 143, 0.28), rgba(212, 175, 55, 0.22));
  color: #fff0b3;
  border: 1px solid rgba(247, 223, 143, 0.65);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.28);
}

.geju-chip--xiong {
  background: linear-gradient(135deg, rgba(232, 76, 124, 0.28), rgba(123, 47, 191, 0.34));
  color: #ffb8d2;
  border: 1px solid rgba(232, 76, 124, 0.62);
  box-shadow: 0 0 10px rgba(176, 46, 122, 0.32);
}

/* 奇门下栏：罗盘 + 格局全列表 */
.qimen-lower-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  gap: 20px;
  margin-bottom: 24px;
}

.compass-card,
.geju-list-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(12, 10, 34, 0.78);
  border: 1px solid rgba(0, 229, 204, 0.22);
}

.compass-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.compass-svg {
  width: 100%;
  max-width: 268px;
  height: auto;
}

.jifang-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.jifang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.18);
  font-size: 0.84rem;
  transition: all 0.22s ease;
  cursor: pointer;
}

.jifang-row:hover {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(247, 223, 143, 0.55);
}

.jifang-dir {
  font-weight: 700;
  color: var(--gold-bright);
}

.jifang-reasons {
  color: #93fff4;
  font-size: 0.8rem;
}

.geju-all-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.geju-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: all 0.24s var(--ease-mystic);
  cursor: pointer;
}

.geju-item:hover,
.geju-item.is-linked {
  transform: translateX(4px);
  border-color: rgba(247, 223, 143, 0.65);
  background: rgba(212, 175, 55, 0.12);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.2);
}

.geju-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.geju-item-name {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-main);
}

.geju-item-desc {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.geju-item-palace {
  font-size: 0.78rem;
  color: #93fff4;
  white-space: nowrap;
}

.geju-empty {
  padding: 26px 14px;
  text-align: center;
  color: var(--text-sub);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ==========================================================================
   Toast 轻提示
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(18, 10, 42, 0.92);
  border: 1px solid rgba(247, 223, 143, 0.5);
  color: var(--gold-bright);
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  animation: toastIn 0.3s var(--ease-mystic) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   自定义滚动条
   ========================================================================== */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 6, 24, 0.6);
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(247, 223, 143, 0.6);
}

/* ==========================================================================
   响应式适配
   ========================================================================== */
@media (max-width: 980px) {
  .portal-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
  }

  .meihua-analysis-grid,
  .qimen-lower-grid {
    grid-template-columns: 1fr;
  }

  .yongshen-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leixiang-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .zhifu-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .quick-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .nav-pill {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  .app-main {
    padding: 18px 14px 56px;
  }

  .form-row-grid,
  .num-inputs-grid,
  .manual-yao-grid,
  .hex-trio-grid {
    grid-template-columns: 1fr;
  }

  .control-card-inner {
    padding: 18px 16px 20px;
  }

  .result-stage {
    padding: 18px 14px 24px;
  }

  .coin-3d {
    width: 70px;
    height: 70px;
  }

  .coin-hole {
    width: 18px;
    height: 18px;
  }

  .qimen-grid {
    gap: 8px;
  }

  .qimen-palace {
    min-height: 158px;
    padding: 10px 8px 9px;
  }

  .stem-tian {
    font-size: 1.5rem;
  }

  .stem-di {
    font-size: 1.25rem;
  }

  .palace-star {
    font-size: 0.82rem;
  }

  .palace-door {
    font-size: 0.88rem;
  }

  .leixiang-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parchment-card {
    padding: 18px 16px;
  }
}

@media (max-width: 440px) {
  .brand-text {
    font-size: 1.25rem;
  }

  .history-toggle-btn span:nth-child(2) {
    display: none;
  }

  .shake-progress-bar {
    gap: 4px;
  }

  .shake-step {
    font-size: 0.7rem;
    padding: 5px 2px;
  }

  .qimen-palace {
    min-height: 146px;
  }

  .palace-stems {
    min-width: 42px;
    padding: 3px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
