@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --paper: #ffffff;
  --surface: #f7f7f3;
  --surface-strong: #f0f1eb;
  --ink: #17201f;
  --body: #4e5b58;
  --muted: #77817e;
  --line: #dfe3df;
  --orange: #ef6437;
  --orange-soft: #fff0ea;
  --code: #141918;
  --shadow: 0 18px 50px rgb(23 32 31 / 9%);
  --sans: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", STSong, "Noto Serif CJK SC", Georgia, serif;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; padding-top: 72px; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { text-underline-offset: .2em; }
a:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
h1, h2, h3, h4, p { margin-top: 0; }

.grain { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.site-header { position: fixed; inset: 0 0 auto; z-index: 15; height: 72px; padding: 0 max(4.5vw, 24px); display: flex; align-items: center; justify-content: space-between; background: rgb(255 255 255 / 94%); border-bottom: 1px solid rgb(223 227 223 / 90%); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; }
.brand img { display: block; width: 280px; height: auto; }
.site-header nav { display: flex; align-items: center; gap: 30px; }
.site-header nav a { color: var(--ink); font-size: 16px; font-weight: 800; text-decoration: none; }
.site-header nav a:first-child { color: var(--orange); }
.site-header nav a.install-link { padding: 8px 13px; background: var(--orange); color: #fff; }
.site-header nav a:hover { opacity: .66; }

.page-shell { width: min(1180px, calc(100vw - 48px)); margin-inline: auto; }
.eyebrow, .card-kicker { color: var(--orange); font: 500 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.home-hero { min-height: calc(100vh - 72px); padding: clamp(72px, 9vh, 110px) 0; display: grid; grid-template-columns: minmax(0, .92fr) minmax(390px, .78fr); align-items: center; gap: clamp(60px, 8vw, 120px); }
.hero h1 { margin: 20px 0 30px; font-size: clamp(58px, 6.6vw, 92px); font-weight: 700; letter-spacing: -.065em; line-height: .92; }
.hero h1 em, .tutorial-hero h1 em, .section-intro h2 em { color: var(--orange); font-family: var(--serif); font-style: normal; font-weight: 400; letter-spacing: -.04em; }
.lede { max-width: 565px; margin-bottom: 0; color: var(--body); font-size: 16px; line-height: 1.8; }
.home-hero .lede span { display: block; margin-top: 9px; color: inherit; font: inherit; }
.hero-actions { display: flex; align-items: center; gap: 26px; margin-top: 34px; }
.button { display: inline-flex; align-items: center; gap: 22px; padding: 13px 18px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; transition: transform .18s ease, background .18s ease; }
.button span { color: #ffb89e; }
.button:hover { transform: translateY(-2px); background: #26302f; }
.text-link, .back-link { color: var(--ink); font-size: 13px; font-weight: 800; text-decoration: none; }
.text-link { border-bottom: 1px solid currentColor; }
.text-link:hover, .back-link:hover { color: var(--orange); }

.schema-card { position: relative; padding: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 18px 18px 0 var(--surface-strong); transform: rotate(.7deg); }
.schema-card::before { content: ''; position: absolute; top: -1px; left: 28px; width: 70px; height: 3px; background: var(--orange); }
.schema-label { display: flex; justify-content: space-between; gap: 16px; padding: 2px 3px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font: 500 10px/1.4 var(--mono); letter-spacing: .12em; }
.schema-card img { display: block; width: 100%; margin-top: 14px; }

.home-section { padding: 108px 0 118px; border-top: 1px solid var(--line); }
.skill-section { display: grid; grid-template-columns: minmax(230px, .68fr) minmax(0, 1.32fr); gap: 8vw; }
.section-intro h2 { margin: 16px 0 20px; font-size: clamp(40px, 4.5vw, 62px); font-weight: 700; letter-spacing: -.06em; line-height: .98; }
.section-intro > p:last-child { max-width: 280px; margin: 0; color: var(--body); font-size: 14px; }
.terminal-frame { padding: 14px; background: #151918; border: 1px solid #303735; box-shadow: var(--shadow); }
.terminal-frame img { display: block; width: 100%; }
.skill-copy { display: grid; gap: 8px; margin-top: 22px; }
.skill-lead { margin: 0 0 3px; font-size: 14px; font-weight: 800; }
.skill-copy code { display: block; padding: 11px 14px; background: var(--surface); border-left: 2px solid var(--orange); color: #34413e; font: 12px/1.6 var(--mono); white-space: normal; }

.app-section { padding-bottom: 138px; }
.app-section .section-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .78fr); align-items: end; gap: 7vw; margin-bottom: 36px; }
.app-section .section-intro > p { max-width: 430px; margin-bottom: 3px; color: var(--body); font-size: 14px; }
.app-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 22px; }
.app-gallery figure { margin: 0; }
.app-gallery img { display: block; width: 100%; border: 1px solid var(--line); box-shadow: 0 12px 32px rgb(23 32 31 / 8%); }
.app-gallery figcaption { margin-top: 9px; color: var(--muted); font: 500 10px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }

.tutorial-hero { padding: 54px 0 48px; border-bottom: 1px solid var(--line); }
.tutorial-hero h1 { max-width: 920px; margin: 13px 0 17px; font-size: clamp(42px, 5vw, 66px); font-weight: 700; letter-spacing: -.065em; line-height: .98; }
.tutorial-hero > p:last-child { max-width: 560px; margin-bottom: 0; color: var(--body); font-size: 14px; }
.docs-layout { display: grid; grid-template-columns: 210px 1fr; gap: 7vw; padding: 58px 0 120px; }
.docs-nav { position: sticky; top: 96px; align-self: start; }
.nav-group, .nav-single { display: flex; flex-direction: column; gap: 7px; margin: 23px 0; color: var(--ink); text-decoration: none; }
.nav-group > span, .nav-single > span { color: var(--muted); font: 500 10px/1.4 var(--mono); text-transform: uppercase; }
.nav-group strong, .nav-single strong { font-size: 14px; }
.nav-group a { padding-left: 11px; border-left: 1px solid var(--line); color: var(--body); font-size: 12px; text-decoration: none; }
.nav-group a:hover { border-color: var(--orange); color: var(--orange); }
.doc-cards { display: grid; gap: 14px; }
.doc-row, .mini-card { display: flex; align-items: center; gap: 24px; padding: 25px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.doc-row:hover, .mini-card:hover { transform: translateY(-3px); border-color: #f3a58a; box-shadow: var(--shadow); }
.row-index { color: var(--orange); font: 500 12px/1 var(--mono); }
.doc-row h2 { margin: 6px 0 4px; font-size: 27px; letter-spacing: -.04em; }
.doc-row p:last-of-type, .doc-group > p { margin: 0; color: var(--body); font-size: 14px; }
.doc-row b, .mini-card b { margin-left: auto; color: var(--orange); }
.doc-group { padding: 30px; background: var(--surface); border: 1px solid var(--line); }
.doc-group h2 { margin: 6px 0 5px; font-size: 30px; letter-spacing: -.045em; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 22px; }
.mini-card { padding: 15px; background: #fff; font-size: 12px; }

.article-head { padding: 24px 0 20px; border-bottom: 1px solid var(--line); }
.back-link { color: var(--orange); }
.article-layout { display: grid; grid-template-columns: minmax(0, 860px) 240px; justify-content: center; align-items: start; gap: 60px; padding: 18px 0 110px; }
.markdown { width: 100%; color: var(--body); }
.article-toc { position: sticky; top: 94px; max-height: calc(100vh - 124px); padding: 5px 0 5px 18px; overflow-y: auto; border-left: 1px solid var(--line); scrollbar-width: thin; }
.article-toc > p { margin: 0 0 15px; color: var(--ink); font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.article-toc button { position: relative; display: block; width: 100%; padding: 8px 0; overflow: hidden; border: 0; background: none; color: var(--muted); font: 500 15px/1.5 var(--sans); text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: color .15s ease; }
.article-toc button::before { content: ''; position: absolute; top: 8px; bottom: 8px; left: -19px; width: 2px; background: transparent; }
.article-toc button:hover { color: var(--ink); }
.article-toc button.is-active { color: var(--orange); font-weight: 700; }
.article-toc button.is-active::before { background: var(--orange); }
.article-toc .toc-level-3 { padding-left: 12px; font-size: 14px; }
.markdown > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.markdown h2, .markdown h3 { scroll-margin-top: 90px; }
.markdown h2 { margin: 52px 0 20px; padding-top: 30px; border-top: 1px solid var(--line); color: var(--ink); font-size: clamp(30px, 3.2vw, 40px); font-weight: 750; letter-spacing: -.05em; line-height: 1.16; }
.markdown h3 { margin: 38px 0 14px; color: var(--ink); font-size: 24px; letter-spacing: -.035em; line-height: 1.3; }
.markdown h4 { margin: 30px 0 10px; color: var(--ink); font-size: 18px; line-height: 1.4; }
.markdown h5, .markdown h6 { margin: 24px 0 9px; color: var(--ink); font-size: 15px; }
.markdown p, .markdown li { font-size: 15.5px; line-height: 1.82; }
.markdown p { margin-bottom: 16px; }
.markdown strong { color: var(--ink); font-weight: 750; }
.markdown em { color: #33413e; }
.markdown del { color: var(--muted); }
.markdown ul, .markdown ol { margin: 12px 0 22px; padding-left: 1.55em; }
.markdown li { padding-left: .3em; margin: 6px 0; }
.markdown li::marker { color: var(--orange); font-family: var(--mono); font-size: .82em; }
.markdown a { color: #c94720; text-decoration-color: #ef643766; }
.markdown a:hover { text-decoration-color: currentColor; }
.markdown img { display: block; width: 100%; height: auto; margin: 24px 0; border: 1px solid var(--line); }
.markdown code { padding: 2px 5px; background: var(--orange-soft); color: #7f321b; border-radius: 3px; font: 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.markdown pre { position: relative; margin: 24px 0 28px; padding: 34px 20px 20px; overflow: auto; background: var(--code); border-left: 3px solid var(--orange); color: #edf1ee; tab-size: 2; }
.markdown pre::before { content: attr(data-language); position: absolute; top: 10px; left: 20px; color: #89918e; font: 500 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.markdown pre code { padding: 0; background: none; color: inherit; font-size: 12px; line-height: 1.7; overflow-wrap: normal; }
.markdown blockquote { margin: 24px 0; padding: 15px 20px; background: var(--surface); border-left: 3px solid var(--orange); color: var(--body); }
.markdown blockquote > :last-child { margin-bottom: 0; }
.markdown blockquote h2, .markdown blockquote h3, .markdown blockquote h4 { margin-top: 18px; padding-top: 0; border-top: 0; }
.markdown hr { height: 1px; margin: 42px 0; border: 0; background: var(--line); }
.table-wrap { width: 100%; margin: 24px 0 30px; overflow-x: auto; border: 1px solid var(--line); }
.markdown table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.markdown th, .markdown td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown th { background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 800; }
.markdown tr:last-child td { border-bottom: 0; }
.markdown tbody tr:hover { background: #fffaf7; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(4.5vw, 24px); border-top: 1px solid var(--line); color: var(--muted); font: 500 10px/1.4 var(--mono); letter-spacing: .06em; }

@media (max-width: 820px) {
  body { padding-top: 64px; }
  .site-header { height: 64px; padding-inline: 18px; }
  .brand img { width: 194px; }
  .site-header nav { gap: 16px; }
  .site-header nav a { font-size: 14px; }
  .page-shell { width: min(100% - 34px, 680px); }
  .home-hero { min-height: auto; padding: 66px 0 82px; grid-template-columns: 1fr; gap: 58px; }
  .hero h1 { font-size: clamp(54px, 16vw, 72px); }
  .schema-card { transform: none; box-shadow: 10px 10px 0 var(--surface-strong); }
  .home-section { padding: 78px 0 84px; }
  .skill-section { grid-template-columns: 1fr; gap: 38px; }
  .section-intro > p:last-child { max-width: 520px; }
  .app-section .section-intro { grid-template-columns: 1fr; gap: 12px; margin-bottom: 28px; }
  .app-gallery { grid-template-columns: 1fr; gap: 26px; }
  .tutorial-hero { padding: 42px 0 38px; }
  .tutorial-hero h1 { font-size: clamp(39px, 11vw, 52px); }
  .docs-layout { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 85px; }
  .docs-nav { position: static; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
  .nav-group, .nav-single { margin: 16px 0; }
  .mini-grid { grid-template-columns: 1fr; }
  .article-head { padding: 20px 0 17px; }
  .article-layout { display: block; padding: 14px 0 80px; }
  .article-toc { display: none; }
  .markdown h2 { margin-top: 42px; padding-top: 24px; }
  .markdown p, .markdown li { font-size: 15px; }
}

@media (min-width: 821px) and (max-width: 1120px) {
  .article-layout { display: block; }
  .markdown { width: min(860px, 100%); margin-inline: auto; }
  .article-toc { display: none; }
}

@media (max-width: 460px) {
  .site-header nav { gap: 8px; }
  .site-header nav a { font-size: 12px; }
  .site-header nav a.install-link { padding: 6px 8px; }
  .brand img { width: 148px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .doc-row { align-items: flex-start; gap: 13px; padding: 20px 17px; }
  .doc-row h2 { font-size: 23px; }
  .row-index { margin-top: 8px; }
  .doc-group { padding: 23px 18px; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
