/* ==========================================================================
   uuwis design tokens + base layer
   智慧树学习网 · 教育清新绿设计系统
   加载顺序：bootstrap.min.css -> style.css -> tokens.css -> ui.css -> pages.css
   ========================================================================== */

:root {
  /* ===== v2 设计变量：取值与 _design/preview/assets/base.css 完全一致 ===== */

  /* 品牌色 */
  --brand-900: #06382a;
  --brand-800: #0a5c40;
  --brand-700: #0c7a52;
  --brand-600: #0f9d63;
  --brand-500: #16b877;
  --brand-400: #3fd08f;
  --brand-300: #8ce4bb;
  --brand-200: #c2f0da;
  --brand-100: #e0f7ec;
  --brand-50: #f1fbf6;

  /* 辅助色：蓝 / 琥珀 / 红 / 紫 / 青 / 粉 */
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --amber-700: #b45309;
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --amber-50: #fffbeb;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --red-50: #fef2f2;
  --violet-600: #7c3aed;
  --violet-100: #ede9fe;
  --cyan-600: #0891b2;
  --cyan-100: #cffafe;
  --pink-600: #db2777;
  --pink-100: #fce7f3;

  /* 中性色：带一点绿意的墨色 */
  --ink-900: #0f1a15;
  --ink-800: #1b2a23;
  --ink-700: #31423a;
  --ink-600: #4c5d54;
  --ink-500: #6c7c74;
  --ink-400: #95a29b;

  /* 背景与描边 */
  --line: #e4e9e4;
  --line-2: #d5ddd6;
  --bg: #f2f6f3;
  --paper: #fafcf9;
  --surface: #ffffff;

  /* 圆角 */
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 14px;
  --r-xl: 20px;

  /* 阴影 */
  --sh-s: 0 1px 2px rgba(15, 26, 21, .04);
  --sh-m: 0 10px 30px -18px rgba(15, 26, 21, .22);
  --sh-l: 0 24px 60px -30px rgba(15, 26, 21, .3);

  /* 布局与字体 */
  --container: 1320px;
  --header-h: 66px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-num: "SF Mono", "DIN Alternate", ui-monospace, "Helvetica Neue", Arial, sans-serif;

  /* ===== 旧模板兼容别名（legacy.css / 搜索、专题、会员页继续可用）===== */
  --font-sans: var(--font);
  --ink-300: #cbd5e1;
  --bg-soft: #f9fffa;
  --surface-2: #f4f7f5;
  --line-soft: #f0f4f2;
  --hot: #ef4444;
  --warn: #f59e0b;
  --info: #0ea5e9;
  --violet: #7c5cff;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --sh-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --sh-sm: 0 2px 8px rgba(15, 23, 42, .05);
  --sh-md: 0 12px 28px -16px rgba(15, 23, 42, .18);
  --sh-lg: 0 22px 48px -24px rgba(15, 23, 42, .24);
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 56px;
  --s-16: 72px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-28: 28px;
  --fs-34: 34px;
  --gutter: 16px;
  --ring: 0 0 0 3px rgba(22, 184, 119, .28);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* style.css 里的 overflow:hidden 会让 position:sticky 失效 */
#page {
  overflow: clip;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink-900);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 var(--s-3);
}

p {
  margin: 0 0 var(--s-3);
}

a {
  color: var(--brand-700);
  text-decoration: none;
  transition: color .18s ease;
}

a:hover {
  color: var(--brand-600);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--brand-200);
  color: var(--ink-900);
}

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.u-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.u-section {
  padding: var(--s-10) 0;
}

.u-section--tight {
  padding: var(--s-8) 0;
}

.u-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 10px 20px;
  background: var(--brand-600);
  color: #fff;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 700;
  transition: top .2s ease;
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* 两行/三行截断 */
.u-clamp-1,
.u-clamp-2,
.u-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.u-clamp-1 { -webkit-line-clamp: 1; }
.u-clamp-2 { -webkit-line-clamp: 2; }
.u-clamp-3 { -webkit-line-clamp: 3; }

.text-hot { color: var(--hot); }
.text-muted { color: var(--ink-500); }

@media (max-width: 767px) {
  :root {
    --fs-34: 26px;
    --fs-28: 22px;
    --s-12: 40px;
    --s-16: 48px;
  }

  .u-section {
    padding: var(--s-8) 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
