.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(245,240,230,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-border);
  height: 80px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--blue-deep);
  text-decoration: none;
}

.logo-icon {
  color: var(--blue-deep);
  display: flex;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--blue-deep);
}

.logo-sub {
  font-size: 0.65rem;
  letter-spacing: 0.5em;
  color: var(--ink-pale);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: 0.5rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(26,58,92,0.05);
  color: var(--blue-deep);
}

.nav-link.active {
  color: var(--gold);
  background: rgba(196,163,90,0.08);
}

.lang-toggle {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: var(--space-sm);
}

.lang-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Mobile */
@media (max-width: 768px) {
  .header { height: 54px; }
  .header-inner { padding: 0 var(--space-sm); }
  .logo-title { font-size: 0.88rem; }
  .logo-sub { display: none; }
  .logo-icon svg { width: 20px; height: 20px; }
  .hamburger { display: flex; }
  .header-nav {
    display: none;
    position: fixed;
    top: 54px; left: 0; right: 0;
    background: rgba(245,240,230,0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: var(--space-md);
    border-bottom: 1px solid var(--paper-border);
    gap: 2px;
  }
  .header-nav.open { display: flex; }
  .nav-link { width: 100%; padding: 0.6rem 0.8rem; font-size: 0.78rem; }
  .lang-toggle { margin-left: 0; width: 100%; text-align: center; margin-top: var(--space-xs); }
}
.footer {
  margin-top: auto;
}

.footer-wave {
  margin-bottom: -1px;
  line-height: 0;
}

.footer-wave svg {
  display: block;
  width: 100%;
  height: 50px;
}

.footer-body {
  background: var(--blue-deep);
  color: var(--blue-pale);
  padding: var(--space-3xl) 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-2xl);
}

.footer-logo {
  margin-bottom: var(--space-md);
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--blue-pale);
  line-height: 1.6;
  max-width: 300px;
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: var(--space-lg);
}

.footer-col a {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--blue-pale);
  padding: 0.3rem 0;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--gold-light);
}

.footer-bottom {
  margin-top: var(--space-2xl);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--ink-pale);
  color: rgba(168,200,219,0.5);
  margin-top: var(--space-md);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .footer-tagline { max-width: 100%; }
}
.home-page {
  overflow-x: hidden;
}

/* Hero */
.hero-section {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  overflow: hidden;
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(26,58,92,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(196,163,90,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.compass-canvas {
  position: absolute;
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.7;
  pointer-events: none;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.4rem 1rem;
  border: 1px solid var(--paper-border);
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-pale);
  margin-bottom: var(--space-lg);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.15;
  color: var(--blue-deep);
  margin-bottom: var(--space-md);
}

.hero-title .hero-line1 {
  display: block;
  font-weight: 300;
  letter-spacing: 0.12em;
}

.hero-title .hero-line2 {
  display: block;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.18em;
}

.hero-desc {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--ink-pale);
  line-height: 1.7;
  max-width: 500px;
  margin: 0 auto var(--space-lg);
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Services */
.services-section {
  padding: var(--space-3xl) 0;
  text-align: center;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.service-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.service-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.service-card p {
  font-size: 0.85rem;
  color: var(--ink-pale);
  line-height: 1.6;
  flex-grow: 1;
}

/* Why Section */
.why-section {
  background: var(--blue-deep);
  padding: var(--space-3xl) 0;
  color: var(--blue-pale);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.why-card {
  text-align: center;
}

.why-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.why-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-light);
  margin-bottom: var(--space-xs);
}

.why-card p {
  font-size: 0.85rem;
  color: var(--blue-pale);
  line-height: 1.6;
}

/* CTA */
.cta-section {
  padding: var(--space-3xl) 0;
}

.cta-card {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-card p {
  color: var(--ink-pale);
  line-height: 1.7;
  margin-top: var(--space-md);
}

/* Mobile — COMPACT LAYOUT */
@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    padding: calc(60px + var(--space-lg)) var(--space-md) var(--space-lg);
  }
  .compass-canvas {
    width: 150px !important;
    height: 150px !important;
  }
  .hero-badge {
    font-size: 0.6rem;
    padding: 0.25rem 0.7rem;
    margin-bottom: var(--space-sm);
  }
  .hero-title {
    font-size: 1.3rem;
    line-height: 1.3;
  }
  .hero-desc {
    font-size: 0.78rem;
    margin-bottom: var(--space-md);
    max-width: 100%;
  }
  .hero-actions {
    flex-direction: row;
    gap: var(--space-xs);
  }
  .hero-actions .btn {
    flex: 1;
    font-size: 0.78rem;
    padding: 0.55rem 0.8rem;
    justify-content: center;
    min-width: 0;
  }
  .hero-actions .btn svg {
    display: none;
  }
  /* Services — icon + title only, 3 columns */
  .services-section {
    padding: var(--space-lg) 0;
  }
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xs);
    margin-top: var(--space-md);
  }
  .service-card {
    padding: var(--space-sm) var(--space-xs);
    gap: 2px;
  }
  .service-card .service-icon {
    font-size: 1.3rem;
    margin-bottom: 0;
  }
  .service-card h3 {
    font-size: 0.65rem !important;
    line-height: 1.2;
  }
  .service-card .service-tag,
  .service-card .service-description,
  .service-card p,
  .service-card .gold-divider-left {
    display: none;
  }
  /* Why section — compact */
  .why-section {
    padding: var(--space-lg) 0;
  }
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
    margin-top: var(--space-md);
  }
  .why-card {
    padding: var(--space-sm);
    text-align: left;
  }
  .why-icon {
    font-size: 1.2rem;
    margin-bottom: 0;
  }
  .why-card h3 {
    font-size: 0.7rem;
    margin-top: 2px;
  }
  .why-card p {
    display: none;
  }
  /* CTA */
  .cta-section {
    padding: var(--space-lg) 0;
  }
  .cta-card h2 {
    font-size: 1.2rem !important;
  }
  .cta-card p {
    font-size: 0.78rem;
  }
  .song-section-title {
    font-size: 1.1rem;
  }
  .song-section-sub {
    font-size: 0.78rem;
  }
}
.hexagram-display {
  padding: var(--space-lg);
}

.hexagram-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.hex-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faded);
  padding: 2px 8px;
  background: var(--paper);
  border-radius: var(--radius-sm);
}

.hex-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--blue-deep);
  letter-spacing: 0.1em;
}

.hexagram-visual {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: var(--space-md) 0;
}

.hex-yao-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
}

.hex-bar {
  min-width: 140px;
  display: flex;
  align-items: center;
}

.hex-bar-solid {
  display: block;
  height: 10px;
  width: 140px;
  border-radius: 5px;
  background: var(--blue-deep);
}

.hex-bar-left,
.hex-bar-right {
  display: block;
  height: 10px;
  width: 60px;
  border-radius: 5px;
  background: var(--gold-dark);
}

.yin-bar {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.hex-line-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #c0392b;
  min-width: 20px;
  text-align: left;
}
.loading-compass-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 16px;
}

.lc-ring-container {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-outer-ring,
.lc-inner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.lc-outer-ring {
  animation: lc-spin 12s linear infinite;
}

.lc-inner-ring {
  animation: lc-reverse-spin 8s linear infinite;
}

.lc-center {
  position: relative;
  z-index: 2;
}

.lc-center-char {
  font-family: var(--font-display, serif);
  font-size: 1.6rem;
  color: var(--gold, #c4a35a);
  text-shadow: 
    0 0 20px rgba(196, 163, 90, 0.4),
    0 0 40px rgba(196, 163, 90, 0.15);
}

.lc-text {
  text-align: center;
}

.lc-phase {
  font-family: var(--font-display, serif);
  font-size: 1rem;
  color: var(--blue-deep, #1a3a5c);
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

.lc-sub {
  font-family: var(--font-body, sans-serif);
  font-size: 0.78rem;
  color: var(--ink-pale, #888);
}

.lc-quote {
  max-width: 280px;
  text-align: center;
}

.lc-quote-line {
  height: 1px;
  width: 60px;
  margin: 8px auto;
  background: linear-gradient(to right, transparent, rgba(196,163,90,0.3), transparent);
}

.lc-quote-text {
  font-family: var(--font-display, serif);
  font-size: 0.88rem;
  color: var(--ink-faded, #666);
  font-style: italic;
  line-height: 1.6;
  min-height: 1.6em;
  transition: opacity 0.5s ease;
}

.lc-quote-text.fade-in {
  opacity: 1;
}

.lc-quote-text.fade-out {
  opacity: 0;
}

@keyframes lc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes lc-reverse-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
.liuyao-page {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-4xl);
}

.liuyao-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.liuyao-casting {
  position: sticky;
  top: 100px;
}

.question-input {
  margin-bottom: var(--space-lg);
  min-height: 80px;
  resize: vertical;
}

/* Hexagram Area */
.hexagram-area {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.hexagram-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 350px;
}

/* Yao Row - CSS bars like old app */
.yao-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  transition: all 0.4s ease;
}

.yao-row.yang {
  background: rgba(26,58,92,0.08);
  border-left: 3px solid var(--blue-deep);
}

.yao-row.yin {
  background: rgba(196,163,90,0.08);
  border-left: 3px solid var(--gold);
}

.yao-row.empty {
  background: rgba(0,0,0,0.02);
  border: 1px dashed var(--paper-border);
}

/* Yang bar: one solid bar (standard I-Ching yang line →) */
.yang-bar {
  display: flex;
  align-items: center;
  min-width: 120px;
}

.yang-bar span {
  display: block;
  height: 8px;
  width: 120px;
  border-radius: 4px;
  background: var(--blue-deep);
}

/* Yin bar: two broken bars (standard I-Ching yin line - -) */
.yin-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 120px;
  justify-content: center;
}

.yin-bar .yin-left,
.yin-bar .yin-right {
  display: block;
  height: 8px;
  width: 50px;
  border-radius: 4px;
  background: var(--gold-dark);
}

.yao-row.yin .yin-bar .yin-left,
.yao-row.yin .yin-bar .yin-right {
  background: var(--gold-dark);
}

/* Pending bar */
.pending-bar {
  height: 8px;
  width: 120px;
  border-radius: 4px;
  background: var(--ink-faded);
  opacity: 0.3;
}

.yao-name {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-pale);
  white-space: nowrap;
}

.yao-changing {
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: rgba(231, 76, 60, 0.15);
  color: #c0392b;
  margin-left: auto;
}

.yao-name.pending { color: var(--ink-faded); }

.yao-row.animating {
  animation: yaoFlash 0.5s ease-out;
}

@keyframes yaoFlash {
  0% { opacity: 0.2; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

.yao-row.revealed {
  animation: yaoReveal 0.4s ease-out;
}

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

.hexagram-placeholder {
  text-align: center;
  color: var(--ink-pale);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.step-hint {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  margin-top: var(--space-sm);
  opacity: 0.6;
}

/* Controls */
.liuyao-controls { text-align: center; min-height: 100px; }

.cast-btn { width: 100%; justify-content: center; }

.cast-btn.casting {
  animation: btnCast 0.8s infinite;
  pointer-events: none;
}

@keyframes btnCast {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.error-box {
  background: rgba(192,57,43,0.05);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: #c0392b;
  font-size: 0.85rem;
}

.error-box button {
  margin-top: var(--space-sm);
}

.liuyao-result { position: relative; }

.result-card { animation: fadeIn 0.5s ease-out; }

.result-content { margin-top: var(--space-lg); }

.report-body {
  font-family: var(--font-body);
  line-height: 1.8;
  color: var(--ink);
  font-size: 0.95rem;
}

.report-body h2 {
  font-size: 1.2rem;
  color: var(--blue-deep);
  margin: 1.5rem 0 0.5rem;
}

.report-body h3 {
  font-size: 1.05rem;
  color: var(--gold-dark);
  margin: 1.2rem 0 0.5rem;
  font-family: var(--font-display);
}

.report-body strong { color: var(--blue-deep); }

.result-actions { margin-top: var(--space-xl); text-align: center; }

@media (max-width: 768px) {
  .liuyao-layout { grid-template-columns: 1fr; }
  .liuyao-casting { position: static; }
}
.divination-page {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-4xl);
}

.divination-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.divination-form {
  position: sticky;
  top: 100px;
}

.form-group + .form-group {
  margin-top: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-sm);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-actions {
  margin-top: var(--space-lg);
  text-align: center;
}

.divination-result {
  min-height: 200px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--ink-faded);
  margin-top: 0.3rem;
  font-family: var(--font-sans);
}

.required {
  color: #c0392b;
}

.gender-selector {
  display: flex;
  gap: 0.5rem;
}

.gender-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--paper-border);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink-pale);
  cursor: pointer;
  transition: all 0.2s;
}

.gender-btn.active {
  border-color: var(--gold);
  background: rgba(196,163,90,0.08);
  color: var(--gold-dark);
}

.gender-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
  justify-content: center;
}
.btn-full:first-child {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .divination-layout { grid-template-columns: 1fr; }
  .divination-form { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr 1fr; }
}
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding-top: 80px;
}
/* =============================================
   东方共振 · 宋式青花美学设计系统
   Eastern Resonance — Song Dynasty Aesthetic
   ============================================= */


:root {
  /* 本地字体栈 — 不依赖 Google Fonts CDN（国内用户访问） */
  --font-display: 'Georgia', 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
  --font-body: 'Georgia', 'Songti SC', 'SimSun', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Menlo', 'Monaco', 'Courier New', monospace;

  /* 宣纸基调 — 宋式留白 */
  --paper: #f5f0e6;
  --paper-warm: #faf6ef;
  --paper-dark: #efe8da;
  --paper-border: #e0d8c8;

  /* 青花瓷主色 — 藏蓝体系 */
  --blue-deep: #0f2744;
  --blue-primary: #1a3a5c;
  --blue-mid: #2b5f8e;
  --blue-light: #4a8bb5;
  --blue-pale: #a8c8db;

  /* 鎏金 — 皇家点缀 */
  --gold: #c4a35a;
  --gold-light: #d4b87a;
  --gold-dark: #a8883e;
  --gold-pale: #e8dcc8;

  /* 墨色 — 正文 */
  --ink: #2c2416;
  --ink-light: #5c4a2e;
  --ink-pale: #8b7a5e;
  --ink-faded: #b8a88e;

  /* 朱红 — 小面积点缀 */
  --red: #c0392b;
  --red-light: #d55a4a;

  /* 白色 */
  --white: #ffffff;
  --white-alpha-80: rgba(255,255,255,0.8);
  --white-alpha-60: rgba(255,255,255,0.6);
  --white-alpha-30: rgba(255,255,255,0.3);

  /* 黑暗模式 */
  --dark-bg: #0a0f18;
  --dark-card: #141c28;
  --dark-border: #1e2a38;

  /* 字体 - 在顶部已定义（本地字体栈） */

  /* 间距 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;
}

/* 全局重置 */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--paper-warm);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--blue-mid);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--gold);
}

/* 青花装饰背景 — SVG 暗纹 */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5C30 5 32 10 35 12C38 14 42 14 45 12C48 10 50 5 50 5' fill='none' stroke='%231a3a5c' stroke-width='0.3' opacity='0.12'/%3E%3Cpath d='M10 25C10 25 14 28 18 28C22 28 26 25 26 25C26 25 22 22 18 22C14 22 10 25 10 25Z' fill='none' stroke='%231a3a5c' stroke-width='0.3' opacity='0.08'/%3E%3Ccircle cx='30' cy='35' r='8' fill='none' stroke='%23c4a35a' stroke-width='0.3' opacity='0.1'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

/* ===== 通用组件 ===== */

/* 宋式标题 */
.song-title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.song-title-sm {
  font-size: 1.1rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-md);
}

.song-title-main {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: var(--blue-deep);
  line-height: 1.2;
  margin-bottom: var(--space-lg);
}

.song-title-main .chinese {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink-light);
}

.song-section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 500;
  color: var(--blue-deep);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.song-section-sub {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink-pale);
  text-align: center;
  margin-bottom: var(--space-2xl);
  letter-spacing: 0.05em;
}

/* 金色分隔线 */
.gold-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: var(--space-lg) auto;
}

.gold-divider-left {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin: var(--space-md) 0;
}

/* 青花卡片 — 通用卡片组件 */
.blue-card {
  background: var(--white);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all 0.3s ease;
  position: relative;
}

.blue-card:hover {
  border-color: var(--blue-pale);
  box-shadow: 0 4px 20px rgba(26,58,92,0.08);
}

/* 金色边框卡片 */
.gold-card {
  background: linear-gradient(135deg, var(--white), var(--paper));
  border: 1px solid var(--gold-pale);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
}

.gold-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.btn-lg {
  padding: 0.85rem 1.8rem;
  font-size: 0.95rem;
}
.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue-primary));
  color: var(--paper);
  box-shadow: 0 2px 10px rgba(15,39,68,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-mid));
  box-shadow: 0 4px 15px rgba(15,39,68,0.4);
  transform: translateY(-1px);
  color: var(--paper);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--white);
  box-shadow: 0 2px 10px rgba(196,163,90,0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 4px 15px rgba(196,163,90,0.4);
  transform: translateY(-1px);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--blue-mid);
  color: var(--blue-mid);
}
.btn-outline:hover {
  background: var(--blue-deep);
  color: var(--paper);
  border-color: var(--blue-deep);
}

/* 输入框 */
.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink);
  transition: all 0.3s ease;
  outline: none;
}
.input-field:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(43,95,142,0.1);
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%235c4a2e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2rem;
}

label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* 响应式容器 */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

@media (max-width: 768px) {
  .page-container {
    padding: 0 var(--space-md);
  }
}

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--blue-pale);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 淡入动画 */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

/* 太极旋转 */
@keyframes taiji-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 罗盘关键帧 */
@keyframes compass-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ===== 背景纹理 ===== */
.bg-cloud-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M25 45 Q30 35 40 40 Q45 30 55 35 Q60 28 70 32 Q75 25 85 30 L80 45 L25 45Z' fill='%231a3a5c' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
