/* ===== 设计变量 ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --accent: #00f5d4;
    --accent-secondary: #7b2cbf;
    --text-primary: #f0f0f5;
    --text-muted: #8b8b9e;
    --border: rgba(0, 245, 212, 0.2);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Noto Sans SC', sans-serif;
}

/* ===== 重置与基础 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body.login-locked {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* ===== 粒子背景 ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 245, 212, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(123, 44, 191, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(0, 245, 212, 0.05), transparent);
}

/* ===== 登录覆盖层 ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at top, rgba(0, 245, 212, 0.08), transparent 60%),
                radial-gradient(circle at bottom, rgba(123, 44, 191, 0.12), transparent 65%),
                rgba(3, 4, 10, 0.96);
    backdrop-filter: blur(18px);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    position: relative;
    max-width: 420px;
    width: 100%;
    padding: 2.2rem 2.4rem 2rem;
    background: linear-gradient(145deg, rgba(10, 10, 20, 0.95), rgba(10, 15, 30, 0.98));
    border-radius: 18px;
    border: 1px solid rgba(0, 245, 212, 0.25);
    box-shadow:
        0 0 40px rgba(0, 245, 212, 0.18),
        0 24px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: -40%;
    background-image: radial-gradient(circle at 10% 20%, rgba(0, 245, 212, 0.08), transparent 55%),
                      radial-gradient(circle at 80% 80%, rgba(123, 44, 191, 0.16), transparent 60%);
    opacity: 0.8;
    mix-blend-mode: screen;
    pointer-events: none;
}

.login-card-header {
    position: relative;
    margin-bottom: 1.8rem;
}

.login-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 245, 212, 0.12);
    border: 1px solid rgba(0, 245, 212, 0.35);
    color: var(--accent);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.login-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
}

.login-title span {
    background: linear-gradient(120deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-bottom: 0.8rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-prefix {
    position: absolute;
    left: 0.9rem;
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0.85;
}

.login-input-wrapper input {
    width: 100%;
    padding: 0.75rem 0.9rem 0.75rem 2.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(8, 10, 20, 0.9);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.login-input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 245, 212, 0.6);
    background: rgba(5, 7, 16, 0.95);
}

.login-input-wrapper input[readonly] {
    cursor: default;
    color: var(--text-muted);
}

.login-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.login-btn {
    width: 100%;
    margin-top: 0.4rem;
}

.login-error {
    min-height: 1.1rem;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #ff6b81;
}

.login-footer-note {
    position: relative;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.85;
}

.login-footer-note span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.login-footer-note span::before {
    content: '●';
    font-size: 0.4rem;
    color: var(--accent);
}

/* 登录区代码流星 / 流体效果 */
.login-meteors {
    position: absolute;
    inset: -10%;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: screen;
}

.login-meteors::before {
    content: '';
    position: absolute;
    inset: -50%;
    background-image:
        repeating-linear-gradient(
            120deg,
            rgba(0, 245, 212, 0.04) 0px,
            rgba(0, 245, 212, 0.16) 1px,
            transparent 2px,
            transparent 6px
        ),
        repeating-linear-gradient(
            60deg,
            rgba(123, 44, 191, 0.1) 0px,
            transparent 4px,
            transparent 10px
        );
    animation: codeRain 14s linear infinite;
}

.login-meteors .meteor {
    position: absolute;
    width: 130px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 245, 212, 0.8), rgba(0, 245, 212, 0));
    filter: drop-shadow(0 0 10px rgba(0, 245, 212, 0.9));
    opacity: 0.7;
    transform: translate3d(0, 0, 0) rotate(12deg);
    animation: meteorMove 5s linear infinite;
}

.login-meteors .meteor:nth-child(1) {
    top: 15%;
    left: -20%;
    animation-duration: 5.5s;
    animation-delay: -1.2s;
}

.login-meteors .meteor:nth-child(2) {
    top: 40%;
    left: -30%;
    animation-duration: 6.2s;
    animation-delay: -2.4s;
}

.login-meteors .meteor:nth-child(3) {
    top: 65%;
    left: -10%;
    animation-duration: 4.8s;
    animation-delay: -3.1s;
}

.login-meteors .meteor:nth-child(4) {
    top: 80%;
    left: -25%;
    animation-duration: 7s;
    animation-delay: -0.8s;
}

.login-meteors .meteor:nth-child(5) {
    top: 5%;
    left: -15%;
    animation-duration: 6.8s;
    animation-delay: -4s;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.5rem 2rem;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
}

/* ===== 英雄区 ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    position: relative;
}

.hero-content {
    max-width: 600px;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-title .title-line {
    display: block;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title .title-line:nth-child(1) {
    animation-delay: 0.2s;
}

.hero-title .title-line:nth-child(2) {
    animation-delay: 0.4s;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: #00e6c4;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 245, 212, 0.3);
}

.btn-outline {
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: rgba(0, 245, 212, 0.1);
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 3rem;
}

.cube-container {
    perspective: 800px;
}

.cube {
    width: 120px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 8s linear infinite;
}

.cube::before,
.cube::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 8px;
    opacity: 0.6;
}

.cube::before {
    transform: rotateY(45deg) rotateX(30deg);
}

.cube::after {
    transform: rotateY(-45deg) rotateX(-30deg);
    border-color: var(--accent-secondary);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
    animation: bounce 2s ease infinite;
}

@keyframes codeRain {
    0% {
        transform: translate3d(0, -10%, 0);
        opacity: 0.45;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        transform: translate3d(0, 18%, 0);
        opacity: 0.45;
    }
}

@keyframes meteorMove {
    0% {
        transform: translate3d(0, 0, 0) rotate(12deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translate3d(140%, -40%, 0) rotate(12deg);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotateCube {
    to {
        transform: rotateY(360deg) rotateX(360deg);
    }
}

@keyframes bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(8px); }
}

/* ===== 通用区块样式 ===== */
section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-muted);
}

/* ===== 作品展示 ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.4s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 245, 212, 0.1);
}

.project-image {
    aspect-ratio: 16/10;
    position: relative;
    overflow: hidden;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 245, 212, 0.1), rgba(123, 44, 191, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-muted);
}

.project-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.project-tag {
    background: var(--accent);
    color: var(--bg-dark);
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.project-link {
    color: var(--accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.project-link:hover {
    gap: 0.5rem;
}

/* ===== 技能区 ===== */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skill-category h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tags span {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.skill-tags span:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== 关于我 ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
}

.about-text .section-title {
    text-align: left;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.avatar-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--bg-dark);
}

/* ===== 联系区 ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    border-color: var(--accent);
}

.contact-icon {
    font-weight: 600;
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-visual {
        margin: 2rem 0 0;
    }

    .hero-buttons {
        justify-content: center;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-text .section-title {
        text-align: center;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.98);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
        display: none;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-visual {
        display: none;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}
