/* ==========================================================================
   whymm theme — main.css
   面向 CTF Writeup 的暗色优先主题
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1140px;
  --ease: cubic-bezier(.4, .14, .3, 1);

  --bg: #080b10;
  --bg-soft: #0b1017;
  --surface: #0f151d;
  --surface-2: #131b25;
  --surface-3: #182231;
  --border: #1c2530;
  --border-strong: #2a3745;
  --text: #dae4ee;
  --text-2: #a9b8c8;
  --muted: #6d7f93;
  --accent: #35e0a1;
  --accent-2: #4cc2ff;
  --accent-ink: #04120c;
  --accent-soft: rgba(53, 224, 161, .10);
  --accent-line: rgba(53, 224, 161, .28);
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .75);
  --glow: 0 0 0 1px rgba(53, 224, 161, .12), 0 12px 32px -12px rgba(53, 224, 161, .18);
  --header-bg: rgba(8, 11, 16, .72);
  --grid-line: rgba(255, 255, 255, .028);
  --sel: rgba(53, 224, 161, .24);
}

html[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-soft: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f2f6fa;
  --surface-3: #e9eff6;
  --border: #e0e7ef;
  --border-strong: #cbd7e3;
  --text: #16202b;
  --text-2: #43566a;
  --muted: #6b7f94;
  --accent: #0c9a71;
  --accent-2: #0b7bc4;
  --accent-ink: #ffffff;
  --accent-soft: rgba(12, 154, 113, .08);
  --accent-line: rgba(12, 154, 113, .3);
  --shadow: 0 18px 40px -24px rgba(23, 43, 66, .35);
  --glow: 0 0 0 1px rgba(12, 154, 113, .14), 0 12px 32px -16px rgba(12, 154, 113, .22);
  --header-bg: rgba(246, 248, 251, .82);
  --grid-line: rgba(10, 30, 60, .045);
  --sel: rgba(12, 154, 113, .18);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--sel); color: var(--text); }

h1, h2, h3, h4, h5 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; }
code, pre, kbd, samp { font-family: var(--font-mono); }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. Utilities ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.section { padding: 54px 0; }
.section + .section { padding-top: 8px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .16em;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.section-title { font-size: 1.6rem; letter-spacing: -.02em; }

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .86rem;
  color: var(--muted);
  padding-bottom: 4px;
  transition: color .18s var(--ease), gap .18s var(--ease);
}
.section-more:hover { color: var(--accent); gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: .94rem;
  font-weight: 600;
  color: var(--text);
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--glow); }
.btn-primary {
  background: linear-gradient(180deg, #45eab0, var(--accent));
  color: var(--accent-ink);
  border-color: transparent;
}
.btn-primary:hover { box-shadow: 0 12px 30px -12px rgba(53, 224, 161, .55); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  transition: color .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip-cat { color: var(--c, var(--accent)); border-color: color-mix(in srgb, var(--c, var(--accent)) 34%, transparent); background: color-mix(in srgb, var(--c, var(--accent)) 10%, transparent); }
.chip-mini { height: 20px; font-size: .66rem; padding: 0 7px; }
.chip + .chip { margin-left: 2px; }

/* ---------- 4. Background ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 12% -8%, rgba(53, 224, 161, .10), transparent 62%),
    radial-gradient(760px 460px at 88% -4%, rgba(76, 194, 255, .09), transparent 60%);
}
html[data-theme="light"] .bg-grid {
  background:
    radial-gradient(720px 420px at 12% -8%, rgba(12, 154, 113, .09), transparent 62%),
    radial-gradient(760px 460px at 88% -4%, rgba(11, 123, 196, .08), transparent 60%);
}
.bg-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 20%, transparent 78%);
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 120;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .1s linear;
}

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), #17b886);
  color: var(--accent-ink);
  font-size: .9rem;
  font-weight: 800;
  box-shadow: 0 6px 16px -8px rgba(53, 224, 161, .8);
}
.brand-name { font-weight: 700; }
.brand-caret { color: var(--accent); animation: blink 1.15s steps(1) infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: .9rem;
  color: var(--text-2);
  transition: color .16s var(--ease), background .16s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.is-active { color: var(--accent); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

.header-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--text-2);
  transition: color .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease);
}
.icon-btn:hover { color: var(--accent); background: var(--surface-2); border-color: var(--border); }

.theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: block; }
html[data-theme="light"] .theme-toggle .i-moon { display: none; }

.nav-btn { display: none; }

/* ---------- 6. Hero ---------- */
.hero { padding: 76px 0 46px; }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  align-items: center;
  gap: 56px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--text-2);
  margin-bottom: 22px;
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(53, 224, 161, .6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(53, 224, 161, .55); }
  70% { box-shadow: 0 0 0 8px rgba(53, 224, 161, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 224, 161, 0); }
}

.hero-title {
  font-size: clamp(2.05rem, 4.5vw, 3.05rem);
  line-height: 1.22;
  letter-spacing: -.03em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.02rem;
  color: var(--text-2);
  max-width: 46ch;
  line-height: 1.85;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 34px; }

.hero-stats { display: flex; gap: 34px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--font-mono); font-size: 1.32rem; font-weight: 700; letter-spacing: -.02em; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat + .stat { padding-left: 34px; border-left: 1px solid var(--border); }

/* terminal */
.hero-term { position: relative; }
.hero-term::before {
  content: "";
  position: absolute;
  inset: 12% 8% -6%;
  background: radial-gradient(closest-side, rgba(53, 224, 161, .16), transparent 78%);
  filter: blur(26px);
  z-index: 0;
}
.terminal {
  position: relative;
  z-index: 1;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: #0a0e14;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .84rem;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: #0e141c;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.terminal-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.terminal-title { margin-left: 8px; font-size: .72rem; color: #5f6f80; letter-spacing: .02em; }
.terminal-body { padding: 18px 18px 20px; line-height: 2; }
.t-line { white-space: pre-wrap; word-break: break-word; }
.t-prompt { color: #35e0a1; user-select: none; }
.t-cmd { color: #dbe6f2; }
.t-out { color: #7f90a2; padding-left: 14px; }
.t-out.is-ok { color: #35e0a1; }
.t-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  vertical-align: -2px;
  background: #35e0a1;
  animation: blink 1.1s steps(1) infinite;
}

/* ---------- 7. Category cards ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  min-height: 158px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.cat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--c), transparent 70%);
  opacity: .5;
  transition: opacity .2s var(--ease);
}
.cat-card::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -60px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--c);
  opacity: .07;
  filter: blur(18px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 42%, var(--border));
  box-shadow: 0 16px 34px -22px rgba(0, 0, 0, .8);
}
.cat-card:hover::before { opacity: 1; }
.cat-card:hover::after { opacity: .16; transform: scale(1.15); }

.cat-card-top { display: flex; align-items: center; justify-content: space-between; }
.cat-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 24%, transparent);
}
.cat-count { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }

.cat-name { font-size: 1.06rem; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.cat-label { font-size: .74rem; font-weight: 500; color: var(--muted); }
.cat-desc { font-size: .84rem; line-height: 1.65; color: var(--text-2); }

/* ---------- 8. Post list ---------- */
.post-list { list-style: none; border-top: 1px solid var(--border); }

.post-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 22px;
  align-items: start;
  gap: 22px;
  padding: 24px 4px;
  border-bottom: 1px solid var(--border);
  transition: background .18s var(--ease);
}
.post-item:hover { background: linear-gradient(90deg, var(--surface) 0%, transparent 92%); }

.post-item-date {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-mono);
  padding-top: 3px;
}
.post-item-date b { font-size: .92rem; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.post-item-date span { font-size: .7rem; color: var(--muted); }

.post-item-title { font-size: 1.1rem; line-height: 1.5; margin-bottom: 6px; }
.post-item-title a { transition: color .16s var(--ease); }
.post-item-title a:hover { color: var(--accent); }

.post-item-excerpt {
  font-size: .89rem;
  color: var(--muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.meta-dot { color: var(--muted); font-size: .7rem; }
.meta-text { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }

.post-item-arrow { color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .2s var(--ease), transform .2s var(--ease), color .2s var(--ease); padding-top: 4px; }
.post-item:hover .post-item-arrow { opacity: 1; transform: translateX(0); color: var(--accent); }

/* ---------- 9. Pager ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .84rem;
  color: var(--text-2);
  transition: color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.pager-btn:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-1px); }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-info { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.pager-info b { color: var(--text); }

/* ---------- 10. Page shells ---------- */
.page-wrap { padding-top: 52px; padding-bottom: 72px; }
.page-head { margin-bottom: 34px; }
.page-title { font-size: clamp(1.75rem, 3.6vw, 2.15rem); letter-spacing: -.025em; display: flex; align-items: center; gap: 12px; }
.title-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.page-desc { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.page-desc b { color: var(--text); font-family: var(--font-mono); }

/* archive */
.archive-group { margin-bottom: 40px; }
.archive-year {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 1.16rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 4px;
}
.archive-year span {
  font-size: .7rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
.archive-list { list-style: none; }
.archive-list li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--border);
}
.archive-date { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.archive-title { font-size: .96rem; transition: color .16s var(--ease); }
.archive-title:hover { color: var(--accent); }
.archive-cats { display: flex; gap: 4px; }

/* categories overview */
.cat-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.cat-row {
  display: grid;
  grid-template-columns: 110px 110px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 18px;
  padding: 18px 12px;
  border-bottom: 1px solid var(--border);
  transition: background .18s var(--ease);
}
.cat-row:hover { background: var(--surface); }
.cat-row.is-empty { opacity: .42; pointer-events: none; }
.cat-row-name { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; color: var(--c); }
.cat-row-label { font-size: .84rem; color: var(--text-2); }
.cat-row-desc { font-size: .84rem; color: var(--muted); }
.cat-row-count {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 34px;
  height: 24px;
  display: grid;
  place-items: center;
}

/* tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: calc(.86rem * var(--w, 1));
  color: var(--text-2);
  transition: border-color .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.tag-cloud-item b { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); }
.tag-cloud-item:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-2px); }

/* 404 */
.notfound { padding: 84px 0 96px; text-align: center; max-width: 640px; }
.notfound-code {
  font-family: var(--font-mono);
  font-size: clamp(4.5rem, 16vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.06em;
  background: linear-gradient(160deg, var(--accent), var(--accent-2) 70%, transparent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.notfound-title { font-size: 1.5rem; margin: 12px 0 8px; }
.notfound-desc { color: var(--muted); font-size: .94rem; }
.notfound-desc code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text-2); font-size: .86em; }
.notfound-term {
  margin: 28px auto 30px;
  max-width: 460px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #0a0e14;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.9;
}
.notfound-actions { display: flex; justify-content: center; gap: 12px; }

/* ---------- 11. Footer ---------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 46px 0 26px;
}
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700; }
.footer-brand .caret { color: var(--accent); animation: blink 1.15s steps(1) infinite; }
.footer-motto { margin-top: 8px; font-size: .88rem; color: var(--muted); }
.footer-nav { display: flex; gap: 64px; }
.footer-nav-col { display: flex; flex-direction: column; gap: 8px; min-width: 96px; }
.footer-label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; }
.footer-nav-col a { font-size: .87rem; color: var(--text-2); transition: color .16s var(--ease); }
.footer-nav-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--muted);
}
.footer-bottom a:hover { color: var(--accent); }
.footer-bottom b { color: var(--text-2); font-weight: 600; }
.dot-sep { opacity: .5; }

/* ---------- 12. Search ---------- */
.search-layer { position: fixed; inset: 0; z-index: 200; display: none; }
.search-layer.is-open { display: block; }
.search-backdrop { position: absolute; inset: 0; background: rgba(4, 7, 11, .68); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .18s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.search-panel {
  position: relative;
  width: min(660px, calc(100% - 32px));
  margin: 13vh auto 0;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8);
  overflow: hidden;
  animation: pop .2s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }

.search-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-head input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 1rem;
}
.search-head input::placeholder { color: var(--muted); }
.search-close {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 7px;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.search-close:hover { color: var(--text); border-color: var(--border-strong); }

.search-body { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.search-empty-icon { font-family: var(--font-mono); font-size: 1.5rem; color: var(--text-2); opacity: .7; margin-bottom: 8px; }
.search-empty p { font-size: .92rem; color: var(--text-2); }
.search-empty span { font-size: .78rem; }

.search-hit {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  transition: background .14s var(--ease);
}
.search-hit:hover, .search-hit.is-active { background: var(--surface-2); }
.search-hit-title { font-size: .94rem; font-weight: 600; margin-bottom: 3px; }
.search-hit-title mark { background: transparent; color: var(--accent); font-weight: 700; }
.search-hit-meta { display: flex; gap: 8px; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }
.search-hit-desc { font-size: .8rem; color: var(--muted); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.search-hit-desc mark { background: transparent; color: var(--accent); }

/* ---------- 13. Floating UI ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), color .2s var(--ease), visibility .2s;
  box-shadow: var(--shadow);
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent-line); }

.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  place-items: center;
  padding: 4vh 4vw;
  background: rgba(4, 7, 11, .9);
  cursor: zoom-out;
}
.img-viewer.is-open { display: grid; }
.img-viewer img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9); }

/* ---------- 14. Responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero { padding: 56px 0 36px; }
  .hero-term { max-width: 560px; }
  .cat-row { grid-template-columns: 92px 1fr 48px; }
  .cat-row-label { display: none; }
}

@media (max-width: 860px) {
  .nav {
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 20px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav-link { padding: 11px 12px; }
  .nav-link.is-active::after { display: none; }
  .nav-link.is-active { background: var(--accent-soft); }
  .nav-btn { display: grid; }
  .header-inner { gap: 12px; }
  .wrap { padding: 0 20px; }
}

@media (max-width: 680px) {
  .section { padding: 38px 0; }
  .hero-title { font-size: 1.9rem; }
  .hero-stats { gap: 20px; }
  .stat + .stat { padding-left: 20px; }
  .post-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .post-item-date { flex-direction: row; align-items: center; gap: 8px; }
  .post-item-arrow { display: none; }
  .post-item-title { font-size: 1.02rem; }
  .meta-dot { display: none; }
  .post-item-meta { gap: 8px; }
  .cat-row { grid-template-columns: 1fr 44px; }
  .cat-row-desc { display: none; }
  .archive-list li { grid-template-columns: 46px minmax(0, 1fr); }
  .archive-cats { display: none; }
  .footer-grid { flex-direction: column; gap: 28px; }
  .footer-nav { gap: 40px; }
  .search-panel { margin-top: 8vh; }
}

/* ---------- empty state ---------- */
.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 46px 26px 42px;
  text-align: center;
  background: linear-gradient(180deg, var(--accent-soft), transparent 70%);
}
.empty-term {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 22px;
  max-width: 100%;
  overflow: hidden;
}
.empty-term .t-prompt { color: var(--accent); }
.empty-term .empty-out { opacity: .75; }
.empty-title { margin: 0 0 10px; font-size: 1.2rem; letter-spacing: -.01em; }
.empty-desc { margin: 0 auto; max-width: 46ch; color: var(--text-2); font-size: .93rem; line-height: 1.8; }
.empty-desc code { font-size: .86em; padding: .12em .4em; }
.empty-hint { margin: 20px 0 0; }
.empty-hint code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
}
.empty-hint code::before { content: '$ '; color: var(--muted); }
.empty-state .btn { margin-top: 22px; }
@media (max-width: 680px) {
  .empty-state { padding: 34px 18px 32px; }
  .empty-title { font-size: 1.08rem; }
}

/* ---------- comments ---------- */
.comments {
  margin-top: 58px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}
.comments-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}
.comments-title {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -.01em;
}
.comments-title .t-prompt { color: var(--accent); font-family: var(--font-mono); margin-right: 8px; }
.comments-sub { color: var(--muted); font-size: .82rem; }
.giscus-wrap { min-height: 340px; }
.giscus-wrap .giscus,
.giscus-wrap .giscus-frame { width: 100% !important; }
.footer-stats { color: var(--muted); }
@media (max-width: 680px) {
  .comments { margin-top: 40px; padding-top: 26px; }
  .comments-head { flex-direction: column; gap: 6px; }
}
