/* ===== CSS VARIABLES & RESET ===== */
:root {
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-surface-hover: #f5f1eb;
  --color-ink: #1a1a1a;
  --color-ink-light: #3d3d3d;
  --color-gold: #b8860b;
  --color-gold-light: #d4a017;
  --color-gold-bg: #fdf6e3;
  --color-muted: #6b6b6b;
  --color-border: #e8e3da;
  --color-border-light: #f0ece5;

  /* Node type colors */
  --color-core: #b8860b;
  --color-core-bg: #fdf6e3;
  --color-practice: #4a7a48;
  --color-practice-bg: #f0f7f0;
  --color-metaphor: #6b52b5;
  --color-metaphor-bg: #f3f0fb;
  --color-event: #a0622b;
  --color-event-bg: #fdf1e8;
  --color-person: #2e6da4;
  --color-person-bg: #eef4fb;
  --color-work: #5c6b7a;
  --color-work-bg: #f2f4f6;
  --color-overview: #7a5c6b;
  --color-overview-bg: #f8f2f5;
  --color-popular: #2e8b6e;
  --color-popular-bg: #edfaf5;

  --sidebar-width: 260px;
  --header-height: 56px;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);

  --transition: 0.2s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-gold-light);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-ink);
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.25rem; }

blockquote {
  border-left: 3px solid var(--color-gold);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-gold-bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-ink-light);
  font-style: italic;
}

blockquote p { margin-bottom: 0.5rem; }
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-border-light);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}

pre {
  background: #f5f2ed;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

th, td {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

th {
  background: var(--color-gold-bg);
  font-weight: 600;
  color: var(--color-ink-light);
}

tr:nth-child(even) td { background: #fdfdfc; }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #ccc5bb; }

/* ===== UTILITIES ===== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.text-muted { color: var(--color-muted); }
.text-gold { color: var(--color-gold); }
.font-serif { font-family: var(--font-serif); }

/* ===== ICP 备案 FOOTER ===== */
.icp-footer {
  padding: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border-light);
  background: transparent;
}
.icp-footer a {
  color: var(--color-muted);
  text-decoration: none;
}
.icp-footer a:hover {
  color: var(--color-gold);
  text-decoration: underline;
}
