/* =====================
   DESIGN TOKENS
===================== */
:root {
  --bg:         #f7f0e6;
  --surface:    #ffffff;
  --ink:        #1c0f0f;
  --ink-light:  #2d1a1a;
  --red:        #b83232;
  --red-light:  #d44e4e;
  --saffron:    #c8820a;
  --saffron-lt: #e09c2a;
  --text:       #2d1f1f;
  --muted:      #7a6060;
  --border:     #e0d0c8;
  --radius:     8px;
}

/* =====================
   SKIP LINK
===================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--red);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  font-weight: bold;
  text-decoration: none;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

/* =====================
   RESET & BASE
===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  scroll-behavior: smooth;
}

a { color: inherit; text-decoration: none; }

/* =====================
   PORTAL BAR
===================== */
.portal-bar {
  background: var(--ink);
  padding: 0.45rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.portal-bar-link {
  font-size: 0.78rem;
  color: var(--saffron-lt);
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.portal-bar-link:hover { color: #ffffff; }

/* =====================
   HEADER — INDEX
===================== */
.site-header {
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
}

.site-header h1 {
  font-family: "Noto Serif SC", serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--red-light);
  margin: 0;
  letter-spacing: 0.06em;
}

.header-zh {
  font-family: "Noto Serif SC", serif;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.25em;
  margin-top: 0.3rem;
}

.header-tradition {
  font-size: 0.75rem;
  color: var(--saffron-lt);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* =====================
   HEADER — SECTION PAGE
===================== */
.section-header {
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
}

.section-header h1 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--red-light);
  margin: 0 0 0.5rem 0;
}

.section-header .header-zh {
  font-size: 0.88rem;
}

.back-link {
  display: inline-block;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  transition: color 0.2s;
}

.back-link:hover { color: var(--saffron-lt); }

.section-nav {
  display: flex;
  gap: 2rem;
  margin-top: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* =====================
   INTRO — INDEX
===================== */
.intro {
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  text-align: center;
  font-size: 0.97rem;
  color: var(--muted);
  line-height: 1.85;
}

/* =====================
   SECTION CARD GRID — INDEX
===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 860px;
  margin: 1.5rem auto 3.5rem;
  padding: 0 1.5rem;
}

.section-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 90px;
  padding: 1.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  text-align: center;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.09);
  border-color: var(--red);
}

.section-card .card-symbol {
  font-family: "Noto Serif SC", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.section-card .card-title-zh {
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.section-card .card-title-en {
  font-size: 0.78rem;
  color: var(--muted);
}

.section-card .card-title-combined {
  font-family: "Noto Serif SC", serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

/* =====================
   SECTION PAGE — CONTAINER
===================== */
.section-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem 3rem;
}

/* =====================
   FULL TEXT BLOCK
===================== */
.full-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.75rem;
  text-align: center;
  font-family: "Noto Serif SC", serif;
  font-size: 1.15rem;
  line-height: 2.1;
  color: var(--text);
}

.read-btn {
  display: inline-block;
  margin-top: 1.1rem;
  padding: 0.5rem 1.1rem;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  font-family: "Noto Sans SC", sans-serif;
}

.read-btn:hover { background: var(--red-light); }

/* =====================
   LINE-BY-LINE EXPLANATION
===================== */
.line-explanation h2,
.summary h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.75rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}

.explanation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.9rem;
}

.explanation-card .line {
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.explanation-card .pinyin {
  font-size: 0.82rem;
  color: var(--saffron);
  margin-bottom: 0.35rem;
  font-style: italic;
}

.explanation-card .translation {
  font-size: 0.9rem;
  color: var(--red);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.explanation-card .explanation-zh {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.explanation-card .explanation {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--muted);
}

/* =====================
   EXPAND / COLLAPSE TOGGLE
===================== */
.toggle-btn {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.3rem 0.7rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  font-family: "Noto Sans SC", sans-serif;
  transition: color 0.2s, border-color 0.2s;
}

.toggle-btn:hover {
  color: var(--red);
  border-color: var(--red);
}

.detail-content {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.detail-content .translation {
  font-size: 0.9rem;
  color: var(--red);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.detail-content .explanation {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--muted);
}

/* Summary toggle */
.summary .toggle-btn {
  margin-top: 0.8rem;
}

.summary .detail-content {
  margin-top: 0.8rem;
}

.summary-zh {
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--text);
}

/* =====================
   SUMMARY
===================== */
.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.75rem;
}

.summary p {
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--muted);
}

/* =====================
   FOOTER
===================== */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.35);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  margin-top: 2rem;
}

.footer-portal-link {
  display: block;
  color: rgba(255,255,255,0.45);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.footer-portal-link:hover { color: var(--saffron-lt); }

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .section-header,
  .site-header { padding: 1.5rem 1rem; }
  .section-container { padding: 0 1rem 2rem; }
  .full-text { padding: 1.25rem 1rem; font-size: 1.05rem; }
}
