:root {
    --primary: #00f5d4;
    --secondary: #9b5de5;
    --accent: #f15bb5;
    --dark: #00171f;
    --darker: #000814;
    --light: #fff;
    --gray: #8d99ae;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--darker);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 预加载动画 */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--darker);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    display: flex;
    font-size: 3rem;
    font-weight: bold;
}

.loader span:first-child {
    color: var(--primary);
    animation: pulse 1s infinite;
}

.loader span:last-child {
    color: var(--accent);
    animation: pulse 1s infinite 0.5s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

/* 头部导航 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    transition: var(--transition);
    background: rgba(0, 8, 20, 0.8);
    backdrop-filter: blur(10px);
}

.header.scrolled {
    padding: 1rem 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.bracket {
    color: var(--primary);
}

.name {
    color: var(--light);
    margin: 0 0.2rem;
}

.nav-list {
    display: flex;
    list-style: none;
}

.nav-list li {
    margin: 0 1rem;
}

.nav-link {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 首页部分 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(0, 245, 212, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 212, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
}

.hero-content {
    max-width: 800px;
}

.terminal {
    background: rgba(0, 23, 31, 0.8);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 245, 212, 0.2);
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(0, 23, 31, 0.9);
    border-bottom: 1px solid rgba(0, 245, 212, 0.1);
}

.terminal-dots {
    display: flex;
    margin-right: 1rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.terminal-title {
    color: var(--gray);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
}

.terminal-line {
    margin-bottom: 0.5rem;
    color: var(--light);
}

.terminal-line:last-child {
    margin-bottom: 0;
}

.highlight {
    color: var(--primary);
}

.typing-text {
    color: var(--primary);
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: var(--primary);
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.hero-title .line:nth-child(1) {
    animation-delay: 0.5s;
}

.hero-title .line:nth-child(2) {
    animation-delay: 0.7s;
}

.hero-title .line:nth-child(3) {
    animation-delay: 0.9s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--darker);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 245, 212, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: rgba(0, 245, 212, 0.1);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--primary);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-20px); }
    60% { transform: translateX(-50%) translateY(-10px); }
}

/* 通用部分样式 */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    margin: 0 auto;
    border-radius: 2px;
}

/* 关于部分 */
.about {
    padding: 6rem 0;
    background: var(--dark);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--gray);
    font-size: 1.1rem;
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-size: 1rem;
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hex-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.hex-item {
    background: rgba(0, 23, 31, 0.7);
    border: 1px solid rgba(0, 245, 212, 0.2);
    border-radius: 10px;
    padding: 2rem 1rem;
    text-align: center;
    transition: var(--transition);
}

.hex-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 245, 212, 0.2);
    border-color: var(--primary);
}

.hex-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.hex-item span {
    display: block;
    font-weight: 500;
}

/* 技能部分 */
.skills {
    padding: 6rem 0;
}

.skills-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-percent {
    color: var(--primary);
}

.skill-bar {
    height: 8px;
    background: rgba(141, 153, 174, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    width: 0;
    transition: width 1s ease-in-out;
}

/* 项目部分 */
.projects {
    padding: 6rem 0;
    background: var(--dark);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(0, 23, 31, 0.7);
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(0, 245, 212, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 245, 212, 0.3);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-content p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(0, 245, 212, 0.1);
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.project-actions {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link:hover {
    color: var(--secondary);
}

/* 联系部分 */
.contact {
    padding: 6rem 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.contact-info p {
    color: var(--gray);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    margin-bottom: 1.5rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 1rem;
    min-width: 30px;
}

.contact-item h4 {
    margin-bottom: 0.3rem;
}

.contact-item p {
    margin: 0;
    color: var(--gray);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 245, 212, 0.1);
    color: var(--primary);
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    color: var(--darker);
    transform: translateY(-3px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 23, 31, 0.7);
    border: 1px solid rgba(141, 153, 174, 0.3);
    border-radius: 5px;
    color: var(--light);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}

/* 页脚 */
.footer {
    background: var(--darker);
    padding: 3rem 0 1.5rem;
    border-top: 1px solid rgba(141, 153, 174, 0.1);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer-text {
    color: var(--gray);
    margin-bottom: 2rem;
}

.footer-bottom {
    border-top: 1px solid rgba(141, 153, 174, 0.1);
    padding-top: 1.5rem;
    color: var(--gray);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .about-visual {
        order: -1;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--darker);
        transition: var(--transition);
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 2rem;
    }
    
    .nav-list li {
        margin: 1rem 0;
    }
    
    .hero-title {
        font-size: 2.3rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .stats {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .hex-grid {
        grid-template-columns: 1fr;
    }
}