/* =============================================================
   Mei Hua Yi Shu — Section Styles
   Inherits base from ../css/style.css
   ============================================================= */

/* ============ SECTION NAV ============ */
.section-nav {
  position: sticky;
  top: 56px;
  z-index: 900;
  background: oklch(0.97 0.01 270 / 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid oklch(0.90 0.02 270 / 0.5);
  padding: 0 2rem;
}
.section-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.section-nav-inner::-webkit-scrollbar { display: none; }
.section-nav a {
  display: block;
  padding: 0.75rem 1rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .3s, border-color .3s;
}
.section-nav a:hover { color: var(--gold); }
.section-nav a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ============ INDEX HERO ============ */
.mh-hero {
  position: relative;
  padding: 8rem 2rem 5rem;
  text-align: center;
  background: var(--sacred-gradient);
  overflow: hidden;
}
.mh-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, oklch(0.95 0.06 200 / 0.25), transparent),
    radial-gradient(ellipse 50% 60% at 70% 80%, oklch(0.94 0.05 340 / 0.2), transparent);
  pointer-events: none;
}
.mh-hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
}
.mh-hero .zh-title {
  font-family: var(--font-zh);
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: var(--gold);
  margin-bottom: 0.3rem;
  letter-spacing: .3em;
}
.mh-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}
.mh-hero .en-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.mh-hero p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.85;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.mh-hero-cta {
  display: inline-block;
  padding: 0.8rem 2.4rem;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: .4s;
  position: relative;
  overflow: hidden;
}
.mh-hero-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-100%);
  transition: .4s;
  z-index: -1;
}
.mh-hero-cta:hover { color: #fff; }
.mh-hero-cta:hover::before { transform: translateX(0); }

/* Floating trigram decoration */
.mh-hero-deco {
  position: absolute;
  bottom: 2rem;
  right: 3rem;
  font-family: 'Noto Serif SC', serif;
  font-size: 8rem;
  color: var(--gold);
  opacity: 0.06;
  pointer-events: none;
  line-height: 1;
}

/* ============ OVERVIEW GRID (INDEX) ============ */
.mh-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}
.mh-overview-card {
  display: block;
  padding: 2rem 1.6rem;
  border: 1px solid oklch(0.88 0.02 270 / 0.5);
  border-radius: 4px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: transform .3s, box-shadow .3s, border-color .3s;
  text-decoration: none;
}
.mh-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--glow);
  border-color: var(--gold);
}
.mh-overview-card .card-icon {
  font-family: 'Noto Serif SC', serif;
  font-size: 2.2rem;
  color: var(--gold);
  margin-bottom: 0.8rem;
  display: block;
}
.mh-overview-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
  color: var(--text-bright);
}
.mh-overview-card .zh-label {
  font-family: var(--font-zh);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.7rem;
}
.mh-overview-card p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1rem;
}
.mh-overview-card .card-link {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ============ FEATURED QUOTE (INDEX) ============ */
.mh-featured-quote {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 2rem;
}
.mh-featured-quote .zh-text {
  font-family: var(--font-zh);
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
  line-height: 1.8;
}
.mh-featured-quote .en-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
  line-height: 1.7;
}
.mh-featured-quote .source {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* ============ TIMELINE ============ */
.timeline {
  max-width: 720px;
  margin: 2rem auto;
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), oklch(0.80 0.04 85 / 0.3));
}
.timeline-item {
  margin-bottom: 2.5rem;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--bg);
  transform: translateX(-4px);
}
.timeline-item h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-bright);
}
.timeline-item p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}

/* ============ PRINCIPLE CARDS ============ */
.principle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  margin: 2rem auto;
}
.principle-card {
  padding: 1.8rem 1.4rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: transform .3s, box-shadow .3s;
}
.principle-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--glow);
}
.principle-card .card-icon {
  font-family: 'Noto Serif SC', serif;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 0.8rem;
  display: block;
}
.principle-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-bright);
}
.principle-card .zh-label {
  font-family: var(--font-zh);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}
.principle-card p {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ============ METHOD STEPS ============ */
.method-steps {
  max-width: 720px;
  margin: 2rem auto;
}
.method-step {
  display: flex;
  gap: 1.4rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}
.method-step .step-num {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--bg2);
}
.method-step .step-content h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}
.method-step .step-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

/* ============ EXAMPLE BOX ============ */
.example-box {
  max-width: 720px;
  margin: 2rem auto;
  padding: 2rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--bg-card);
  position: relative;
}
.example-box::before {
  content: '例';
  position: absolute;
  top: -14px;
  left: 24px;
  font-family: var(--font-zh);
  font-size: 0.85rem;
  color: var(--gold);
  background: var(--bg);
  padding: 0 8px;
  letter-spacing: .1em;
}
.example-box h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.8rem;
  color: var(--gold);
}
.example-box .calc-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.example-box .calc-row .label {
  color: var(--text-dim);
  min-width: 140px;
}
.example-box .calc-row .value {
  color: var(--text-bright);
  font-weight: 600;
}
.example-box .calc-row .arrow {
  color: var(--gold);
}
.example-box hr {
  border: none;
  border-top: 1px solid oklch(0.90 0.02 270 / 0.5);
  margin: 1rem 0;
}

/* ============ TABLE ============ */
.ref-table {
  width: 100%;
  max-width: 720px;
  margin: 1.5rem auto;
  border-collapse: collapse;
}
.ref-table th,
.ref-table td {
  padding: 0.6rem 1rem;
  text-align: center;
  border: 1px solid oklch(0.88 0.02 270 / 0.5);
  font-size: 0.9rem;
}
.ref-table th {
  background: var(--bg3);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ref-table td { color: var(--text); }
.ref-table .zh {
  font-family: var(--font-zh);
  color: var(--gold);
  font-weight: 600;
}

/* ============ APP GRID ============ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  max-width: 880px;
  margin: 2rem auto;
}
.app-item {
  padding: 1.4rem;
  border: 1px solid oklch(0.88 0.02 270 / 0.5);
  border-radius: 4px;
  background: var(--bg-card);
  transition: border-color .3s;
}
.app-item:hover { border-color: var(--gold); }
.app-item h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.app-item p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ============ QUOTE BLOCK ============ */
.quote-block {
  max-width: 640px;
  margin: 2rem auto;
  text-align: center;
  padding: 2rem;
}
.quote-block .zh-text {
  font-family: var(--font-zh);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
  line-height: 1.8;
}
.quote-block .en-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
  line-height: 1.7;
}
.quote-block .source {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* ============ CONTENT CARDS (generic) ============ */
.content-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  margin: 2rem auto;
}
.content-card {
  padding: 1.6rem;
  border: 1px solid oklch(0.88 0.02 270 / 0.5);
  border-radius: 4px;
  background: var(--bg-card);
  transition: border-color .3s, transform .3s;
}
.content-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.content-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--text-bright);
}
.content-card .zh-label {
  font-family: var(--font-zh);
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}
.content-card p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

/* ============ FIVE-ELEMENT DIAGRAM ============ */
.wuxing-diagram {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem auto;
  max-width: 560px;
}
.wuxing-node {
  width: 72px;
  height: 72px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-zh);
  font-size: 1.1rem;
  color: var(--gold);
  background: var(--bg-card);
  transition: background .3s;
}
.wuxing-node:hover { background: var(--gold-muted); }
.wuxing-node .el-name {
  font-size: 0.65rem;
  font-family: var(--font-display);
  color: var(--text-dim);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.wuxing-arrow {
  font-size: 1.2rem;
  color: var(--gold);
  opacity: 0.5;
}

/* ============ BACK-TO-INDEX ============ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  transition: color .3s;
}
.back-link:hover { color: var(--gold); }

/* ============ REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .mh-hero { padding: 6rem 1.5rem 3rem; }
  .mh-hero-deco { display: none; }
  .mh-overview { grid-template-columns: 1fr; }
  .principle-grid { grid-template-columns: 1fr; }
  .method-step { flex-direction: column; gap: 0.8rem; }
  .example-box { padding: 1.4rem; }
  .app-grid { grid-template-columns: 1fr; }
  .content-cards { grid-template-columns: 1fr; }
  .wuxing-diagram { gap: 0.3rem; }
  .wuxing-node { width: 56px; height: 56px; font-size: 0.9rem; }
  .ref-table { font-size: 0.8rem; }
  .ref-table th, .ref-table td { padding: 0.4rem 0.5rem; }
}
