/* ============ Tokens ============ */
:root {
  --bg: #fafaf8;
  --surface: rgba(255, 255, 255, .68);
  --surface-solid: #ffffff;
  --ink: #15151a;
  --ink-2: #4a4a56;
  --muted: #8b8b98;
  --line: rgba(20, 20, 35, .09);
  --line-2: rgba(20, 20, 35, .18);
  --a1: #5b6cff;
  --a2: #ff5fa2;
  --a3: #18c8d8;
  --a4: #ffb84d;
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 55%, var(--a4));
  --shadow: 0 1px 2px rgba(20, 20, 35, .04), 0 12px 32px -14px rgba(20, 20, 35, .16);
  --shadow-lg: 0 2px 4px rgba(20, 20, 35, .05), 0 30px 60px -20px rgba(20, 20, 35, .28);
  --blob-o: .34;
  --grain: .16;
  --r: 24px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", SimSun, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0a0f;
  --surface: rgba(24, 24, 34, .62);
  --surface-solid: #14141d;
  --ink: #f2f2f7;
  --ink-2: #b4b4c2;
  --muted: #7d7d8e;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .18);
  --a1: #7c89ff;
  --a2: #ff7ab6;
  --a3: #35d6e4;
  --a4: #ffc46b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 30px 60px -20px rgba(0, 0, 0, .7);
  --blob-o: .3;
  --grain: .35;
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: color-mix(in srgb, var(--a1) 32%, transparent); }
:focus-visible { outline: 2px solid var(--a1); outline-offset: 3px; border-radius: 8px; }
.mono { font-family: var(--mono); }
.skip { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; transition: top .2s; }
.skip:focus { top: 16px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }

.wrap { width: min(1040px, 100% - 48px); margin-inline: auto; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============ Background ============ */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; width: 40vmax; height: 40vmax; border-radius: 50%; filter: blur(90px); opacity: var(--blob-o); animation: float 26s ease-in-out infinite alternate; transition: opacity .5s; }
.bg i:nth-child(1) { background: var(--a1); left: -12vmax; top: -16vmax; }
.bg i:nth-child(2) { background: var(--a2); right: -14vmax; top: 6vmax; animation-duration: 32s; animation-delay: -8s; }
.bg i:nth-child(3) { background: var(--a3); left: 24vmax; bottom: -30vmax; animation-duration: 38s; animation-delay: -16s; }
.bg b { position: absolute; inset: 0; opacity: var(--grain); mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes float { to { transform: translate3d(6vmax, 5vmax, 0) scale(1.12); } }

.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 120; background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; opacity: 0; transition: opacity .3s; }
.progress.on { opacity: 1; }

/* ============ Nav ============ */
.nav-wrap { position: fixed; z-index: 100; top: 16px; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  backdrop-filter: blur(20px) saturate(1.7);
}
.brand { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; transition: transform .4s var(--ease); }
.brand:hover { transform: rotate(-12deg) scale(1.06); }
.nav-links { position: relative; display: flex; }
.nav-links a { position: relative; z-index: 1; padding: 7px 16px; font-size: 14px; font-weight: 500; color: var(--ink-2); border-radius: 999px; transition: color .25s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.ind { position: absolute; z-index: 0; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); transition: transform .45s var(--ease), width .45s var(--ease), opacity .3s; }
.sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 4px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); transition: background .2s, color .2s, transform .3s var(--ease); }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.icon-btn:active { transform: scale(.9); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ============ Layout ============ */
main { min-height: 100vh; padding-top: 96px; outline: none; }
main.enter > * { animation: rise .7s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: .08s; }
main.enter > *:nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.section { padding: 56px 0 8px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(26px, 4vw, 36px); line-height: 1.25; letter-spacing: -.01em; margin-bottom: 8px; }
.sub { color: var(--ink-2); max-width: 60ch; }

/* ============ Hero ============ */
.hero { padding: clamp(40px, 9vh, 96px) 0 24px; }
.badge { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2ecf75; position: relative; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 2s ease-out infinite; }
@keyframes ping { to { transform: scale(3.2); opacity: 0; } }
.display { font-family: var(--serif); font-weight: 900; font-size: clamp(44px, 9vw, 92px); line-height: 1.06; letter-spacing: -.03em; margin: 22px 0 18px; }
.role { font-size: clamp(18px, 2.4vw, 24px); color: var(--ink-2); font-weight: 500; min-height: 1.6em; }
.role b { font-weight: 600; color: var(--ink); }
.caret { display: inline-block; width: 2px; height: 1.05em; background: var(--a1); vertical-align: -.16em; margin-left: 3px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { margin-top: 18px; max-width: 54ch; color: var(--ink-2); font-size: 17px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 500; font-size: 15px; border: 1px solid var(--line-2); background: var(--surface); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s, background .3s; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.primary:hover { box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--a1) 70%, transparent); }
.social { display: flex; gap: 8px; margin-top: 28px; }
.social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); transition: all .3s var(--ease); }
.social a:hover { color: #fff; background: var(--ink); border-color: transparent; transform: translateY(-3px) rotate(-6deg); }
.scroll-hint { display: none; }

/* ============ Cards / Bento ============ */
.card {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  transition: transform .5s var(--ease), border-color .3s, box-shadow .4s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--a1) 20%, transparent), transparent 60%);
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: var(--line-2); }
.card h3 { font-size: 13px; font-family: var(--mono); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }

.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 36px; }
.c-about { grid-column: span 7; }
.c-clock { grid-column: span 5; }
.c-stack, .c-now, .c-stats { grid-column: span 4; }
.c-heat { grid-column: span 12; }

.avatar { width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: conic-gradient(from 0deg, var(--a1), var(--a2), var(--a4), var(--a3), var(--a1)); animation: spin 12s linear infinite; }
.avatar span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--surface-solid); font-family: var(--serif); font-weight: 900; font-size: 26px; animation: spin 12s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.about-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.about-head strong { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.about-head small { color: var(--muted); font-size: 13px; }
.c-about p + p { margin-top: 10px; }
.c-about p { color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { font-size: 12.5px; padding: 4px 11px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2); border: 1px solid var(--line); }

.clock { font-family: var(--mono); font-size: clamp(34px, 5vw, 48px); font-weight: 500; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.clock i { font-style: normal; opacity: .4; animation: blink 1s steps(2) infinite; }
.clock-meta { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.sky { width: 100%; height: 76px; margin-top: 14px; display: block; overflow: visible; }
.sky .arc { stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 3 5; fill: none; }
.sky .horizon { stroke: var(--line-2); stroke-width: 1; }
.sky .orb { transition: transform 1s var(--ease); }

.marquee { overflow: hidden; margin: 0 -28px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.marquee + .marquee { margin-top: 10px; }
.track { display: flex; gap: 10px; width: max-content; animation: slide 38s linear infinite; }
.marquee.rev .track { animation-direction: reverse; animation-duration: 46s; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.tag { white-space: nowrap; padding: 7px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500; background: var(--surface-solid); border: 1px solid var(--line); }

.now li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.now li:first-child { border-top: 0; padding-top: 0; }
.now li span:first-child { flex: none; width: 34px; color: var(--muted); font-family: var(--mono); font-size: 12px; padding-top: 2px; }
.now li span:last-child { color: var(--ink); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; }
.stat b { display: block; font-family: var(--serif); font-size: 38px; line-height: 1; font-weight: 900; letter-spacing: -.02em; }
.stat b em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 13px; color: var(--muted); }

.heat-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.heat-head h3 { margin: 0; }
.heat-head small { color: var(--muted); font-size: 12.5px; }
.gh { display: grid; grid-template-columns: 28px auto; grid-template-rows: 16px auto; column-gap: 4px; row-gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.gh-corner { grid-column: 1; grid-row: 1; }
.gh-months { grid-column: 2; grid-row: 1; position: relative; display: grid; grid-template-columns: repeat(53, 14px); }
.gh-months span { grid-row: 1; white-space: nowrap; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.gh-days { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(7, 14px); align-items: center; }
.gh-days span { font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1; }
.heat { grid-column: 2; grid-row: 2; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); grid-auto-columns: 11px; gap: 3px; }
.heat i { width: 11px; height: 11px; border-radius: 3px; background: var(--line); transition: transform .15s; }
.heat i:hover { transform: scale(1.5); }
.heat i.none { visibility: hidden; }
.heat i.l1, .legend i.l1 { background: #9be9a8; }
.heat i.l2, .legend i.l2 { background: #40c463; }
.heat i.l3, .legend i.l3 { background: #30a14e; }
.heat i.l4, .legend i.l4 { background: #216e39; }
:root[data-theme="dark"] .heat i.l1, :root[data-theme="dark"] .legend i.l1 { background: #0e4429; }
:root[data-theme="dark"] .heat i.l2, :root[data-theme="dark"] .legend i.l2 { background: #006d32; }
:root[data-theme="dark"] .heat i.l3, :root[data-theme="dark"] .legend i.l3 { background: #26a641; }
:root[data-theme="dark"] .heat i.l4, :root[data-theme="dark"] .legend i.l4 { background: #39d353; }
.legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); justify-content: flex-end; }
.legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--line); }

/* ============ Timeline ============ */
.timeline { position: relative; margin-top: 28px; }
.timeline::before { content: ""; position: absolute; left: 175px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--line-2), var(--line-2) 80%, transparent); }
.tl { display: grid; grid-template-columns: 150px 1fr; gap: 50px; padding: 14px 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 171px; top: 24px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--a1); transition: transform .3s var(--ease), background .3s; }
.tl:hover::before { transform: scale(1.5); background: var(--a1); }
.tl time { color: var(--muted); font-family: var(--mono); font-size: 13px; padding-top: 3px; text-align: right; }
.tl strong { display: block; font-weight: 600; font-size: 16.5px; }
.tl span { color: var(--muted); font-size: 14px; }

/* ============ Projects ============ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.proj { display: flex; flex-direction: column; min-height: 220px; transform-style: preserve-3d; will-change: transform; }
.proj .thumb { height: 74px; border-radius: 16px; margin-bottom: 18px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 90% 62%), hsl(calc(var(--h) + 50) 90% 68%)); }
.proj .thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 0%, rgba(255,255,255,.55), transparent 55%), repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px); }
.proj h4 { margin: 0; font-family: var(--serif); font-size: 20px; }
.proj p { color: var(--ink-2); font-size: 14.5px; margin: 6px 0 16px; flex: 1; }
.proj .pfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proj .arrow { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); transition: all .3s var(--ease); }
.proj:hover .arrow { background: var(--ink); color: var(--bg); transform: rotate(45deg); }
.proj .chips { margin: 0; }

/* ============ Post list ============ */
.plist li + li { border-top: 1px solid var(--line); }
.prow { display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: baseline; padding: 20px 8px; margin: 0 -8px; border-radius: 16px; transition: background .3s, padding .4s var(--ease); }
.prow:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); padding-left: 18px; padding-right: 18px; }
.prow time { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.prow strong { display: block; font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.4; }
.prow p { color: var(--ink-2); font-size: 14.5px; margin-top: 2px; }
.prow .meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.year { font-family: var(--serif); font-weight: 900; font-size: 34px; color: color-mix(in srgb, var(--ink) 14%, transparent); margin: 36px 0 4px; letter-spacing: -.02em; }
.more { display: inline-flex; margin-top: 20px; color: var(--ink-2); font-weight: 500; gap: 6px; align-items: center; }
.more:hover { color: var(--a1); }

/* ============ Page header / filters ============ */
.page-head { padding: 36px 0 12px; }
.page-head h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(36px, 6vw, 60px); letter-spacing: -.03em; line-height: 1.1; }
.page-head p { color: var(--ink-2); margin-top: 12px; max-width: 56ch; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 28px 0 8px; }
.search { flex: 1 1 240px; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: border-color .3s, box-shadow .3s; }
.search:focus-within { border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 16%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; height: 100%; }
.search svg { color: var(--muted); flex: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.fbtn { padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; color: var(--ink-2); transition: all .25s var(--ease); }
.fbtn:hover { border-color: var(--line-2); color: var(--ink); }
.fbtn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.empty { text-align: center; color: var(--muted); padding: 64px 0; }

/* ============ Friends ============ */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 20px; }
.friend { display: flex; gap: 16px; align-items: center; padding: 20px; border-radius: 20px; }
.friend:hover { transform: translateY(-4px); }
.fav { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 19px; background: linear-gradient(135deg, hsl(var(--h) 80% 58%), hsl(calc(var(--h) + 40) 85% 66%)); box-shadow: 0 8px 20px -8px hsl(var(--h) 80% 50%); }
.friend b { display: block; font-weight: 600; line-height: 1.3; }
.friend small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; margin-top: 2px; }
.friend .host { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 6px; display: block; }
.blank { min-height: 34vh; display: grid; place-content: center; text-align: center; gap: 10px; margin-top: 20px; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 48px 24px; }
.blank-mark { font-family: var(--serif); font-weight: 900; font-size: clamp(44px, 9vw, 84px); letter-spacing: .3em; padding-left: .3em; color: color-mix(in srgb, var(--ink) 10%, transparent); }
.blank p { color: var(--muted); font-size: 14.5px; }
.exchange { margin-top: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.exchange pre { margin: 14px 0 0; padding: 16px; background: color-mix(in srgb, var(--ink) 5%, transparent); border-radius: 14px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.exchange p { color: var(--ink-2); font-size: 14.5px; }
.exchange .btn { margin-top: 14px; }

/* ============ Guestbook ============ */
.gb { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin-top: 28px; align-items: start; }
.form label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.field { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-solid); outline: none; transition: border-color .25s, box-shadow .25s; resize: vertical; }
.field:focus { border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 16%, transparent); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.form .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.form small { color: var(--muted); font-size: 12.5px; }
.hp { position: absolute; left: -9999px; }
.notes p { color: var(--ink-2); font-size: 14.5px; }
.notes p + p { margin-top: 8px; }
.msg { padding: 16px 0; border-top: 1px solid var(--line); }
.msg:first-child { border-top: 0; padding-top: 0; }
.msg header { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.msg header b { color: var(--ink); font-weight: 600; font-size: 14px; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.linkbtn { background: none; border: 0; color: var(--muted); font-size: 12.5px; padding: 0; }
.linkbtn:hover { color: var(--a2); }

/* ============ Post ============ */
.post-layout { display: grid; grid-template-columns: minmax(0, 720px) 220px; gap: 64px; justify-content: center; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; margin: 28px 0 8px; transition: color .2s, transform .3s var(--ease); }
.back:hover { color: var(--ink); transform: translateX(-4px); }
.post-head h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(32px, 5.4vw, 50px); line-height: 1.2; letter-spacing: -.025em; margin: 6px 0 16px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 14px; align-items: center; }
.post-meta .chips { margin: 0; }
.prose { margin-top: 36px; font-size: 17.5px; line-height: 1.95; color: var(--ink-2); }
.prose > * + * { margin-top: 1.25em; }
.prose h2, .prose h3 { font-family: var(--serif); color: var(--ink); line-height: 1.35; scroll-margin-top: 100px; }
.prose h2 { font-size: 27px; margin-top: 2.2em; font-weight: 700; }
.prose h3 { font-size: 21px; margin-top: 1.8em; font-weight: 700; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--a1); border-bottom: 1px solid color-mix(in srgb, var(--a1) 40%, transparent); }
.prose a:hover { border-color: var(--a1); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: none; }
.prose ul li { position: relative; }
.prose ul li::before { content: ""; position: absolute; left: -1.05em; top: .95em; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--a1); font-family: var(--mono); font-size: .9em; }
.prose code { font-family: var(--mono); font-size: .86em; padding: .15em .45em; border-radius: 7px; background: color-mix(in srgb, var(--a1) 12%, transparent); color: var(--ink); }
.prose blockquote { padding: 6px 0 6px 22px; border-left: 3px solid transparent; border-image: linear-gradient(var(--a1), var(--a2)) 1; font-family: var(--serif); font-size: 1.06em; color: var(--ink); }
.prose hr { border: 0; height: 1px; background: var(--line-2); margin: 2.4em 0; }
.code { border-radius: 16px; overflow: hidden; background: #0f0f16; color: #e8e8f2; border: 1px solid var(--line); box-shadow: var(--shadow); }
.code figcaption { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: rgba(255, 255, 255, .05); font-family: var(--mono); font-size: 12px; color: #9a9aae; }
.code figcaption button { background: none; border: 1px solid rgba(255, 255, 255, .16); color: #c8c8da; padding: 2px 10px; border-radius: 8px; font-size: 12px; transition: all .2s; }
.code figcaption button:hover { background: rgba(255, 255, 255, .12); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.75; }
.code pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.toc { position: sticky; top: 100px; align-self: start; margin-top: 36px; font-size: 13.5px; border-left: 1px solid var(--line); padding-left: 16px; }
.toc h3 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.toc a { display: block; padding: 4px 0; color: var(--muted); line-height: 1.5; transition: color .2s, transform .25s var(--ease); cursor: pointer; }
.toc a.l3 { padding-left: 12px; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--a1); transform: translateX(4px); font-weight: 500; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 64px; }
.pn a { padding: 20px 22px; }
.pn small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; font-family: var(--mono); }
.pn b { font-family: var(--serif); line-height: 1.4; }
.pn a:last-child { text-align: right; }

/* ============ Footer ============ */
.foot { margin-top: 96px; padding: 32px 0 calc(48px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13.5px; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot a:hover, .foot button:hover { color: var(--ink); }
.foot button { background: none; border: 0; padding: 0; color: inherit; }
.foot a.ext { border-bottom: 1px dashed var(--line-2); }

/* ============ Palette & Toast ============ */
.palette[hidden] { display: none; }
.palette { position: fixed; inset: 0; z-index: 300; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; }
.palette-mask { position: absolute; inset: 0; background: rgba(8, 8, 14, .42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s both; }
.palette-box { position: relative; width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .28s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; border: 0; background: transparent; outline: none; font-size: 17px; color: var(--ink); height: 100%; }
kbd { font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--ink-2); background: color-mix(in srgb, var(--ink) 4%, transparent); }
#paletteList { overflow-y: auto; padding: 8px; }
.pgroup { padding: 10px 12px 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--ink-2); }
.pitem svg { flex: none; opacity: .7; }
.pitem span.t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem small { color: var(--muted); font-size: 12px; }
.pitem[aria-selected="true"] { background: color-mix(in srgb, var(--a1) 14%, transparent); color: var(--ink); }
.pnone { padding: 32px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.palette-foot kbd { margin-right: 4px; }
.toast { position: fixed; z-index: 400; left: 50%; bottom: 84px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 20px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow-lg); transition: all .35s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Molecule showcase ============ */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 48px; align-items: center; }
.mol { padding: 22px 22px 18px; }
.mol h3 { margin-bottom: 6px; }
.mol-svg { display: block; width: 100%; height: 250px; color: var(--ink); overflow: visible; animation: sway 9s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.bond { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .7s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.atom { font-family: Arial, "Helvetica Neue", sans-serif; font-size: 19px; font-weight: 600; fill: currentColor; opacity: 0; animation: fadein .5s .55s forwards; }
.atom.el-O { fill: #e5484d; }
.atom.el-N { fill: var(--a1); }
.atom.el-K { fill: #b25de6; font-size: 21px; }
.lp-dot { fill: var(--a1); opacity: 0; animation: fadein .5s .75s forwards; }
.bond.dash { stroke: #b25de6; stroke-width: 1.4; stroke-dasharray: .03 .05; stroke-dashoffset: 0; opacity: 0; animation: fadein .7s 1.1s forwards; }
@keyframes fadein { to { opacity: 1; } }
.mol-info { margin-top: 4px; }
.mol-title { display: flex; align-items: baseline; gap: 10px; }
.mol-title b { font-family: var(--serif); font-size: 21px; }
.mol-title span { color: var(--muted); font-size: 13px; }
.mol-meta { display: flex; gap: 14px; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.mol-meta sub { font-size: .72em; }
.mol-info p { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); min-height: 3.1em; line-height: 1.6; }
.mol-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.mol-tabs button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; color: var(--ink-2); transition: all .25s var(--ease); }
.mol-tabs button:hover { border-color: var(--line-2); color: var(--ink); }
.mol-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }

/* ============ Tools ============ */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; align-items: start; }
.tool.wide { grid-column: 1 / -1; }
.lbl { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.tool .field { padding: 10px 14px; }
select.field { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.ex { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.ex .fbtn { font-family: var(--mono); font-size: 12px; padding: 4px 11px; }
.mw-out { margin-top: 14px; }
.big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big span { font-size: 18px; color: var(--ink-2); }
.big sub { font-size: .7em; }
.big b { font-family: var(--serif); font-size: 42px; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big em { font-style: normal; color: var(--muted); font-size: 14px; }
.comp { margin-top: 12px; }
.comp li { display: grid; grid-template-columns: 34px 1fr 120px; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); padding: 3px 0; }
.comp i { height: 6px; border-radius: 6px; background: var(--line); position: relative; overflow: hidden; }
.comp i::after { content: ""; position: absolute; inset: 0; width: var(--w); background: var(--grad); border-radius: 6px; transition: width .5s var(--ease); }
.comp li span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.err { color: var(--a2); font-size: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1.1fr 1.4fr; gap: 10px; margin-bottom: 12px; }
.row3.top { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.out { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 5%, transparent); font-family: var(--mono); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; min-height: 3em; user-select: all; }
.out.dim { color: var(--muted); user-select: none; }
.tool .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.tool .actions small { color: var(--muted); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 10px; white-space: nowrap; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.tbl td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl td.o { font-family: var(--mono); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; padding: 6px 10px; }
.cell { width: 100%; min-width: 72px; padding: 7px 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; outline: none; transition: border-color .2s, background .2s; }
.cell:hover { border-color: var(--line); }
.cell:focus { border-color: var(--a1); background: var(--surface-solid); }
.cell.num { min-width: 64px; }
.cell:disabled { opacity: .55; }
.mwh { display: block; padding: 0 9px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); min-height: 1em; }
.yield { font-size: 14px; color: var(--ink-2); }
.yield b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.yield .pct { font-family: var(--serif); font-size: 22px; font-weight: 900; }
.hint { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ============ Auth ============ */
body.no-scroll { overflow: hidden; }
.nav { position: relative; }
.auth-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; margin-left: 2px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; transition: transform .3s var(--ease), box-shadow .3s; }
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--a1) 70%, transparent); }
.auth-btn.in { background: transparent; color: var(--ink); padding: 0 12px 0 3px; border: 1px solid var(--line); }
.auth-btn.in:hover { box-shadow: none; border-color: var(--line-2); }
.auth-btn.in .auth-label { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, hsl(var(--h) 80% 58%), hsl(calc(var(--h) + 40) 85% 66%)); }
.av.lg { width: 72px; height: 72px; font-size: 30px; font-family: var(--serif); box-shadow: 0 12px 28px -10px hsl(var(--h) 80% 50%); }
.user-menu { position: absolute; z-index: 5; top: calc(100% + 10px); right: 0; min-width: 236px; padding: 8px; background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .22s var(--ease) both; }
.user-menu[hidden] { display: none; }
.um-head { display: flex; gap: 10px; align-items: center; padding: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.um-head b { display: block; line-height: 1.3; }
.um-head small { display: block; color: var(--muted); font-size: 12px; word-break: break-all; }
.user-menu a, .user-menu button[role="menuitem"] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-size: 14px; text-align: left; }
.user-menu a:hover, .user-menu button[role="menuitem"]:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.user-menu em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 12px; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; }
.modal-mask { position: absolute; inset: 0; background: rgba(8, 8, 14, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .2s both; }
.modal-box { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 34px 30px 26px; background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 26px; box-shadow: var(--shadow-lg); animation: pop .3s var(--ease) both; }
.modal-x { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.modal-x:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.modal h2 { font-family: var(--serif); font-weight: 900; font-size: 26px; letter-spacing: -.01em; margin-bottom: 6px; padding-right: 30px; }
.modal .sub { color: var(--ink-2); font-size: 14.5px; margin-bottom: 20px; }
.modal .linkbtn { color: var(--a1); font-size: inherit; }
.modal .linkbtn:hover { text-decoration: underline; }

.fld { margin-bottom: 14px; }
.fld > label, .fld > .lbl { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.inp { position: relative; }
.inp .field { padding-right: 46px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); display: grid; place-items: center; }
.eye:hover { color: var(--ink); }
.field[aria-invalid="true"] { border-color: #e5484d; box-shadow: 0 0 0 4px color-mix(in srgb, #e5484d 14%, transparent); }
.ferr { display: block; margin-top: 5px; color: #e5484d; font-size: 12.5px; }
.ferr:empty { display: none; }
.form-msg { margin: 0 0 10px; color: #e5484d; font-size: 13.5px; }
.form-msg:empty { display: none; }
.btn.block { width: 100%; justify-content: center; margin-top: 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.row-between .check { margin-bottom: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--a1); }
.switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.terms { margin: 0 0 12px; padding: 12px 14px 12px 30px; list-style: disc; border-radius: 12px; background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink-2); font-size: 12.5px; }
.terms[hidden] { display: none; }
.terms li + li { margin-top: 4px; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 5px; align-items: center; margin-top: 8px; }
.meter i { height: 4px; border-radius: 4px; background: var(--line-2); transition: background .3s; }
.meter span { min-width: 6em; margin-left: 6px; font-size: 12px; color: var(--muted); }
.meter[data-s="0"] i:nth-child(-n+1) { background: #e5484d; }
.meter[data-s="1"] i:nth-child(-n+2) { background: #f0883e; }
.meter[data-s="2"] i:nth-child(-n+3) { background: #e5b53a; }
.meter[data-s="3"] i:nth-child(-n+4) { background: #7cc15a; }
.meter[data-s="4"] i:nth-child(-n+4) { background: #2ecf75; }
.rec-code { padding: 18px 12px; margin-bottom: 14px; border-radius: 16px; border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--a1) 9%, transparent); font-size: 20px; letter-spacing: .08em; text-align: center; word-break: break-all; user-select: all; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

.acc-head { display: flex; align-items: center; gap: 20px; }
.acc-head h1 { font-size: clamp(28px, 5vw, 44px); }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; align-items: start; }
.acc-grid .field { padding: 10px 14px; }
.acc-grid .field:disabled { opacity: .6; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { position: relative; cursor: pointer; }
.sw input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sw span { display: block; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, hsl(var(--h) 80% 58%), hsl(calc(var(--h) + 40) 85% 66%)); box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px transparent; transition: box-shadow .2s, transform .2s; }
.sw:hover span { transform: scale(1.08); }
.sw input:checked + span { box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--ink); }
.sw input:focus-visible + span { outline: 2px solid var(--a1); outline-offset: 5px; }
.muted { color: var(--muted); font-size: 13.5px; }
.marks li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.marks li:first-child { border-top: 0; padding-top: 0; }
.marks a { flex: 1; min-width: 0; }
.marks b { display: block; font-family: var(--serif); line-height: 1.4; }
.marks small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.hr { height: 1px; margin: 22px 0; border: 0; background: var(--line); }
.danger h4 { margin: 0 0 4px; color: #e5484d; font-size: 15px; }
.danger .muted { margin-bottom: 12px; }
.danger-btn { color: #e5484d; border-color: color-mix(in srgb, #e5484d 40%, transparent); }
.danger-btn:hover { background: #e5484d; color: #fff; border-color: transparent; }
.gate { padding: 48px 24px; text-align: center; margin-top: 20px; }
.gate p { color: var(--ink-2); }
.gate .cta { justify-content: center; }
.gate-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2); }
.gate-ico svg { width: 28px; height: 28px; }
[data-bookmark].on { background: var(--ink); color: var(--bg); border-color: transparent; }
[data-bookmark].on svg { fill: currentColor; }

/* ============ Community ============ */
.wrap.narrow { width: min(760px, 100% - 48px); }
.notice { margin: 8px 0 22px; padding: 12px 16px; border-radius: 14px; border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--a1) 6%, transparent); color: var(--ink-2); font-size: 13.5px; line-height: 1.65; }
.notice b { color: var(--ink); }
.comm { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.comm-main > * + * { margin-top: 16px; }
.comm-main .toolbar { margin: 20px 0 0; }
.comm-main .filters { margin-top: 12px; }
.comm-side { position: sticky; top: 96px; display: grid; gap: 16px; }
.comm-side .card { padding: 22px; }
.rules { list-style: decimal; padding-left: 1.3em; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.rules li + li { margin-top: 6px; }
.rules li::marker { color: var(--a1); font-family: var(--mono); }
.hot li { padding: 9px 0; border-top: 1px solid var(--line); }
.hot li:first-child { border-top: 0; padding-top: 0; }
.hot a { display: block; font-family: var(--serif); font-weight: 700; line-height: 1.45; }
.hot a:hover { color: var(--a1); }
.hot small, .side-stat { color: var(--muted); font-size: 12.5px; }
.side-stat { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.seg { display: flex; gap: 6px; }
.fbtn small { opacity: .6; font-family: var(--mono); font-size: 11px; margin-left: 2px; }
.more-btn { display: block; margin: 20px auto 0; }
.more-btn[hidden] { display: none; }

.composer { display: grid; gap: 12px; padding: 20px; }
.composer .field { padding: 10px 14px; }
.composer textarea.field { resize: vertical; min-height: 96px; }
.c-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.c-top .av { width: 32px; height: 32px; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-opt { position: relative; cursor: pointer; }
.cat-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.cat-opt span { display: block; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); transition: all .25s var(--ease); }
.cat-opt:hover span { border-color: var(--line-2); color: var(--ink); }
.cat-opt input:checked + span { background: var(--ink); color: var(--bg); border-color: transparent; }
.cat-opt input:focus-visible + span { outline: 2px solid var(--a1); outline-offset: 2px; }
.composer .row-between { margin: 0; }
.gate-mini { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; }
.gate-mini p { color: var(--ink-2); margin: 0; }
.gate-mini .cta { margin: 0; }

.post { padding: 22px 24px; }
.post + .post { margin-top: 14px; }
.p-head { display: flex; align-items: center; gap: 12px; }
.p-who { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.p-who b { font-weight: 600; }
.p-who time, .cmt-head time { color: var(--muted); font-size: 12.5px; }
.demo-tag { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.chip.cat { flex: none; }
.p-title { display: block; margin: 14px 0 6px; font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.4; }
a.p-title:hover { color: var(--a1); }
.p-title.big { font-weight: 900; font-size: clamp(24px, 4vw, 32px); letter-spacing: -.01em; }
.p-body { color: var(--ink-2); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.p-full { color: var(--ink-2); font-size: 16.5px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 12px; }
.p-foot { display: flex; align-items: center; gap: 4px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.p-foot .sp { flex: 1; }
.act { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 13.5px; transition: background .2s, color .2s, transform .2s var(--ease); }
.act:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.act:active { transform: scale(.94); }
.act.like.on { color: #e5484d; }
.act.like.on svg { fill: currentColor; }
.act.danger:hover { color: #e5484d; background: color-mix(in srgb, #e5484d 10%, transparent); }
.post.detail { padding: 28px; }
.comments { margin-top: 32px; }
.c-h { font-size: 22px; margin-bottom: 14px; }
.cmt { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.cmt:first-child { border-top: 0; }
.cmt .av { width: 34px; height: 34px; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cmt-head b { font-weight: 600; font-size: 14.5px; }
.cmt p { margin-top: 3px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.at { color: var(--a1); }
.cmt-act { display: flex; gap: 14px; margin-top: 4px; }
.cmt-act .linkbtn { font-size: 12.5px; }
.linkbtn.danger-l:hover { color: #e5484d; }
#cReply { margin-top: 20px; }
.reply-chip { display: inline-flex; align-items: center; gap: 6px; }
.reply-chip button { border: 0; background: none; color: var(--muted); padding: 0; line-height: 1; }
.reply-chip button:hover { color: var(--ink); }

/* ============ Scroll reveal ============ */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }

/* ============ Theme transition ============ */
html.vt::view-transition-old(root), html.vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.vt::view-transition-new(root) { z-index: 2; }
html.vt::view-transition-old(root) { z-index: 1; }

/* ============ Responsive ============ */
@media (max-width: 920px) {
  .comm { grid-template-columns: 1fr; }
  .comm-side { position: static; }
  .acc-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .tools { grid-template-columns: 1fr; }
  .c-about, .c-clock, .c-stack, .c-now, .c-stats { grid-column: span 12; }
  .grid-3 { grid-template-columns: 1fr; }
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .exchange, .gb { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  main { padding-top: 40px; }
  .nav-wrap { top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .nav-links a { padding: 7px 8px; font-size: 13px; }
  .wrap.narrow { width: calc(100% - 32px); }
  .post, .post.detail { padding: 18px; }
  .gate-mini { padding: 18px; }
  .brand, .auth-btn .auth-label { display: none; }
  .auth-btn { padding: 0 9px; }
  .auth-btn.in { padding: 0 3px; }
  .user-menu { top: auto; bottom: calc(100% + 10px); }
  .modal { align-items: end; padding: 0; }
  .modal-box { width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; padding: 30px 20px calc(24px + env(safe-area-inset-bottom)); }
  .acc-head { gap: 14px; }
  .av.lg { width: 56px; height: 56px; font-size: 24px; }
  .row3, .row3.top { grid-template-columns: 1fr; }
  .mol-svg { height: 220px; }
  .sep, .kbd-btn { display: none; }
  .card { padding: 22px; border-radius: 22px; }
  .marquee { margin: 0 -22px; }
  .timeline::before { left: 4px; }
  .tl { grid-template-columns: 1fr; gap: 2px; padding: 12px 0 12px 28px; }
  .tl::before { left: 0; top: 20px; }
  .tl time { text-align: left; }
  .prow { grid-template-columns: 1fr; gap: 4px; }
  .prow .meta { order: -1; }
  .prow time { display: none; }
  .form .row { grid-template-columns: 1fr; }
  .pn { grid-template-columns: 1fr; }
  .foot { margin-top: 64px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: 96px; }
  .prose { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
  .track { animation: none; }
}
