/* ============================================================
   快思学习空间 · 全站共享样式
   主页与 notes/ 下的文章页共用本文件。
   改主题色只需改下面的 --accent / --accent-2 两处。
   ============================================================ */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --border: #e2e6ec;
  --text: #1a1f28;
  --text-dim: #5b6673;
  --text-faint: #8b95a3;
  --accent: #2f6fed;
  --accent-soft: #e8f0fe;
  --accent-2: #0f9d8f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --max: 1080px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --surface-2: #1c232c;
    --border: #262d38;
    --text: #e6eaf0;
    --text-dim: #a2adbb;
    --text-faint: #78838f;
    --accent: #6f9dff;
    --accent-soft: #1a2540;
    --accent-2: #3ec9b8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶栏 ---------- */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); /* 旧浏览器回退 */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
header.site .wrap {
  display: flex; align-items: center; gap: 20px;
  min-height: 62px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 650; letter-spacing: .01em; color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff;
}
.brand .logo svg { width: 16px; height: 16px; display: block; }
nav.site { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
nav.site a {
  color: var(--text-dim); font-size: 14px; padding: 6px 12px;
  border-radius: 8px; white-space: nowrap;
}
nav.site a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

/* ---------- 通用区块 ---------- */
section { padding: 64px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: 0; }

h1, h2, h3 { line-height: 1.3; letter-spacing: -.01em; }
h2 {
  font-size: 24px; margin: 0 0 8px;
  display: flex; align-items: center; gap: 10px;
}
h2::before {
  content: ""; width: 4px; height: 20px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  flex: none;
}
.sec-lead { color: var(--text-dim); margin: 0 0 32px; max-width: 62ch; }

/* ---------- Hero（仅主页） ---------- */
.hero { padding: 72px 0 56px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-dim); margin: 0 0 16px;
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill {
  font-size: 12.5px; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  white-space: nowrap;
}
.pill.muted {
  background: var(--surface-2); color: var(--text-faint);
  border-color: var(--border);
}
.hero h1 { font-size: clamp(28px, 5vw, 42px); margin: 0 0 16px; font-weight: 700; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  font-size: 17px; color: var(--text-dim); max-width: 64ch; margin: 0 0 14px;
}
.hero .notice {
  margin-top: 24px; padding: 14px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  font-size: 14px; color: var(--text-dim); max-width: 68ch;
}
.hero .notice strong { color: var(--text); }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 15.5px; margin: 0 0 8px; }
.card p { margin: 0; font-size: 14px; color: var(--text-dim); }
.card .icon {
  width: 34px; height: 34px; border-radius: 10px; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.card .icon svg { width: 18px; height: 18px; display: block; }

/* ---------- 技术栈 ---------- */
.stack-group { margin-bottom: 22px; }
.stack-group:last-child { margin-bottom: 0; }
.stack-group h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); font-weight: 600; margin: 0 0 10px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 13.5px; padding: 6px 13px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--mono);
}

/* ---------- 进度时间线 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 26px 30px;
  border-left: 2px solid var(--border);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
}
.timeline li.done::before { background: var(--accent-2); border-color: var(--accent-2); }
.timeline li.active::before {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline .stage { font-weight: 600; font-size: 15px; }
.timeline .stage .state {
  font-size: 12px; font-weight: 500; margin-left: 8px; padding: 2px 9px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-faint);
  vertical-align: 1px;
}
.timeline li.done .state { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.timeline li.active .state { background: var(--accent-soft); color: var(--accent); }
.timeline .desc { font-size: 14px; color: var(--text-dim); margin-top: 2px; }

/* ---------- 声明 / 提示条 ---------- */
.statement {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow);
}
.statement ul { margin: 0; padding-left: 1.2em; color: var(--text-dim); font-size: 14.5px; }
.statement li { margin-bottom: 8px; }
.statement li:last-child { margin-bottom: 0; }
.statement li strong { color: var(--text); }

.note {
  margin-top: 20px; padding: 15px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  font-size: 14px; color: var(--text-dim);
}
.note strong { color: var(--text); }

/* ============================================================
   文章列表（主页「学习笔记」区）
   ============================================================ */
.post-list { display: grid; gap: 14px; }

.post-item {
  display: block; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.post-item:hover {
  text-decoration: none; border-color: var(--accent);
  transform: translateY(-2px);
}
.post-item .post-title {
  font-size: 16.5px; font-weight: 650; margin: 0 0 6px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.post-item:hover .post-title { color: var(--accent); }
.post-item .post-sum {
  margin: 0; font-size: 14px; color: var(--text-dim); max-width: 70ch;
}
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 12px; font-size: 12.5px; color: var(--text-faint);
}
.post-meta .dot { color: var(--border); }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.post-tags span {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-faint);
}

/* ============================================================
   文章正文（notes 目录下的文章页）
   ============================================================ */
.post-head { padding: 56px 0 8px; }
.crumb {
  font-size: 13.5px; color: var(--text-faint); margin: 0 0 18px;
}
.crumb a { color: var(--text-dim); }
.crumb .sep { margin: 0 7px; color: var(--border); }
.post-head h1 {
  font-size: clamp(24px, 4vw, 34px); margin: 0 0 14px; font-weight: 700;
}
.post-head .post-sum {
  font-size: 16.5px; color: var(--text-dim); margin: 0; max-width: 66ch;
}

.prose { max-width: 74ch; font-size: 15.5px; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin: 44px 0 14px; font-size: 21px; }
.prose h3 { margin: 32px 0 10px; font-size: 17px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 1.4em; }
.prose li { margin-bottom: 7px; }
.prose li > ul, .prose li > ol { margin-top: 7px; }
.prose strong { color: var(--text); font-weight: 650; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

.prose blockquote {
  margin: 0 0 18px; padding: 14px 20px;
  border-left: 3px solid var(--accent-2);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono); font-size: .885em;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px;
  word-break: break-word;
}
.prose pre {
  margin: 0 0 18px; padding: 16px 18px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; line-height: 1.65;
}
.prose pre code {
  background: none; border: 0; padding: 0; font-size: inherit;
  white-space: pre;
}

.prose table {
  width: 100%; border-collapse: collapse; margin: 0 0 20px;
  font-size: 14px; display: block; overflow-x: auto;
}
.prose thead th {
  text-align: left; font-weight: 650; color: var(--text);
  background: var(--surface-2);
  padding: 9px 14px; border: 1px solid var(--border); white-space: nowrap;
}
.prose tbody td {
  padding: 9px 14px; border: 1px solid var(--border);
  color: var(--text-dim); vertical-align: top;
}

/* 文章底部导航 */
.post-foot {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 14px;
}
.post-foot a { color: var(--text-dim); }
.post-foot a:hover { color: var(--accent); }

/* ---------- 页脚 ---------- */
footer.site {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 40px 0 48px; font-size: 13.5px; color: var(--text-faint);
}
footer.site .cols {
  display: flex; flex-wrap: wrap; gap: 28px 48px;
  justify-content: space-between; align-items: flex-start;
}
footer.site .col { min-width: 200px; }
footer.site h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); margin: 0 0 10px; font-weight: 600;
}
footer.site p { margin: 0 0 6px; }
footer.site a { color: var(--text-dim); }
footer.site a:hover { color: var(--accent); }
.beian {
  margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--border);
  display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center;
}
.beian a { color: var(--text-faint); display: inline-flex; align-items: center; gap: 5px; }
.beian a:hover { color: var(--accent); }
.beian svg { width: 14px; height: 14px; flex: none; }
.copyright { margin-top: 16px; color: var(--text-faint); font-size: 12.5px; }

@media (max-width: 640px) {
  section { padding: 48px 0; }
  .hero { padding: 48px 0 40px; }
  .post-head { padding: 40px 0 8px; }
  nav.site { width: 100%; margin-left: 0; }
}
