/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a192f;
    --bg-secondary: #112240;
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --accent: #64ffda;
    --accent-tint: rgba(100, 255, 218, 0.1);
}

/* 粒子背景 */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

body {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 50px;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1.25rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: color 0.3s;
}

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

.nav-links span {
    color: var(--accent);
    margin-right: 5px;
}

/* Hero 区域 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
}

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

.hero-content .greeting {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.hero-content h1 {
    font-size: 4.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: 'Calibre', 'Inter', 'San Francisco', sans-serif;
    font-weight: 600;
}

.hero-content h2 {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-family: 'Calibre', 'Inter', 'San Francisco', sans-serif;
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 540px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.highlight {
    color: var(--accent);
}

/* 按钮 */
.btn {
    padding: 1rem 1.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.25s;
    display: inline-block;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn:hover {
    background: var(--accent-tint);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

/* 通用区域 */
section {
    padding: 100px 0;
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    font-family: 'Calibre', 'Inter', sans-serif;
}

.section-title::before {
    content: '0' counter(section) '.';
    counter-increment: section;
    color: var(--accent);
    font-size: 1.25rem;
    margin-right: 10px;
    font-family: 'SF Mono', monospace;
}

.section-title::after {
    content: '';
    display: block;
    height: 1px;
    width: 200px;
    background: #233554;
    margin-left: 20px;
}

body {
    counter-reset: section;
}

/* 关于我 */
.about-text {
    max-width: 600px;
}

.about-text p {
    margin-bottom: 1rem;
}

/* 技能 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.skill-card {
    background: rgba(17, 34, 64, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 255, 218, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.skill-card:hover {
    background: rgba(17, 34, 64, 0.85);
    border-color: rgba(100, 255, 218, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.skill-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.skill-card ul {
    list-style: none;
}

.skill-card li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.skill-card li::before {
    content: '▹';
    color: var(--accent);
    margin-right: 10px;
}

/* 项目展示 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card {
    background: rgba(17, 34, 64, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(17, 34, 64, 0.85);
    border-color: rgba(100, 255, 218, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-card .folder-icon {
    color: var(--accent);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.project-card h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.project-card h3:hover {
    color: var(--accent);
}

.project-card p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

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

.project-tags span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 联系方式 */
.contact {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.contact .section-title {
    justify-content: center;
}

.contact .section-title::after {
    display: none;
}

.contact-intro {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    color: var(--text-secondary);
}

.contact-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.contact-card {
    background: rgba(17, 34, 64, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    transition: all 0.3s ease;
    text-align: center;
}

.contact-card:hover {
    transform: translateY(-8px);
    border-color: rgba(100, 255, 218, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.contact-icon i {
    transition: transform 0.3s ease;
}

.contact-card:hover .contact-icon i {
    transform: scale(1.1);
}

.contact-card h3 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.contact-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.25s;
}

.contact-link:hover {
    letter-spacing: 1px;
}

.status-badge {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--accent-tint);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

.status-badge .status-dot {
    font-size: 0.5rem;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* 社交链接区域 */
.social-section {
    text-align: center;
}

.social-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(17, 34, 64, 0.7);
    border: 1px solid rgba(100, 255, 218, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.social-icon:focus {
    outline: none;
    border-color: var(--accent);
}

.social-icon:active {
    transform: scale(0.95);
}

.social-icon.clicked {
    transform: scale(0.9);
    border-color: var(--accent);
    background: var(--accent-tint);
}

.social-icon.clicked i {
    color: var(--accent);
}

.social-icon i {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.social-icon:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: var(--accent-tint);
}

.social-icon:hover i {
    color: var(--accent);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.8rem;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* 响应式设计 */
@media (max-width: 1080px) {
    .container {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 25px;
    }

    section {
        padding: 60px 0;
    }

    .hero {
        padding-top: 80px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

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

    .section-title {
        font-size: 1.4rem;
    }

    .section-title::after {
        width: 80px;
        margin-left: 15px;
    }

    .contact-info {
        flex-direction: column;
        gap: 1.5rem;
    }

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

    .nav-links {
        display: none;
    }

    .project-card {
        padding: 1.5rem;
    }

    .skill-card {
        padding: 1.25rem;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content h2 {
        font-size: 1.25rem;
    }

    .hero-content .greeting {
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .section-title::before {
        font-size: 1rem;
    }

    .section-title::after {
        display: none;
    }

    .navbar {
        padding: 1rem 0;
    }

    .logo {
        font-size: 1.25rem;
    }
}

/* 动画效果 */
.hero-content .greeting,
.hero-content h1,
.hero-content h2,
.hero-content p,
.hero-buttons {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.hero-content .greeting { animation-delay: 0.1s; }
.hero-content h1 { animation-delay: 0.2s; }
.hero-content h2 { animation-delay: 0.3s; }
.hero-content p { animation-delay: 0.4s; }
.hero-buttons { animation-delay: 0.5s; }

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

/* 链接下划线效果 */
.nav-links a {
    position: relative;
}

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

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

/* 光标光晕效果 */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}

@media (max-width: 768px) {
    .cursor-glow {
        display: none;
    }
}

/* 流动渐变背景 */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(
        45deg,
        var(--bg-primary) 0%,
        #0d1f3c 25%,
        #0a192f 50%,
        #071222 75%,
        var(--bg-primary) 100%
    );
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 滚动视差效果 */
.parallax-section {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

.section-title,
.skill-card,
.project-card,
.contact-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-title.visible,
.skill-card.visible,
.project-card.visible,
.contact-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 延迟动画 */
.skill-card:nth-child(1) { transition-delay: 0.1s; }
.skill-card:nth-child(2) { transition-delay: 0.2s; }
.skill-card:nth-child(3) { transition-delay: 0.3s; }
.skill-card:nth-child(4) { transition-delay: 0.4s; }

.project-card:nth-child(1) { transition-delay: 0.1s; }
.project-card:nth-child(2) { transition-delay: 0.2s; }
.project-card:nth-child(3) { transition-delay: 0.3s; }
.project-card:nth-child(4) { transition-delay: 0.4s; }

.contact-card:nth-child(1) { transition-delay: 0.1s; }
.contact-card:nth-child(2) { transition-delay: 0.2s; }
.contact-card:nth-child(3) { transition-delay: 0.3s; }
