/*
Theme Name: SavePoint
Theme URI: https://saveslot.xyz
Author: SavePoint
Description: 橙色点缀、固定顶栏、封面 Hero 与双栏卡片列表的轻博客主题，版式对照 MewKon (Sify) 设计移植。
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: savepoint
*/

/* ---------- tokens ---------- */
:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #fdba74;
  --text: #2c3e50;
  --muted: #7f8c8d;
  --bg: #f5f5f5;
  --card: #ffffff;
  --border: #e8e8e8;
  --border-soft: rgba(0, 0, 0, .04);
  --chip-bg: #f1f2f4;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10);
  --radius: 16px;
  --sans: "Inter", "Noto Sans SC", -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  color-scheme: light;
}

html.dark {
  --text: #e8e8e8;
  --muted: #999999;
  --bg: #1a1a2e;
  --card: #1e2a45;
  --border: #2a2a4a;
  --border-soft: rgba(255, 255, 255, .05);
  --chip-bg: rgba(255, 255, 255, .05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
img { max-width: 100%; height: auto; display: block; }
svg { flex: none; width: 1em; height: 1em; }
a { color: inherit; text-decoration: none; transition: color .2s, background-color .2s; }
a:hover { color: var(--primary); }
button { font: inherit; cursor: pointer; }
.wrap { width: 100%; max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
  transition: background-color .3s, border-color .3s;
}
.site-header { transition: background-color .3s, border-color .3s, backdrop-filter .3s; }
/* single-post pages start with a full-bleed cover behind the header */
.site-header.over-hero:not(.scrolled) {
  background: transparent; border-bottom-color: transparent; backdrop-filter: none;
}
.site-header.over-hero:not(.scrolled) .logo { color: #fff; }
.site-header.over-hero:not(.scrolled) .nav a,
.site-header.over-hero:not(.scrolled) .icon-btn { color: rgba(255, 255, 255, .78); }
.site-header.over-hero:not(.scrolled) .nav a:hover,
.site-header.over-hero:not(.scrolled) .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.site-header.over-hero:not(.scrolled) .nav .current-menu-item > a { color: #fff; background: rgba(255, 255, 255, .12); }
.site-header.over-hero:not(.scrolled) .kbd { color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .12); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); letter-spacing: -.01em; }
.logo:hover { color: var(--primary); opacity: .8; }
.nav { display: none; align-items: center; gap: .25rem; }
.nav > ul { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav a, .nav .menu-parent {
  display: flex; align-items: center; gap: .3rem; padding: .5rem .75rem; border-radius: 10px;
  font-size: .875rem; font-weight: 500; color: var(--muted);
}
.nav .menu-parent { cursor: default; }
.nav .menu-parent svg { width: 12px; height: 12px; opacity: .5; }
.nav > ul > li > a:hover, .nav .current-menu-item > a, .nav .current_page_item > a,
.nav .current-menu-parent > .menu-parent, .nav .current-menu-ancestor > .menu-parent {
  color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent);
}
.nav .sub-menu a { background: transparent; }
.nav .sub-menu a:hover, .nav .sub-menu .current-menu-item > a {
  color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent);
}
/* dropdown */
.nav .menu-item-has-children { position: relative; }
.nav .sub-menu {
  position: absolute; top: 100%; left: 0; z-index: 60;
  min-width: 9rem; padding: .5rem; margin: .25rem 0 0;
  list-style: none; background: var(--card); border-radius: 12px;
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .2s, visibility .2s, transform .2s;
}
.nav .menu-item-has-children:hover .sub-menu,
.nav .menu-item-has-children:focus-within .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav .sub-menu li { margin: 0; }
.nav .sub-menu a { display: block; padding: .5rem .75rem; color: var(--muted); }
.header-tools { display: flex; align-items: center; gap: .35rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--chip-bg); color: var(--primary); }
.icon-btn svg { width: 20px; height: 20px; }
.kbd {
  display: none; margin-left: .35rem; padding: .1rem .35rem; font-size: .625rem; font-family: var(--mono);
  color: var(--muted); background: var(--chip-bg); border-radius: .25rem;
}
@media (min-width: 640px) { .kbd { display: inline-block; } }
.theme-icon { display: inline-flex; }
.theme-icon-sun { display: none; }
html.dark .theme-icon-moon { display: none; }
html.dark .theme-icon-sun { display: inline-flex; }

.nav-toggle { display: inline-flex; }
.mobile-nav {
  display: none; border-top: 1px solid var(--border-soft);
  background: var(--card); padding: .5rem 1rem 1rem;
}
.mobile-nav.open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav a { display: block; padding: .6rem 0; font-size: .95rem; color: var(--muted); }
.mobile-nav a:hover { color: var(--primary); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: #111827;
}
.hero-bg {
  position: absolute; inset: -8% 0 0 0; z-index: 0;
  background: #111827 center / cover no-repeat;
  will-change: transform;
}
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .5), rgba(0, 0, 0, .3) 45%, rgba(0, 0, 0, .62)),
    linear-gradient(to right, rgba(0, 0, 0, .25), transparent 60%);
}
/* hero entrance animation (no JS required) */
[data-hero-reveal] { animation: hero-reveal .7s cubic-bezier(.22, 1, .36, 1) both; }
[data-hero-reveal]:nth-child(2) { animation-delay: .1s; }
[data-hero-reveal]:nth-child(3) { animation-delay: .2s; }
[data-hero-reveal]:nth-child(4) { animation-delay: .3s; }
[data-hero-reveal]:nth-child(5) { animation-delay: .4s; }
@keyframes hero-reveal {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-inner {
  position: relative; z-index: 1; color: #fff;
  display: grid; grid-template-columns: 1fr; gap: 3rem; align-items: center;
}
.hero .hero-inner { padding: 7rem 1rem 5rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .75rem; margin-bottom: 1.5rem; border-radius: 999px;
  background: rgba(255, 255, 255, .1); backdrop-filter: blur(6px);
  font-size: .75rem; color: rgba(255, 255, 255, .72);
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.hero h1 {
  margin: 0 0 1.1rem; font-size: clamp(2.25rem, 3.6vw, 3.75rem);
  line-height: 1.08; letter-spacing: -.02em; font-weight: 700;
}
.hero-desc {
  margin: 0 0 1.9rem; max-width: 34rem;
  font-size: 1.125rem; font-weight: 300; line-height: 1.65;
  color: rgba(255, 255, 255, .66);
}
.hero-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-bottom: 2.2rem; }
.hero-stat { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: rgba(255, 255, 255, .5); }
.hero-stat svg { width: 16px; height: 16px; color: var(--primary); flex: none; }
.hero-stat strong { color: #fff; font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.5rem; border-radius: 999px;
  font-size: .875rem; font-weight: 500; border: 1px solid transparent;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px rgba(249, 115, 22, .28); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost {
  background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .82);
  border-color: rgba(255, 255, 255, .1); backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.hero-card {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 24px; padding: 1.5rem; backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.hero-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.hero-card-head h2 {
  margin: 0; font-size: .875rem; font-weight: 500; color: rgba(255, 255, 255, .5);
  display: flex; align-items: center; gap: .5rem;
}
.hero-card-head h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 999px; background: var(--primary);
}
.hero-card-head a { font-size: .75rem; color: rgba(255, 255, 255, .3); }
.hero-card-head a:hover { color: var(--primary); }
.hero-list { list-style: none; margin: 0; padding: 0; }
.hero-list li + li { border-top: 1px solid rgba(255, 255, 255, .05); }
.hero-list a {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem .75rem; margin: 0 -.75rem; border-radius: 12px;
}
.hero-list a:hover { background: rgba(255, 255, 255, .04); }
.hero-list li { animation: hero-reveal .6s cubic-bezier(.22, 1, .36, 1) both; }
.hero-list li:nth-child(1) { animation-delay: .45s; }
.hero-list li:nth-child(2) { animation-delay: .55s; }
.hero-list li:nth-child(3) { animation-delay: .65s; }
.hero-list li:nth-child(4) { animation-delay: .75s; }
.hero-list li:nth-child(5) { animation-delay: .85s; }
.hero-idx { font-family: var(--mono); font-size: .625rem; letter-spacing: .08em; color: rgba(255, 255, 255, .2); flex: none; }
.hero-item { flex: 1; min-width: 0; }
.hero-item h3 {
  margin: 0; font-size: .875rem; font-weight: 500; color: rgba(255, 255, 255, .85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-list a:hover h3 { color: var(--primary); }
.hero-meta { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; font-size: .6875rem; color: rgba(255, 255, 255, .3); }
.hero-meta .sep { opacity: .4; }
.hero-arrow { width: 14px; height: 14px; color: rgba(255, 255, 255, .15); flex: none; }
.hero-list a:hover .hero-arrow { color: var(--primary); }

/* ---------- layout ---------- */
.layout { display: flex; flex-direction: column; gap: 2rem; padding: 2rem 0 3rem; }
.main-col { min-width: 0; flex: 1; }
.side-col { display: none; }
.side-inner {
  position: sticky; top: 5.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.side-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem;
}
.side-card.profile { text-align: center; }
.avatar-wrap { position: relative; display: inline-block; margin-bottom: .75rem; }
.avatar {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent);
}
.avatar-dot {
  position: absolute; right: 0; bottom: 0; width: 20px; height: 20px; border-radius: 50%;
  background: #4ade80; border: 2px solid var(--card);
}
.profile-name { margin: 0; font-size: 1rem; font-weight: 600; }
.profile-bio { margin: .25rem 0 0; font-size: .75rem; line-height: 1.6; color: var(--muted); }
.profile-social { display: flex; justify-content: center; gap: .75rem; margin-top: 1rem; }
.profile-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--chip-bg); color: var(--muted);
}
.profile-social a:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.profile-social svg { width: 16px; height: 16px; }
.profile-stats {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-soft);
}
.profile-stats div { text-align: center; }
.profile-stats strong { display: block; font-size: .875rem; font-weight: 600; }
.profile-stats span { font-size: .625rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-title {
  margin: 0 0 .75rem; font-size: .75rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .35rem .75rem; border-radius: 999px;
  background: var(--chip-bg); color: var(--text);
  font-size: .75rem; border: 1px solid transparent;
}
.chip .count { opacity: .55; }
.chip:hover { background: var(--primary); color: #fff; }
.chip.sm { font-size: .625rem; padding: .1rem .5rem; background: transparent; color: var(--muted); border-color: var(--border-soft); }
.chip.sm:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }

.section-head { display: flex; align-items: center; gap: .75rem; margin: 0 0 1.25rem; }
.section-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.section-head h2::before { content: ""; width: 4px; height: 22px; border-radius: 999px; background: var(--primary); }
.section-head .more { margin-left: auto; font-size: .75rem; color: var(--muted); }
.section-head .more:hover { color: var(--primary); }
.home-section { margin-top: 2.5rem; }

.post-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.post-card {
  position: relative; overflow: hidden; background: var(--card);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: box-shadow .3s, border-color .3s, transform .3s;
}
.post-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border); }
.thumb { display: block; aspect-ratio: 2 / 1; overflow: hidden; background: var(--chip-bg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card-body { padding: 1.25rem; }
.cat-pill {
  display: inline-flex; align-items: center; margin-bottom: .75rem;
  padding: .1rem .65rem; border-radius: 999px;
  font-size: .6875rem; font-weight: 500;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.post-card h3 { margin: 0 0 .5rem; font-size: .95rem; font-weight: 600; line-height: 1.4; }
.post-card:hover h3 { color: var(--primary); }
.post-card p {
  margin: 0 0 .75rem; font-size: .875rem; line-height: 1.65; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .6875rem; color: var(--muted);
}
.card-meta .left { display: flex; align-items: center; gap: .75rem; }
.card-meta .sep { width: 1px; height: 12px; background: var(--border); }
.card-meta .read { color: var(--primary); opacity: 0; transition: opacity .3s; display: inline-flex; align-items: center; gap: .25rem; }
.post-card:hover .card-meta .read { opacity: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 1.25rem 1rem; }

/* ---------- pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 2.5rem 0 0; }
.pagination .page-numbers, .pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 .75rem; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border-soft); color: var(--muted); font-size: .85rem;
}
.pagination .current, .pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .dots { background: transparent; border-color: transparent; }

/* ---------- single post ---------- */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 55;
  height: 3px; pointer-events: none;
}
.reading-progress-bar {
  display: block; height: 100%; width: 0;
  background: var(--primary);
  transition: width .1s linear;
}

.post-hero {
  position: relative; display: flex; align-items: flex-end;
  min-height: 60vh; overflow: hidden; background: #111827;
}
.post-hero-bg { position: absolute; inset: -10% 0 0 0; z-index: 0; will-change: transform; }
.post-hero-img {
  position: absolute; inset: 0;
  background: #111827 center / cover no-repeat;
  transform: scale(1.1);
}
.post-hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, .4) 50%, rgba(0, 0, 0, .2));
}
.post-hero.no-cover .post-hero-img { opacity: .35; }
.post-hero-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 56rem; margin: 0 auto;
  padding: 7rem 1rem 3rem; color: #fff;
}
.post-hero-text { animation: hero-reveal .8s cubic-bezier(.22, 1, .36, 1) both .1s; }
.post-hero-cat {
  display: inline-block; margin-bottom: 1rem; padding: .25rem .75rem;
  border-radius: 999px; background: rgba(255, 255, 255, .1); backdrop-filter: blur(6px);
  font-size: .75rem; font-weight: 500; color: var(--primary);
}
.post-hero-cat:hover { background: rgba(255, 255, 255, .2); }
.post-hero h1 {
  margin: 0 0 1rem; font-size: clamp(1.85rem, 3vw, 3rem);
  line-height: 1.2; letter-spacing: -.02em; font-weight: 700;
}
.post-hero-desc {
  margin: 0 0 1.5rem; max-width: 42rem;
  font-size: 1.125rem; font-weight: 300; line-height: 1.6;
  color: rgba(255, 255, 255, .7);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  font-size: .875rem; color: rgba(255, 255, 255, .5);
}
.post-hero-meta .sep { opacity: .4; }
.post-hero-tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  margin-top: .75rem; font-size: .8125rem; color: rgba(255, 255, 255, .5);
}
.post-hero-tags a { transition: color .2s; }
.post-hero-tags a:hover { color: var(--primary); }

.post-layout {
  display: flex; flex-direction: column; gap: 2rem;
  padding: 2rem 0 3rem;
}
.post-main { flex: 1; min-width: 0; }

/* the article itself sits directly on the page (no card), like the reference */
.entry {
  font-size: 1.0625rem; line-height: 1.75;
}
.entry > *:first-child { margin-top: 0; }
.entry p { margin: 0 0 1.3rem; }
.entry h2, .entry h3, .entry h4 { letter-spacing: -.01em; scroll-margin-top: 4.75rem; }
.entry h2 { margin: 2.6rem 0 1rem; font-size: 1.33rem; font-weight: 600; line-height: 1.4; }
.entry h3 { margin: 2rem 0 .75rem; font-size: 1.15rem; font-weight: 600; line-height: 1.45; }
.entry h4 { margin: 1.6rem 0 .6rem; font-size: 1rem; font-weight: 600; }
.entry a { color: var(--primary); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.entry strong { font-weight: 600; color: var(--text); }
.entry img, .entry .wp-block-image img { border-radius: 12px; margin: 1.5rem 0; }
.entry .wp-block-image { margin: 1.5rem 0; }
.entry blockquote {
  margin: 1.6rem 0; padding: .25rem 0 .25rem 1.25rem;
  border-left: 3px solid var(--primary); color: var(--muted); font-style: normal;
}
.entry blockquote > *:last-child { margin-bottom: 0; }
.entry ul, .entry ol { padding-left: 1.6rem; margin: 0 0 1.3rem; }
.entry ul { list-style: disc; }
.entry ol { list-style: decimal; }
.entry li { margin: .4rem 0; }
.entry li::marker { color: var(--muted); }
.entry pre {
  background: #0f172a; color: #e2e8f0; padding: 1.1rem 1.25rem; border-radius: 12px;
  overflow-x: auto; font-family: var(--mono); font-size: .85rem; line-height: 1.65;
}
.entry code { font-family: var(--mono); font-size: .88em; background: var(--chip-bg); padding: .12em .38em; border-radius: 6px; }
.entry pre code { background: none; padding: 0; font-size: inherit; }
.entry table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; }
.entry th, .entry td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }
.entry th { background: var(--chip-bg); font-weight: 600; }
.entry figure { margin: 1.5rem 0; }
.entry figcaption { font-size: .78rem; color: var(--muted); text-align: center; margin-top: .5rem; }
.entry hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* share row */
.share-row { display: flex; align-items: center; gap: .5rem; margin-top: 2rem; }
.share-label { font-size: .875rem; color: var(--muted); }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); transition: color .2s, background-color .2s;
}
.share-btn svg { width: 20px; height: 20px; }
.share-btn:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.share-btn:nth-of-type(1):hover { color: #1da1f2; background: rgba(29, 161, 242, .1); }
.share-native { display: none; }
.share-native.is-supported { display: inline-flex; }
.share-icon-check { display: none; }
.share-btn.is-copied .share-icon-copy { display: none; }
.share-btn.is-copied .share-icon-check { display: block; }
.share-btn.is-copied { color: #22c55e; }

/* table of contents */
.post-aside { display: none; }
.toc-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.25rem;
  max-height: calc(100vh - 8rem); overflow: hidden; display: flex; flex-direction: column;
}
.toc-title {
  margin: 0 0 .75rem; font-size: .875rem; font-weight: 600; color: var(--text);
}
.toc-list {
  list-style: none; margin: 0; padding: 0;
  overflow-y: auto; max-height: calc(100vh - 11rem);
}
.toc-link {
  display: block; padding: .375rem .5rem; border-radius: .5rem;
  font-size: .8rem; line-height: 1.35; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.toc-link:hover { color: var(--primary); }
.toc-level-3 { padding-left: 1.15rem; }
.toc-link.is-active {
  color: var(--primary); font-weight: 500;
  background: color-mix(in srgb, var(--primary) 5%, transparent);
}

/* mobile TOC */
.toc-trigger {
  position: fixed; left: 1rem; bottom: 1.5rem; z-index: 40;
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .6rem .9rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--primary); box-shadow: var(--shadow-lg);
  font-size: .875rem; font-weight: 500;
}
.toc-trigger svg { width: 16px; height: 16px; }
.toc-drawer { position: fixed; inset: 0; z-index: 60; }
.toc-drawer[inert] { display: none; }
.toc-drawer-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .5);
  opacity: 0; transition: opacity .3s;
}
.toc-drawer.open .toc-drawer-backdrop { opacity: 1; }
.toc-drawer-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 70vh;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, .25);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.toc-drawer.open .toc-drawer-panel { transform: none; }
.toc-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--border-soft); flex: none;
}
.toc-drawer-head h2 { margin: 0; font-size: .875rem; font-weight: 600; }
.toc-drawer-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-right: -.5rem; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
}
.toc-drawer-close svg { width: 20px; height: 20px; }
.toc-drawer-body { overflow-y: auto; padding: 1rem; }
.toc-drawer-body .toc-list { max-height: none; }
.toc-drawer-body .toc-link { font-size: .95rem; padding: .7rem .75rem; min-height: 44px; display: flex; align-items: center; }
.toc-drawer-body .toc-level-3 { padding-left: 1.75rem; }

/* attachment cards inside the article body */
.entry .attachment-card {
  display: flex; align-items: center; gap: .75rem;
  margin: 1rem 0; padding: .875rem 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: .75rem;
  transition: border-color .2s, box-shadow .2s;
}
.entry .attachment-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: 0 2px 12px color-mix(in srgb, var(--primary) 12%, transparent);
}
.entry .attachment-icon { flex-shrink: 0; width: 2.25rem; height: 2.25rem; color: #95a5a6; }
.entry .attachment-icon svg { display: block; width: 100%; height: 100%; }
.entry .attachment-icon-pdf { color: #e74c3c; }
.entry .attachment-icon-doc, .entry .attachment-icon-docx { color: #2980b9; }
.entry .attachment-icon-xls, .entry .attachment-icon-xlsx, .entry .attachment-icon-csv { color: #27ae60; }
.entry .attachment-icon-ppt, .entry .attachment-icon-pptx { color: #e67e22; }
.entry .attachment-icon-txt { color: #7f8c8d; }
.entry .attachment-icon-zip, .entry .attachment-icon-rar, .entry .attachment-icon-7z,
.entry .attachment-icon-tar, .entry .attachment-icon-gz, .entry .attachment-icon-bz2,
.entry .attachment-icon-xz { color: #8e44ad; }
.entry .attachment-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.entry .attachment-filename {
  font-size: .875rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.entry .attachment-ext { font-size: .75rem; color: var(--muted); }
.entry .attachment-btn {
  display: inline-flex; align-items: center; gap: .375rem; flex-shrink: 0;
  padding: .375rem .875rem; border-radius: .5rem;
  background: var(--primary); color: #fff;
  font-size: .8125rem; font-weight: 500; text-decoration: none;
  transition: background .2s;
}
.entry .attachment-btn:hover { background: color-mix(in srgb, var(--primary) 82%, #000); color: #fff; }
.entry .attachment-dl-icon { width: .875rem; height: .875rem; }
/* the <ul> wrapping attachment cards should not show bullets */
.entry ul:has(> li > .attachment-card) { list-style: none; padding-left: 0; }
.entry ul:has(> li > .attachment-card) > li { margin: 0; }

.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.post-nav { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.75rem; }
.post-nav a {
  display: block; padding: 1rem 1.25rem; background: var(--card);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
}
.post-nav span { display: block; font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
.post-nav strong { font-size: .9rem; font-weight: 600; }
.post-nav a:hover strong { color: var(--primary); }

/* static page reuses the article column */
.article-wrap { max-width: 50rem; margin: 0 auto; padding: 6rem 0 3rem; }
.page-head { margin-bottom: 2rem; }
.page-head .eyebrow {
  margin: 0 0 .5rem; font-size: .875rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary);
}
.page-head h1 { margin: 0 0 .75rem; font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.2; letter-spacing: -.02em; }
.page-head .lead { margin: 0; color: var(--muted); }
.page-head .page-sub { margin: 0; font-size: .9375rem; color: var(--muted); }
.page-head .page-sub strong { color: var(--primary); }

/* standalone pages (分类 / 标签 / 归档 / 关于) */
.page-shell { padding: 8rem 0 4rem; }
.about-shell { max-width: 48rem; margin: 0 auto; padding: 8rem 0 4rem; }
.section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 2rem; font-size: 1.5rem; }
.section-title::before { content: ""; width: 4px; height: 22px; border-radius: 999px; background: var(--primary); }

/* category overview */
.cat-rows { display: flex; flex-direction: column; gap: .75rem; }
.cat-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem; background: var(--card); border-radius: 14px;
  border: 1px solid var(--border-soft); transition: box-shadow .2s, transform .2s;
}
.cat-row:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.cat-idx { font-family: var(--mono); font-size: .875rem; color: var(--muted); opacity: .5; width: 2rem; flex: none; }
.cat-row .cat-name { flex: 1; min-width: 0; font-weight: 600; }
.cat-row:hover .cat-name { color: var(--primary); }
.cat-row .cat-count { font-size: .875rem; color: var(--muted); }
.cat-row svg { width: 16px; height: 16px; color: var(--muted); opacity: .5; }
.cat-row:hover svg { color: var(--primary); opacity: 1; }

/* tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .75rem; }
.tag-pill {
  display: inline-flex; align-items: baseline; gap: .3rem;
  padding: .75rem 1.25rem; background: var(--card); border-radius: 999px;
  border: 1px solid var(--border-soft); font-size: 1.125rem;
}
.tag-pill:hover { color: var(--primary); box-shadow: var(--shadow-lg); }
.tag-pill sup { font-size: .6875rem; color: var(--muted); }

/* archive list */
.archive-year { margin: 2.5rem 0 1rem; font-size: 1.25rem; display: flex; align-items: center; gap: .6rem; }
.archive-year::before { content: ""; width: 4px; height: 20px; border-radius: 999px; background: var(--primary); }
.archive-year:first-of-type { margin-top: 0; }
.archive-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.archive-list li + li { border-top: 1px solid var(--border-soft); }
.archive-list a { display: flex; align-items: center; gap: 1rem; padding: .875rem .25rem; }
.archive-list time { font-family: var(--mono); font-size: .8125rem; color: var(--muted); flex: none; width: 3.25rem; }
.archive-list .archive-title { flex: 1; min-width: 0; font-size: .9375rem; }
.archive-list a:hover .archive-title { color: var(--primary); }
.archive-list .cat-pill { flex: none; }
@media (min-width: 1024px) { .page-shell { padding: 9rem 0 5rem; } .about-shell { padding: 9rem 0 5rem; } }

/* ---------- projects ---------- */
.project-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.project-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: box-shadow .3s, border-color .3s, transform .3s;
}
.project-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border); transform: translateY(-2px); }
.project-card-main { display: flex; flex-direction: column; flex: 1; }
.project-thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--chip-bg); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.project-card:hover .project-thumb img { transform: scale(1.05); }
.project-body { padding: 1.25rem 1.25rem .5rem; }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .6rem; }
.project-year { font-family: var(--mono); font-size: .75rem; color: var(--primary); }
.project-body h2 { margin: 0 0 .5rem; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.project-card:hover h2 { color: var(--primary); }
.project-body p {
  margin: 0; font-size: .875rem; line-height: 1.7; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.project-links {
  display: flex; flex-wrap: wrap; gap: 1rem;
  padding: .75rem 1.25rem 1.25rem; margin-top: auto;
  font-size: .8125rem; font-weight: 500; color: var(--muted);
}
.project-links a { display: inline-flex; align-items: center; gap: .3rem; }
.project-links svg { width: 14px; height: 14px; }

.project-stack, .project-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.btn-link {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem 1rem; border-radius: 999px;
  background: var(--chip-bg); font-size: .8125rem; font-weight: 500;
}
.btn-link svg { width: 14px; height: 14px; }
.btn-link:hover { background: var(--primary); color: #fff; }
.project-cover { margin: 0 0 2rem; border-radius: var(--radius); overflow: hidden; }

/* single project: hero head (same as post-hero, shorter) */
.post-hero-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .875rem; }
.post-hero-chips .post-hero-cat { margin-bottom: 0; }
.project-author { font-weight: 500; color: rgba(255, 255, 255, .8); }
.post-hero .project-actions { gap: .6rem; margin-top: 1.25rem; }
.post-hero .btn-link {
  padding: .55rem 1.1rem; border-radius: 10px;
  background: rgba(255, 255, 255, .12); color: #fff;
  font-size: .875rem; font-weight: 500; backdrop-filter: blur(6px);
}
.post-hero .btn-link:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.btn-link.btn-primary {
  background: var(--primary); color: #fff; font-weight: 600;
  padding: .55rem 1.35rem;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 30%, transparent);
}
.post-hero .btn-link.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-link.btn-primary svg { width: 16px; height: 16px; }

/* project hero: shorter than the article hero */
.post-hero.project-hero { min-height: 0; }
.project-hero .post-hero-inner { padding: 5.25rem 1rem 1.5rem; }
.project-hero .post-hero-img { transform: scale(1.04); }
.project-hero h1 { margin-bottom: .6rem; }
.project-hero .post-hero-desc { margin-bottom: 1rem; -webkit-line-clamp: 1; }
.project-hero .post-hero-tags { margin-top: .5rem; }
.project-hero .project-actions { margin-top: .9rem; }
@media (min-width: 1024px) {
  .project-hero .post-hero-inner { padding: 5.75rem 2rem 1.75rem; }
  .project-hero .post-hero-desc { -webkit-line-clamp: 1; }
  .project-hero h1 { font-size: clamp(1.75rem, 2.3vw, 2.25rem); }
}

/* ---------- reviews ---------- */
.review-layout { display: grid; grid-template-columns: 1fr; gap: 1.75rem; align-items: start; }
.review-side .side-title { margin: 0 0 .75rem; font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.review-side .side-title + .side-title { margin-top: 1.5rem; }
.review-types { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.review-types a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .75rem; border-radius: 10px; font-size: .875rem; color: var(--muted);
  transition: background .2s, color .2s;
}
.review-types a:hover { background: var(--chip-bg); color: var(--text); }
.review-types a.is-active { background: var(--primary); color: #fff; font-weight: 600; }
.review-types .count { font-family: var(--mono); font-size: .6875rem; opacity: .65; }
.review-sort { display: flex; flex-wrap: wrap; gap: .4rem; }
.review-sort .chip.is-active { background: var(--primary); color: #fff; }

.review-list { display: flex; flex-direction: column; gap: .75rem; }
.review-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem; background: var(--card); border-radius: 14px;
  border: 1px solid var(--border-soft); transition: box-shadow .2s, transform .2s, border-color .2s;
}
.review-row:hover { box-shadow: var(--shadow-lg); border-color: var(--border); transform: translateY(-1px); }
.review-cover {
  flex: none; width: 4.5rem; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden;
  background: var(--chip-bg); display: flex; align-items: center; justify-content: center;
}
.review-cover img { width: 100%; height: 100%; object-fit: cover; }
.review-cover-fallback { font-size: 1.5rem; font-weight: 700; color: var(--muted); opacity: .5; }
.review-info { flex: 1; min-width: 0; }
.review-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.review-tags .cat-pill { margin-bottom: 0; }
.review-tags time { font-size: .75rem; color: var(--muted); }
.review-info h2 { margin: 0; font-size: .9375rem; font-weight: 600; line-height: 1.4; }
.review-row:hover h2 { color: var(--primary); }
.review-info p {
  margin: .25rem 0 0; font-size: .8125rem; line-height: 1.6; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.review-score {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem;
  padding-left: .5rem;
}
.review-score .stars-num { font-family: var(--mono); font-size: 1.0625rem; font-weight: 700; color: var(--text); }
.review-score-den { font-family: var(--mono); font-size: .6875rem; color: var(--muted); }
.review-score-none { font-size: .75rem; color: var(--muted); }

/* stars */
.stars { display: inline-flex; align-items: center; gap: .5rem; }
.stars-visual { position: relative; display: inline-block; font-size: .9375rem; letter-spacing: .06em; line-height: 1; }
.stars-base { color: var(--border); }
.stars-top {
  position: absolute; left: 0; top: 0; width: var(--fill); overflow: hidden; white-space: nowrap;
  color: var(--primary);
}
.stars-num { font-family: var(--mono); font-size: .9375rem; font-weight: 600; color: var(--text); }

.review-single { max-width: 56rem; margin: 0 auto; padding: 7rem 0 3rem; }
.review-single-head { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 2.5rem; }
.review-single-cover {
  flex: none; width: 10rem; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden;
  background: var(--chip-bg); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg);
}
.review-single-cover img { width: 100%; height: 100%; object-fit: cover; }
.review-single-cover .review-cover-fallback { font-size: 3rem; }
.review-single-text h1 { margin: .25rem 0 1rem; font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.25; letter-spacing: -.02em; }
.review-lead { margin: 1.25rem 0 0; color: var(--muted); line-height: 1.8; }
.review-single-score { display: flex; align-items: baseline; gap: .6rem; margin-top: 1rem; }
.review-single-score .stars-visual { font-size: 1.25rem; }
.review-single-score .stars-num { font-size: 1.25rem; }

.project-thumb-fallback {
  display: flex; align-items: center; justify-content: center; height: 100%;
  font-size: 2rem; font-weight: 700; color: var(--muted); opacity: .45;
}

@media (min-width: 640px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .review-single-head { flex-direction: row; align-items: flex-end; gap: 2rem; }
}
@media (min-width: 900px) {
  .review-layout { grid-template-columns: 11rem 1fr; gap: 2.5rem; }
  .review-side { position: sticky; top: 6rem; }
}

/* ---------- comments ---------- */
.comments { margin-top: 2rem; background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.comments h2 { margin-top: 0; font-size: 1.05rem; }
.comment-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.comment-list ol.children { list-style: none; padding-left: 1.25rem; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--border-soft); font-size: .9rem; }
.comment-meta { font-size: .75rem; color: var(--muted); margin-bottom: .35rem; }
.comment-form label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .25rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: .6rem .8rem; margin-bottom: .9rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: .9rem;
}
.comment-form .submit {
  padding: .6rem 1.4rem; border: 0; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: .875rem;
}
.comment-form .submit:hover { background: var(--primary-dark); }

/* ---------- page / archive / 404 ---------- */
.page-title-area { padding: 2.25rem 0 .5rem; }
.page-title-area h1 { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -.02em; }
.page-title-area .sub { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; }
.empty { padding: 4rem 1rem; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); margin-top: 0; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 4rem; overflow: hidden;
  border-top: 1px solid var(--border); background: var(--card);
}

/* nyan cat marquee */
.marquee-track {
  position: relative; width: 100%; height: 3.5rem;
  display: flex; align-items: center; overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.marquee-content { display: flex; align-items: center; width: max-content; animation: marquee 40s linear infinite; }
.marquee-track:hover .marquee-content { animation-play-state: paused; }
.marquee-cat {
  height: 7rem; width: auto; flex: none;
  margin: -3.5rem 1rem -3.5rem 0; align-self: center;
}
.marquee-item {
  position: relative; display: flex; align-items: center; flex: none;
  padding: 0 1.5rem; font-size: .875rem; color: var(--muted); white-space: nowrap;
}
.marquee-item::after {
  content: "·"; position: absolute; right: -4px; color: var(--muted); opacity: .3;
}
.marquee-item.no-dot::after { content: ""; }
.marquee-item:hover { color: var(--primary); }
@keyframes marquee {
  from { transform: translateX(-33.3333%); }
  to   { transform: translateX(0); }
}

.footer-inner { padding: 3rem 1rem 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-logo { font-size: 1.125rem; font-weight: 700; color: var(--primary); }
.footer-logo:hover { opacity: .8; }
.footer-bio { margin: .75rem 0 .5rem; font-size: .875rem; color: var(--muted); line-height: 1.7; }
.footer-meta { margin: 0; font-size: .75rem; color: var(--muted); opacity: .75; }
.footer-grid h3 { margin: 0 0 1rem; font-size: .875rem; font-weight: 600; color: var(--text); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .625rem; }
.footer-grid ul a { font-size: .875rem; color: var(--muted); }
.footer-grid ul a:hover { color: var(--primary); }

.footer-bottom {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding-top: 1.5rem; border-top: 1px solid var(--border-soft);
  font-size: .75rem; color: var(--muted); text-align: center;
}
.footer-bottom a { color: var(--primary); }
.footer-bottom a:hover { text-decoration: underline; }

/* ---------- scroll reveal ---------- */
.reveal-up { opacity: 0; transform: translateY(40px); transition: opacity .7s ease, transform .7s cubic-bezier(.22, 1, .36, 1); }
.reveal-up.is-visible { opacity: 1; transform: none; }

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: 1.5rem; bottom: 5rem; z-index: 40;
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%;
  background: var(--card); color: var(--muted); box-shadow: var(--shadow-lg);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s, visibility .25s, transform .25s, color .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--primary); }
.to-top svg { width: 18px; height: 18px; }
@media (min-width: 1024px) { .to-top { bottom: 2rem; } }

/* ---------- search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px);
  padding: 6rem 1rem 1rem;
}
.search-overlay.open { display: block; }
.search-box { max-width: 34rem; margin: 0 auto; background: var(--card); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-lg); }
.search-box form { display: flex; gap: .5rem; }
.search-box input[type="search"] {
  flex: 1; padding: .7rem .9rem; font: inherit; font-size: .95rem;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
}
.search-box button {
  padding: .7rem 1.2rem; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font-size: .875rem;
}
.search-hint { margin: .75rem 0 0; font-size: .75rem; color: var(--muted); }

/* ---------- sidebar drawer (mobile) ---------- */
.drawer-toggle {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 40;
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--primary); color: #fff; box-shadow: 0 10px 24px rgba(249, 115, 22, .35);
  display: inline-flex; align-items: center; justify-content: center;
}
.drawer-toggle svg { width: 20px; height: 20px; }
.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 20rem; max-width: 85vw;
  background: var(--bg); box-shadow: var(--shadow-lg); overflow-y: auto; padding: 1.25rem;
}
.drawer-close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--chip-bg); color: var(--muted); margin-bottom: 1rem; }
.drawer-close svg { width: 18px; height: 18px; }

/* ---------- responsive ---------- */
@media (min-width: 768px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-nav { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}
@media (min-width: 1024px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .post-hero { min-height: 70vh; }
  .post-hero-inner { padding: 9rem 2rem 4rem; }
  .post-hero h1 { font-size: clamp(2.25rem, 3.6vw, 3.25rem); }
  .post-hero-meta { font-size: .875rem; }
  .post-layout { flex-direction: row; align-items: flex-start; gap: 2rem; padding: 2rem 0 4rem; }
  .post-aside { display: block; width: 16rem; flex: none; order: 2; align-self: stretch; }
  .post-aside .toc-card { position: sticky; top: 5.5rem; }
  .toc-trigger { display: none; }
  .entry { font-size: 1.0625rem; }
  .hero-inner { grid-template-columns: repeat(2, 1fr); gap: 5rem; }
  .hero .hero-inner { padding: 9rem 2rem 7rem; }
  .hero-card { padding: 1.75rem 2rem; }
  .hero-list a { padding: 1rem .75rem; }
  .layout { flex-direction: row; align-items: flex-start; gap: 2rem; }
  .side-col { display: block; width: 20rem; flex: none; order: -1; }
  .side-inner { top: 5.5rem; }
  .drawer-toggle { display: none; }
  .wrap { padding: 0 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
