/* ==========================================================================
   xyzz personal site
   System: Swiss editorial, dark. One accent (electric lime), locked.
   Discipline: no runtime blur filters, no per-frame layout reads,
   one rAF loop total, IO-driven reveals.
   ========================================================================== */

/* ---------- 1. tokens ---------- */
:root {
    --ink: #07070a;
    --ink-1: #0b0b10;
    --ink-2: #101018;
    --ink-3: #15151f;

    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.16);

    --text: #f2f2f0;
    --text-2: #a2a2ad;
    --text-3: #6b6b78;

    --a: #d9f24a;
    --a-hover: #e6ff70;
    --a-ink: #07070a;
    --a-rgb: 217, 242, 74;
    --grid-line: rgba(255, 255, 255, 0.028);
    --header-bg: rgba(7, 7, 10, 0.94);
    --chip-bg: rgba(7, 7, 10, 0.86);
    --overlay: rgba(5, 5, 8, 0.97);

    /* 页面外壳色 = --ink*；浅色方案会整体重定义（见文件末尾「配色方案」） */
    --shell: #07070a;
    --shell-1: #0b0b10;
    --shell-2: #101018;
    --shell-3: #15151f;

    --band-bg: #d9f24a;
    --band-ink: #07070a;

    --radius: 4px;
    --radius-lg: 10px;

    --pad: clamp(20px, 5vw, 72px);
    --maxw: 1440px;
    --header-h: 72px;

    --f-display: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
    --f-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    --f-mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", ui-monospace, monospace;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    --rule: 1px solid var(--line);
}

/* ---------- 2. reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    background: var(--shell);
}

html.intro-lock, html.intro-lock body { overflow: hidden; }

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--ink);
    color: var(--text);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px);
    background-size: min(12vw, 160px) 100%;
    mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
time { font-variant-numeric: tabular-nums; }

::selection { background: var(--a); color: var(--a-ink); }

:focus-visible {
    outline: 2px solid var(--a);
    outline-offset: 3px;
    border-radius: 2px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 500;
    padding: 10px 16px;
    background: var(--a); color: var(--a-ink);
    font-family: var(--f-mono); font-size: 13px;
    border-radius: var(--radius);
    transform: translateY(-200%);
    transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 3. layout primitives ---------- */
.shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.section {
    padding-block: clamp(80px, 11vw, 168px);
    border-top: var(--rule);
}

.section-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: clamp(40px, 6vw, 80px);
}

.label {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
}
.label::before {
    content: "";
    width: 28px; height: 1px;
    background: var(--a);
    transform: translateY(-4px);
}

.title {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: clamp(2.2rem, 5.4vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.title em {
    font-style: normal;
    color: var(--a);
}

.lede {
    max-width: 52ch;
    color: var(--text-2);
    font-size: clamp(0.95rem, 1.1vw, 1.0625rem);
    text-wrap: pretty;
}

@media (min-width: 900px) {
    .section-head {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: end;
        column-gap: 48px;
    }
    .section-head .lede { justify-self: end; }
}

/* buttons: one shape system, pill radius for interactive elements */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 32px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
                border-color 0.25s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary { background: var(--a); color: var(--a-ink); }
.btn-primary:hover { background: var(--a-hover); }

.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--a); color: var(--a); }

.btn-sm { min-height: 36px; padding: 0 16px; font-size: 0.82rem; }

.btn[disabled] { opacity: 0.42; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--line-2); color: var(--text); background: none; }
.btn-primary[disabled]:hover { background: var(--a); color: var(--a-ink); }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 2px;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.link-arrow svg { transition: transform 0.3s var(--ease); }
.link-arrow:hover { color: var(--a); border-color: var(--a); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- 4. reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.06s; }
.reveal[data-d="2"] { transition-delay: 0.12s; }
.reveal[data-d="3"] { transition-delay: 0.18s; }
.reveal[data-d="4"] { transition-delay: 0.24s; }

/* ---------- 5. header ---------- */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: transparent;
    transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
    border-bottom: 1px solid transparent;
}
.header.is-stuck {
    background: var(--header-bg);
    border-bottom-color: var(--line);
}

.nav {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--pad);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* ===== 原版 Logo：L 字 + 橙蓝双线动画，还原 */
.logo-l {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
    flex-shrink: 0;
}
.l-letter {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
    animation: lPulse 3.5s ease-in-out infinite;
    position: relative;
}
.l-lines {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
}
.l-line {
    display: block;
    height: 3px;
    width: 0;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}
.l-line:first-child { width: 32px; }
.l-line:last-child { width: 22px; }
.l-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    transform: scaleX(0);
    transform-origin: left center;
    animation: lineRun 2.8s ease-in-out infinite;
    will-change: transform;
}
@keyframes lineRun {
    0%   { transform: scaleX(0);   opacity: 0.45; transform-origin: left center; }
    32%  { transform: scaleX(1);   opacity: 1;    transform-origin: left center; }
    50%  { transform: scaleX(1);   opacity: 1;    transform-origin: left center; }
    68%  { transform: scaleX(1);   opacity: 1;    transform-origin: right center; }
    100% { transform: scaleX(0);   opacity: 0.45; transform-origin: right center; }
}
.l-line-orange::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 8px rgba(245, 158, 11, 0.6); }
.l-line-blue::after {
    background: linear-gradient(90deg, #38bdf8, #60a5fa);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
    animation-delay: 0.6s;   /* 旧版错峰：蓝线比橙线晚 0.6s */
}

.logo-text {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    font-family: "Segoe UI", Arial, sans-serif;
    position: relative;
    display: inline-block;
}
/* 流光字标：一条亮带从左扫到右，首尾同色保证循环无跳变 */
.logo-text-inner {
    display: inline-block;
    background-image: linear-gradient(
        100deg,
        #94a3b8 0%,
        #94a3b8 35%,
        #cbd5e1 43%,
        #ffffff 50%,
        #38bdf8 56%,
        #f59e0b 66%,
        #cbd5e1 74%,
        #94a3b8 82%,
        #94a3b8 100%
    );
    background-size: 300% 100%;
    background-repeat: no-repeat;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: logoShine 3.2s linear infinite;
    will-change: background-position;
}

/* 大号 Logo 里的字标更醒目：加一层与文字同色的柔光 */
.hero-logo .logo-text-large .logo-text-inner {
    animation-duration: 4.2s;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.35));
}

@keyframes lPulse {
    0%, 100% { text-shadow: 0 0 8px rgba(56, 189, 248, 0.3), 0 0 16px rgba(245, 158, 11, 0.2); }
    50% { text-shadow: 0 0 16px rgba(56, 189, 248, 0.55), 0 0 30px rgba(245, 158, 11, 0.35); }
}
@keyframes progressFill {
    0% { width: 0%; opacity: 0.4; }
    30% { width: 100%; opacity: 1; }
    70% { width: 100%; opacity: 1; }
    100% { width: 0%; opacity: 0.4; }
}
@keyframes logoShine {
    0%   { background-position: 100% 0; }
    100% { background-position: 0% 0; }
}

/* hero 里的大号 Logo（原版 .hero-logo 的静态还原，去掉了 backdrop-filter 与无限浮动） */
.hero-logo {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(18px, 2.6vw, 34px);
    padding: clamp(14px, 2vw, 30px) clamp(30px, 3.6vw, 56px) clamp(14px, 2vw, 30px) clamp(18px, 2.6vw, 40px);
    border-radius: 20px;
    width: fit-content;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--line-2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.hero-logo::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.7), rgba(56, 189, 248, 0.4), rgba(var(--a-rgb), 0.35));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.7;
    pointer-events: none;
}
.hero-logo .logo-l { gap: 6px; z-index: 1; }
.hero-logo .l-letter {
    font-size: clamp(3.2rem, 7vw, 6rem);
    line-height: 1;
    text-shadow: 0 0 24px rgba(56, 189, 248, 0.45), 0 0 48px rgba(245, 158, 11, 0.22);
}
.hero-logo .l-line { height: 9px; }
.hero-logo .l-line:first-child { width: clamp(74px, 10vw, 140px); }
.hero-logo .l-line:last-child { width: clamp(50px, 6.8vw, 92px); }
.hero-logo .l-line::after { border-radius: 4px; }
.hero-logo .logo-text-large {
    font-size: clamp(1.9rem, 4.4vw, 3.9rem);
    letter-spacing: clamp(3px, 0.55vw, 7px);
    margin-right: calc(clamp(3px, 0.55vw, 7px) * -1);   /* 抵消末字后多出的字距，让 xyzz 视觉居中 */
    font-weight: 800;
}
@keyframes lPulseLarge {
    0%, 100% { text-shadow: 0 0 25px rgba(56, 189, 248, 0.45), 0 0 50px rgba(245, 158, 11, 0.2); }
    50% { text-shadow: 0 0 40px rgba(56, 189, 248, 0.65), 0 0 80px rgba(245, 158, 11, 0.4); }
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.4vw, 34px);
}
.nav-link {
    position: relative;
    padding: 6px 0;
    font-size: 0.875rem;
    color: var(--text-2);
    transition: color 0.2s var(--ease);
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--a);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after { transform: scaleX(1); }

.menu-toggle {
    display: none;
    width: 44px; height: 44px;
    margin-right: -10px;
    position: relative;
}
.menu-toggle span {
    position: absolute;
    left: 11px; right: 11px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 21.5px; }
.menu-toggle span:nth-child(3) { top: 27px; }
.menu-toggle.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- 6. hero（沿用旧版居中结构：标题 → 副标题 → 大 Logo → 按钮 → 数据条） ---------- */
.hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: calc(var(--header-h) + clamp(20px, 3.4vh, 44px)) var(--pad) clamp(32px, 5vh, 56px);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* 在线状态 pills：悬停/聚焦显示来源与偏差说明 */
.hero-status {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 16px;
    margin-bottom: clamp(22px, 3.2vh, 32px);
    border: 1px solid var(--line-2);
    border-radius: 100px;
    background: var(--ink-1);
    font-family: var(--f-mono);
    font-size: 14px;
    letter-spacing: 0.1em;
    color: var(--text-2);
    cursor: help;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.hero-status:hover,
.hero-status:focus-visible { border-color: var(--a); color: var(--text); outline: none; }
.hero-status .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.hero-status.is-online .dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.hero-status.is-away .dot { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
.hero-status.is-offline .dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
.hero-status.is-unknown .dot { background: var(--text-3); }

.hero-status-tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translate(-50%, 6px);
    width: max-content;
    max-width: min(78vw, 360px);
    padding: 12px 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-lg);
    background: var(--ink-2);
    color: var(--text-2);
    font-family: var(--f-body);
    font-size: 13px;
    line-height: 1.55;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    z-index: 5;
}
.hero-status-tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: var(--line-2);
}
.hero-status:hover .hero-status-tip,
.hero-status:focus-visible .hero-status-tip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.hero-title {
    font-family: var(--f-display);
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0 0 16px;
}
/* 名字用渐变字：沿用旧版做法，但静态（去掉无限浮动与 drop-shadow 滤镜） */
.hero-name {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b 0%, var(--a) 45%, #38bdf8 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: logoShine 6s linear infinite;
}

.hero-subtitle {
    max-width: 560px;
    margin: 0 auto clamp(28px, 4vh, 44px);
    color: var(--text-2);
    font-size: clamp(1.1rem, 1.9vw, 1.5rem);
    letter-spacing: 1px;
}

.hero-title,
.hero-subtitle,
.hero-logo-wrap,
.hero-actions,
.hero-stats {
    opacity: 0;
    transform: translateY(16px);
}
.intro-done .hero-title,
.intro-done .hero-subtitle,
.intro-done .hero-logo-wrap,
.intro-done .hero-actions,
.intro-done .hero-stats,
.no-intro .hero-title,
.no-intro .hero-subtitle,
.no-intro .hero-logo-wrap,
.no-intro .hero-actions,
.no-intro .hero-stats {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s var(--ease), transform 0.8s var(--ease);
}
.intro-done .hero-subtitle, .no-intro .hero-subtitle { transition-delay: 0.06s; }
.intro-done .hero-logo-wrap, .no-intro .hero-logo-wrap { transition-delay: 0.14s; }
.intro-done .hero-actions, .no-intro .hero-actions { transition-delay: 0.22s; }
.intro-done .hero-stats, .no-intro .hero-stats { transition-delay: 0.28s; }

.hero-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: clamp(8px, 2vh, 22px) 0 clamp(30px, 5vh, 50px);
}
.hero-logo { margin-inline: auto; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: clamp(30px, 5vh, 48px);
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(20px, 3vh, 30px) 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--ink-1);
}
.hero-stats .stat {
    flex: 1 1 auto;
    padding-inline: clamp(18px, 3.6vw, 44px);
}
.hero-stats .stat-label { font-size: 13px; }
.hero-stats .stat-num { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.stat-sep {
    width: 1px;
    align-self: stretch;
    background: var(--line);
}
/* intro overlay */
.intro {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--ink);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.intro.is-leaving {
    opacity: 0;
    transition: opacity 0.55s var(--ease);
    pointer-events: none;
}
.intro-word {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(3rem, 16vw, 13rem);
    letter-spacing: -0.06em;
    line-height: 1;
    color: var(--text);
    clip-path: inset(0 100% 0 0);
    animation: introWipe 0.9s var(--ease) forwards;
}
@keyframes introWipe {
    to { clip-path: inset(0 0 0 0); }
}
.intro-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--a);
    transform-origin: left;
    transform: scaleX(0);
    animation: introBar 1.5s var(--ease-in-out) forwards;
}
@keyframes introBar {
    to { transform: scaleX(1); }
}
.intro-tag {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-3);
}

/* banned state */
.ban {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    place-items: center;
    background: var(--ink);
    padding: 24px;
    text-align: center;
}
.ban.is-on { display: grid; }
.ban h1 {
    font-family: var(--f-display);
    font-size: clamp(2rem, 8vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: #ff4d4d;
}
.ban p {
    margin-top: 16px;
    font-family: var(--f-mono);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}

/* ---------- 7. about ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}
@media (min-width: 900px) {
    .about-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}

.portrait {
    position: relative;
    aspect-ratio: 1 / 1;
    border: var(--rule);
    border-radius: var(--radius-lg);
    background: var(--ink-2);
    overflow: hidden;
}
.portrait img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s var(--ease);
}
.portrait:hover img { transform: scale(1.02); }
/* 头像图与占位层的关系：图加载成功 → 占位层自动隐藏；失败/缺失 → 图让位给占位层 */
.portrait img {
    position: relative;
    z-index: 1;
    display: block;
    background: var(--ink-2);
}
.portrait img.is-missing,
.portrait img[hidden] {
    display: none;
}
.portrait .portrait-fallback {
    z-index: 0;
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}
.portrait .portrait-fallback[hidden] { display: none; }
.portrait-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--f-display);
    font-size: clamp(4rem, 12vw, 9rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--ink-3);
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 10px),
        var(--ink-2);
}
.portrait-tag {
    position: absolute;
    left: 14px; bottom: 14px;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
    background: var(--chip-bg);
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 2px;
}

.about-body { display: flex; flex-direction: column; gap: clamp(22px, 3vw, 34px); }

.about-lead {
    font-family: var(--f-display);
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1.24;
    letter-spacing: -0.02em;
    font-weight: 500;
    text-wrap: pretty;
}
.about-lead::first-letter { color: var(--a); }

.about-copy { color: var(--text-2); max-width: 56ch; text-wrap: pretty; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    padding: 7px 14px;
    border: var(--rule);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-2);
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.tag:hover { border-color: var(--a); color: var(--a); }

.facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: var(--rule);
    padding-top: 22px;
    gap: 16px;
}
.fact span {
    display: block;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 4px;
}
.fact strong {
    font-family: var(--f-display);
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- 8. work ---------- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: var(--rule);
}
@media (min-width: 1024px) {
    .work-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    /* asymmetric rhythm set by nth-child, not by repeating the same row */
    .work:nth-child(4n+1) { grid-column: span 7; }
    .work:nth-child(4n+2) { grid-column: span 5; }
    .work:nth-child(4n+3) { grid-column: span 5; }
    .work:nth-child(4n+4) { grid-column: span 7; }
}

.work {
    position: relative;
    background: var(--ink);
    min-width: 0;
}

.work-link {
    display: block;
    height: 100%;
    padding: 18px;
}
.work-media {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: var(--ink-2);
}
.work-media img {
    position: relative;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease), opacity 0.4s var(--ease);
}
/* 图片加载前的占位底纹：图片失败时自然露出，不留空洞 */
.work-ph {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 9px),
        var(--ink-2);
}
.work-link:hover .work-media img { transform: scale(1.04); }
.is-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 16px;
    text-align: center;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 9px),
        var(--ink-2);
}
.work-pin {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 1;
    padding: 4px 9px;
    background: var(--a);
    color: var(--a-ink);
    font-family: var(--f-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 2px;
}
.work-info {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-top: 14px;
}
.work-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.work-idx {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--text-3);
    flex-shrink: 0;
}
.work-desc {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-more {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: var(--rule);
}
.skeleton {
    grid-column: span 12;
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(100deg, var(--ink-2) 30%, var(--ink-3) 50%, var(--ink-2) 70%);
    background-size: 220% 100%;
    animation: shimmer 1.6s linear infinite;
}
@media (min-width: 1024px) {
    .skeleton { grid-column: span 4; }
    .skeleton:first-child { grid-column: span 8; }
}
@keyframes shimmer {
    to { background-position: -220% 0; }
}

.empty {
    padding: clamp(40px, 8vw, 80px) 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 0.95rem;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius);
}

/* ---------- 9. guestbook ---------- */
.guest-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
}
@media (min-width: 1000px) {
    .guest-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}

.form-card {
    border: var(--rule);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 3vw, 30px);
    background: var(--ink-1);
}

.identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: var(--rule);
}
.identity-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.identity-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line-2);
    flex-shrink: 0;
}
.identity-name {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.identity-lock {
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
}
.identity-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.form-hint {
    display: none;
    font-size: 0.82rem;
    color: var(--text-2);
    margin-bottom: 16px;
    padding-left: 10px;
    border-left: 2px solid var(--a);
}
.form-hint.is-on { display: block; }

.field { margin-bottom: 18px; }
.field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-2);
}
.field-label .opt { color: var(--text-3); font-weight: 400; }
.counter {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.counter.is-warn { color: #ff9a5a; }

.input, .textarea {
    display: block;
    width: 100%;
    padding: 12px 14px;
    background: var(--ink);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.92rem;
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .textarea:hover { border-color: rgba(255, 255, 255, 0.24); }
.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--a);
    background: var(--ink-1);
}
.textarea { resize: vertical; min-height: 132px; line-height: 1.6; }

.btn-submit { width: 100%; margin-top: 4px; }
.btn-loader {
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
.btn-submit.is-loading .btn-loader { display: block; }
.btn-submit.is-loading .btn-text { opacity: 0.75; }
@keyframes spin { to { transform: rotate(360deg); } }

.msg-list { display: flex; flex-direction: column; }
.msg-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: var(--rule);
}
.msg-head h3 { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.msg-total {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
}

.msg {
    display: flex;
    gap: 14px;
    padding: 20px 0;
    border-bottom: var(--rule);
}

/* 留言骨架屏（不继承 grid 尺寸，避免撑爆布局） */
.msg .skel {
    background:
        linear-gradient(100deg, var(--ink-2) 30%, var(--ink-3) 50%, var(--ink-2) 70%);
    background-size: 220% 100%;
    animation: shimmer 1.6s linear infinite;
    border-radius: 3px;
}
.msg .skel.msg-avatar { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px; }
.skel.msg-line { height: 11px; }
.msg-avatar {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--a-ink);
    background: var(--a);
    object-fit: cover;
    overflow: hidden;
}
.msg-body { min-width: 0; flex: 1; }
.msg-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.msg-author { font-size: 0.9rem; font-weight: 600; }
.msg-time {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
}
.msg-content {
    margin-top: 6px;
    color: var(--text-2);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* ---------- 10. contact band ---------- */
.band {
    background: var(--band-bg);
    color: var(--band-ink);
    border-top: none;
    position: relative;
    z-index: 1;
}
.band .label { color: rgba(7, 7, 10, 0.55); }
.band .label::before { background: var(--band-ink); }
.band .title { color: var(--band-ink); }
.band .title em { color: var(--band-ink); font-style: italic; font-weight: 700; }

.band-mail {
    display: inline-block;
    margin-block: clamp(24px, 4vw, 40px) clamp(36px, 6vw, 64px);
    font-family: var(--f-display);
    font-size: clamp(1.5rem, 6.4vw, 5.4rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--band-ink);
    word-break: break-word;
    border-bottom: 3px solid transparent;
    transition: border-color 0.3s var(--ease);
}
.band-mail:hover { border-bottom-color: var(--band-ink); }

.socials {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid rgba(7, 7, 10, 0.22);
}
@media (min-width: 800px) {
    .socials { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.social {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 18px 22px 0;
    border-bottom: 1px solid rgba(7, 7, 10, 0.22);
    transition: background-color 0.25s var(--ease);
}
@media (min-width: 800px) {
    .social { padding-inline: 18px; border-left: 1px solid rgba(7, 7, 10, 0.22); }
    .social:first-child { border-left: 0; padding-left: 0; }
}
.social:hover { background: rgba(7, 7, 10, 0.06); }
.social-k {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(7, 7, 10, 0.6);
}
.social-v {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.social-v svg { flex-shrink: 0; transition: transform 0.3s var(--ease); }
.social:hover .social-v svg { transform: translate(3px, -3px); }

/* ---------- 11. footer ---------- */
.footer {
    position: relative;
    z-index: 1;
    border-top: var(--rule);
    padding-block: 34px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
}
.footer-inner a { transition: color 0.2s var(--ease); }
.footer-inner a:hover { color: var(--a); }
/* 备案信息 */
.footer-record {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--text-3);
}
.footer-record .record-site { color: var(--text-2); }
.footer-record .record-icp {
    color: var(--text-3);
    transition: color 0.2s var(--ease);
}
.footer-record .record-icp:hover { color: var(--a); }
@media (max-width: 520px) {
    .footer-record { flex-direction: column; gap: 4px; text-align: center; }
}


/* ---------- 12. floating actions ---------- */
.to-top {
    position: fixed;
    right: clamp(16px, 3vw, 32px);
    bottom: clamp(16px, 3vw, 32px);
    z-index: 90;
    width: 44px; height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--line-2);
    background: var(--chip-bg);
    color: var(--text);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.2s var(--ease), visibility 0.3s;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--a); color: var(--a); }

.read-progress {
    position: fixed;
    top: 0; left: 0;
    z-index: 110;
    height: 2px;
    width: 100%;
    background: var(--a);
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}

/* ---------- 13. toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: clamp(20px, 4vw, 40px);
    z-index: 400;
    transform: translate(-50%, 16px);
    max-width: min(92vw, 460px);
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--text);
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 500;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
}
.toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast[data-type="error"] { background: #ff5a5a; color: #150505; }

/* ---------- 14. gallery page ---------- */
.gallery-page { padding-top: calc(var(--header-h) + clamp(48px, 9vw, 120px)); padding-bottom: clamp(64px, 10vw, 140px); }
.gallery-head { margin-bottom: clamp(32px, 5vw, 64px); }
.gallery-head .title { font-size: clamp(2.4rem, 8vw, 6rem); }
.gallery-count {
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-top: 16px;
}

.gallery-grid {
    columns: 2;
    column-gap: 1px;
    background: var(--line);
}
@media (min-width: 900px) { .gallery-grid { columns: 3; } }
@media (min-width: 1280px) { .gallery-grid { columns: 4; } }

.gcard {
    break-inside: avoid;
    position: relative;
    background: var(--ink);
    cursor: zoom-in;
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
    color: inherit;
}
.gcard-media {
    position: relative;
    overflow: hidden;
    background: var(--ink-2);
}
.gcard-media img {
    position: relative;
    width: 100%;
    display: block;
    transition: transform 0.7s var(--ease), opacity 0.4s var(--ease);
}
.gcard-media { min-height: 160px; }
.gcard-media .work-ph { position: absolute; inset: 0; }
.gcard:hover .gcard-media img { transform: scale(1.03); }
.gcard-media .is-placeholder {
    position: static;
    aspect-ratio: 4 / 3;
    display: grid; place-items: center;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 9px),
        var(--ink-2);
}
.gcard-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 16px;
}
.gcard-title {
    font-size: 0.86rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.gcard-idx {
    font-family: var(--f-mono);
    font-size: 10px;
    color: var(--text-3);
    flex-shrink: 0;
}

/* lightbox */
.lb {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: var(--overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.lb.is-on { opacity: 1; visibility: visible; }
.lb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 32px);
    border-bottom: var(--rule);
}
.lb-title {
    font-size: 0.92rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.lb-idx {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}
.lb-stage {
    display: grid;
    place-items: center;
    padding: clamp(12px, 3vw, 32px);
    min-height: 0;
    overflow: hidden;
}
.lb-stage img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius);
}
.lb-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px clamp(16px, 4vw, 32px);
    border-top: var(--rule);
}
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-nav { display: flex; gap: 8px; }
.lb-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-2);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.lb-btn:hover { border-color: var(--a); color: var(--a); }
.lb-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.lb-close {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    flex-shrink: 0;
}
.lb-close:hover { border-color: var(--a); color: var(--a); }
.lb-nav-btn {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.lb-nav-btn:hover { border-color: var(--a); color: var(--a); }

/* ---------- 14b. 作品集页（work.html） ---------- */
.proj-grid {
    display: grid;
    grid-template-columns: 1fr;
    border-top: var(--rule);
}
.proj-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(16px, 3vw, 40px);
    padding: clamp(22px, 3.6vw, 40px) 0;
    border-bottom: var(--rule);
    text-align: left;
    color: inherit;
    transition: background-color 0.3s var(--ease);
}
.proj-card:hover { background: rgba(255, 255, 255, 0.015); }

.proj-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--ink-2);
    aspect-ratio: 16 / 10;
}
.proj-media img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease);
}
.proj-card:hover .proj-media img { transform: scale(1.03); }

.proj-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.proj-title {
    font-family: var(--f-display);
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.proj-summary {
    color: var(--text-2);
    font-size: clamp(0.92rem, 1.15vw, 1.05rem);
    max-width: 52ch;
}
.proj-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}
.proj-year {
    margin-left: auto;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--text-3);
}

.proj-empty {
    padding: clamp(40px, 8vw, 80px) 0;
    color: var(--text-3);
    text-align: center;
}
.proj-empty[hidden] { display: none; }

/* 项目详情弹层 */
.proj-stage {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: center;
    gap: clamp(14px, 2vw, 24px);
    max-width: 1100px;
    margin-inline: auto;
    overflow: auto;
}
.proj-stage img {
    min-height: 0;
    max-height: 62vh;
}
.proj-detail { display: flex; flex-direction: column; gap: 14px; color: var(--text-2); }
.proj-detail-lead { color: var(--text); font-size: clamp(1rem, 1.4vw, 1.15rem); }
.proj-detail-body { max-width: 70ch; line-height: 1.7; font-size: 0.94rem; }

@media (min-width: 900px) {
    .proj-card {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
        align-items: center;
        gap: clamp(24px, 4vw, 64px);
    }
    .proj-card:nth-child(even) .proj-media { order: 2; }
}

/* ---------- 后台：项目表单 ---------- */
.proj-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.proj-thumb {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
}
.proj-thumb img { width: 100%; height: 92px; object-fit: cover; display: block; }
.proj-thumb .n {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 8px; font-size: 11px; color: var(--text2);
}
.proj-thumb .n button { color: var(--red); }

/* ---------- 分类筛选条 ---------- */
.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}
.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-2);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.cat-tab:hover { border-color: var(--a); color: var(--text); }
.cat-tab.is-active {
    background: var(--a);
    border-color: var(--a);
    color: var(--a-ink);
    font-weight: 600;
}
.cat-tab .n {
    font-family: var(--f-mono);
    font-size: 11px;
    opacity: 0.72;
}

/* 卡片上的分类标签 */
.gcard-cat {
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-left: auto;
    margin-right: 10px;
    white-space: nowrap;
}
.tag.tag-cat {
    border-color: var(--a);
    color: var(--a);
}

/* 作品集详情里的「打开项目」按钮 */
.proj-jump {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--a);
    color: var(--a-ink);
    font-weight: 600;
    font-size: 0.92rem;
    transition: background-color 0.25s var(--ease), transform 0.15s var(--ease);
}
.proj-jump:hover { background: var(--a-hover); }
.proj-jump:active { transform: translateY(1px) scale(0.99); }

/* ---------- 15. responsive ---------- */
@media (max-width: 899px) {
    :root { --header-h: 72px; }

    .header .theme-toggle { display: none; }   /* 手机端收进菜单，避免导航拥挤 */
    .nav-menu .theme-toggle { width: 100%; border-radius: 999px; margin: 10px 0 0; }

    .logo-l { gap: 1px; }
    .l-letter { font-size: 1.6rem; }
    .l-line:first-child { width: 28px; }
    .l-line:last-child { width: 19px; }
    .logo-text { font-size: 0.9rem; letter-spacing: 2px; }

    .hero-title { font-size: 2.1rem; }
    .hero-status { font-size: 13px; padding: 9px 16px 9px 13px; }
    .hero-logo-wrap { margin: clamp(6px, 1.6vh, 14px) 0 clamp(24px, 4vh, 36px); }
    .hero-stats { padding: 18px 12px; }
    .hero-stats .stat { padding-inline: 12px; }
    .hero-stats .stat-num { font-size: 1.6rem; }
    .hero-stats .stat-label { font-size: 11px; }
    .btn { min-height: 50px; padding: 0 24px; font-size: 1rem; }
    .hero-logo { padding: 16px 22px; gap: 14px; }
    .hero-logo .logo-text-large { font-size: 1.7rem; letter-spacing: 3px; }
    .hero-logo .l-letter { font-size: 2.9rem; }
    .hero-logo .l-line:first-child { width: 66px; }
    .hero-logo .l-line:last-child { width: 44px; }

    .menu-toggle { display: block; }

    .nav-menu {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--pad) 24px;
        background: var(--ink-1);
        border-bottom: var(--rule);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
    }
    .nav-menu.is-open { opacity: 1; visibility: visible; transform: none; }
    .nav-menu li { border-bottom: var(--rule); }
    .nav-menu li:last-child { border-bottom: 0; }
    .nav-menu li:has(> .theme-toggle) { border-bottom: 0; }
    .nav-link { display: block; padding: 16px 0; font-size: 1rem; }
    .nav-link::after { display: none; }

    .hero-stats { gap: 20px; }
    .work-grid { grid-template-columns: 1fr; }
    .identity-actions { width: 100%; }
    .identity-actions .btn { flex: 1 1 0; min-width: 0; padding-inline: 10px; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
    .gallery-grid { columns: 1; }
    .socials { grid-template-columns: 1fr; }
    .social { padding: 16px 0; border-left: 0; }
}

@media (max-width: 520px) {
    .hero-actions .btn { flex: 1 1 auto; }
    .lb-foot { flex-direction: column; align-items: stretch; }
    .lb-actions, .lb-nav { justify-content: space-between; }
}


/* ==========================================================================
   17. 深浅色主题 THEMES
   只有两套：深色 = 酸性橙，浅色 = 暖纸驼。
   切换由 <html data-theme="dark|light"> 驱动，index.js 里点按钮写 localStorage。
   默认（未设置 data-theme）按系统 prefers-color-scheme 走。
   ========================================================================== */

/* ---- 深色 · 酸性橙：强调 #ff8a00 · 纯黑底 · 联系带橙底深字 ---- */
:root,
[data-theme="dark"] {
    color-scheme: dark;
    --ink: #07070a;
    --ink-1: #0b0b10;
    --ink-2: #101018;
    --ink-3: #15151f;
    --shell: #07070a;
    --shell-1: #0b0b10;
    --shell-2: #101018;
    --shell-3: #15151f;

    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.16);
    --grid-line: rgba(255, 255, 255, 0.028);
    --header-bg: rgba(7, 7, 10, 0.94);
    --chip-bg: rgba(7, 7, 10, 0.86);
    --overlay: rgba(5, 5, 8, 0.97);

    --text: #f2f2f0;
    --text-2: #a2a2ad;
    --text-3: #6b6b78;

    --a: #ff8a00;
    --a-hover: #ffa02e;
    --a-ink: #140800;
    --a-rgb: 255, 138, 0;

    --band-bg: #ff8a00;
    --band-ink: #140800;
}

/* ---- 浅色 · 暖纸驼：强调 #b4532a · 暖米底 · 联系带浅驼底深字 ---- */
[data-theme="light"] {
    color-scheme: light;
    --ink: #f3efe6;
    --ink-1: #faf7f0;
    --ink-2: #e8e2d4;
    --ink-3: #ddd5c4;
    --shell: #f3efe6;
    --shell-1: #faf7f0;
    --shell-2: #e8e2d4;
    --shell-3: #ddd5c4;

    --line: rgba(38, 32, 22, 0.12);
    --line-2: rgba(38, 32, 22, 0.2);
    --grid-line: rgba(38, 32, 22, 0.055);
    --header-bg: rgba(243, 239, 230, 0.94);
    --chip-bg: rgba(250, 247, 240, 0.9);
    --overlay: rgba(238, 233, 223, 0.97);

    --text: #1b1712;
    --text-2: #554d41;
    --text-3: #7d7466;

    --a: #b4532a;
    --a-hover: #c86233;
    --a-ink: #ffffff;
    --a-rgb: 180, 83, 42;

    --band-bg: #ecdcc6;
    --band-ink: #2a1f14;
}

/* 浅色需要额外收边的地方 */
[data-theme="light"] .hero-logo {
    background: linear-gradient(135deg, rgba(38, 32, 22, 0.05) 0%, rgba(38, 32, 22, 0.015) 100%);
    box-shadow: 0 18px 50px rgba(38, 32, 22, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
[data-theme="light"] .portrait-tag { background: rgba(250, 247, 240, 0.82); color: var(--text-2); }
[data-theme="light"] .band .label,
[data-theme="light"] .social-k { color: rgba(42, 31, 20, 0.62); }
[data-theme="light"] .band .label::before { background: var(--band-ink); }
[data-theme="light"] .socials { border-top-color: rgba(42, 31, 20, 0.2); }
[data-theme="light"] .social { border-color: rgba(42, 31, 20, 0.2); }
[data-theme="light"] .social:hover { background: rgba(42, 31, 20, 0.05); }
[data-theme="light"] .work-ph,
[data-theme="light"] .is-placeholder,
[data-theme="light"] .portrait-fallback {
    background:
        repeating-linear-gradient(135deg, rgba(38, 32, 22, 0.045) 0 1px, transparent 1px 9px),
        var(--ink-2);
}
[data-theme="light"] .toast { background: #1b1712; color: #f3efe6; }
/* 浅色下 Logo 的白字与发光要压暗，否则糊在米白底上 */
[data-theme="light"] .l-letter {
    color: #2a1f14;
    text-shadow: 0 0 10px rgba(180, 83, 42, 0.28), 0 0 18px rgba(56, 189, 248, 0.16);
}
[data-theme="light"] .hero-logo .l-letter {
    text-shadow: 0 0 22px rgba(180, 83, 42, 0.35), 0 0 46px rgba(56, 189, 248, 0.18);
}
/* 浅色主题：暗底改成暖棕→白→赤陶的流光，保证在米白底上可见 */
[data-theme="light"] .logo-text-inner {
    background-image: linear-gradient(
        100deg,
        #6b6156 0%,
        #6b6156 35%,
        #8d8175 43%,
        #ffffff 50%,
        #b4532a 56%,
        #2f6fae 68%,
        #8d8175 76%,
        #6b6156 84%,
        #6b6156 100%
    );
}
[data-theme="light"] .hero-logo .logo-text-large .logo-text-inner {
    filter: drop-shadow(0 0 10px rgba(180, 83, 42, 0.35));
}
[data-theme="light"] .l-line-orange::after { box-shadow: 0 0 6px rgba(245, 158, 11, 0.45); }
[data-theme="light"] .l-line-blue::after { box-shadow: 0 0 6px rgba(56, 189, 248, 0.45); }

/* 跟随系统：未手动切换时用系统偏好 */
@media (prefers-color-scheme: light) {
    html:not([data-theme="dark"]) {
        color-scheme: light;
        --ink: #f3efe6;
        --ink-1: #faf7f0;
        --ink-2: #e8e2d4;
        --ink-3: #ddd5c4;
        --shell: #f3efe6;
        --shell-1: #faf7f0;
        --shell-2: #e8e2d4;
        --shell-3: #ddd5c4;
        --line: rgba(38, 32, 22, 0.12);
        --line-2: rgba(38, 32, 22, 0.2);
        --grid-line: rgba(38, 32, 22, 0.055);
        --header-bg: rgba(243, 239, 230, 0.94);
        --chip-bg: rgba(250, 247, 240, 0.9);
        --overlay: rgba(238, 233, 223, 0.97);
        --text: #1b1712;
        --text-2: #554d41;
        --text-3: #7d7466;
        --a: #b4532a;
        --a-hover: #c86233;
        --a-ink: #ffffff;
        --a-rgb: 180, 83, 42;
        --band-bg: #ecdcc6;
        --band-ink: #2a1f14;
    }
}

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-left: 4px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    color: var(--text-2);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover { border-color: var(--a); color: var(--a); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .ico-sun { display: none; }
[data-theme="light"] .theme-toggle .ico-sun { display: block; }
[data-theme="light"] .theme-toggle .ico-moon { display: none; }
@media (prefers-color-scheme: light) {
    html:not([data-theme="dark"]) .theme-toggle .ico-sun { display: block; }
    html:not([data-theme="dark"]) .theme-toggle .ico-moon { display: none; }
}

/* ---------- 16. reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    .hero-title, .hero-subtitle, .hero-logo-wrap, .hero-actions, .hero-stats { opacity: 1; transform: none; }
    .logo-text-inner, .hero-name { animation: none !important; background-position: 50% 0; }
    .skeleton { animation: none; }
}
