/* ============================================================
   LiuHao Brand Design System v1.0
   ============================================================
   用法：复制此文件到你的项目目录，HTML 中 <link rel="stylesheet" href="liuhao-brand.css">
   所有设计决策参见：[[LiuHao品牌设计系统]]
   ============================================================ */

/* ── 外部字体 ── */
@import url('https://fonts.googleapis.com/css2?family=LXGW+WenKai:wght@300;400;700&family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

/* ══════════════════════════════════════════════
   SECTION 1: 设计 Token (CSS 自定义属性)
   在 :root 中定义，亮色模式默认值。
   如需暗色模式，在 [data-theme="dark"] 中覆盖即可。
   ══════════════════════════════════════════════ */
:root {
  /* ── 色盘 ── */
  --lh-bg:          #FAFAF9;
  --lh-text:        #1A1A1A;
  --lh-text-soft:   #2D2D2D;      /* 正文用，略浅 */
  --lh-muted:       #6B7280;
  --lh-accent:      #2563EB;
  --lh-accent-soft: #DBEAFE;
  --lh-accent-deep: #1E40AF;
  --lh-border:      #E5E7EB;
  --lh-green:       #059669;
  --lh-red:         #DC2626;
  --lh-tag-gray:    #9CA3AF;
  --lh-white:       #FFFFFF;
  --lh-dark:        #1F2937;       /* Keynote 深色底 */

  /* ── 字体栈 ── */
  --lh-font-title:  "Noto Sans SC", sans-serif;
  --lh-font-body:   "LXGW WenKai", "Noto Serif SC", serif;
  --lh-font-mono:   "JetBrains Mono", "Consolas", "Monaco", monospace;

  /* ── 字号层级 ── */
  --lh-fs-h1:   clamp(28px, 5vw, 44px);
  --lh-fs-h2:   clamp(20px, 3vw, 28px);
  --lh-fs-h3:   18px;
  --lh-fs-body: 16px;
  --lh-fs-sm:   13px;
  --lh-fs-xs:   11px;

  /* ── 行高 ── */
  --lh-lh-h1:   1.2;
  --lh-lh-h2:   1.35;
  --lh-lh-body: 1.9;
  --lh-lh-sm:   1.5;

  /* ── 间距 ── */
  --lh-gap-para: 1.3em;            /* 段间距 */
  --lh-space-xs: 4px;
  --lh-space-sm: 8px;
  --lh-space-md: 16px;
  --lh-space-lg: 24px;
  --lh-space-xl: 32px;
  --lh-space-2xl:48px;

  /* ── 宽度 ── */
  --lh-w-main: 840px;              /* 展示/文档 最大宽度 */
  --lh-w-read: 620px;              /* 阅读场景 最大宽度 */

  /* ── 圆角 ── */
  --lh-radius-sm: 4px;
  --lh-radius-md: 8px;
  --lh-radius-lg: 12px;

  /* ── 阴影 ── */
  --lh-shadow-card: 0 2px 8px rgba(0,0,0,0.04);
  --lh-shadow-modal: 0 4px 24px rgba(0,0,0,0.08);
}

/* ══════════════════════════════════════════════
   SECTION 2: 全局重置
   ══════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--lh-bg);
  color: var(--lh-text);
  font-family: var(--lh-font-body);
  font-size: var(--lh-fs-body);
  line-height: var(--lh-lh-body);
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ══════════════════════════════════════════════
   SECTION 3: 排版类
   ══════════════════════════════════════════════ */
.lh-title {
  font-family: var(--lh-font-title);
  font-weight: 700;
  line-height: var(--lh-lh-h1);
  color: var(--lh-text);
}

.lh-h1 {
  font-family: var(--lh-font-title);
  font-size: var(--lh-fs-h1);
  font-weight: 700;
  line-height: var(--lh-lh-h1);
  color: var(--lh-text);
  letter-spacing: -0.01em;
}

.lh-h2 {
  font-family: var(--lh-font-title);
  font-size: var(--lh-fs-h2);
  font-weight: 600;
  line-height: var(--lh-lh-h2);
  color: var(--lh-text);
}

.lh-h3 {
  font-family: var(--lh-font-title);
  font-size: var(--lh-fs-h3);
  font-weight: 600;
  line-height: 1.4;
  color: var(--lh-text);
}

.lh-body {
  font-family: var(--lh-font-body);
  font-size: var(--lh-fs-body);
  line-height: var(--lh-lh-body);
  color: var(--lh-text-soft);
  letter-spacing: 0.005em;
}

.lh-body p {
  margin-bottom: var(--lh-gap-para);
}

.lh-small {
  font-family: var(--lh-font-title);
  font-size: var(--lh-fs-sm);
  color: var(--lh-muted);
  line-height: var(--lh-lh-sm);
}

.lh-xs {
  font-family: var(--lh-font-title);
  font-size: var(--lh-fs-xs);
  color: var(--lh-tag-gray);
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.lh-mono {
  font-family: var(--lh-font-mono);
  font-size: 13px;
}

/* ══════════════════════════════════════════════
   SECTION 4: 组件类
   ══════════════════════════════════════════════ */

/* ── 卡片 ── */
.lh-card {
  background: var(--lh-white);
  border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-md);
  padding: var(--lh-space-lg);
  box-shadow: var(--lh-shadow-card);
}

/* ── 引用块 / Callout ── */
.lh-callout {
  background: var(--lh-accent-soft);
  border-left: 4px solid var(--lh-accent);
  padding: 14px 18px;
  margin: 20px 0;
  border-radius: 0 var(--lh-radius-sm) var(--lh-radius-sm) 0;
}
.lh-callout p {
  margin: 0;
  font-family: var(--lh-font-title);
  font-weight: 500;
  font-size: 15px;
  color: var(--lh-accent-deep);
  line-height: 1.6;
}

/* ── 标签 ── */
.lh-tag {
  display: inline-block;
  font-family: var(--lh-font-title);
  font-size: var(--lh-fs-xs);
  font-weight: 500;
  padding: 4px 12px;
  background: var(--lh-accent-soft);
  color: var(--lh-accent);
  border-radius: var(--lh-radius-sm);
  letter-spacing: 0.04em;
}

.lh-tag-outline {
  display: inline-block;
  font-family: var(--lh-font-title);
  font-size: var(--lh-fs-xs);
  padding: 5px 14px;
  border: 1px solid var(--lh-accent);
  color: var(--lh-accent);
  border-radius: 20px;
  letter-spacing: 0.06em;
}

.lh-tag-muted {
  display: inline-block;
  font-size: 10px;
  padding: 3px 10px;
  background: #F3F4F6;
  color: var(--lh-muted);
  border-radius: var(--lh-radius-sm);
}

/* ── 功能色标注 ── */
.lh-positive { color: var(--lh-green); font-weight: 500; }
.lh-negative { color: var(--lh-red);   font-weight: 500; }

/* ── 分割线 ── */
.lh-divider {
  border: none;
  border-top: 1px solid var(--lh-border);
  margin: var(--lh-space-lg) 0;
}

.lh-divider-accent {
  border: none;
  width: 48px;
  height: 2px;
  background: var(--lh-accent);
  margin: var(--lh-space-md) 0;
  border-radius: 1px;
}

/* ── 文章元信息行 ── */
.lh-meta {
  font-family: var(--lh-font-title);
  font-size: var(--lh-fs-xs);
  color: var(--lh-tag-gray);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lh-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--lh-tag-gray);
}

/* ── 按钮 ── */
.lh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--lh-font-title);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--lh-radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.03em;
}
.lh-btn-primary {
  background: var(--lh-accent);
  color: white;
}
.lh-btn-primary:hover {
  background: var(--lh-accent-deep);
}
.lh-btn-outline {
  background: transparent;
  color: var(--lh-accent);
  border: 1px solid var(--lh-accent);
}
.lh-btn-outline:hover {
  background: var(--lh-accent-soft);
}

/* ══════════════════════════════════════════════
   SECTION 5: 布局工具类
   ══════════════════════════════════════════════ */
.lh-container {
  max-width: var(--lh-w-main);
  margin: 0 auto;
  padding: 0 var(--lh-space-lg);
}

.lh-container-read {
  max-width: var(--lh-w-read);
  margin: 0 auto;
  padding: 0 var(--lh-space-md);
}

.lh-section {
  padding: var(--lh-space-2xl) 0;
}

.lh-section + .lh-section {
  border-top: 1px solid var(--lh-border);
}

/* ── 网格 ── */
.lh-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lh-space-lg);
}

.lh-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--lh-space-md);
}

@media (max-width: 680px) {
  .lh-grid-2,
  .lh-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════
   SECTION 6: Keynote 深色模式
   在容器上加 class="lh-kn-slide" 即可切换
   ══════════════════════════════════════════════ */
.lh-kn-slide {
  background: var(--lh-dark);
  color: var(--lh-bg);
  padding: var(--lh-space-2xl);
}

.lh-kn-slide .lh-h1,
.lh-kn-slide .lh-h2,
.lh-kn-slide .lh-h3 {
  color: var(--lh-bg);
}

.lh-kn-slide .lh-body {
  color: #D1D5DB;
}

.lh-kn-slide .lh-accent-text {
  color: var(--lh-accent);
}

/* ══════════════════════════════════════════════
   SECTION 7: 打印样式
   ══════════════════════════════════════════════ */
@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }
  .lh-kn-slide {
    background: white;
    color: black;
  }
  .lh-no-print {
    display: none;
  }
}

/* ══════════════════════════════════════════════
   命名约定
   ══════════════════════════════════════════════
   所有 CSS 自定义属性以 --lh- 开头（LiuHao 缩写）
   所有工具类以 .lh- 开头
   避免与项目现有类名冲突

   版本: v1.0
   日期: 2026-07-11
   源文件: all-in-yourself/03-学习笔记/工具实践/LiuHao品牌设计系统.md
   ══════════════════════════════════════════════ */
