/* ============================================================
   共享设计系统基础
   参考 GitHub Primer 的色彩可访问性规范 + Linear/Vercel 的排版节奏
   两个页面（index.html / ulcer.html）共用这份 token + 基础组件，
   各页面自己的 <style> 只覆盖 accent 色和独有的组件。
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

:root {
  /* 间距阶梯（4px 基准） */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;

  /* 圆角阶梯 */
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px; --radius-xl: 26px;

  /* 字号阶梯 */
  --text-xs:  13px;
  --text-sm:  14.5px;
  --text-base: 16px;
  --text-md:  17.5px;
  --text-lg:  19px;
  --text-xl:  23px;
  --text-2xl: 28px;
  --text-3xl: clamp(30px, 7vw, 40px);

  --font: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Segoe UI', sans-serif;

  /* 阴影（浅色） */
  --shadow-1: 0 1px 2px rgba(0,0,0,.04);
  --shadow-2: 0 2px 8px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-3: 0 12px 28px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05);

  /* 中性色（浅色，对比度参照 WCAG AA） */
  --bg:          #f6f8fa;
  --card:        #ffffff;
  --border:      #d8dee4;
  --border-soft: #ebeef1;
  --text-1: #1b1f24;   /* 标题，对比度 ~15:1 */
  --text-2: #3c4249;   /* 正文，对比度 ~10:1 */
  --text-3: #57606a;   /* 次要文本，对比度 ~6:1 */
  --text-4: #6e7781;   /* 辅助/说明文字，对比度 ~4.6:1，仅用于非关键信息 */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0d1117;
    --card:        #161b22;
    --border:      #30363d;
    --border-soft: #21262d;
    --text-1: #e6edf3;
    --text-2: #c9d1d9;
    --text-3: #9198a1;
    --text-4: #6e7681;

    --shadow-1: 0 1px 2px rgba(0,0,0,.35);
    --shadow-2: 0 2px 8px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
    --shadow-3: 0 16px 32px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.4);
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

.wrap {
  max-width: 720px; margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) calc(72px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
@media (min-width: 860px) { .wrap { max-width: 760px; } }

.backnav {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 4px; margin: 12px -4px 0;
  font-size: var(--text-sm); line-height: 1.4; color: var(--text-3); font-weight: 500;
  text-decoration: none; transition: color .15s ease, transform .15s ease;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .backnav:hover { color: var(--accent); transform: translateX(-2px); }
}
.backnav:active { color: var(--accent); opacity: .7; }

header { padding: 26px 2px 26px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft); border-radius: 8px;
  padding: 5px 13px; margin-bottom: 15px;
  font-size: var(--text-xs); font-weight: 700; color: var(--accent);
  letter-spacing: .02em;
}
h1 {
  font-size: var(--text-3xl); font-weight: 800;
  color: var(--text-1); letter-spacing: -0.02em; line-height: 1.15;
  margin-bottom: 9px;
}
.header-sub { font-size: var(--text-md); color: var(--text-3); line-height: 1.6; }

.slabel {
  font-size: var(--text-sm); font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em;
  margin: 40px 2px 13px; display: flex; align-items: baseline; gap: 8px;
}
.slabel em { font-style: normal; font-weight: 500; text-transform: none; font-size: var(--text-xs); color: var(--text-4); }

footer {
  border-top: 1px solid var(--border-soft); margin-top: 44px;
  padding: 28px 2px 8px;
  text-align: center; font-size: var(--text-xs); color: var(--text-4); line-height: 1.9;
}
footer strong { color: var(--text-3); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fadeup { animation: fadeUp .45s cubic-bezier(.16,1,.3,1) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fadeup { animation: none; }
}
