:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #eef4f2;
  --text: #17211f;
  --muted: #65726f;
  --line: #dce5e2;
  --brand: #0f766e;
  --brand-strong: #0a5c56;
  --brand-soft: #dff5ef;
  --code: #101817;
  --shadow: 0 18px 50px rgba(26, 55, 49, .08);
  --radius: 20px;
  --shell: min(1160px, calc(100vw - 40px));
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101513;
  --surface: #171e1b;
  --surface-soft: #1d2824;
  --text: #eaf1ee;
  --muted: #9aacA6;
  --line: #2a3733;
  --brand: #55c9b8;
  --brand-strong: #7addce;
  --brand-soft: #173a34;
  --code: #090d0c;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; line-height: 1.75; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
.shell { width: var(--shell); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #14a38f, #0a5c56); font-size: 13px; font-weight: 800; letter-spacing: -.02em; box-shadow: 0 8px 24px rgba(15,118,110,.25); }
.brand strong, .brand small { display: block; line-height: 1.25; }
.brand strong { font-size: 16px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a, .theme-toggle { border: 0; border-radius: 10px; padding: 8px 12px; color: var(--muted); background: transparent; cursor: pointer; transition: .2s ease; }
.main-nav a:hover, .main-nav a.active, .theme-toggle:hover { color: var(--text); background: var(--surface-soft); }
.theme-toggle { width: 40px; font-size: 18px; }

.hero { position: relative; overflow: hidden; padding: 90px 0 82px; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; width: 520px; height: 520px; top: -300px; left: 50%; border-radius: 50%; background: radial-gradient(circle, rgba(48, 190, 164, .17), transparent 70%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.07fr .93fr; gap: 80px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-size: 13px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.hero h1 { margin: 20px 0 22px; font-size: clamp(44px, 6vw, 74px); line-height: 1.08; letter-spacing: -.055em; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero p { max-width: 630px; margin: 0; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; align-items: center; gap: 22px; margin-top: 34px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 12px; color: #fff; background: var(--brand); font-weight: 700; box-shadow: 0 10px 28px rgba(15,118,110,.22); transition: .2s ease; }
.primary-button:hover { transform: translateY(-2px); background: var(--brand-strong); }
.text-button, .read-more { color: var(--brand); font-weight: 700; }
.hero-panel { overflow: hidden; border: 1px solid #25312e; border-radius: 18px; background: #101817; box-shadow: 0 24px 70px rgba(8, 25, 21, .25); transform: rotate(1.2deg); }
.terminal-bar { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px; border-bottom: 1px solid #283431; color: #82918c; font-size: 12px; }
.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: #40504b; }
.terminal-bar i:first-child { background: #ec6a5f; }.terminal-bar i:nth-child(2) { background: #f4bd4f; }.terminal-bar i:nth-child(3) { background: #61c454; }
.terminal-bar span { margin-left: auto; }
.hero-panel pre { margin: 0; padding: 30px 32px 34px; color: #cfdbd6; font: 14px/1.9 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.prompt { color: #53d5bd; }.cursor { color: #53d5bd; animation: blink 1s steps(1) infinite; } @keyframes blink { 50% { opacity: 0; } }

.section { padding: 78px 0 92px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-head h2, .about-grid h2 { margin: 8px 0 0; font-size: clamp(30px, 4vw, 42px); line-height: 1.18; letter-spacing: -.035em; }
.search-box { width: min(310px, 100%); display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search-box input { width: 100%; height: 44px; border: 0; outline: 0; color: var(--text); background: transparent; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.post-card { min-height: 320px; display: flex; flex-direction: column; padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 rgba(0,0,0,.02); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.post-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); box-shadow: var(--shadow); }
.post-card-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.category { color: var(--brand); font-weight: 700; }
.post-card h2 { margin: 25px 0 14px; font-size: 23px; line-height: 1.35; letter-spacing: -.025em; }
.post-card h2 a:hover { color: var(--brand); }
.post-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 14px; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.read-more { margin-top: auto; padding-top: 24px; font-size: 14px; }
.read-more span { display: inline-block; transition: transform .2s ease; }.read-more:hover span { transform: translateX(4px); }
.empty-state { padding: 40px; text-align: center; color: var(--muted); }
.about-section { padding: 74px 0; background: var(--surface-soft); border-block: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 90px; align-items: start; }
.about-grid p { margin: 0 0 14px; color: var(--muted); font-size: 17px; }
.site-footer { padding: 26px 0; color: var(--muted); font-size: 13px; }
.site-footer .shell { display: flex; justify-content: space-between; gap: 20px; }

.article-layout { display: grid; grid-template-columns: minmax(0, 820px) 220px; gap: 54px; align-items: start; padding: 54px 0 80px; }
.article-card { min-width: 0; padding: 50px 58px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 34px; color: var(--muted); font-size: 13px; }.breadcrumb a:hover { color: var(--brand); }
.article-head { padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.article-head h1 { margin: 15px 0 16px; font-size: clamp(34px, 5vw, 52px); line-height: 1.18; letter-spacing: -.045em; }
.article-meta { display: flex; gap: 9px; margin: 0; color: var(--muted); font-size: 13px; }
.article-body { padding-top: 22px; font-size: 16px; }
.article-body > blockquote:first-child { margin-top: 0; }
.article-body h2 { margin: 46px 0 16px; padding-top: 8px; font-size: 28px; line-height: 1.3; letter-spacing: -.025em; }
.article-body h3 { margin: 30px 0 12px; font-size: 21px; }
.article-body p { margin: 14px 0; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin: 7px 0; }
.article-body a { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 3px; }
.article-body blockquote { margin: 24px 0; padding: 16px 19px; border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; background: var(--surface-soft); color: var(--muted); }
.article-body blockquote p { margin: 0; }
.article-body code { padding: .15em .38em; border-radius: 6px; background: var(--surface-soft); color: var(--brand-strong); font: .9em ui-monospace, SFMono-Regular, Consolas, monospace; }
.article-body pre { position: relative; overflow-x: auto; margin: 20px 0; padding: 20px; border-radius: 14px; background: var(--code); color: #d8e3df; }
.article-body pre code { padding: 0; background: transparent; color: inherit; font-size: 13px; line-height: 1.7; }
.copy-code { position: absolute; top: 10px; right: 10px; border: 1px solid #34433e; border-radius: 7px; padding: 5px 9px; color: #9eb0aa; background: #18211f; cursor: pointer; font-size: 11px; }
.article-body img[alt*="二维码"], .article-body img[alt*="咖啡"] { width: min(220px, 68vw); height: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; }
.article-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }.article-footer a { color: var(--brand); font-weight: 700; }
.article-toc { position: sticky; top: 102px; padding-top: 8px; font-size: 13px; }
.article-toc strong { display: block; margin-bottom: 10px; font-size: 14px; }
.article-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.article-toc li { margin: 0; }
.article-toc a { display: block; padding: 6px 0 6px 15px; color: var(--muted); line-height: 1.45; transition: .2s ease; }.article-toc a:hover { color: var(--brand); }
.not-found { min-height: calc(100vh - 150px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }.not-found h1 { margin: 12px 0; font-size: clamp(44px,8vw,78px); }.not-found p { margin: 0 0 28px; color: var(--muted); }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }.hero-panel { max-width: 650px; transform: none; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { display: block; }.article-toc { display: none; }.article-card { max-width: 820px; margin: 0 auto; }
}
@media (max-width: 680px) {
  :root { --shell: min(100% - 28px, 1160px); }
  .header-inner { min-height: 64px; }.brand small { display: none; }.main-nav a[href="/#about"] { display: none; }.main-nav a, .theme-toggle { padding: 7px 9px; }
  .hero { padding: 62px 0 58px; }.hero h1 { font-size: 46px; }.hero p { font-size: 16px; }.hero-panel pre { padding: 23px 20px 26px; font-size: 12px; }
  .section { padding: 58px 0 68px; }.section-head { align-items: stretch; flex-direction: column; }.search-box { width: 100%; }
  .post-grid { grid-template-columns: 1fr; }.post-card { min-height: 280px; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }.about-section { padding: 58px 0; }
  .site-footer .shell, .article-footer { align-items: flex-start; flex-direction: column; }
  .article-layout { padding: 22px 0 54px; width: 100%; }.article-card { padding: 30px 20px; border-inline: 0; border-radius: 0; box-shadow: none; }.article-head h1 { font-size: 35px; }.article-body h2 { font-size: 25px; }
}
