:root {
    --bg: #0b0e13;
    --surface: #11151d;
    --surface-2: #161b25;
    --text: #eef1f6;
    --muted: #97a2b3;
    --faint: #6b7686;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #7aa5ff;
    --accent-soft: rgba(122, 165, 255, 0.12);
    --gold: #e0b872;
    --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Noto Serif SC', 'Songti SC', 'STSong', 'Georgia', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

::selection { background: var(--accent); color: #0b0e13; }
::-moz-selection { background: var(--accent); color: #0b0e13; }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #242c38; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3b4657; }

body {
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(1100px 560px at 50% -8%, rgba(122, 165, 255, 0.16), transparent 62%),
        radial-gradient(820px 480px at 100% 6%, rgba(224, 184, 114, 0.12), transparent 58%),
        radial-gradient(760px 460px at 0% 40%, rgba(122, 165, 255, 0.08), transparent 60%);
    background-size:
        44px 44px,
        44px 44px,
        auto,
        auto,
        auto;
    background-repeat:
        repeat,
        repeat,
        no-repeat,
        no-repeat,
        no-repeat;
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- 顶部导航 ---------- */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px clamp(24px, 5vw, 64px);
    transition: background 0.35s ease, padding 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
    border-bottom: 1px solid transparent;
}
.top-nav.scrolled {
    background: rgba(11, 14, 19, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border-bottom-color: var(--line);
    padding: 13px clamp(24px, 5vw, 64px);
}
.brand {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
    text-decoration: none;
}
.brand-dot { color: var(--accent); }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 99px;
    transition: color 0.25s, background 0.25s;
    position: relative;
}
.nav-link:hover { color: #fff; }
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    height: 100vh;
    min-height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: -4% 0;
    background-image: url('background_1.jpg');
    background-size: cover;
    background-position: center;
    opacity: 1;
    will-change: transform, opacity;
    transform: scale(1.06);
    z-index: 0;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at 50% 22%, rgba(11, 14, 19, 0.1) 0%, rgba(11, 14, 19, 0.55) 78%),
        linear-gradient(180deg, rgba(11, 14, 19, 0.5) 0%, rgba(11, 14, 19, 0.12) 34%, rgba(11, 14, 19, 0.62) 72%, var(--bg) 100%);
}
.hero-grain {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.14;
    pointer-events: none;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 820px;
    padding: 96px 28px 56px;
    will-change: opacity, transform;
}
.hero-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 11px;
    letter-spacing: 0.34em;
    color: rgba(255, 255, 255, 0.68);
    margin-bottom: 30px;
}
.hero-eyebrow span {
    display: inline-block;
    width: 42px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
}
.hero-avatar {
    width: 164px;
    height: 164px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 24px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.45);
}
.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}
.hero-name {
    font-family: var(--font-display);
    font-size: clamp(58px, 10vw, 100px);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.02;
    color: #fff;
    text-shadow: 0 8px 60px rgba(0, 0, 0, 0.5);
}
.hero-motto-box {
    max-width: 700px;
    margin: 22px auto 0;
}
.motto {
    font-family: var(--font-display);
    font-size: clamp(19px, 2.8vw, 26px);
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 3px 30px rgba(0, 0, 0, 0.55);
}
.motto::after {
    content: "|";
    margin-left: 3px;
    color: var(--accent);
    animation: blink 0.8s step-end infinite;
}
.motto-author {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 13px;
    letter-spacing: 0.22em;
}
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 34px;
}
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 24px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.hero-btn.primary {
    background: #fff;
    color: #0b0e13;
}
.hero-btn.primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(122, 165, 255, 0.35);
}
.hero-btn.ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.hero-btn.ghost:hover {
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}
.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.55);
    will-change: opacity;
}
.scroll-line {
    width: 1px;
    height: 44px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
    animation: scrollLine 2s ease-in-out infinite;
}
.scroll-text {
    font-size: 10px;
    letter-spacing: 0.3em;
}

/* ---------- 内容区 ---------- */
.content-container {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px) 60px;
}
.section {
    padding: 78px 0;
    border-bottom: 1px solid var(--line);
}
.section:last-of-type { border-bottom: 0; }

.section-head {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
}
.section-index {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--accent);
    padding-top: 6px;
    letter-spacing: 0.06em;
}
.section-title {
    font-size: clamp(26px, 3.6vw, 34px);
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #fff;
    line-height: 1.1;
}
.section-title-en {
    display: block;
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--faint);
    margin-top: 8px;
    font-weight: 500;
}

/* 滚动入场 */
html.js .section.reveal {
    opacity: 0;
    transform: translateY(30px);
}
html.js .section.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* 关于我 */
.lead {
    font-size: clamp(17px, 2vw, 20px);
    color: #e6e9ee;
    line-height: 1.9;
    max-width: 760px;
}
.about-text {
    color: var(--muted);
    margin-top: 16px;
    max-width: 720px;
}
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0 20px;
}
.tag {
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #cdd4de;
    padding: 8px 15px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
    transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.tag:hover {
    border-color: rgba(122, 165, 255, 0.5);
    color: #fff;
    background: var(--accent-soft);
}
.github-snake {
    width: 100%;
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #0d1117;
}

/* OC */
.oc-layout {
    display: flex;
    gap: 28px;
    align-items: center;
}
.oc-wrapper {
    width: min(220px, 100%);
    border-radius: 18px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}
.oc-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.5s ease;
}
.oc-wrapper:hover .oc-image { transform: scale(1.07); }
.oc-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}
.oc-name-en { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 作品区 */
.works-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}
.work-card {
    display: grid;
    grid-template-columns: 330px 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.work-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.9);
}
.work-preview {
    position: relative;
    min-height: 230px;
    overflow: hidden;
    background: #0d1117;
    cursor: pointer;
}
.work-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.work-card:hover .work-preview img { transform: scale(1.06); }
.work-preview-placeholder {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 40px;
    gap: 8px;
}
.work-preview-placeholder.show { display: flex; }
.work-preview-placeholder span {
    font-size: 12px;
    letter-spacing: 0.2em;
}
.work-preview-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.34));
    pointer-events: none;
}
.work-info {
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}
.work-title {
    color: #fff;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.work-title-sub {
    font-weight: 400;
    font-size: 14px;
    color: var(--faint);
    margin-left: 8px;
}
.work-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.8;
}
.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}
.work-tag {
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 5px 12px;
    border-radius: 99px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: #aeb8c6;
}
.work-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}
.work-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent-soft);
    color: #b9cdff;
    padding: 8px 18px;
    border-radius: 99px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(122, 165, 255, 0.32);
    transition: all 0.25s ease;
}
.work-btn:hover {
    background: var(--accent);
    color: #0b0e13;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(122, 165, 255, 0.28);
}
.work-btn.secondary {
    background: rgba(224, 184, 114, 0.1);
    color: #ecd0a0;
    border-color: rgba(224, 184, 114, 0.32);
}
.work-btn.secondary:hover {
    background: var(--gold);
    color: #1a1308;
    box-shadow: 0 10px 26px rgba(224, 184, 114, 0.28);
}
.work-status {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 99px;
    display: inline-block;
    font-weight: 500;
}
.work-status.wip {
    background: rgba(224, 184, 114, 0.1);
    color: #ecd0a0;
    border: 1px solid rgba(224, 184, 114, 0.32);
}

/* GitHub 仓库卡片 */
.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}
.repo-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.repo-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    background: var(--surface-2);
}
.repo-name {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.repo-name i { color: var(--accent); }
.repo-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
    flex: 1;
    min-height: 44px;
}
.repo-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--faint);
    margin-top: 2px;
    flex-wrap: wrap;
}
.repo-meta .lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    vertical-align: -1px;
}
.repo-meta i { margin-right: 3px; }
.repo-err { color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }

/* 联系方式 / 链接 */
.contact-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 48px;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}
.contact-item i {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--accent);
    font-size: 14px;
}
.contact-item a {
    color: #c7cdd8;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.25s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.contact-item a:hover { color: #fff; }
.quote-container {
    margin: 20px 0;
    padding: 20px 22px;
    border-left: 3px solid var(--gold);
    background: rgba(224, 184, 114, 0.07);
    border-radius: 0 12px 12px 0;
}
.quote-container p {
    font-family: var(--font-display);
    color: #ecd0a0;
    font-size: 16px;
    letter-spacing: 0.03em;
}

/* 赛博乞讨 */
.pay-grid {
    display: flex;
    gap: 28px;
}
.pay-item { text-align: center; font-size: 13px; color: var(--muted); }
.pay-item img {
    width: 132px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    border-radius: 16px;
    background: #fff;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pay-item img:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8);
}
.pay-item p { margin-top: 10px; }

/* 页脚 */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 44px 20px 48px;
    color: var(--faint);
    font-size: 13px;
    border-top: 1px solid var(--line);
}
.footer-sub {
    margin-top: 8px;
    font-size: 11px;
    letter-spacing: 0.28em;
    color: #4b5462;
    text-transform: uppercase;
}
.site-footer .fa-heart { color: var(--gold); animation: heartBeat 1.2s ease infinite; }

/* 返回顶部 */
.back-to-top {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(17, 21, 29, 0.85);
    border: 1px solid var(--line);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: 0.35s ease;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #0b0e13;
}

/* 阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    z-index: 1000;
}

/* 图片模态框 */
.image-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 9, 0.94);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.modal-content {
    max-width: 86%;
    max-height: 86%;
    border-radius: 16px;
    animation: zoomIn 0.3s ease;
}
.modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 42px;
    line-height: 1;
    color: #9aa3b2;
    background: none;
    border: none;
    cursor: pointer;
    transition: 0.25s;
    z-index: 10001;
}
.modal-close:hover { color: var(--accent); transform: rotate(90deg) scale(1.1); }

/* 动画 */
@keyframes blink { 50% { opacity: 0; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.82); } to { opacity: 1; transform: scale(1); } }
@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
    35% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    70% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    40% { transform: scale(1); }
    60% { transform: scale(1.15); }
}

/* 响应式 */
@media (max-width: 820px) {
    .work-card {
        grid-template-columns: 1fr;
    }
    .work-preview {
        min-height: 0;
        height: 210px;
    }
    .contact-list {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    .top-nav {
        padding: 16px 20px;
    }
    .top-nav.scrolled {
        padding: 11px 20px;
    }
    .hero {
        min-height: 560px;
    }
    .hero-content {
        padding-top: 76px;
    }
    .hero-eyebrow span {
        width: 22px;
    }
    .section {
        padding: 58px 0;
    }
    .oc-layout {
        flex-direction: column;
        align-items: flex-start;
    }
    .repo-grid {
        grid-template-columns: 1fr;
    }
}
