/* ==========================================================================
   太极拳兴趣会官网 · 主样式表
   --------------------------------------------------------------------------
   设计基调：水墨国风（宣纸底 + 墨黑 + 朱砂点缀），大量留白，移动端优先。
   结构顺序：
     01 变量与基础重置
     02 通用布局容器与标题
     03 顶部导航
     04 首屏横幅
     05 关于我们
     06 拳法体系
     07 活动风采
     08 加入我们
     09 页脚
     10 响应式适配
     11 动效与可访问性
   修改提示：改配色只动 01 区的 CSS 变量，其余样式均引用变量，不必逐个替换。
   ========================================================================== */

/* ============================ 01 变量与基础重置 ============================ */
:root {
  /* —— 色彩：宣纸、墨色、朱砂 —— */
  --paper:        #f7f4ec;   /* 宣纸底色（页面背景） */
  --paper-soft:   #fbf9f4;   /* 次级浅底（用于区块交替） */
  --paper-deep:   #efe9dc;   /* 稍深的纸色（分隔线、卡片底） */
  --ink:          #1f1d1a;   /* 主文字（浓墨） */
  --ink-soft:     #4a453d;   /* 正文文字（中墨） */
  --ink-fade:     #8a8275;   /* 辅助说明（淡墨） */
  --cinnabar:     #a8322d;   /* 朱砂红（强调色：印章、按钮、序号） */
  --cinnabar-dim: #c2605b;   /* 朱砂浅调（悬停态） */
  --line:         #ddd5c4;   /* 分隔线 */

  /* —— 字体 —— */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --font-sans:  "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;

  /* —— 尺寸 —— */
  --max-width: 1140px;        /* 内容区最大宽度 */
  --header-h: 72px;           /* 顶栏高度（滚动锚点偏移用） */
  --radius: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;                 /* 导航锚点平滑滚动 */
  scroll-padding-top: var(--header-h);     /* 锚点定位时避开固定顶栏 */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-soft);
  background-color: var(--paper);
  /* 纸纹：两层极淡的径向渐变叠加，模拟宣纸的不均匀感，无需图片 */
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.7), transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(226,218,201,.5), transparent 45%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--cinnabar); color: #fff; }

/* ============================ 02 通用布局与标题 ============================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 96px 0; }
.section-alt { background-color: var(--paper-soft); }

/* 区块标题：左侧竖排序号 + 中文大标题 + 英文小字 */
.section-head {
  text-align: center;
  margin-bottom: 56px;
  position: relative;
}

.section-index {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--cinnabar);
  letter-spacing: .3em;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .28em;
  text-indent: .28em;         /* 补偿末字右侧多出的字距，使整体视觉居中 */
}

.section-sub {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-fade);
}

/* 标题下方的朱砂短线装饰 */
.section-head::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin: 20px auto 0;
  background: var(--cinnabar);
  opacity: .7;
}

/* ============================ 03 顶部导航 ============================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(247, 244, 236, 0);
  transition: background-color .3s ease, box-shadow .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}

/* 页面向下滚动后由 JS 添加 is-solid，顶栏变为不透明纸色 */
.site-header.is-solid {
  background: rgba(247, 244, 236, .94);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand-mark { width: 34px; height: 34px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink);
  letter-spacing: .16em;
}
.brand-text em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: .22em;
  color: var(--ink-fade);
}

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

.nav-link {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: .14em;
  position: relative;
  padding: 4px 0;
  transition: color .25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--cinnabar);
  transition: width .3s ease;
}
.nav-link:hover { color: var(--cinnabar); }
.nav-link:hover::after,
.nav-link.is-active::after { width: 100%; }
.nav-link.is-active { color: var(--cinnabar); }

/* 汉堡按钮（默认隐藏，小屏显示） */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s ease, opacity .3s ease;
}
/* 展开态：三条横线变叉 */
.nav-toggle.is-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ============================ 04 首屏横幅 ============================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--header-h) + 40px) 0 80px;
}

/* 背景水墨：三层径向渐变模拟远山与墨晕，纯 CSS 实现 */
.hero-ink {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 78% 82%, rgba(31,29,26,.13), transparent 65%),
    radial-gradient(ellipse 45% 30% at 18% 88%, rgba(31,29,26,.09), transparent 70%),
    radial-gradient(circle 22% at 88% 14%, rgba(168,50,45,.10), transparent 70%);
}
/* 右上角一枚极淡的太极图，与首屏标题形成呼应；直接复用品牌 SVG，避免用渐变硬凑造型
   尺寸与位置需保证：在 1140px 及以上宽度内完整显示，不被右边缘裁切 */
.hero-ink::after {
  content: "";
  position: absolute;
  top: 10%; right: 8%;
  width: 240px; height: 240px;
  background: url("../img/taiji-mark.svg") no-repeat center / contain;
  opacity: .04;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; text-align: center; }

.hero-eyebrow {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: .5em;
  color: var(--ink-fade);
  margin-bottom: 26px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(38px, 7.5vw, 76px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: .1em;
  margin-bottom: 28px;
}

.hero-desc {
  max-width: 620px;
  margin: 0 auto 40px;
  font-size: 16.5px;
  line-height: 2.1;
  color: var(--ink-soft);
}

.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 38px;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: .18em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all .28s ease;
}
.btn-primary { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }
.btn-primary:hover { background: #8f2823; border-color: #8f2823; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink-fade); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(31,29,26,.04); transform: translateY(-2px); }

/* 首屏底部数据条 */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 72px;
  flex-wrap: wrap;
}
.hero-stats li { text-align: center; }
.hero-stats strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 30px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}
.hero-stats span { font-size: 12.5px; letter-spacing: .18em; color: var(--ink-fade); }

.hero-scroll {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--ink-fade);
  writing-mode: vertical-rl;
  animation: floatY 2.4s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translate(-50%, 0); opacity: .6; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* ============================ 05 关于我们 ============================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text .lead {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 2.1;
  color: var(--ink);
  margin-bottom: 22px;
}
.about-text p + p { margin-top: 18px; }

.about-card {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
}
.about-card h3,
.join-card h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink);
  letter-spacing: .16em;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.principle-list li + li { margin-top: 22px; }
.principle-list strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--cinnabar);
  margin-bottom: 4px;
}
.principle-list span { font-size: 14.5px; color: var(--ink-soft); line-height: 1.9; }

/* ============================ 06 拳法体系 ============================ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.course-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 26px 30px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.course-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168,50,45,.35);
  box-shadow: 0 14px 34px rgba(31,29,26,.09);
}

.course-no {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--cinnabar);
  letter-spacing: .1em;
  margin-bottom: 14px;
}
.course-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--ink);
  letter-spacing: .1em;
  margin-bottom: 8px;
}
.course-tag { font-size: 12.5px; color: var(--ink-fade); letter-spacing: .1em; margin-bottom: 16px; }
.course-desc { font-size: 14.5px; line-height: 1.95; }

/* ============================ 07 活动风采 ============================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  /* 图片缺失时的兜底底纹：淡纸色 + 斜纹，避免出现破图图标 */
  background-color: var(--paper-deep);
  background-image: repeating-linear-gradient(45deg, rgba(31,29,26,.03) 0 10px, transparent 10px 20px);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.gallery-item:hover img { transform: scale(1.06); }

.gallery-item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 18px 14px;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: .18em;
  color: #fff;
  background: linear-gradient(transparent, rgba(31,29,26,.72));
}

/* ============================ 08 加入我们 ============================ */
.join-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 64px;
  align-items: start;
}

.join-info h3 { display: none; }   /* 桌面端该标题冗余，仅移动端通过布局保留语义 */

.step-list li {
  position: relative;
  padding-left: 42px;
  margin-bottom: 18px;
  font-size: 15.5px;
  line-height: 1.95;
}
.step-list span {
  position: absolute;
  left: 0; top: 4px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--cinnabar);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 13px;
  text-align: center;
  line-height: 26px;
}

.join-meta {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.join-meta > div {
  padding: 20px 4px;
  border-bottom: 1px solid var(--line);
}
.join-meta > div:nth-child(odd) { padding-right: 24px; }
.join-meta dt {
  font-size: 12.5px;
  letter-spacing: .2em;
  color: var(--ink-fade);
  margin-bottom: 6px;
}
.join-meta dd {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.7;
}

.join-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 30px 34px;
  overflow: hidden;
}
/* 右上角淡朱砂「太极」印章，纯装饰 */
.join-seal {
  position: absolute;
  top: -18px; right: -18px;
  width: 92px; height: 92px;
  border: 2px solid rgba(168,50,45,.28);
  border-radius: var(--radius);
  font-family: var(--font-serif);
  font-size: 22px;
  color: rgba(168,50,45,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .1em;
  transform: rotate(8deg);
}

.tips-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 14px;
  font-size: 14.5px;
  line-height: 1.9;
}
.tips-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 11px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cinnabar);
  opacity: .7;
}

/* ============================ 09 页脚 ============================ */
.site-footer {
  background: var(--ink);
  color: #b9b2a6;
  padding: 56px 0 40px;
}
.footer-inner {
  display: grid;
  /* 中间列略宽：给四个导航项留足空间，避免「加入我们」被挤到第二行 */
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 30px;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-mark { width: 38px; height: 38px; opacity: .9; }
.footer-brand strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  color: #f0ece3;
  letter-spacing: .16em;
  margin-bottom: 2px;
}
.footer-brand p { font-size: 12px; letter-spacing: .18em; color: #8d867a; }

.footer-nav { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.footer-nav a {
  font-size: 14px;
  letter-spacing: .12em;
  white-space: nowrap;          /* 单个链接内不折行，整体靠 flex 换行 */
  transition: color .25s ease;
}
.footer-nav a:hover { color: #e8e2d6; }

.footer-legal { text-align: right; font-size: 13px; line-height: 1.9; }
.footer-legal a { color: #b9b2a6; border-bottom: 1px solid transparent; }
.footer-legal a:hover { color: #e8e2d6; border-bottom-color: #8d867a; }

/* ============================ 10 响应式适配 ============================ */
@media (max-width: 1024px) {
  .about-grid, .join-grid { grid-template-columns: 1fr; gap: 44px; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-legal { text-align: center; }
}

@media (max-width: 768px) {
  .section { padding: 68px 0; }
  .section-title { font-size: 27px; }
  .section-head { margin-bottom: 40px; }

  /* 顶栏：显示汉堡按钮，导航改为下拉面板 */
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: var(--header-h); left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(247, 244, 236, .98);
    border-bottom: 1px solid var(--line);
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
  }
  .site-nav.is-open { max-height: 320px; padding: 8px 24px 18px; }
  .site-nav .nav-link { width: 100%; padding: 13px 0; border-bottom: 1px solid rgba(221,213,196,.6); }
  .site-nav .nav-link:last-child { border-bottom: none; }

  .hero { min-height: 92vh; }
  /* 小屏收小装饰图，避免压住标题文字 */
  .hero-ink::after { width: 150px; height: 150px; top: 4%; right: 3%; opacity: .035; }
  .hero-stats { gap: 34px; margin-top: 52px; }
  .hero-stats strong { font-size: 25px; }

  .course-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .join-meta { grid-template-columns: 1fr; }
  .join-meta > div:nth-child(odd) { padding-right: 4px; }
  .join-info h3 {
    display: block;
    font-family: var(--font-serif);
    font-size: 19px;
    color: var(--ink);
    letter-spacing: .16em;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; text-align: center; }
}

/* ============================ 11 动效与可访问性 ============================ */
/* 尊重系统「减少动画」偏好，关闭所有过渡与动画 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 键盘导航时的焦点可见性 */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 3px;
}

/* 进入视口时的淡入上浮效果（由 JS 添加 is-in 类触发） */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-in { opacity: 1; transform: none; }
