@charset "UTF-8";
/* ============================================================
 * 霍州比特人博客 · 设计系统 theme.css
 * 移动端优先 / 技术极简 / 科技感 / 明暗双主题
 * 变量 -> 基础 -> 布局 -> 组件 -> 响应式增强(min-width)
 * ============================================================ */

/* ---------- 1. 主题变量（浅色为默认，data-theme=dark 覆盖） ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --bg: #f5f7fb;
  --bg-grid: rgba(20, 40, 90, .035);
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --surface-3: #e8edf6;
  --line: #e2e8f2;
  --line-strong: #cbd6e8;
  --text: #16203a;
  --text-2: #4a5670;
  --text-3: #8590a8;

  --brand: #2f6bff;
  --brand-2: #00b8d4;
  --brand-3: #7c5cff;
  --brand-soft: rgba(47, 107, 255, .09);
  --brand-glow: rgba(47, 107, 255, .18);
  --accent-warm: #ff6b4a;

  --code-bg: #f4f7fc;
  --code-line: #e4eaf5;
  --code-text: #24304d;
  --tok-key: #a1349b;
  --tok-str: #0a7f5b;
  --tok-num: #b45309;
  --tok-com: #8a95ab;
  --tok-fn: #2457c5;
  --tok-pun: #5a6785;

  --shadow-sm: 0 1px 2px rgba(20, 35, 75, .05), 0 2px 8px rgba(20, 35, 75, .04);
  --shadow-md: 0 4px 24px rgba(20, 35, 75, .09);
  --shadow-lg: 0 18px 50px rgba(20, 35, 75, .14);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --maxw: 1200px;
  --header-h: 62px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #080d18;
  --bg-grid: rgba(90, 150, 255, .045);
  --surface: #101827;
  --surface-2: #151f33;
  --surface-3: #1b2740;
  --line: #22304a;
  --line-strong: #31415f;
  --text: #e8eefb;
  --text-2: #a5b3ce;
  --text-3: #6f809e;

  --brand: #5b8cff;
  --brand-2: #2ee6e0;
  --brand-3: #a78bfa;
  --brand-soft: rgba(91, 140, 255, .13);
  --brand-glow: rgba(70, 130, 255, .32);
  --accent-warm: #ff8a6a;

  --code-bg: #0c1424;
  --code-line: #1c2942;
  --code-text: #d7e2f6;
  --tok-key: #c792ea;
  --tok-str: #7ee2a8;
  --tok-num: #ffcb6b;
  --tok-com: #627393;
  --tok-fn: #82aaff;
  --tok-pun: #89a0c8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 6px 26px rgba(0, 0, 0, .38);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .28s var(--ease), color .28s var(--ease);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .18s; }
a:hover { color: var(--brand-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.35em; }
::selection { background: var(--brand-glow); color: var(--text); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- 3. 布局容器 ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
.main { min-height: 60vh; padding-block: 26px 56px; }
.row { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.center { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--text-3); }
.mono { font-family: var(--font-mono); }

/* ---------- 4. 顶部计时条 + 头部 ---------- */
.notice-bar {
  position: relative; z-index: 60;
  background: linear-gradient(90deg, var(--brand), var(--brand-3) 55%, var(--brand-2));
  color: #fff; font-size: 12.5px; line-height: 1.5;
  overflow: hidden;
}
.notice-inner { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 5px 16px; text-align: center; }
.notice-bar strong { font-family: var(--font-mono); font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.notice-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.22); animation: pulse 2.4s infinite; flex: none; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.75); } }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; flex: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 4px 14px var(--brand-glow); }
.brand-mark svg { width: 19px; height: 19px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15.5px; letter-spacing: .02em; }
.brand-text small { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; color: var(--text-3); text-transform: uppercase; }

.main-nav { display: none; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2);
  transition: all .2s var(--ease);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .i-sun { display: none; }
html[data-theme="dark"] .icon-btn .i-sun { display: block; }
html[data-theme="dark"] .icon-btn .i-moon { display: none; }

.nav-toggle { display: inline-grid; }
.mobile-nav {
  display: none; border-top: 1px solid var(--line); background: var(--surface);
  padding: 10px 16px 16px;
}
.mobile-nav.open { display: block; animation: slideDown .22s var(--ease); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.mobile-nav a { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-radius: 9px; color: var(--text-2); font-size: 14.5px; }
.mobile-nav a + a { border-top: 1px solid var(--line); border-radius: 0; }
.mobile-nav a.active, .mobile-nav a:hover { background: var(--brand-soft); color: var(--brand); }
.mobile-nav a span { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: .1em; }

/* 搜索浮层 */
.search-pop { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); padding: 16px; }
.search-pop.open { display: block; animation: slideDown .2s var(--ease); }
.search-form { display: flex; gap: 8px; max-width: 620px; margin: 0 auto; }
.search-form input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); outline: none; }
.search-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-form button { padding: 0 20px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-3)); font-weight: 600; }

/* ---------- 5. 通用组件 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; transition: all .2s var(--ease); white-space: nowrap; }
.btn:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow-sm); }
.btn-primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-3)); box-shadow: 0 6px 18px var(--brand-glow); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 26px var(--brand-glow); }
.btn svg { width: 15px; height: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }

.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; line-height: 1.7; font-family: var(--font-mono); background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent); }
.tag:hover { background: var(--brand); color: #fff; }
.tag-plain { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }

.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.eyebrow::before { content: ""; width: 16px; height: 1px; background: currentColor; }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sec-head h2 { font-size: 21px; }
.sec-head .sec-sub { color: var(--text-3); font-size: 12.5px; margin: 3px 0 0; }
.sec-more { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.sec-more:hover { color: var(--brand); }
.section { margin-top: 40px; }

.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 34%, var(--line)); }
.card-pad { padding: 18px; }

.surface-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.surface-title::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: linear-gradient(var(--brand), var(--brand-2)); }

/* 面包屑 */
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-bottom: 18px; }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--brand); }
.crumb .sep { color: var(--line-strong); font-family: var(--font-mono); }
.crumb .cur { color: var(--text); }

/* 分页 */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; }
.pager a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-2); font-size: 13px; font-family: var(--font-mono); }
.pager a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.pager a.current, .pager .current, .pager span.current { border-color: var(--brand); background: var(--brand); color: #fff; }
.pager .numbar { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; padding: 44px 16px; color: var(--text-3); }

/* ---------- 6. 页脚 ---------- */
.site-footer { margin-top: 46px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; padding-block: 34px 26px; }
.footer-brand p { color: var(--text-3); font-size: 12.5px; max-width: 34em; margin-top: 12px; }
.footer-col h4 { font-size: 13px; margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-col a { color: var(--text-2); font-size: 12.5px; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.footer-bottom a { color: var(--text-3); }

/* 回到顶部 */
.backtop { position: fixed; right: 16px; bottom: 20px; z-index: 40; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transform: translateY(10px); transition: all .25s var(--ease); }
.backtop.show { opacity: 1; pointer-events: auto; transform: none; }
.backtop:hover { color: var(--brand); border-color: var(--brand); }
.backtop svg { width: 18px; height: 18px; }

/* 阅读进度 */
.read-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 70; background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3)); transition: width .1s linear; }

/* ---------- 7. 响应式增强（移动优先） ---------- */
@media (min-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notice-inner { font-size: 13px; }
}
@media (min-width: 860px) {
  .wrap { padding-inline: 24px; }
  .main-nav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }
  .main-nav a { position: relative; padding: 8px 11px; border-radius: 8px; font-size: 14px; color: var(--text-2); font-weight: 500; }
  .main-nav a:hover { color: var(--brand); background: var(--brand-soft); }
  .main-nav a.active { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
  .main-nav a.active::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
  .nav-toggle { display: none; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .sec-head h2 { font-size: 25px; }
}
@media (min-width: 1080px) {
  .row-with-side { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
