/* Rose · 个人网站 —— 深色笔记本风格（纯手写） */
:root {
  color-scheme: dark;
  --ink: #10131c;
  --ink-2: #141826;
  --panel: #181c2a;
  --panel-2: #1e2334;
  --line: #2b3146;
  --line-soft: rgba(214, 220, 240, .055);
  --paper: #efebe1;
  --muted: #a9aec0;
  --dim: #767c93;
  --lime: #d97757;            /* 站点主色：陶土橙（Claude 风格） */
  --lime-rgb: 217, 119, 87;
  --accent: var(--lime);
  --serif: Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "SF Mono", monospace;
  --wrap: 1180px;
  --mast: 72px;
  --glass: rgba(14, 17, 26, .84);
  --glass-2: rgba(24, 28, 42, .72);
  --foot-bg: rgba(10, 12, 19, .6);
  --btn-bg: rgba(255, 255, 255, .03);
  --ico-bg: rgba(0, 0, 0, .25);
  --star: rgba(236, 232, 222, .55);
  --star-dim: rgba(236, 232, 222, .28);
  --dots: rgba(214, 220, 240, .09);
  --prose: #d7d8de;
  --on-accent: #141826;
  --shadow: #000;
  --shadow-soft: rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--mast); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background-color: var(--ink);
  /* 淡淡的星空：三层不同间距的小星点平铺，错开就不会显得规律 */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(var(--lime-rgb), .10), transparent 60%),
    radial-gradient(1px 1px at 23px 41px, var(--star) 50%, transparent 52%),
    radial-gradient(1px 1px at 131px 87px, var(--star) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 67px 151px, var(--star) 50%, transparent 52%),
    radial-gradient(1px 1px at 201px 19px, var(--star-dim) 50%, transparent 52%),
    radial-gradient(1px 1px at 97px 233px, var(--star-dim) 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 311px 173px, var(--star) 50%, transparent 52%),
    radial-gradient(1px 1px at 257px 291px, var(--star-dim) 50%, transparent 52%);
  background-size: auto, 223px 223px, 223px 223px, 223px 223px, 307px 307px, 307px 307px, 389px 389px, 389px 389px;
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12% 22%, var(--star) 50%, transparent 55%),
    radial-gradient(1.6px 1.6px at 78% 14%, var(--star) 50%, transparent 55%),
    radial-gradient(2px 2px at 63% 71%, var(--star) 50%, transparent 55%),
    radial-gradient(1.6px 1.6px at 31% 83%, var(--star) 50%, transparent 55%),
    radial-gradient(1.8px 1.8px at 91% 52%, var(--star) 50%, transparent 55%);
  animation: twinkle 4.5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .15; } to { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; opacity: .5; } }
/* 星空画布接管背景后，关掉静态星点 */
.bg-sky { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; display: block; }
html.sky-on body { background-image: none; }
html.sky-on body::before { display: none; }
::selection { background: var(--lime); color: #fff; }

/* 中英切换 */
html[data-lang="en"] .zh { display: none !important; }
html:not([data-lang="en"]) .en { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

/* ---------- 顶栏 ---------- */
.mast {
  position: sticky; top: 0; z-index: 30; height: var(--mast);
  background: var(--glass);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.mast .wrap { display: flex; align-items: center; gap: 32px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: .01em; }
.brand-mark { width: 30px; height: 30px; color: var(--lime); }
.nav { display: flex; gap: 30px; margin-left: auto; }
.nav a { position: relative; text-decoration: none; font-size: 15px; color: var(--muted); padding: 6px 0; transition: color .2s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--lime); transform: scaleX(0); transition: transform .25s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--lime); }
.nav a[aria-current="page"]::after, .nav a:hover::after { transform: scaleX(1); }
.lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  color: var(--paper); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.lang-btn:hover { border-color: var(--lime); color: var(--lime); }
.lang-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------- 通用小件 ---------- */
.kicker, .kicker-s, .meta, .crumb, .date, .num {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
}
.kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--lime); }
.kicker i { width: 9px; height: 9px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 4px rgba(var(--lime-rgb), .18); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; color: var(--accent); }
.meta .sep { width: 1px; height: 12px; background: var(--line); }
.meta .st { color: var(--muted); }
em { font-style: italic; }
h1 em, h2 em, h3 em { color: var(--accent); font-weight: 400; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: 10px 18px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--paper); background: var(--btn-bg);
  transition: transform .2s, border-color .2s, background .2s, color .2s;
}
.btn i { font-style: normal; opacity: .8; }
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 8px 22px -12px var(--accent); }
.btn.solid:hover { color: var(--on-accent); filter: brightness(1.06); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 首页大标题 + 项目星座 ---------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 56px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: center; }
.hero-inner { position: relative; z-index: 1; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 7.4vw, 96px); line-height: 1; letter-spacing: -.02em; margin: 22px 0 22px; }
.hero h1 em { color: var(--lime); }
.lede { max-width: 560px; font-size: 18px; color: var(--muted); margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.stats { display: inline-flex; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--glass-2); }
.stats div { padding: 12px 20px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.stats dd { margin: 2px 0 0; font-family: var(--serif); font-size: 30px; line-height: 1.1; color: var(--paper); }

.sky { position: relative; height: 480px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(ellipse at 55% 45%, rgba(var(--lime-rgb), .10), transparent 65%); }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.sky canvas.grabbing { cursor: grabbing; }
.sky canvas.pointing { cursor: pointer; }
.sky-ui { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; pointer-events: none; }
.sky-hint { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); transition: opacity .6s; }
.sky.used .sky-hint { opacity: .35; }
.sky-mute { pointer-events: auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass-2); color: var(--muted); cursor: pointer; }
.sky-mute:hover { color: var(--lime); border-color: var(--lime); }
.sky-mute svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sky-mute .off { display: none; }
.sky.muted .sky-mute .on { display: none; }
.sky.muted .sky-mute .off { display: block; }

/* ---------- 精选作品：一次展示一个，自动轮播 ---------- */
.work { padding: 72px 0 8px; }
.feature { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.ftabs { display: flex; flex-direction: column; gap: 6px; }
.ftab {
  position: relative; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 4px 10px;
  text-align: left; padding: 14px 16px 16px; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 10px; color: var(--muted);
  font-family: var(--sans); transition: background .25s, border-color .25s, color .25s;
}
.ftab:hover { background: var(--btn-bg); color: var(--paper); }
.ftab.is-active { background: var(--panel); border-color: var(--line); color: var(--paper); }
.ftab-num { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--dim); }
.ftab.is-active .ftab-num { color: var(--accent); }
.ftab-txt b { display: block; font-family: var(--serif); font-weight: 400; font-size: 18px; line-height: 1.25; }
.ftab-txt small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-top: 3px; }
.ftab-bar { grid-column: 1 / -1; display: block; height: 2px; margin-top: 8px; background: transparent; border-radius: 2px; overflow: hidden; }
.ftab.is-active .ftab-bar { background: var(--line); }
.ftab .fill { display: block; height: 100%; width: 0; background: var(--accent); }

.fstage { position: relative; min-height: 560px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }
.fslide {
  position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s;
}
.fslide.is-active { opacity: 1; visibility: visible; transition: opacity .6s ease, visibility 0s; }
.fslide-art { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 18px;
  background-color: var(--ink-2);
  background-image: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(var(--dots) 1px, transparent 1.4px);
  background-size: auto, 18px 18px; border-bottom: 1px solid var(--line);
}
.fslide-art .art { width: 100%; height: 100%; max-height: 360px; }
.fslide.is-active .art { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { transform: translateY(var(--from, 26px)) scale(.94) rotate(var(--tilt, -1.5deg)); opacity: 0; } to { transform: none; opacity: 1; } }
.fstage.dir-up { --from: -60px; --tilt: 1.5deg; }
.fstage.dir-down { --from: 60px; --tilt: -1.5deg; }
.fstage { outline: none; cursor: ns-resize; }
.fstage:focus-visible { box-shadow: 0 0 0 2px var(--lime); }
.fstage .btn, .fstage a { cursor: pointer; }
.fslide.leaving { opacity: 0; visibility: visible; transition: opacity .45s ease; }
.fslide.leaving .art { animation: leave .45s ease forwards; }
@keyframes leave { to { transform: translateY(calc(var(--from, 26px) * -1)) scale(.96); opacity: 0; } }
.fhint {
  position: absolute; right: 16px; top: 16px; pointer-events: none; z-index: 3; display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper);
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass-2); backdrop-filter: blur(6px);
  transition: opacity .5s;
}
.fhint .mouse { position: relative; width: 12px; height: 18px; border: 1.5px solid currentColor; border-radius: 7px; }
.fhint .mouse i { position: absolute; left: 50%; top: 3px; width: 2px; height: 4px; margin-left: -1px; border-radius: 1px; background: var(--lime); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(6px); opacity: 0; } 100% { opacity: 0; } }
.feature.used .fhint { opacity: .45; }
.fcount { position: absolute; left: 18px; top: 18px; z-index: 3; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.fcount b { color: var(--paper); font-weight: 400; }
.fstage { touch-action: pan-y; }
.fhint .finger { display: none; position: relative; width: 18px; height: 12px; }
.fhint .finger i { position: absolute; top: 3px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); animation: swipe 1.6s ease-in-out infinite; }
@keyframes swipe { 0% { transform: translateX(10px); opacity: 0; } 25% { opacity: 1; } 80% { transform: translateX(-2px); opacity: 1; } 100% { transform: translateX(-2px); opacity: 0; } }
.fhint .h-touch, .sky-hint .h-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .fhint .mouse, .fhint .h-mouse, .sky-hint .h-mouse { display: none; }
  .fhint .finger { display: inline-block; }
  .fhint .h-touch, .sky-hint .h-touch { display: inline; }
}
.fslide-body { padding: 22px 26px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "meta meta" "title actions" "desc actions"; gap: 6px 24px; align-items: end; }
.fslide-body .meta { grid-area: meta; }
.fslide-body h3 { grid-area: title; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.08; margin: 6px 0 0; }
.fslide-body p { grid-area: desc; margin: 0; color: var(--muted); max-width: 560px; }
.fslide-body .actions { grid-area: actions; justify-content: flex-end; }
.fslide.is-active .fslide-body > * { animation: up .6s cubic-bezier(.2, .8, .2, 1) both; }
.fslide.is-active .fslide-body > :nth-child(2) { animation-delay: .06s; }
.fslide.is-active .fslide-body > :nth-child(3) { animation-delay: .12s; }
.fslide.is-active .fslide-body > :nth-child(4) { animation-delay: .18s; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fslide.is-active .art, .fslide.is-active .fslide-body > * { animation: none; } }

/* ---------- 入口卡片 ---------- */
.explore { padding: 64px 0 24px; }
.sec-head { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.sec-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 40px); margin: 0; white-space: nowrap; }
.sec-head h2 em { color: var(--lime); }
.sec-head a.kicker-s { text-decoration: none; }
.sec-head a.kicker-s:hover { color: var(--lime); }
.sec-head .rule { flex: 1; height: 1px; background: var(--line); }
.kicker-s { color: var(--muted); white-space: nowrap; }
.intro { color: var(--muted); max-width: 720px; margin: 0 0 30px; }
.dests { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .dests { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dest {
  position: relative; display: block; text-decoration: none; padding: 22px 22px 26px;
  border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--panel)), var(--panel) 70%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 30px -24px var(--shadow);
  transition: transform .25s, border-color .25s;
}
.dest:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.dest-top { display: flex; align-items: center; gap: 12px; }
.ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--ico-bg); border: 1px solid var(--line); }
.ico svg { width: 19px; height: 19px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dest .num { color: var(--accent); }
.dest .arr { margin-left: auto; color: var(--accent); transition: transform .25s; }
.dest:hover .arr { transform: translate(3px, -3px); }
.dest h3 { font-family: var(--serif); font-weight: 400; font-size: 25px; margin: 22px 0 6px; }
.dest p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- 内页头 ---------- */
.back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--paper);
  padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--btn-bg);
  transition: border-color .2s, color .2s;
}
.back i { font-style: normal; transition: transform .2s; }
.back:hover { border-color: var(--accent); color: var(--accent); }
.back:hover i { transform: translateX(-3px); }
.phead { padding: 56px 0 34px; }
.crumb { color: var(--dim); margin: 0 0 22px; }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--lime); }
.crumb span { margin: 0 6px; }
.phead h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5.4vw, 64px); line-height: 1.06; margin: 12px 0 14px; letter-spacing: -.01em; }
.phead h1 em { color: var(--accent); }
.phead .sub { color: var(--muted); font-size: 18px; margin: 0 0 24px; max-width: 640px; }
.dh-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.dh-art { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--ink-2) 75%); }
.dh-art .art { display: block; width: 100%; height: auto; }

/* ---------- 项目目录卡片 ---------- */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-bottom: 20px; }
.pcard {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.pcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 24px 40px -28px var(--shadow); }
.pcard-art { display: block; aspect-ratio: 16 / 8.2; overflow: hidden; border-bottom: 1px solid var(--line);
  background-color: var(--ink-2);
  background-image: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%),
    linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
}
.pcard-art .art { display: block; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.pcard:hover .pcard-art .art { transform: scale(1.04); }
.pcard-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.pcard-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pcard .date { color: var(--dim); font-size: 10.5px; }
.pcard h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 12px 0 6px; line-height: 1.15; }
.pcard .desc { color: var(--muted); font-size: 15px; margin: 0 0 18px; flex: 1; }

/* ---------- 正文 ---------- */
.prose { max-width: 760px; padding-bottom: 20px; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 48px 0 12px; }
.prose p, .prose li { color: var(--prose); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent); }
.prose b { color: var(--paper); }
.prose a { color: var(--lime); text-decoration-color: rgba(var(--lime-rgb), .45); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--panel-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 4px; color: var(--paper); }

.contact { list-style: none; padding: 0; margin: 12px 0 0; }
.contact li { display: flex; gap: 18px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact li::marker { content: none; }
.contact span { min-width: 70px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.facts div { padding: 16px 20px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.facts dd { margin: 4px 0 0; font-weight: 600; }

.demo { margin: 30px 0 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #000; }
.demo iframe { display: block; width: 100%; height: min(78vh, 720px); border: 0; background: #fff; }
.demo-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--panel-2); color: var(--muted); font-size: 12px; padding: 10px 16px; font-family: var(--mono); letter-spacing: .04em; }
.demo-bar .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 10px; box-shadow: 0 0 10px var(--accent); }
.demo-bar a { color: var(--paper); text-decoration: none; }
.demo-bar a:hover { color: var(--accent); }

.note { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--panel); padding: 14px 18px; color: var(--muted); font-size: 15px; margin: 24px 0; border-radius: 0 8px 8px 0; }

.fig { margin: 18px 0 10px; background: #ece6d3; border-radius: 10px; padding: 18px; color: #1c2230; }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 12px; font-size: 14px; color: #4a5263; line-height: 1.6; }
.muted { color: var(--muted); font-size: 15px; }
.reading { list-style: none; padding: 0; }
.reading li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.reading li a { color: var(--paper); font-weight: 600; text-decoration-color: var(--accent); }
.reading li a:hover { color: var(--accent); }
.reading .src { font-family: var(--mono); font-size: 11px; margin-left: 8px; color: var(--dim); }

/* ---------- 页脚 ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 26px 0 40px; color: var(--dim); font-size: 13px; background: var(--foot-bg); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--lime); }


/* ---------- 浅色主题（可切换）：米白底 + 陶土橙 ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --ink: #faf9f5;
  --ink-2: #f2efe6;
  --panel: #ffffff;
  --panel-2: #f4f1e9;
  --line: #e4ded0;
  --line-soft: rgba(80, 64, 40, .07);
  --paper: #23211e;
  --muted: #5f5b53;
  --dim: #8e887c;
  --lime: #c96442;
  --lime-rgb: 201, 100, 66;
  --glass: rgba(250, 249, 245, .86);
  --glass-2: rgba(255, 255, 255, .78);
  --foot-bg: rgba(242, 239, 230, .7);
  --btn-bg: rgba(60, 45, 20, .03);
  --ico-bg: rgba(255, 255, 255, .8);
  --star: rgba(90, 70, 40, .35);
  --star-dim: rgba(90, 70, 40, .18);
  --dots: rgba(80, 64, 40, .13);
  --prose: #3a3833;
  --on-accent: #ffffff;
  --shadow: rgba(80, 60, 30, .35);
  --shadow-soft: rgba(80, 60, 30, .18);
}
html[data-theme="light"] .tile-art, html[data-theme="light"] .fslide-art, html[data-theme="light"] .pcard-art, html[data-theme="light"] .dh-art { background-color: #f1ede3; }
html[data-theme="light"] .demo-bar .dot { box-shadow: none; }
html[data-theme="light"] { --accent-ink: color-mix(in srgb, var(--accent) 58%, #2b1a0c); }
html[data-theme="light"] :is(h1, h2, h3) em,
html[data-theme="light"] .meta,
html[data-theme="light"] .facts dt,
html[data-theme="light"] .ftab.is-active .ftab-num,
html[data-theme="light"] .dest .num,
html[data-theme="light"] .dest .arr,
html[data-theme="light"] .slide-date { color: color-mix(in srgb, var(--accent) 58%, #2b1a0c); }
html[data-theme="light"] .meta .st { color: var(--muted); }
html[data-theme="light"] .prose li::marker { color: color-mix(in srgb, var(--accent) 58%, #2b1a0c); }
html[data-theme="light"] .ico svg { stroke: color-mix(in srgb, var(--accent) 58%, #2b1a0c); }
html[data-theme="light"] .btn.solid { color: #1f1408; }
html[data-theme="light"] .btn:hover:not(.solid) { color: color-mix(in srgb, var(--accent) 58%, #2b1a0c); }
html[data-theme="light"] .sec-head h2 em, html[data-theme="light"] .hero h1 em { color: var(--lime); }


/* 主题切换按钮 */
.theme-btn { display: inline-grid; place-items: center; width: 34px; height: 30px; color: var(--paper); background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; transition: border-color .2s, color .2s; }
.theme-btn:hover { border-color: var(--lime); color: var(--lime); }
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .sun { display: none; }
html[data-theme="light"] .theme-btn .moon { display: none; }
html[data-theme="light"] .theme-btn .sun { display: block; }
.mast .wrap { gap: 32px; }
.mast-tools { display: flex; align-items: center; gap: 8px; }

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .dh-grid { grid-template-columns: 1fr; }
  .dh-art { order: -1; }
  .pgrid, .dests { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .ftabs { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .ftabs::-webkit-scrollbar { display: none; }
  .ftab { flex: 0 0 auto; grid-template-columns: auto; padding: 10px 12px 12px; }
  .ftab-txt small { display: none; }
  .ftab-txt b { font-size: 15px; white-space: nowrap; }
  .hero-grid { grid-template-columns: 1fr; }
  .sky { height: 360px; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .mast .wrap { gap: 14px; }
  .nav { gap: 16px; }
  .nav a { font-size: 14px; }
  .brand { font-size: 20px; }
  .brand-mark { width: 24px; height: 24px; }
  .sec-head .rule, .kicker-s { display: none; }
  .facts div { border-right: 0; border-bottom: 1px solid var(--line); }
  .fstage { min-height: 600px; }
  .fslide-body { grid-template-columns: 1fr; grid-template-areas: "meta" "title" "desc" "actions"; }
  .fslide-body .actions { justify-content: flex-start; margin-top: 8px; }
  .ftab-num { display: none; }
  .hero { padding-top: 40px; }
  .sky { height: 320px; }
  .stats div { padding: 10px 14px; }
}

/* ---------- 全自动扒谱：训练过程 ---------- */
.prose .tl-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin: 26px 0 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.tl-stat { background: var(--glass-2); padding: 16px 10px 14px; text-align: center; }
.tl-stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--accent-ink, var(--accent)); }
.tl-stat span { display: block; margin-top: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.prose .tl-loop { list-style: none; padding: 0; margin: 0 0 34px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: none; }
.prose .tl-loop li { position: relative; margin: 0; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); }
.prose .tl-loop li:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 13px; z-index: 1; }
.tl-loop .lp-n { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--accent); }
.tl-loop b { display: block; margin: 4px 0 2px; font-weight: 500; font-size: 14.5px; }
.tl-loop small { color: var(--dim); font-size: 12.5px; }

.tl-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 12px; }
.tl-chart { margin: 0; padding: 16px 16px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.tl-chart .cap-t { display: block; font-weight: 500; font-size: 14px; color: var(--paper); }
.tl-chart .cap-s { display: block; font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.ch-y { fill: var(--dim); font: 10px var(--mono); text-anchor: end; }
.ch-x { fill: var(--muted); font: 11px var(--mono); text-anchor: middle; }
.ch-x.small { font-size: 10px; fill: var(--dim); }
.ch-x.left { text-anchor: start; }
.ch-v { fill: var(--paper); font: 12px var(--mono); text-anchor: middle; }
.ch-note { fill: var(--dim); font: 10.5px var(--sans, inherit); }
.ch-note.ok { fill: var(--accent-ink, var(--accent)); }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 55%, transparent)); }
.ch-dot { fill: var(--ink); stroke: var(--accent); stroke-width: 2.4; opacity: 0; }
.ch-dot.bad { stroke: #ef8a6f; }
.ch-bar { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); }
.ch-bar.before { fill: color-mix(in srgb, var(--dim) 55%, transparent); }
.ch-bar.after { fill: var(--accent); }
.ch-track { fill: color-mix(in srgb, var(--line) 70%, transparent); }
.ch-fill { transform-box: fill-box; transform-origin: left; transform: scaleX(0); }
.ch-fill.before { fill: color-mix(in srgb, var(--dim) 70%, transparent); }
.ch-fill.after { fill: var(--accent); }
.ch-in { fill: var(--ink); font: 600 11px var(--mono); text-anchor: end; }
.ch-v, .ch-note, .ch-in { opacity: 0; }
.tl-chart.in .ch-line { transition: stroke-dashoffset 1.4s cubic-bezier(.6,.1,.2,1); stroke-dashoffset: 0; }
.tl-chart.in .ch-dot, .tl-chart.in .ch-v, .tl-chart.in .ch-note, .tl-chart.in .ch-in { opacity: 1; transition: opacity .5s 1s; }
.tl-chart.in .ch-bar { transform: scaleY(1); transition: transform .9s cubic-bezier(.3,1.3,.5,1); }
.tl-chart.in .ch-bar.after { transition-delay: .25s; }
.tl-chart.in .ch-fill { transform: scaleX(1); transition: transform 1.1s cubic-bezier(.3,1,.4,1); }
.tl-chart.in .ch-fill.after { transition-delay: .3s; }

.prose h3.tl-sub { font-family: var(--serif); font-weight: 400; font-size: 21px; margin: 40px 0 16px; }
.tl-sub small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-left: 8px; }
.prose ol.tl { list-style: none; padding: 0 0 0 30px; margin: 0; position: relative; }
.prose ol.tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 25%, transparent) 85%, transparent); }
.prose .tl-item { position: relative; margin: 0 0 16px; padding: 14px 18px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s, border-color .25s; }
.prose .tl-item.in { opacity: 1; transform: none; }
.prose .tl-item:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.tl-dot { position: absolute; left: -29px; top: 19px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--ink), 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.tl-item.now .tl-dot { background: var(--accent); animation: tlpulse 2s infinite; }
.tl-item.now { border-style: dashed; }
@keyframes tlpulse { 50% { box-shadow: 0 0 0 4px var(--ink), 0 0 0 9px color-mix(in srgb, var(--accent) 25%, transparent); } }
.tl-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tl-ver { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent-ink, var(--accent)); }
.tl-date { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--dim); }
.tl-review { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 2px 9px; border-radius: 999px; color: var(--accent-ink, var(--accent)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.tl-review.warn { color: #ef8a6f; border-color: rgba(239, 138, 111, .45); }
.prose .tl-item h3 { margin: 6px 0 4px; font-size: 17px; font-weight: 500; }
.prose .tl-item p { margin: 0 0 10px; font-size: 14.5px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chip { font-family: var(--mono); font-size: 11.5px; padding: 3px 9px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--paper); }
.tl-chip.warn { background: rgba(239, 138, 111, .14); color: #ef8a6f; }

.cmp-fig { margin: 0 0 22px; }
.cmp-fig figcaption { margin-bottom: 10px; }
.cmp-fig .cap-t { display: block; font-weight: 500; font-size: 15px; color: var(--paper); }
.cmp-fig .cap-s { display: block;  font-size: 13.5px; color: var(--dim); }
.cmp { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; user-select: none; touch-action: pan-y; }
.cmp img { display: block; width: 100%; height: auto; pointer-events: none; }
.cmp .cmp-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent); pointer-events: none; }
.cmp-handle i { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 15px; background: var(--accent); color: var(--ink); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.cmp-tag { position: absolute; top: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; background: rgba(16, 19, 28, .78); color: #efebe1; pointer-events: none; }
.cmp-tag.l { left: 10px; }
.cmp-tag.r { right: 10px; background: var(--accent); color: #10131c; }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.cmp-range:focus-visible + * , .cmp:focus-within .cmp-handle i { outline: 2px solid var(--paper); outline-offset: 2px; }

@media (max-width: 700px) {
  .prose .tl-stats { grid-template-columns: repeat(3, 1fr); }
  .prose .tl-stats .tl-stat:nth-child(4) { grid-column: span 1; }
  .prose .tl-stats .tl-stat:nth-child(5) { grid-column: span 2; }
  .prose .tl-loop { grid-template-columns: 1fr 1fr; }
  .prose .tl-loop li:nth-child(2)::after { display: none; }
  .tl-charts { grid-template-columns: 1fr; }
  .tl-review { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .prose .tl-item, .ch-line, .ch-dot, .ch-bar, .ch-fill, .ch-v, .ch-note, .ch-in { transition: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; }
}
html[data-theme="light"] .tl-charts { --ch: color-mix(in srgb, var(--accent) 50%, #14435e); }
html[data-theme="light"] .ch-line { stroke: var(--ch); filter: none; }
html[data-theme="light"] .ch-dot { fill: #fff; stroke: var(--ch); }
html[data-theme="light"] .ch-bar.after, html[data-theme="light"] .ch-fill.after { fill: var(--ch); }
html[data-theme="light"] .ch-in { fill: #fff; }
html[data-theme="light"] .ch-fill.before + .ch-in { fill: #fff; }
html[data-theme="light"] .tl-loop .lp-n, html[data-theme="light"] .tl-loop li::after { color: var(--accent-ink); }
html[data-theme="light"] .tl-chip { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------- 详情页：正文居中，目录悬浮在左侧留白 ---------- */
.dlayout { position: relative; max-width: 860px; margin: 0 auto; }
.dlayout .prose { max-width: none; min-width: 0; }
.dlayout .prose > :is(p, ul, h2, h3, .note), .dlayout .prose > ol:not(.tl):not(.tl-loop) { max-width: 760px; margin-left: auto; margin-right: auto; }
.prose h2, .prose h3 { scroll-margin-top: 96px; }
.toc { position: absolute; top: 0; bottom: 0; right: calc(100% + 40px); width: 168px; }
.toc-in { position: sticky; top: 92px; padding-top: 52px; max-height: calc(100vh - 110px); overflow: auto; }
.toc-h { margin: 0 0 12px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.35; color: var(--muted); text-decoration: none; transition: color .2s, border-color .2s; }
.toc li.sub a { padding-left: 26px; font-size: 12.5px; color: var(--dim); }
.toc a:hover { color: var(--paper); }
.toc a.on { color: var(--accent-ink, var(--accent)); border-left-color: var(--accent); }
.dlayout.notoc .toc { display: none; }
@media (max-width: 1290px) { .toc { display: none; } }

.credit { margin-top: 28px; font-size: 12.5px; color: var(--dim); }

/* writing (articles) */
.prose > h3:not([class]) { font-family: var(--serif); font-weight: 400; font-size: 21px; margin: 32px 0 10px; scroll-margin-top: 96px; }
.prose blockquote { max-width: 760px; margin: 18px auto; box-sizing: border-box; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 10px 10px 0; }
.prose blockquote p { margin: 0; }
.prose ol.refs li { font-size: 14px; overflow-wrap: anywhere; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 22px 0; border-bottom: 1px solid var(--line); margin: 0; }
.post-list h2 { margin: 4px 0 8px; font-size: 24px; }
.post-list h2 a { color: var(--paper); text-decoration: none; }
.post-list h2 a:hover { color: var(--lime); }
.post-date { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--dim); }

/* nav with four items: keep labels on one line on small screens */
.nav a { white-space: nowrap; }
@media (max-width: 480px) { .nav a:first-child { display: none; } .nav { gap: 9px; } .nav a { font-size: 13px; } .brand { font-size: 18px; gap: 7px; } .brand-mark { width: 24px; height: 24px; } .mast-tools { gap: 5px; } }
