/* =========================================================
   山海潮韵 · 潮汕文化志 - 样式表
   设计基调：宣纸米白 + 朱砂红 + 茶褐金 + 青瓷绿
   ========================================================= */

:root {
  --bg-paper: #FAF6EE;
  --bg-alt: #F3ECE0;
  --bg-card: #FFFDF8;
  --ink-dark: #2C2420;
  --ink-muted: #66584E;
  --cinnabar: #B83B2A;
  --cinnabar-dark: #932B1D;
  --tea-gold: #C59B5F;
  --celadon: #22444B;
  --border-soft: #E5D9C5;
  --shadow-sm: 0 4px 14px rgba(44, 36, 32, 0.06);
  --shadow-md: 0 12px 30px rgba(44, 36, 32, 0.10);
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-dark);
  background-color: var(--bg-paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  margin-top: 0;
  line-height: 1.3;
  color: var(--ink-dark);
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--cinnabar);
  color: #FFFDF8;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  border-radius: 6px;
  border: 2px solid #F2DEC0;
  box-shadow: 0 2px 8px rgba(184, 59, 42, 0.25);
}

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

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.06em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--ink-muted);
  padding: 6px 2px;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--cinnabar);
  transition: width 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cinnabar);
  font-weight: 600;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0 9px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink-dark);
  border-radius: 2px;
}

/* ---------- Hero 区 ---------- */
.hero {
  position: relative;
  padding: 64px 0 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(197, 155, 95, 0.14), transparent 36%),
    radial-gradient(circle at 88% 75%, rgba(34, 68, 75, 0.10), transparent 40%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 44px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--cinnabar);
  background: rgba(184, 59, 42, 0.08);
  border: 1px solid rgba(184, 59, 42, 0.25);
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2.1rem, 4vw, 3.15rem);
  margin-bottom: 18px;
  letter-spacing: 0.03em;
}

.hero-title .highlight {
  color: var(--cinnabar);
  position: relative;
}

.hero-desc {
  font-size: 1.04rem;
  color: var(--ink-muted);
  margin-bottom: 28px;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--cinnabar);
  color: #FFFDF8;
  box-shadow: 0 6px 16px rgba(184, 59, 42, 0.24);
}

.btn-primary:hover {
  background: var(--cinnabar-dark);
}

.btn-outline {
  background: transparent;
  color: var(--celadon);
  border-color: var(--celadon);
}

.btn-outline:hover {
  background: rgba(34, 68, 75, 0.08);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.88rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding-top: 20px;
  border-top: 1px dashed var(--border-soft);
}

.stat-item dt {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.stat-item dd {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.96rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.visual-frame {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  text-align: center;
  width: min(360px, 100%);
}

.hero-svg {
  width: 100%;
  height: auto;
  display: block;
}

.visual-caption {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--ink-muted);
  letter-spacing: 0.14em;
}

/* ---------- 通用区块标题 ---------- */
.section {
  padding: 72px 0;
}

.section-alt {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 44px;
}

.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--cinnabar);
  font-weight: 700;
  margin-bottom: 8px;
}

.section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  margin-bottom: 12px;
}

.section-head p {
  margin: 0;
  color: var(--ink-muted);
}

/* ---------- 概览三城 ---------- */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.city-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-top: 4px solid var(--cinnabar);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.city-card:nth-child(2) {
  border-top-color: var(--celadon);
}

.city-card:nth-child(3) {
  border-top-color: var(--tea-gold);
}

.city-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.city-badge {
  display: inline-block;
  font-size: 0.76rem;
  color: var(--ink-muted);
  background: var(--bg-alt);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.city-card h3 {
  font-size: 1.28rem;
  margin-bottom: 10px;
}

.city-card p {
  font-size: 0.94rem;
  color: var(--ink-muted);
  margin: 0 0 16px;
}

.city-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.city-tags span {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--ink-dark);
}

/* ---------- 美食筛选与卡片 ---------- */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--ink-muted);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--cinnabar);
  color: #FFFDF8;
  border-color: var(--cinnabar);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.food-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.food-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.food-card.is-hidden {
  display: none;
}

.food-thumb {
  height: 132px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border-soft);
}

.food-thumb svg {
  width: 130px;
  height: 98px;
}

.thumb-red { background: linear-gradient(135deg, #FCECE8, #F7DCD5); }
.thumb-teal { background: linear-gradient(135deg, #E6F0F0, #D5E6E6); }
.thumb-gold { background: linear-gradient(135deg, #FBF2E1, #F3E2C3); }
.thumb-paper { background: linear-gradient(135deg, #F7F1E5, #EDE2CE); }

.food-body {
  padding: 20px 22px 24px;
}

.food-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--cinnabar);
  font-weight: 600;
  margin-bottom: 8px;
}

.food-body h3 {
  font-size: 1.18rem;
  margin-bottom: 8px;
}

.food-body p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

/* ---------- 工夫茶互动区 ---------- */
.tea-showcase {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: stretch;
}

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

.tea-step-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-muted);
  transition: all 0.2s ease;
}

.tea-step-btn .step-num {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.tea-step-btn .step-name {
  font-size: 0.82rem;
}

.tea-step-btn.active,
.tea-step-btn:hover {
  background: var(--celadon);
  color: #FFFDF8;
  border-color: var(--celadon);
}

.tea-detail-card,
.tea-set-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.tea-detail-tag {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--tea-gold);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.tea-detail-card h3 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.tea-detail-card p {
  color: var(--ink-muted);
  margin: 0 0 18px;
}

.tea-tip {
  background: var(--bg-alt);
  border-left: 4px solid var(--tea-gold);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}

.tea-set-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tea-svg {
  width: 100%;
  max-height: 190px;
}

.tea-fact h4 {
  font-size: 1.1rem;
  color: var(--celadon);
  margin-bottom: 6px;
}

.tea-fact p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* ---------- 非遗卡片与弹窗 ---------- */
.heritage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.heritage-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.heritage-card:hover {
  transform: translateY(-4px);
  border-color: var(--cinnabar);
}

.heritage-num {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(184, 59, 42, 0.25);
  margin-bottom: 10px;
}

.heritage-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.heritage-card p {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0 0 16px;
}

.heritage-more {
  font-size: 0.84rem;
  color: var(--cinnabar);
  font-weight: 600;
}

/* ---------- 建筑与人文 ---------- */
.arch-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 32px;
  align-items: center;
}

.arch-diagram-box {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.arch-svg {
  width: 100%;
  height: auto;
}

.diagram-note {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.arch-info-list {
  display: grid;
  gap: 18px;
}

.arch-item {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--celadon);
  border-radius: 12px;
  padding: 18px 20px;
}

.arch-item h3 {
  font-size: 1.12rem;
  margin-bottom: 6px;
}

.arch-item p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

/* ---------- 方言与测验 ---------- */
.interactive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.dialect-panel,
.quiz-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.dialect-panel h3,
.quiz-panel h3 {
  font-size: 1.24rem;
  margin-bottom: 16px;
}

.dialect-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dialect-card {
  text-align: left;
  background: var(--bg-paper);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dialect-card:hover {
  border-color: var(--tea-gold);
}

.dialect-card.revealed {
  background: #FFF9EE;
  border-color: var(--cinnabar);
}

.d-word {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cinnabar);
}

.d-phonetic {
  font-size: 0.8rem;
  color: var(--celadon);
  font-family: monospace;
}

.d-meaning {
  font-size: 0.84rem;
  color: var(--ink-muted);
  display: none;
}

.dialect-card.revealed .d-meaning {
  display: block;
}

.dialect-card:not(.revealed)::after {
  content: "点击查看释义";
  font-size: 0.76rem;
  color: var(--ink-muted);
}

/* 测验 */
.quiz-progress {
  font-size: 0.82rem;
  color: var(--cinnabar);
  font-weight: 700;
  margin-bottom: 8px;
}

.quiz-question {
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 0 14px;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.quiz-opt {
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-paper);
  color: var(--ink-dark);
  font-size: 0.92rem;
  transition: all 0.15s ease;
}

.quiz-opt:hover:not(:disabled) {
  border-color: var(--celadon);
  background: #EEF5F5;
}

.quiz-opt.correct {
  background: #E6F4EA;
  border-color: #2E7D32;
  color: #1B5E20;
  font-weight: 600;
}

.quiz-opt.wrong {
  background: #FDECEA;
  border-color: #C62828;
  color: #8E0000;
}

.quiz-feedback {
  font-size: 0.88rem;
  color: var(--ink-muted);
  min-height: 24px;
  margin-bottom: 12px;
}

.quiz-actions {
  display: flex;
  gap: 10px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--ink-dark);
  color: #E8DFCE;
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.footer-note {
  margin: 0;
  font-size: 0.82rem;
  color: #B8AA9B;
}

.back-top-link {
  padding: 8px 16px;
  border: 1px solid rgba(232, 223, 206, 0.3);
  border-radius: 999px;
  font-size: 0.85rem;
}

.back-top-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- 弹窗 Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 20, 17, 0.62);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  position: relative;
  width: min(540px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-top: 5px solid var(--cinnabar);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--bg-paper);
  font-size: 1.25rem;
  line-height: 1;
}

.modal-tag {
  font-size: 0.78rem;
  color: var(--cinnabar);
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-dialog h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.modal-dialog p {
  color: var(--ink-muted);
  margin: 0 0 16px;
}

.modal-highlights {
  background: var(--bg-alt);
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 960px) {
  .hero-grid,
  .tea-showcase,
  .arch-layout,
  .interactive-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 680px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-paper);
    border-bottom: 1px solid var(--border-soft);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    display: none;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 12px 24px;
  }

  .hero-stats,
  .overview-grid,
  .card-grid,
  .heritage-grid,
  .dialect-cards {
    grid-template-columns: 1fr;
  }

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