/* ============================================================
   温暖健康社区 · 统一设计系统 v1.2（site.css）
   Surface: Decide/Learn · Anti-slop: emoji icon=0 / 等权网格=0
   参考: Notion(暖中性/低语边框/多层阴影) · Clay(暖奶油/燕麦/wayfinding)
         Airbnb(摄影卡/三层阴影/20px 圆角)
   作者: warmth-health-community 站点根（wennuan.life/）
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* 色板（角色化） */
  --bg: #fdfbf7;            /* 暖奶油画布 */
  --surface: #ffffff;       /* 卡片表面 */
  --surface-tint: #f6f1e3;  /* 浅米·交替区块 */
  --ink: #2b343d;           /* 深墨微暖近黑 */
  --text-2: #5d6b73;        /* 雾灰次级 */
  --text-3: #a39e98;        /* 暖灰 muted */
  --border: #ece5da;        /* 燕麦低语边框 */
  --accent: #b76e79;        /* 玫瑰金·唯一饱和强调 */
  --accent-soft: #f3e3e5;   /* 玫瑰浅 tint */
  --sage: #8a9a5b;          /* 鼠尾草·纪念 */
  --sage-soft: #eef0e2;     /* 浅绿 tint */
  --gold: #c9a96e;          /* 暖金·建设中 */
  --gold-soft: #f6f1e3;     /* 浅米 tint */
  --coral: #d9796f;         /* 珊瑚·小鹅通 */
  --coral-soft: #fdeeea;    /* 浅粉 tint */

  /* 阴影（Airbnb 三层） */
  --shadow-card: rgba(0,0,0,0.02) 0 0 0 1px, rgba(0,0,0,0.04) 0 2px 6px, rgba(0,0,0,0.1) 0 4px 8px;
  --shadow-hover: rgba(183,110,121,0.16) 0 12px 28px;

  /* 字体栈 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-sans: "Source Sans Pro", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 8px;
  --radius-pill: 9999px;

  /* 间距基（8px） */
  --sp-1: 8px; --sp-2: 16px; --sp-3: 24px; --sp-4: 32px; --sp-5: 48px; --sp-6: 64px;
}

/* ---------- 2. 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color .25s ease; }
a:hover { color: #a45f6a; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-3); }

.section { padding: var(--sp-6) 0; }
.section--tint { background: var(--surface-tint); }

/* ---------- 3. Wayfinding 大写标签（Clay 启发） ---------- */
.wayfinding {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}

/* ---------- 4. 标题层级 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 1px;   /* CJK 正字距 */
  color: var(--ink);
}

.hero-title { font-size: 2.8rem; letter-spacing: 2px; }
.section-title { font-size: 1.7rem; margin-bottom: var(--sp-1); }
.card-title { font-size: 1.2rem; }

/* Section 标题分隔线（玫瑰金→透明 32px） */
.section-head { text-align: center; margin-bottom: var(--sp-5); }
.section-head .divider {
  width: 32px; height: 2px;
  margin: var(--sp-2) auto 0;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: calc(var(--sp-6) * 1.5) 0 var(--sp-6);
  background: linear-gradient(160deg, rgba(183,110,121,0.30), var(--bg) 70%);
  overflow: hidden;
}
.hero .lotus {
  width: 40px; height: 40px;
  margin: 0 auto var(--sp-3);
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.2;
}
.hero .welcome {
  display: inline-block;
  margin-top: var(--sp-3);
  padding: 6px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.6);
  color: var(--text-2);
  font-size: 0.92rem;
}

/* ---------- 6. 动态 Banner（左对齐编辑式） ---------- */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin: calc(-1 * var(--sp-4)) auto var(--sp-5);
  max-width: 1120px;
}
.banner-text { text-align: left; }
.banner-text .banner-tag {
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 4px; display: block;
}
.banner-text p { color: var(--text-2); font-size: 0.98rem; }
.banner-text strong { color: var(--ink); font-family: var(--font-serif); font-weight: 600; }

/* ---------- 7. 图文卡（Airbnb 摄影驱动结构） ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.card .card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--surface-tint);
}
.card .card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.card:hover .card-media img { transform: scale(1.02); }
.card .card-body { padding: var(--sp-3); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .card-desc { color: var(--text-2); font-size: 0.95rem; flex: 1; }
.card .card-foot { margin-top: auto; }

/* 次级网格（非等权：主卡独立，次级 3 列） */
.grid-sub { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }

/* ---------- 8. 主卡（通栏特色卡） ---------- */
.card--feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  margin-bottom: var(--sp-4);
}
.card--feature .card-media {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card) 0 0 var(--radius-card);
}
.card--feature .card-body { padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-3); gap: 12px; }
.card--feature .card-desc { font-size: 1rem; }
.card--feature .card-foot { display: flex; gap: var(--sp-2); align-items: center; }

/* ---------- 9. Pill 徽章 ---------- */
.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  white-space: nowrap;
}
.pill--live  { background: var(--accent-soft); color: var(--accent); }
.pill--done  { background: var(--gold-soft);  color: var(--gold); }
.pill--mem   { background: var(--sage-soft);  color: var(--sage); }
.pill--wip   { background: var(--gold);       color: #fff; }
.pill--shop  { background: var(--coral-soft); color: var(--coral); }

/* ---------- 10. 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .6px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.btn--primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn--primary:hover { background: #a45f6a; border-color: #a45f6a; color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 11. 关于我们（左对齐编辑式） ---------- */
.about { text-align: left; max-width: 720px; margin: 0 auto var(--sp-5); }
.about p { margin-bottom: var(--sp-2); color: var(--text-2); }
.about p strong { color: var(--ink); }

/* ---------- 12. 公众号区 ---------- */
.wechat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-3);
  background: linear-gradient(135deg, var(--surface-tint), #f9f4ea);
  border-radius: var(--radius-card);
  margin: var(--sp-5) 0;
}
.wechat img { width: 120px; height: 120px; border-radius: 12px; }
.wechat-text { text-align: left; }
.wechat-text h3 { font-size: 1.3rem; margin-bottom: 4px; }
.wechat-text p { color: var(--text-2); font-size: 0.95rem; }

/* ---------- 13. 建设中页专用：进度卡 / 外链卡 / 资源卡 ---------- */
.progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--sp-3);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .3s ease, box-shadow .3s ease;
}
.progress-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.progress-card .step {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.progress-card h3 { font-size: 1.15rem; }
.progress-card p { color: var(--text-2); font-size: 0.95rem; }
.progress-card ul { list-style: none; }
.progress-card li {
  font-size: 0.92rem; color: var(--text-2);
  padding-left: 14px; position: relative; margin-bottom: 4px;
}
.progress-card li::before { content: "·"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.progress-card li a { color: var(--accent); word-break: break-all; }

/* 相关资源卡（建设中页内小卡） */
.resource-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: var(--sp-2);
  text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
}
.resource-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.resource-card .r-title { font-family: var(--font-serif); font-weight: 600; font-size: 1rem; color: var(--ink); }
.resource-card .r-sub { font-size: 0.85rem; color: var(--text-3); margin-top: 2px; }

/* 阅读版式（档案馆页） */
.reader { max-width: 760px; margin: 0 auto; }
.reader h2 {
  font-size: 1.5rem;
  margin: var(--sp-5) 0 var(--sp-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.reader h3 { font-size: 1.2rem; margin: var(--sp-3) 0 8px; }
.reader p { margin-bottom: var(--sp-2); color: var(--text-2); line-height: 1.8; }
.reader figure { margin: var(--sp-3) 0; }
.reader figure img { border-radius: 14px; box-shadow: var(--shadow-card); }
.reader figcaption { font-size: 0.85rem; color: var(--text-3); margin-top: 6px; text-align: center; }
.reader .notice {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.92rem;
  color: var(--text-2);
  margin: var(--sp-3) 0;
}

/* ---------- 14. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-5) 0 var(--sp-4);
  text-align: center;
  color: var(--text-3);
  font-size: 0.92rem;
}
.site-footer .foot-links { margin-bottom: var(--sp-2); }
.site-footer .foot-links a {
  color: var(--text-2);
  margin: 0 var(--sp-2);
  font-size: 0.92rem;
}
.site-footer .foot-links a:hover { color: var(--accent); }

/* ---------- 15. 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- 16. 响应式 ---------- */
@media (max-width: 1024px) {
  .grid-sub { grid-template-columns: repeat(2, 1fr); }
  .progress-grid { grid-template-columns: repeat(2, 1fr); }
  .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .card--feature { grid-template-columns: 1fr; }
  .card--feature .card-media { aspect-ratio: 16 / 9; border-radius: var(--radius-card) var(--radius-card) 0 0; }
}

@media (max-width: 768px) {
  .hero { padding: var(--sp-5) 0 var(--sp-4); }
  .hero-title { font-size: 2.1rem; }
  .banner { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
}

@media (max-width: 640px) {
  .section { padding: var(--sp-5) 0; }
  .hero-title { font-size: 1.9rem; }
  .grid-sub, .progress-grid, .resource-grid { grid-template-columns: 1fr; }
  .card--feature .card-media { aspect-ratio: 4 / 3; }
  .wechat { flex-direction: column; text-align: center; }
  .wechat-text { text-align: center; }
  .hero .lotus { width: 32px; height: 32px; }
}

/* ---------- 17. 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .card:hover, .progress-card:hover, .resource-card:hover { transform: none; }
  .card .card-media img { transform: none; }
}
