:root {
  color-scheme: light;
  --paper: #f7f5ed;
  --ink: #222a23;
  --muted: #505c51;
  --forest: #244c37;
  --deep-forest: #193528;
  --line: #dcded0;
  --white: #fffdf8;
  --orange: #b64d2a;
  --heading: 'Noto Serif CJK SC', 'Noto Serif SC', 'Songti SC', STSong, SimSun, Georgia, serif;
  --body: 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--body); }
a { color: inherit; }
button { font: inherit; }
img, svg { display: block; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
::selection { background: #d9e5d2; color: #172a1d; }
.wrap { width: min(76rem, calc(100% - 6rem)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 2; top: .75rem; left: .75rem; padding: .7rem 1rem; background: var(--white); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 4.75rem; }
.wordmark { width: fit-content; display: inline-flex; align-items: center; gap: .65rem; font-weight: 760; font-size: 1.35rem; letter-spacing: -.06em; line-height: 1; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: clamp(1.2rem, 3.6vw, 3rem); padding: .5rem 0; }
.nav a, .footer-links a { color: var(--muted); font-size: .925rem; font-weight: 560; text-decoration: none; }
.nav a:hover, .footer-links a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: .22em; }
.language-button { justify-self: end; background: transparent; color: var(--ink); min-height: 2.4rem; padding: .2rem .75rem; border: 1px solid #c6cbbd; border-radius: .4rem; font-weight: 630; font-size: .9rem; }
.language-button:hover { background: #eaece2; border-color: #abb4a4; }

.hero { display: grid; grid-template-columns: minmax(0,.84fr) minmax(0,1.16fr); align-items: center; gap: clamp(2rem, 5vw, 5.25rem); padding: clamp(4.2rem, 7.5vw, 7rem) 0 clamp(3.6rem, 7vw, 6.2rem); }
.hero-copy { padding-bottom: 1.8rem; }
.kicker { display: flex; align-items: center; gap: .55rem; color: var(--forest); font: 650 .875rem/1.4 var(--body); letter-spacing: .14em; margin: 0 0 1.2rem; }
.kicker-mark { width: .65rem; height: .65rem; border: 2px solid var(--orange); border-radius: 50%; }
h1, .section-heading h2, .install h2 { font-family: var(--heading); font-weight: 800; letter-spacing: -.065em; }
h1 { font-size: clamp(3rem, 5.45vw, 5.25rem); line-height: 1.13; margin: 0; }
h1 em { color: var(--forest); font-style: normal; }
:lang(en) h1 em { font-style: italic; }
.intro { max-width: 25.5rem; color: var(--muted); margin: 1.4rem 0 1.65rem; font-size: clamp(1.05rem, 1.48vw, 1.19rem); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; gap: .5rem; padding: .65rem 1.12rem; border-radius: .4rem; border: 1px solid var(--forest); font-weight: 690; line-height: 1.35; text-decoration: none; }
.button-primary { background: var(--forest); color: var(--white); }
.button-primary:hover { background: var(--deep-forest); }
.button-outline { border-color: #b3bfad; color: var(--forest); }
.button-outline:hover { background: #e7eadf; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--muted); margin-top: 1.25rem; font-size: .8775rem; }
.hero-meta span + span::before { content: '·'; color: var(--orange); margin-inline-end: .9rem; }

.demo { min-width: 0; }
.demo-frame { border: 1px solid #cdd4c8; border-radius: .9rem; overflow: hidden; background: var(--white); box-shadow: 0 1.35rem 3.4rem #253a2820, 0 .3rem .8rem #253a280e; }
.demo-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 3.25rem; background: var(--deep-forest); padding: .6rem clamp(.85rem, 2vw, 1.35rem); color: #fcfcf1; }
.demo-brand { display: flex; align-items: center; gap: .52rem; font-size: 1.06rem; font-weight: 720; letter-spacing: -.035em; }
.demo-sample { color: #d0ddcc; font-size: .875rem; }
.demo-body { container-type: inline-size; padding: .95rem clamp(.85rem, 2vw, 1.35rem) 1.15rem; }
.demo-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.demo-heading h2 { margin: 0; font-size: clamp(1.21rem, 2vw, 1.45rem); line-height: 1.25; font-weight: 770; letter-spacing: -.04em; }
.view-controls { padding: .16rem; display: flex; gap: .12rem; border: 1px solid #e1e4d9; border-radius: .48rem; background: #f1f2eb; }
.view-controls button { display: grid; width: 2rem; height: 1.9rem; place-items: center; padding: 0; border: 1px solid transparent; background: transparent; border-radius: .32rem; color: #526351; }
.view-controls button:hover { background: #e6eae1; }
.view-controls button[aria-pressed='true'] { background: var(--white); border-color: #dedfd4; color: var(--deep-forest); box-shadow: 0 1px 2px #1c2c2012; }
.demo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .45rem .65rem; min-height: 2rem; margin: .7rem 0 .7rem; }
.tag-controls { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-controls button { min-height: 1.85rem; padding: .16rem .55rem; border: 1px solid #e1e3d7; border-radius: 2rem; background: var(--white); color: #454f44; font-size: .875rem; line-height: 1.1; white-space: nowrap; }
.tag-controls button:hover { background: #f0f3e9; }
.tag-controls button[aria-pressed='true'] { background: #e3eadb; color: #234532; border-color: #d5dfce; font-weight: 690; }
.result-count { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.demo-results { min-height: calc(46cqw + 3.7rem); }
.gallery { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-auto-rows: max-content; gap: .55rem; list-style: none; }
.gallery li { min-width: 0; overflow: hidden; background: #f6f6ed; border: 1px solid #e6e6da; border-radius: .4rem; }
.gallery img { width: 100%; height: auto; aspect-ratio: 1.45; object-fit: cover; background: #dce3d8; }
.gallery li > span { display: block; margin: .34rem .43rem .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4c584e; font: 500 .76rem/1.2 var(--mono); }
.gallery-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .875rem; }
.gallery-table th, .gallery-table td { padding: .43rem .25rem; text-align: left; }
.gallery-table th { color: var(--muted); font-weight: 620; }
.gallery-table th:first-child { width: 62%; }
.gallery-table th:last-child { width: 14%; }
.gallery-table td { border-top: 1px solid #e5e7dd; }
.table-file { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.table-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-file img { width: 2rem; height: 1.5rem; object-fit: cover; border-radius: .24rem; }
.demo-caption { margin: .9rem 0 0; text-align: center; color: var(--muted); font-size: .875rem; }

.features { background: #efefe5; border-block: 1px solid #e0e2d6; }
.section-inner { padding: clamp(3rem, 5.7vw, 5.1rem) 0; }
.section-heading h2, .install h2 { font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.2; margin: 0; }
.section-heading p { margin: .65rem 0 1.75rem; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: #d3d8cb; border: 1px solid #d3d8cb; border-radius: .75rem; overflow: hidden; }
.feature { background: var(--white); padding: clamp(1.15rem, 2.6vw, 2.05rem); }
.feature-icon { display: grid; width: 2.7rem; height: 2.7rem; place-items: center; color: var(--forest); background: #ebf0e5; border-radius: .45rem; margin-bottom: .85rem; }
.feature h3 { color: var(--deep-forest); font-size: 1.25rem; letter-spacing: -.035em; line-height: 1.3; margin: 0 0 .38rem; }
.feature p { color: var(--muted); margin: 0; }

.install-wrap { padding: clamp(3.4rem, 6.5vw, 5.6rem) 0; }
.install { border-radius: 1rem; background: var(--deep-forest); color: #f6f5e8; display: grid; grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr); align-items: start; gap: clamp(1rem, 4.5vw, 4rem); padding: clamp(1.35rem, 4.6vw, 4rem); }
.install-copy p { color: #d1dfd0; max-width: 23rem; margin: .95rem 0 1.2rem; }
.install-links { display: flex; flex-wrap: wrap; gap: .36rem 1.05rem; font-weight: 650; font-size: .9rem; }
.install-links a { color: #eff6e8; text-underline-offset: .25em; }
.install-links a:hover { color: #fff; }
.install-modes { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid #5a7464; margin-bottom: .73rem; }
.install-modes button { padding: .35rem .63rem .52rem; background: transparent; color: #d1dfd0; border: 0; border-bottom: 2px solid transparent; font-weight: 620; font-size: .925rem; }
.install-modes button:hover { color: #fff; }
.install-modes button[aria-pressed='true'] { color: #fff; border-bottom-color: #d7a288; }
.requirement { color: #d1dfd0; margin: 0 0 .55rem; font-size: .89rem; }
.install-panel + .install-panel { margin-top: 1rem; }
.install-modes:not([hidden]) ~ .install-panel { margin-top: 0; }
.terminal { background: #101e17; border: 1px solid #607361; border-radius: .6rem; }
.terminal-bar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; min-height: 2.6rem; padding: .3rem .6rem .3rem .9rem; border-bottom: 1px solid #43594b; color: #c6d9c9; font: 500 .875rem/1.25 var(--mono); }
.copy { min-height: 1.8rem; padding: .15rem .48rem; border: 1px solid #6c8170; border-radius: .35rem; background: transparent; color: #eff5ec; font: 610 .85rem/1.25 var(--body); }
.copy:hover { background: #30493a; }
.terminal pre, .install-notes pre { margin: 0; padding: .8rem .9rem; overflow-x: auto; font: .875rem/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal code { color: #edf8e8; }
.install-notes { font-size: .9rem; color: #d1dfd0; }
.install-notes p { margin: .65rem 0 .25rem; }
.install-notes code { font-family: var(--mono); color: #eff6e8; overflow-wrap: anywhere; }
.install-notes details { margin-top: .55rem; }
.install-notes summary { width: fit-content; font-weight: 640; color: #eff6e8; }
.install-notes pre { padding: .35rem 0 0; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 0; gap: 1rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 1.2rem; }

@media (max-width: 61rem) {
  .wrap { width: calc(100% - 3rem); }
  .hero { gap: 2rem; }
  .hero-meta { column-gap: .5rem; }
  .hero-meta span + span::before { margin-inline-end: .5rem; }
}

@media (max-width: 47rem) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 3.1rem; }
  .hero-copy { padding-bottom: 0; }
  h1 { font-size: clamp(3.05rem, 9vw, 4.7rem); }
  .intro { max-width: 31rem; }
  .demo { max-width: 39rem; }
  .feature-grid, .install { grid-template-columns: 1fr; }
  .install { gap: 1.6rem; }
}

@media (max-width: 30rem) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { grid-template: auto auto / 1fr auto; padding: .8rem 0 .25rem; row-gap: .3rem; }
  .nav { grid-row: 2; grid-column: 1 / -1; gap: 1.25rem; }
  .language-button { grid-column: 2; grid-row: 1; }
  .gallery { gap: .33rem; }
  .gallery li > span { margin-inline: .25rem; }
  .demo-toolbar { align-items: flex-start; flex-direction: column; }
  .result-count { align-self: end; }
  .table-file img { display: none; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
