:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-soft: #10172b;
  --panel: rgba(20, 29, 53, .78);
  --panel-solid: #151f38;
  --line: rgba(164, 183, 226, .16);
  --text: #edf2ff;
  --muted: #98a6c6;
  --accent: #8cf0cd;
  --accent-2: #92a7ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, .28);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  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.6;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 0%, rgba(76, 107, 208, .25), transparent 32%),
    radial-gradient(circle at 87% 17%, rgba(70, 218, 172, .12), transparent 27%),
    linear-gradient(180deg, #0b1020 0%, #0c1327 66%, #0b1020 100%);
}
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.site-shell { display: flex; flex-direction: column; width: min(1160px, calc(100% - 40px)); min-height: 100vh; min-height: 100dvh; margin: 0 auto; }
.site-shell > main { flex: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 88px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(140, 240, 205, .45); border-radius: 12px; color: var(--accent); font: 700 14px/1 ui-monospace, SFMono-Regular, Consolas, monospace; background: rgba(140, 240, 205, .08); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.topnav { display: flex; align-items: center; gap: 25px; color: var(--muted); font-size: 13px; }
.topnav a { text-decoration: none; transition: color .2s ease; }
.topnav a:hover { color: var(--text); }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: rgba(255,255,255,.04); }
.hero { display: grid; grid-template-columns: 1fr .82fr; gap: 80px; align-items: center; min-height: 570px; padding: 85px 0 74px; }
.eyebrow { margin: 0 0 15px; color: var(--accent); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .22em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 600px; margin-bottom: 22px; font-size: clamp(42px, 6vw, 72px); line-height: 1.08; letter-spacing: -.055em; }
h1 span { color: var(--accent); }
.hero-intro { max-width: 510px; margin-bottom: 29px; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; align-items: center; gap: 23px; }
.primary-button { display: inline-flex; align-items: center; gap: 19px; padding: 12px 20px; border: 1px solid rgba(140,240,205,.48); border-radius: 12px; color: #07131a; font-weight: 800; text-decoration: none; background: var(--accent); box-shadow: 0 12px 27px rgba(140,240,205,.13); }
.primary-button span { font-size: 20px; }
.text-button { color: var(--muted); font-size: 14px; text-decoration: none; }
.text-button:hover { color: var(--text); }
.hero-stats { display: flex; gap: 33px; margin-top: 56px; }
.hero-stats span { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 24px; line-height: 1.2; }
.hero-stats small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.hero-terminal { position: relative; overflow: hidden; border: 1px solid rgba(161,181,233,.2); border-radius: 18px; background: linear-gradient(145deg, rgba(24,38,72,.92), rgba(13,20,39,.96)); box-shadow: var(--shadow); transform: rotate(1.3deg); }
.hero-terminal::after { position: absolute; top: -95px; right: -70px; width: 210px; height: 210px; border-radius: 50%; content: ""; background: rgba(140,240,205,.12); filter: blur(2px); }
.terminal-top { display: flex; align-items: center; gap: 7px; padding: 15px 17px; border-bottom: 1px solid var(--line); color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.terminal-top span { width: 8px; height: 8px; border-radius: 50%; background: #ff7e86; }
.terminal-top span:nth-child(2) { background: #ffd268; }
.terminal-top span:nth-child(3) { background: #8cf0cd; }
.terminal-top em { margin-left: auto; font-style: normal; opacity: .65; }
pre { overflow: auto; margin: 0; padding: 28px 26px 31px; color: #cbd5f2; font: 13px/1.9 ui-monospace, SFMono-Regular, Consolas, monospace; }
.code-comment { color: #687da7; }.code-keyword { color: #b5a5ff; }.code-name { color: var(--accent); }.code-string { color: #ffd79b; }
.terminal-footer { display: flex; align-items: center; gap: 8px; padding: 10px 17px 13px; border-top: 1px solid var(--line); color: #7d91bc; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(140,240,205,.12); }
.notes-section { padding: 40px 0 70px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
h2 { margin-bottom: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.035em; }
.search-box { display: flex; align-items: center; gap: 9px; width: 220px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.035); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #6e7d9e; }
.category-list { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 23px; }
.category-chip { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; font-size: 12px; transition: all .2s ease; }
.category-chip:hover, .category-chip.active { border-color: rgba(140,240,205,.5); color: #08131a; background: var(--accent); }
.note-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.note-card { min-height: 206px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(155deg, rgba(24,35,65,.75), rgba(16,23,43,.75)); transition: transform .2s ease, border-color .2s ease; }
.note-card:hover { border-color: rgba(140,240,205,.38); transform: translateY(-4px); }
.note-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.note-tag { padding: 4px 9px; border-radius: 7px; color: var(--accent); background: rgba(140,240,205,.1); font-size: 11px; }
.note-date { color: #697998; font-size: 11px; }
.note-card h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.35; letter-spacing: -.02em; }
.note-card p { min-height: 48px; margin-bottom: 15px; color: var(--muted); font-size: 13px; }
.note-link { color: var(--accent-2); font-size: 12px; text-decoration: none; }
.note-link span { margin-left: 4px; }
.empty-state { padding: 45px 0; color: var(--muted); text-align: center; }
.about-section { padding: 0 0 70px; }
.about-card { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(20,29,53,.52); }
.about-avatar { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 18px; color: #09141e; background: linear-gradient(145deg, var(--accent), #8aa7ff); font-weight: 900; }
.about-card h2 { margin-bottom: 9px; font-size: 22px; }.about-card p:not(.eyebrow) { max-width: 570px; margin: 0; color: var(--muted); font-size: 13px; }
.about-code { display: grid; gap: 4px; min-width: 175px; padding-left: 22px; border-left: 1px solid var(--line); font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.about-code span { color: #687da7; }.about-code strong { margin-bottom: 7px; color: var(--accent); font-weight: 500; }
.site-footer { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 78px; border-top: 1px solid var(--line); color: #7887a5; font-size: 11px; text-align: center; }
.site-footer a { color: #a9b8d8; text-underline-offset: 3px; }.site-footer a:hover { color: var(--accent); }.footer-divider { color: #3d4c69; }
body.light { --bg: #f2f6fb; --bg-soft: #e9f0f9; --panel: rgba(255,255,255,.78); --panel-solid: #fff; --line: rgba(49,73,112,.14); --text: #152039; --muted: #60708d; --accent: #0b8a77; --accent-2: #4266c5; --shadow: 0 22px 70px rgba(38,66,111,.14); }
body.light::before { background: radial-gradient(circle at 15% 0%, rgba(104,146,238,.18), transparent 32%), linear-gradient(180deg, #f2f6fb, #e9f2f7); }
body.light .hero-terminal { background: linear-gradient(145deg, #223359, #172344); }
body.light .note-card, body.light .about-card { background: rgba(255,255,255,.7); }
/* Reading pages and shared interaction states. */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.search-box:focus-within { border-color: var(--accent); }
.search-box input:focus-visible { outline: 0; }
.note-date { color: var(--muted); }
.site-footer { padding-bottom: env(safe-area-inset-bottom, 0px); }
.site-footer a { font-size: 12px; }
.reading-main { width: min(800px, 100%); margin: 0 auto; padding: 38px 0 65px; }
.back-link { display: inline-block; margin-bottom: 26px; color: var(--muted); font-size: 13px; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.reading-card { padding: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow-wrap: anywhere; }
.reading-card h1 { max-width: none; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.025em; line-height: 1.4; margin-bottom: 20px; }
.article-meta { margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.article-intro { padding-bottom: 26px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 16px; line-height: 1.9; }
.article-contents { padding: 20px 24px; margin: 28px 0 38px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--bg-soft); font-size: 14px; }
.article-contents strong { color: var(--accent); font-size: 12px; }
.article-contents ol { margin: 10px 0 0; padding-left: 20px; }
.article-contents li + li { margin-top: 8px; }
.article-contents a { color: var(--muted); text-decoration: none; }
.article-contents a:hover { color: var(--accent); }
.article-section + .article-section { margin-top: 36px; }
.article-section h2 { margin: 0 0 16px; font-size: 22px; line-height: 1.5; letter-spacing: -.01em; scroll-margin-top: 24px; }
.article-section p { margin-bottom: 17px; color: var(--muted); font-size: 15px; line-height: 1.95; }
.code-label { margin-top: 22px; padding: 9px 18px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: #0c1326; color: #8cf0cd; font: 10px/1.5 ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.article-section pre { max-width: 100%; padding: 19px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; background: #0c1326; color: #cbd5f2; font-size: 12px; line-height: 1.85; overflow-wrap: normal; }
.article-navigation { display: flex; gap: 16px; margin-top: 24px; }
.article-navigation a { flex: 1; padding: 20px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.article-navigation a:hover { border-color: var(--accent); }
.article-navigation small { display: block; margin-bottom: 8px; color: var(--accent); font-size: 11px; }
.article-navigation span { font-size: 14px; }
body.light .primary-button, body.light .category-chip.active, body.light .category-chip:hover { color: #fff; }
body.light .site-footer, body.light .site-footer a { color: #526580; }
body.light .hero-terminal .code-name, body.light .hero-terminal .pulse { --accent: #8cf0cd; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
@media (max-width: 850px) { .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 65px; }.hero-terminal { max-width: 620px; transform: none; }.note-grid { grid-template-columns: repeat(2, 1fr); }.about-card { grid-template-columns: auto 1fr; }.about-code { grid-column: 1 / -1; padding: 17px 0 0; border-top: 1px solid var(--line); border-left: 0; grid-template-columns: auto 1fr; }.about-code strong { margin-bottom: 0; } }
@media (max-width: 560px) { .site-shell { width: min(100% - 28px, 1160px); }.topbar { min-height: 74px; }.brand small { display: none; }.topnav { gap: 12px; }.topnav a { display: none; }.hero { min-height: auto; padding: 58px 0 52px; }.hero-intro { font-size: 14px; }.hero-stats { gap: 23px; margin-top: 42px; }.hero-stats strong { font-size: 20px; }.section-heading { align-items: start; flex-direction: column; }.search-box { width: 100%; }.note-grid { grid-template-columns: 1fr; }.about-card { grid-template-columns: 1fr; padding: 23px; }.about-avatar { width: 54px; height: 54px; }.site-footer { flex-direction: column; gap: 3px; min-height: 88px; padding: 14px 0; }.footer-divider { display: none; } }
@media (max-width: 560px) { .hero, .hero-copy, .hero-terminal { min-width: 0; }.hero-terminal pre { padding: 20px 16px; font-size: 11px; }.topnav a:first-child { display: inline; }.reading-main { padding-top: 24px; }.reading-card { padding: 24px 20px; }.reading-card h1 { font-size: 27px; }.article-section h2 { font-size: 20px; }.article-section p { font-size: 14px; }.article-contents { padding: 16px; }.article-navigation { flex-direction: column; }.site-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } }
