/* ==========================================================================
   知归 ZHGUI — 主样式
   深色电影感 · 编辑式排版 · 克制动效
   所有颜色 / 圆角 / 间距 / 阴影均通过设计 Token 管理
   ========================================================================== */

/* ---------- 设计 Token ---------- */
:root {
    /* 色彩 */
    --bg: #050a11;            /* 页面背景：午夜蓝黑 */
    --bg-2: #070c16;          /* 次级背景：深蓝灰 */
    --bg-3: #0d1522;          /* 卡片 / 浮层 */
    --text: #e9edf5;          /* 正文：浅灰白 */
    --text-2: #c3cbda;        /* 强正文 */
    --muted: #8d97ab;         /* 次级文字：低对比灰蓝 */
    --mist: #9db4d0;          /* 强调：雾蓝 */
    --gold: #d8b878;          /* 强调：柔和金 */
    --violet: #8f88d8;        /* 点缀：蓝紫（少量） */
    --line: rgba(148, 163, 184, .14);
    --line-strong: rgba(148, 163, 184, .30);

    /* 圆角 */
    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-full: 999px;

    /* 间距体系 */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;
    --s-9: 96px;
    --s-10: 140px;

    /* 布局 */
    --container: 1200px;
    --gutter: clamp(20px, 4vw, 48px);
    --nav-h: 76px;

    /* 字体 */
    --font-body: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei",
                 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --font-calligraphy: "Zhgui Calligraphy", "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;

    /* 阴影（深色环境阴影） */
    --shadow-1: 0 10px 30px rgba(2, 6, 16, .45);
    --shadow-2: 0 24px 64px rgba(2, 6, 16, .55);

    /* 动效 */
    --ease-out: cubic-bezier(.22, .61, .21, 1);
    --dur-1: .5s;
    --dur-2: .8s;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

html, body { overflow-x: clip; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* 页面氛围：极轻的冷色辉光，避免死黑 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(52vw 44vh at 86% -6%, rgba(94, 118, 163, .10), transparent 62%),
        radial-gradient(40vw 36vh at 4% 32%, rgba(84, 92, 158, .05), transparent 60%);
    pointer-events: none;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
em, i { font-style: normal; }
b, strong { font-weight: 600; }

/* 滚动条（深色主题） */
html { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .32) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .28);
    border: 3px solid transparent;
    border-radius: var(--r-full);
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(148, 163, 184, .48); }
::-webkit-scrollbar-corner { background: transparent; }

::selection { background: rgba(216, 184, 120, .85); color: #0a0f1c; }

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

.skip-link {
    position: fixed;
    top: -48px;
    left: var(--s-4);
    z-index: 200;
    padding: 10px 18px;
    background: var(--bg-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    transition: top .25s var(--ease-out);
}
.skip-link:focus-visible { top: var(--s-4); }

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* 每个区块独占一屏（页脚除外），内容不足时垂直居中，超出时自然延展 */
.section {
    padding-block: var(--s-8);
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
}
/* 紧凑区块（如「生活与思考」横幅）：不独占一屏，靠上下 padding 控制高度 */
.section--compact {
    min-height: 0;
    padding-block: var(--s-6);
}
.section > .container { width: 100%; }
.section--tinted { background: var(--bg-2); border-block: 1px solid var(--line); }

/* 滚动条隐藏：以右侧分屏圆点代替 */
html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }
body::-webkit-scrollbar { display: none; }

/* 右侧分屏圆点导航 */
.section-dots {
    position: fixed;
    right: clamp(14px, 2.4vw, 34px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 70;
    display: grid;
    gap: 14px;
}
.section-dots a {
    position: relative;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
}
.section-dots__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: rgba(233, 237, 245, .28);
    border: 1px solid rgba(233, 237, 245, .22);
    transition: background-color .3s var(--ease-out), transform .3s var(--ease-out),
                border-color .3s var(--ease-out);
}
.section-dots a:hover .section-dots__dot { background: rgba(233, 237, 245, .6); transform: scale(1.25); }
.section-dots a.is-active .section-dots__dot {
    background: var(--gold);
    border-color: var(--gold);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(216, 184, 120, .16);
}
.section-dots__label {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    font-size: 12px;
    letter-spacing: .12em;
    color: var(--text-2);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.section-dots a:hover .section-dots__label,
.section-dots a.is-active .section-dots__label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* 移动端不展示圆点 */
@media (max-width: 1100px) {
    .section-dots { display: none; }
}
body.menu-open .section-dots { opacity: 0; pointer-events: none; }

/* ---------- 通用文本组件 ---------- */
.eyebrow {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .22em;
    color: var(--muted);
    text-transform: uppercase;
}
.eyebrow__bar {
    width: 2px;
    height: 13px;
    background: #587da9;
    display: inline-block;
}

.section-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .02em;
    margin-top: var(--s-4);
}

.section-lead {
    margin-top: var(--s-4);
    max-width: 34em;
    color: var(--muted);
    font-size: 15px;
}

.section-head--split {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-5);
    margin-bottom: var(--s-7);
}
.section-head--split .section-title { margin-top: var(--s-3); }
.section-head--split .section-lead { margin-top: var(--s-3); }

/* 左置标题 + 下方按钮的区块头 */
.section-head--stack { margin-bottom: var(--s-7); }
.section-head--stack .section-title { margin-top: var(--s-3); }
.section-head--stack .section-lead { margin-top: var(--s-3); }
.section-head--stack .btn { margin-top: var(--s-5); }
.skills__head .btn, .journey__head .btn { margin-top: var(--s-5); }

.link-more {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 14px;
    color: var(--text-2);
    padding-bottom: var(--s-1);
    border-bottom: 1px solid var(--line);
    transition: color .3s var(--ease-out), border-color .3s var(--ease-out);
    white-space: nowrap;
}
.link-more:hover { color: var(--gold); border-color: var(--gold); }

.section-empty {
    padding: var(--s-8) var(--s-5);
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-md);
    color: var(--muted);
    text-align: center;
}
.section-empty--boxed { display: grid; justify-items: center; gap: var(--s-3); }
.section-empty--boxed .icon { width: 28px; height: 28px; color: var(--mist); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    padding: 13px 26px;
    border-radius: var(--r-full);
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: .04em;
    line-height: 1;
    white-space: nowrap;
    transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out),
                background-color .35s var(--ease-out), border-color .35s var(--ease-out),
                color .35s var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn--primary {
    background: #fff;
    color: #10131a;
    box-shadow: 0 8px 24px rgba(7, 11, 20, .18);
}
.btn--primary:hover {
    background: rgba(255, 255, 255, .92);
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(7, 11, 20, .28);
}

/* 幽灵按钮：深色半透明胶囊 + 浅描边（首屏「探索作品」） */
.btn--ghost {
    padding: 12px 24px;
    color: rgba(233, 237, 245, .92);
    background: rgba(11, 17, 30, .38);
    border: 1px solid rgba(233, 237, 245, .42);
    border-radius: var(--r-full);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.btn--ghost:hover {
    color: #fff;
    background: rgba(11, 17, 30, .55);
    border-color: rgba(233, 237, 245, .75);
    transform: translateY(-2px);
}
.btn--ghost:hover .btn__icon--shift { transform: translateX(4px); }
.btn--ghost .btn__icon { color: rgba(233, 237, 245, .75); }

.btn__icon { width: 18px; height: 18px; flex: none; }
.btn__icon--shift { transition: transform .35s var(--ease-out); }
.btn:hover .btn__icon--shift { transform: translateX(4px); }

.icon { width: 20px; height: 20px; flex: none; }
.icon--shift { transition: transform .35s var(--ease-out); }
a:hover > .icon--shift, .link-more:hover .icon--shift { transform: translateX(4px); }

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    color: var(--muted);
    transition: color .3s var(--ease-out), border-color .3s var(--ease-out),
                background-color .3s var(--ease-out);
}
.icon-link:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(216, 184, 120, .08);
}
.icon-link .icon { width: 17px; height: 17px; }

/* ---------- 导航 ---------- */
.site-nav {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 100;
    transition: background-color .4s var(--ease-out), border-color .4s var(--ease-out),
                box-shadow .4s var(--ease-out);
    border-bottom: 1px solid transparent;
    animation: navIn .9s var(--ease-out) both;
}
@keyframes navIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.site-nav.is-scrolled {
    background: rgba(7, 11, 20, .78);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
}

.site-nav__inner {
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
}

.site-nav__brand { display: inline-flex; align-items: center; }
.site-nav__logo {
    height: 40px;
    width: auto;
    transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.site-nav__brand:hover .site-nav__logo { opacity: .85; transform: translateY(-1px); }

.site-nav__links ul { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 30px); }
.site-nav__links a {
    position: relative;
    display: inline-block;
    padding: 6px 2px;
    font-size: 14px;
    color: var(--text-2);
    transition: color .3s var(--ease-out);
}
.site-nav__links a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
    transform: translateX(-50%);
    transition: width .35s var(--ease-out);
}
.site-nav__links a:hover { color: #fff; }
.site-nav__links a.is-active { color: #fff; }
.site-nav__links a.is-active::after { width: 18px; }

/* 汉堡按钮 */
.site-nav__toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    background: rgba(16, 24, 39, .5);
}
.site-nav__toggle .icon { width: 20px; height: 20px; }

/* 移动端全屏菜单 */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--nav-h) + var(--s-6)) var(--gutter) var(--s-7);
    background: rgba(7, 11, 20, .96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    opacity: 0;
    transition: opacity .35s var(--ease-out);
}
.mobile-menu[hidden] { display: none; }
body.menu-open { overflow: hidden; }
.mobile-menu.is-open { opacity: 1; }
.mobile-menu nav ul { display: grid; gap: var(--s-4); }
.mobile-menu nav a {
    display: flex;
    align-items: baseline;
    gap: var(--s-4);
    font-size: 26px;
    font-weight: 500;
    color: var(--text);
    opacity: 0;
    transform: translateY(14px);
}
.mobile-menu.is-open nav a {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .5s var(--ease-out) var(--menu-delay, 0ms),
                transform .5s var(--ease-out) var(--menu-delay, 0ms);
}
.mobile-menu__index { font-size: 12px; color: var(--gold); letter-spacing: .1em; }
.mobile-menu__foot { margin-top: var(--s-8); color: var(--muted); font-size: 13px; letter-spacing: .08em; }

/* ---------- 01 Hero ---------- */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    isolation: isolate;
    overflow: hidden;
}

.hero__media { position: absolute; inset: 0; z-index: -1; }

/* 完整铺满：封面裁剪展示，object-position 保住右侧人物主体 */
.hero__scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 66% 58%;
}

.hero__video-slot, .hero__video-slot video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.hero__video-slot video { object-fit: cover; object-position: 66% 58%; }
/* 淡入用 CSS animation（forwards）：与 JS 时序完全解耦，任何时序竞态都不可能
   把画面卡在透明态。动画 0.8s 后稳定在 opacity:1；JS 换源时重置动画即可 */
.hero__video-slot { opacity: 0; animation: heroVideoIn .8s ease-out 1.2s forwards; }
.hero__video-slot video { opacity: 0; animation: heroVideoIn .8s ease-out 1.2s forwards; }
@keyframes heroVideoIn { to { opacity: 1; } }

.hero__veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 11, 20, .72) 0%, rgba(7, 11, 20, .55) 28%, rgba(7, 11, 20, .28) 54%, rgba(7, 11, 20, .05) 74%, rgba(9, 14, 26, .16) 100%),
        linear-gradient(180deg, rgba(7, 11, 20, .42) 0%, rgba(7, 11, 20, .10) 24%, rgba(7, 11, 20, .12) 62%, rgba(7, 11, 20, .62) 100%);
}

.hero__inner { position: relative; width: 100%; padding-top: var(--nav-h); }

.hero__copy { max-width: 640px; }

.hero__title { margin-top: 0; line-height: 1.05; }
.hero__title-cn {
    font-family: var(--font-calligraphy);
    font-weight: 400;
    font-size: clamp(72px, 10vw, 132px);
    letter-spacing: -.01em;
    color: #fff;
    text-shadow: 0 6px 40px rgba(7, 11, 20, .6);
}

.hero__poem {
    margin-top: var(--s-4);
    font-family: var(--font-calligraphy);
    font-weight: 400;
    font-size: clamp(21px, 2.2vw, 30px);
    line-height: 1.9;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .96);
    text-shadow: 0 2px 18px rgba(7, 11, 20, .55);
}

.hero__intro {
    margin-top: var(--s-5);
    font-size: 15.5px;
    color: rgba(233, 237, 245, .82);
    letter-spacing: .05em;
}

.hero__tags { display: flex; flex-wrap: wrap; align-items: center; margin-top: var(--s-3); }
.hero__tags li {
    font-size: 13.5px;
    letter-spacing: .08em;
    color: rgba(233, 237, 245, .78);
}
.hero__tags li + li::before {
    content: "|";
    margin-inline: 18px;
    font-weight: 300;
    color: rgba(233, 237, 245, .32);
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-4);
    margin-top: var(--s-7);
}

.btn__play {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--r-full);
    background: rgba(11, 17, 30, .9);
    color: #fff;
}
.btn__play .icon { width: 13px; height: 13px; }

.hero__foot {
    position: absolute;
    inset-inline: 0;
    bottom: var(--s-6);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-5);
}

.hero__scroll {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .3em;
    transition: color .3s var(--ease-out);
}
.hero__scroll:hover { color: var(--text-2); }
.hero__scroll-mouse {
    width: 20px;
    height: 32px;
    border: 1.5px solid currentColor;
    border-radius: var(--r-full);
    display: inline-flex;
    justify-content: center;
    padding-top: 6px;
}
.hero__scroll-mouse span {
    width: 3px;
    height: 7px;
    border-radius: 2px;
    background: var(--gold);
    animation: scrollHint 2.2s var(--ease-out) infinite;
}
@keyframes scrollHint {
    0%   { transform: translateY(0); opacity: 1; }
    70%  { transform: translateY(9px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

.hero__progress { display: flex; align-items: center; gap: var(--s-4); }
.hero__progress-index { font-size: 12px; letter-spacing: .18em; color: var(--muted); }
.hero__progress-index b { color: var(--gold); font-weight: 500; }
.hero__progress-track {
    width: 120px;
    height: 1px;
    background: var(--line-strong);
    display: inline-block;
    position: relative;
    overflow: hidden;
}
.hero__progress-track i {
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--ease-out);
}

/* ---------- 02 About ---------- */
/* 紧凑横幅：上下留白由区块 padding 控制，不独占一屏（复刻设计稿） */
.about.section {
    min-height: 0;
    padding-block: var(--s-8);
}
.about__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.about__bg img {
    position: absolute;
    top: 0;
    left: 0;
    /* 右侧越界 3.5%：把素材右缘自带的亮竖条移出容器裁掉，避免右缘出现暗带
       （max-width 需置 none，否则全局 img{max-width:100%} 会把越界宽度压回 100%） */
    max-width: none;
    width: 103.5%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    opacity: .78;
    /* 左缘渐隐：融入正文区 */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 26%);
}
.about .container { position: relative; z-index: 1; }

.about__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
    gap: clamp(var(--s-6), 4vw, 72px);
    align-items: center;
}

.about__figure { position: relative; }
.about__figure img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
}
/* 手写批注直接压在照片右上：白字书法 + 签名（复刻设计稿） */
.about__note {
    position: absolute;
    top: 10%;
    right: 5%;
    max-width: 48%;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    text-align: left;
    text-shadow: 0 2px 16px rgba(4, 8, 18, .78);
}
.about__note-text {
    display: block;
    font-family: var(--font-calligraphy);
    font-size: clamp(17px, 1.5vw, 22px);
    color: rgba(255, 255, 255, .96);
    line-height: 1.6;
}
.about__note-sign {
    display: block;
    margin-top: var(--s-2);
    text-align: right;
    font-family: var(--font-calligraphy);
    font-size: clamp(14px, 1.2vw, 18px);
    color: rgba(255, 255, 255, .88);
    letter-spacing: .12em;
}

.about__heading {
    margin-top: var(--s-4);
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 600;
}
.about__lead { margin-top: var(--s-4); font-size: 15.5px; color: var(--text-2); }
.about__body { margin-top: var(--s-3); font-size: 15px; color: var(--muted); max-width: 40em; }

.about__principles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-3);
    margin-top: var(--s-7);
}
.principle { display: flex; gap: var(--s-3); align-items: flex-start; }
.principle__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    border: 0;
    background: #10233c;
    color: #cfe0f2;
    transition: background-color .3s var(--ease-out), transform .3s var(--ease-out);
}
.principle:hover .principle__icon { background: #16304f; transform: translateY(-3px); }
.principle__icon .icon { width: 18px; height: 18px; }
.principle__text strong { display: block; font-size: 14.5px; }
.principle__text em {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--muted);
    text-wrap: balance; /* 真放不下时也断成均匀两截，不甩孤字 */
}

/* ---------- 03 Skills ---------- */
/* 紧凑色带：紧随「关于」连续排布，不独占一屏（复刻设计稿） */
.skills.section {
    min-height: 0;
    padding-block: 48px;
}
.skills .section-title { font-size: clamp(24px, 2vw, 30px); }
.skills .section-lead { margin-top: var(--s-3); font-size: 14px; }
.skills__grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(var(--s-5), 3vw, var(--s-7));
    align-items: center;
}
.skills__head { position: static; }

/* 一行四张卡：卡片更宽，条目不易折行 */
.skills__cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-4);
}

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--s-5) var(--s-4);
    background: rgba(13, 21, 34, .72);
    border: 1px solid rgba(148, 163, 184, .10);
    border-radius: var(--r-md);
    transition: transform .4s var(--ease-out), border-color .4s var(--ease-out),
                background-color .4s var(--ease-out);
}
.skill-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    background: #101a2b;
}

/* 圆形彩色徽章：图标居于标题上方（复刻设计稿） */
.skill-card__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    background: rgba(96, 132, 255, .16);
    color: #6f9df2;
}
.skill-card:nth-child(2) .skill-card__icon { background: rgba(56, 208, 144, .14); color: #46d094; }
.skill-card:nth-child(3) .skill-card__icon { background: rgba(96, 132, 255, .16); color: #6f9df2; }
.skill-card:nth-child(4) .skill-card__icon { background: rgba(64, 212, 190, .15); color: #45d4be; }
.skill-card:nth-child(5) .skill-card__icon { background: rgba(141, 151, 171, .16); color: #b7c6d7; }
.skill-card__icon .icon { width: 20px; height: 20px; }
/* 图标与标题同行：徽章居左，名称/副标题居右 */
.skill-card__head {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    min-width: 0;
}
.skill-card__titles { min-width: 0; }
.skill-card__name { font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.skill-card__label { margin-top: 1px; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.skill-card__items {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 14px;
    margin-top: var(--s-4);
}
.skill-card__items li {
    font-size: 12.5px;
    color: var(--text-2);
    letter-spacing: .01em;
    line-height: 1.6;
    /* 长条目（如 HTML5 & CSS3 & JavaScript）允许在卡内换行，防止溢出叠字 */
    overflow-wrap: anywhere;
}
/* 省略提示：条目超出 4 条时显示，完整清单见完整技能页 */
.skill-card__more { color: var(--muted); letter-spacing: .2em; }

.btn--outline {
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: rgba(16, 24, 39, .35);
}
.btn--outline:hover {
    border-color: var(--mist);
    color: #fff;
    transform: translateY(-2px);
}

/* ---------- 04 Projects ---------- */
/* 图二复刻：头部左标题右「查看全部项目」 */
.section-head--projects {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-5);
    margin-bottom: var(--s-6);
}
.section-head--projects .section-title { margin-top: var(--s-3); }

.projects__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 2px;
    font-size: 13.5px;
    letter-spacing: .04em;
    color: var(--text-2);
    white-space: nowrap;
    transition: color .3s var(--ease-out);
}
.projects__more .icon { width: 16px; height: 16px; transition: transform .3s var(--ease-out); }
.projects__more:hover { color: var(--gold); }
.projects__more:hover .icon { transform: translateX(4px); }

.projects__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-5);
}

/* 内容常显卡片：封面 + 标题 + 简介 + 标签行（复刻图二） */
.project-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-3);
    transition: transform .4s var(--ease-out), border-color .4s var(--ease-out),
                box-shadow .4s var(--ease-out);
}
.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-1);
}

.project-card__media {
    display: block;
    aspect-ratio: 2 / 1; /* 封面图实测 1440×715（≈2:1），容器同比例可无裁切铺满 */
    overflow: hidden;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
}
.project-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease-out), filter .8s var(--ease-out);
}
.project-card:hover .project-card__media img { transform: scale(1.05); filter: brightness(1.07); }
.project-card__media--empty { display: grid; place-items: center; }
.project-card__placeholder { color: var(--muted); }

.project-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--s-4);
}

.project-card__title { font-size: 16.5px; font-weight: 600; line-height: 1.4; }
.project-card__title a { transition: color .3s var(--ease-out); }
.project-card__title a:hover { color: var(--gold); }

.project-card__summary {
    margin-top: var(--s-2);
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片底部行：无标签，圆形箭头靠右 */
.project-card__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-3);
    margin-top: auto;
    padding-top: var(--s-4);
}

/* 图二标签胶囊：深蓝底 + 浅蓝字 */
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-list li {
    font-size: 12px;
    color: #9db9ff;
    background: rgba(96, 132, 255, .13);
    padding: 4px 13px;
    border-radius: var(--r-full);
    letter-spacing: .03em;
    white-space: nowrap;
}

/* 右下角圆形箭头按钮（图二） */
.project-card__go {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-full);
    color: var(--text-2);
    transition: color .3s var(--ease-out), border-color .3s var(--ease-out),
                background-color .3s var(--ease-out);
}
.project-card__go .icon { width: 15px; height: 15px; transition: transform .3s var(--ease-out); }
.project-card__go:hover {
    color: #0b111e;
    border-color: var(--gold);
    background: var(--gold);
}
.project-card__go:hover .icon { transform: translateX(2px); }

/* ---------- 全部项目独立页 ---------- */
body.is-projects-page .section-dots { display: none; }
.projects--page { min-height: calc(100svh - var(--nav-h)); }

/* ---------- 完整经历独立页 ---------- */
body.is-journey-page .section-dots { display: none; }
.journey--page { min-height: calc(100svh - var(--nav-h)); }
.journey--page .journey__art { display: none; }
.journey--page .timeline { margin-top: var(--s-6); }

/* 精选角标：全部项目页区分首页精选条目 */
.project-card__flag {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    min-height: 18px;
    font-size: 11.5px;
    letter-spacing: .1em;
}
.project-card__flag-star { color: var(--gold); }
.project-card__flag-year { color: var(--muted); }
.project-card__flag + .project-card__title { margin-top: var(--s-1); }

/* ---------- 05 Journey ---------- */
.journey__grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(var(--s-6), 4vw, var(--s-8));
    align-items: start;
    position: relative;
    z-index: 1;
}
.journey__head { position: sticky; top: calc(var(--nav-h) + var(--s-5)); }

.journey__art {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: clamp(220px, 44%, 400px);
    pointer-events: none;
    z-index: 0;
}
/* 山景上压一层左深右浅的暗色渐变，保证左侧标题与时间轴文字可读 */
.journey__art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(9, 13, 24, .88) 0%,
        rgba(9, 13, 24, .62) 46%,
        rgba(9, 13, 24, .12) 100%);
}
.journey__art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 78% center;
    opacity: .92;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 42%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 42%);
}

.timeline { position: relative; display: grid; gap: var(--s-6); }
.timeline::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 137px;
    width: 1px;
    background: var(--line);
}

.timeline__item {
    display: grid;
    grid-template-columns: 110px 54px minmax(0, 1fr);
    align-items: baseline;
}
.timeline__meta { display: grid; gap: 6px; justify-items: start; }
.timeline__period { font-size: 13px; letter-spacing: .08em; color: var(--gold); white-space: nowrap; }
.timeline__cat {
    font-size: 11px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    padding: 1px 8px;
    letter-spacing: .1em;
}
.timeline__dot {
    position: relative;
    align-self: start;
    justify-self: center;
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--gold);
    box-shadow: 0 0 0 4px rgba(216, 184, 120, .12);
}
.timeline__title { font-size: 16.5px; font-weight: 600; }
.timeline__desc { margin-top: var(--s-2); font-size: 14px; color: var(--muted); max-width: 40em; }

/* ---------- 06 Notes ---------- */
.notes__filter { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-6); }
.chip {
    padding: 7px 18px;
    font-size: 13px;
    letter-spacing: .06em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    transition: color .3s var(--ease-out), border-color .3s var(--ease-out),
                background-color .3s var(--ease-out);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active {
    color: #0b111e;
    background: var(--gold);
    border-color: var(--gold);
    font-weight: 500;
}

/* 左窄栏（标题+按钮）+ 右侧四张紧凑卡片一行排布 */
.notes__grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(var(--s-6), 4vw, var(--s-8));
    align-items: center;
}
.notes__head .btn { margin-top: var(--s-5); }

.notes__cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-4);
}

/* 卡片 = 深色面板：图片贴住上/左/右边缘，标题与类别/日期在面板下方 */
.note-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 0 14px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    transition: transform .35s var(--ease-out), border-color .35s var(--ease-out),
                background-color .35s var(--ease-out);
}
.note-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    background: #121b2c;
}
.note-card[hidden] { display: none; }
@keyframes noteIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.note-card__media {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--bg-2);
    position: relative;
}
.note-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease-out);
}
.note-card:hover .note-card__media img { transform: scale(1.04); }
.note-card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }

.note-card__body { padding: 14px 14px 16px; }
.note-card__meta { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); font-size: 12px; }
.note-card__cat {
    display: inline-block;
    padding: 2px 11px;
    border: 1px solid rgba(157, 180, 208, .38);
    border-radius: var(--r-full);
    color: var(--mist);
    letter-spacing: .1em;
    font-size: 11px;
}
.note-card__date { color: var(--muted); letter-spacing: .06em; }
.note-card__title { margin-top: var(--s-1); font-size: 15.5px; font-weight: 600; line-height: 1.45; }
.note-card__title a { transition: color .3s var(--ease-out); }
.note-card__title a:hover { color: var(--gold); }

/* 文章列表页（notes.php）：复用首页卡片网格 */
.notes__grid--page {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    margin-top: var(--s-6);
}
.notes--page { min-height: calc(100svh - var(--nav-h)); }
.notes--page .note-card__excerpt {
    margin-top: var(--s-2);
    font-size: 13px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 1100px) {
    .notes__grid--page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .notes__grid--page { grid-template-columns: 1fr; }
}

/* 文章详情页（note.php） */
.note-detail { min-height: 100svh; display: block; }
.note-detail__body { margin-top: var(--s-6); }
.note-detail__body p { font-size: 15.5px; line-height: 2.1; color: var(--text-2); max-width: 42em; }
.note-detail__adj {
    margin-top: var(--s-8);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-4);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
}
.note-detail__adj-link {
    display: grid;
    gap: 4px;
    padding: var(--s-4);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: rgba(16, 24, 39, .5);
    transition: border-color .3s var(--ease-out), transform .3s var(--ease-out);
}
.note-detail__adj-link:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.note-detail__adj-link--next { justify-items: end; text-align: right; }
.note-detail__adj-label { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.note-detail__adj-title { font-size: 14.5px; font-weight: 500; color: var(--text-2); }
@media (max-width: 640px) {
    /* 移动端保持左右布局：仅压缩内边距，标题可能较长需允许换行省略 */
    .note-detail__adj { gap: var(--s-3); }
    .note-detail__adj-link { padding: var(--s-3); }
    .note-detail__adj-title { font-size: 13px; }
    .note-detail__adj-link span { overflow-wrap: anywhere; }
}

/* ---------- 07 Contact（全宽山景横幅） ---------- */
.contact {
    position: relative;
    overflow: hidden;
    margin-top: 0;
    border-block: 1px solid var(--line);
    background: var(--bg-2);
    padding-block: var(--s-7);
}
.contact__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.contact__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
    opacity: .9;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 32%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 32%);
}
/* 山景之上再压一层暗色，保证文字可读 */
.contact::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7, 11, 20, .82) 0%, rgba(7, 11, 20, .45) 46%, rgba(7, 11, 20, .18) 100%);
    pointer-events: none;
}

.contact__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-7);
    text-align: left;
}
.contact__heading {
    margin-top: var(--s-3);
    font-size: clamp(22px, 2.6vw, 30px);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .02em;
}
.contact__lead { margin-top: var(--s-2); color: var(--muted); font-size: 13.5px; }

.contact__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3) var(--s-4);
    margin-top: var(--s-5);
}
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0;
    color: var(--text-2);
    font-size: 13.5px;
    letter-spacing: .03em;
    transition: color .3s var(--ease-out);
}
.contact-link .icon { width: 17px; height: 17px; color: var(--mist); transition: color .3s var(--ease-out); }
.contact-link:hover { color: #fff; }
.contact-link:hover .icon { color: var(--gold); }
.contact-link--icon {
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    transition: border-color .3s var(--ease-out), transform .3s var(--ease-out);
}
.contact-link--icon:hover { border-color: var(--gold); transform: translateY(-2px); }
.contact-link--icon .icon { width: 15px; height: 15px; }

.contact__slogan {
    margin: 0;
    flex-shrink: 0;
    align-self: center;
    max-width: 13em;
    font-family: var(--font-calligraphy);
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.7;
    letter-spacing: .14em;
    color: rgba(240, 224, 196, .82);
    text-align: right;
    transform: rotate(-2deg);
    text-shadow: 0 4px 26px rgba(4, 8, 18, .7);
    pointer-events: none;
}
.contact__slogan-line { display: inline; }
.contact__slogan-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    vertical-align: -6px;
    color: rgba(240, 224, 196, .75);
    transform: rotate(12deg);
}

/* 复制成功提示 */
.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    z-index: 150;
    transform: translate(-50%, 16px);
    padding: 10px 22px;
    background: var(--bg-3);
    border: 1px solid var(--gold);
    border-radius: var(--r-full);
    color: var(--gold);
    font-size: 13px;
    letter-spacing: .08em;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.copy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 08 Footer（单行式页脚） ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    padding-block: var(--s-5);
}

.site-footer__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4) var(--s-6);
}

.site-footer__brand {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--s-2) var(--s-4);
}
.site-footer__name { font-size: 15px; font-weight: 600; letter-spacing: .08em; }
.site-footer__slash { color: var(--muted); margin-inline: 6px; font-weight: 300; }
.site-footer__en { font-size: 12px; color: var(--muted); letter-spacing: .22em; }
.site-footer__copy { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

.site-footer__side {
    display: flex;
    align-items: center;
    gap: var(--s-5);
}

.site-footer__beian {
    display: flex;
    gap: var(--s-5);
    margin-top: var(--s-3);
    font-size: 12px;
    color: var(--muted);
}
.site-footer__beian a { transition: color .3s var(--ease-out); }
.site-footer__beian a:hover { color: var(--text-2); }

.back-top {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-full);
    background: rgba(16, 24, 39, .8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text-2);
    transition: color .3s var(--ease-out), border-color .3s var(--ease-out),
                transform .3s var(--ease-out);
}
.back-top:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-2px); }
.back-top .icon { width: 16px; height: 16px; }

/* ---------- 项目详情页（统一新风格） ---------- */
.container--narrow { max-width: 860px; }

/* 子页与文章列表页均无分屏区块，隐藏右侧圆点导航 */
body.is-subpage .section-dots { display: none; }
body.is-notes-page .section-dots { display: none; }

.project-detail { min-height: 100svh; display: block; }

.detail-back { margin-bottom: var(--s-7); }
.icon--flip { transform: rotate(180deg); }
.detail-back:hover .icon--flip { transform: rotate(180deg) translateX(4px); }

.detail-title {
    margin-top: var(--s-4);
    font-size: clamp(30px, 4.4vw, 46px);
    font-weight: 600;
    line-height: 1.25;
}
.detail-meta {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    margin-top: var(--s-4);
    font-size: 13px;
    letter-spacing: .12em;
}
.detail-meta__type { color: var(--gold); }
.detail-meta__year { color: var(--muted); }

.detail-cover {
    margin-top: var(--s-7);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
}
.detail-cover img { width: 100%; object-fit: cover; aspect-ratio: 16 / 9; }

.detail-story { margin-top: var(--s-7); display: grid; gap: var(--s-4); }
.detail-story p { font-size: 15px; line-height: 2; color: var(--text-2); }

.detail-facts {
    margin: var(--s-7) 0 0;
    display: grid;
    gap: var(--s-3);
    padding: var(--s-5) var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(16, 24, 39, .5);
}
.detail-fact { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-4); align-items: baseline; }
.detail-fact dt { font-size: 12.5px; color: var(--muted); letter-spacing: .1em; }
.detail-fact dd { margin: 0; font-size: 14px; color: var(--text-2); }

.detail-tags { margin-top: var(--s-6); }

.detail-links { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-6); }

.detail-gallery { margin-top: var(--s-8); }
.detail-gallery__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--s-5);
    padding-left: var(--s-3);
    border-left: 2px solid var(--gold);
}
.detail-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-4);
}
.detail-gallery__item {
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-3);
}
.detail-gallery__item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* 内嵌实时演示 */
.detail-demo { margin-top: var(--s-8); }
.detail-demo__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.detail-gallery__title--flush { margin-bottom: 0; }
.detail-demo__head .link-more { margin-bottom: var(--s-5); }
.detail-demo__frame {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #04070e;
    aspect-ratio: 16 / 9;
}
.detail-demo__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.detail-demo__hint {
    margin-top: var(--s-3);
    font-size: 12.5px;
    color: var(--muted);
}
.detail-demo__hint a { color: var(--mist); transition: color .3s var(--ease-out); }
.detail-demo__hint a:hover { color: var(--gold); }

/* 内嵌项目视频 */
.detail-video { margin-top: var(--s-8); }
.detail-video__frame {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #04070e;
    aspect-ratio: 16 / 9;
}
.detail-video__frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 使用说明 */
.detail-usage { margin-top: var(--s-8); }
.detail-usage__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--s-3);
    counter-reset: usage;
}
.detail-usage__list li {
    position: relative;
    padding-left: 40px;
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--text-2);
    counter-increment: usage;
}
.detail-usage__list li::before {
    content: counter(usage, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--gold);
    border: 1px solid rgba(216, 184, 120, .4);
    border-radius: var(--r-full);
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
}

/* 代码块 */
.detail-code { margin-top: var(--s-8); }
.code-block {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    background: #0a0f1c;
}
.code-block__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: 10px 16px;
    background: rgba(16, 24, 39, .9);
    border-bottom: 1px solid var(--line);
}
.code-block__lang {
    font-size: 12.5px;
    letter-spacing: .08em;
    color: var(--mist);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.code-block__copy {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--gold);
    border: 1px solid rgba(216, 184, 120, .45);
    border-radius: var(--r-full);
    transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.code-block__copy:hover { background: rgba(216, 184, 120, .12); }
.code-block__copy.is-copied { color: #7fc79a; border-color: rgba(127, 199, 154, .5); }
.code-block__pre {
    margin: 0;
    padding: var(--s-5);
    overflow: auto;
    max-height: 560px;
}
.code-block__pre code {
    display: block;
    font-family: Consolas, "JetBrains Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.9;
    color: #c9d4e8;
    white-space: pre;
    tab-size: 4;
    counter-reset: codeline;
}
.code-block__pre code span[data-line] {
    display: block;
    counter-increment: codeline;
    padding-left: 44px;
    position: relative;
}
.code-block__pre code span[data-line]::before {
    content: counter(codeline);
    position: absolute;
    left: 0;
    width: 32px;
    text-align: right;
    color: rgba(141, 151, 171, .45);
    font-size: 11.5px;
    user-select: none;
}

/* 语法高亮（深色主题） */
.hl-comment { color: #6a7a94; font-style: italic; }
.hl-string  { color: #a8d8a8; }
.hl-keyword { color: #82aaff; font-weight: 500; }
.hl-var     { color: #f0c987; }
.hl-num     { color: #e8a3c0; }
.hl-builtin { color: #9dd0ff; }
.hl-attr    { color: #d8b878; }

@media (max-width: 640px) {
    .detail-gallery__grid { grid-template-columns: 1fr; }
    .detail-fact { grid-template-columns: 1fr; gap: 2px; }
    .detail-demo__frame { aspect-ratio: 4 / 3; }
    .code-block__pre code { font-size: 12px; line-height: 1.8; }
    .code-block__pre code span[data-line] { padding-left: 36px; }
    .code-block__pre code span[data-line]::before { width: 26px; font-size: 10.5px; }
}

/* ---------- 图片加载失败后备 ---------- */
.has-broken-img { position: relative; }
.has-broken-img > img { display: none; }
.has-broken-img::after {
    content: "图片正在路上 · IMAGE COMING SOON";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    letter-spacing: .18em;
    color: var(--muted);
    background: linear-gradient(135deg, #0d1526, #0a0f1c);
    border-radius: inherit;
}

/* ---------- 滚动显现 ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity var(--dur-2) var(--ease-out) var(--reveal-delay, 0s),
                transform var(--dur-2) var(--ease-out) var(--reveal-delay, 0s);
    will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* Hero 文案入场（进入页面即触发） */
.hero [data-reveal].is-visible { will-change: auto; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .skills__grid, .journey__grid { grid-template-columns: 1fr; }
    .journey__head { position: static; }
    .skills__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .notes__grid { grid-template-columns: 1fr; gap: var(--s-6); }
    .notes__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .about__grid { grid-template-columns: 1fr; gap: var(--s-7); }
    .about__note { right: var(--s-4); }
    .contact__inner { flex-direction: column; align-items: flex-start; gap: var(--s-6); }
    .contact__slogan { max-width: none; text-align: left; }
    .contact__slogan-icon { vertical-align: -5px; }
}

@media (max-width: 900px) {
    .section { padding-block: var(--s-9); }
    .timeline::before { left: 5px; }
    .timeline__item { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); padding-left: var(--s-6); }
    .timeline__dot { position: absolute; left: 1px; margin-top: 7px; }
    .timeline__item { position: relative; }
    .timeline__meta { grid-auto-flow: column; justify-content: start; align-items: center; }
}

@media (max-width: 768px) {
    :root { --nav-h: 64px; }

    /* 移动端取消「每区块独占一屏」：内容自然流式，高度自适应 */
    .section {
        min-height: 0;
        display: block;
        padding-block: var(--s-8);
    }
    .hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }

    .site-nav__links { display: none; }
    .site-nav__toggle { display: inline-flex; }
    .hero__inner { padding-top: calc(var(--nav-h) + var(--s-2)); padding-bottom: var(--s-8); }
    .hero__scene, .hero__video-slot video { object-position: 70% center; }
    .hero__foot { bottom: var(--s-5); }
    .hero__progress-track { width: 64px; }
    .hero__cta .btn { padding: 12px 22px; }
    .section-head--split { flex-direction: column; align-items: flex-start; }
    .section-head--projects { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
    .projects__grid { grid-template-columns: 1fr; }
    .skills__cards { grid-template-columns: 1fr; }
    .skills__items-grid { grid-template-columns: 1fr; }
    .about__principles { grid-template-columns: 1fr; gap: var(--s-4); }
    .about__figure { margin-inline: 0; }
    .about__note { right: var(--s-4); top: 12%; max-width: 58%; }
    .journey__art { height: 200px; }
    .timeline__item { padding-block: var(--s-4); }
    .timeline__title { font-size: 15.5px; }
    .timeline__desc { font-size: 13.5px; }
    .note-card__title { font-size: 15.5px; }
    .note-card__media { aspect-ratio: 16 / 9; }
    .contact__heading { font-size: clamp(26px, 7.6vw, 34px); }
    .contact__links { gap: var(--s-4); }
    .contact-link { font-size: 13.5px; }
    .detail-gallery__grid { grid-template-columns: 1fr; }
    /* 页脚：品牌区竖排靠左，回顶按钮固定右侧，同行不换行 */
    .site-footer__bar {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--s-4);
    }
    .site-footer__brand {
        flex: 1;
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .site-footer__side { flex-wrap: nowrap; flex: none; }
}

@media (max-width: 480px) {
    body { font-size: 15px; }
    .section { padding-block: var(--s-7); }
    .hero__title-cn { font-size: clamp(64px, 20vw, 88px); }
    .hero__poem { letter-spacing: .08em; }
    .hero__tags li + li::before { margin-inline: 8px; }
    .hero__cta { gap: var(--s-3); }
    .hero__cta .btn { flex: 1; justify-content: center; padding-inline: 12px; font-size: 13px; white-space: nowrap; }
    .section-title { font-size: 26px; }
    .project-card__summary { -webkit-line-clamp: 3; }
    .tag-list li { font-size: 11px; padding: 3px 10px; }
    .contact__links { gap: var(--s-3); }
    .notes__cards { grid-template-columns: 1fr; }
    .stat__num b { font-size: 22px; }
}

/* ---------- Markdown 正文排版（文章全文 / 项目故事） ---------- */
.md-prose { max-width: 42em; }
.md-prose > * + * { margin-top: var(--s-4); }
.md-prose h1, .md-prose h2, .md-prose h3, .md-prose h4 {
    margin-top: var(--s-7);
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text);
    line-height: 1.4;
    scroll-margin-top: calc(var(--nav-h, 72px) + 16px);
}
.md-prose h1 { font-size: 22px; }
.md-prose h2 { font-size: 19px; }
.md-prose h3 { font-size: 16.5px; }
.md-prose h4 { font-size: 15px; }
.md-prose p { font-size: 15.5px; line-height: 2.1; color: var(--text-2); }
.md-prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(216, 184, 120, .4); }
.md-prose a:hover { text-decoration-color: var(--gold); }
.md-prose strong { color: var(--text); font-weight: 600; }
.md-prose del { color: var(--muted); }
.md-prose ul, .md-prose ol { padding-left: 1.5em; display: grid; gap: 6px; }
.md-prose ul { list-style: disc; }
.md-prose ol { list-style: decimal; }
.md-prose li { font-size: 15px; line-height: 1.9; color: var(--text-2); }
.md-prose li::marker { color: var(--gold); font-size: .92em; }
.md-prose blockquote {
    border-left: 2px solid rgba(216, 184, 120, .55);
    padding: 2px 0 2px var(--s-4);
    color: var(--mist, #9db4d0);
}
.md-prose blockquote p { color: inherit; }
.md-prose img { border-radius: var(--r-md, 12px); border: 1px solid var(--line); }
.md-prose hr { border: 0; border-top: 1px solid var(--line); margin-block: var(--s-6); }
.md-prose code {
    font-family: Consolas, "JetBrains Mono", "Courier New", monospace;
    font-size: .88em;
    color: var(--gold);
    background: rgba(216, 184, 120, .08);
    border: 1px solid rgba(216, 184, 120, .22);
    border-radius: 6px;
    padding: 2px 7px;
    white-space: nowrap;
}
/* 行内代码在代码块标题栏内不重复着色 */
.md-prose .code-block .code-block__lang { letter-spacing: .08em; }
.md-prose .code-block { margin-top: var(--s-5); }
.md-prose pre code { border: 0; background: none; padding: 0; white-space: pre; color: inherit; font-size: inherit; }

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
    .site-nav { animation: none; }
    .hero__scroll-mouse span { animation: none; }
}
