/* 基础重置和布局 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    min-height: 100vh;
    line-height: 1.5;
    color: #333;
    font-size: 14px;
    overflow-x: hidden;
}

.dark body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
}

/* 导航栏 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

.dark nav {
    background: rgba(26, 32, 44, 0.9);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-avatar {
    display: flex;
    align-items: center;
}

.nav-avatar img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease;
}

.nav-avatar img:hover {
    transform: scale(1.05);
}

.dark .nav-avatar img {
    border-color: rgba(139, 148, 158, 0.3);
}

.logo {
    font-weight: bold;
    font-size: 1.25rem;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dark .logo {
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg);
}

/* 主容器 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    min-height: 100vh;
    align-items: start;
}

/* 左侧个人信息 */
.profile-section {
    position: sticky;
    top: 5rem;
}

.profile-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .profile-card {
    background: rgba(45, 55, 72, 0.9);
    border: 1px solid rgba(139, 148, 158, 0.2);
}

.avatar {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gzh-avatar img {
    width: 18rem;
    height: 6.5rem;
    border-radius: 8px;
    object-fit: fill;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease;
}

.gzh-avatar img:hover {
    transform: scale(1.05);
}

.dark .gzh-avatar img {
    border-color: rgba(139, 148, 158, 0.3);
}

.profile-card h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.dark .profile-card h1 {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.dark .subtitle {
    color: #a0aec0;
}

.contact-info {
    margin-bottom: 2rem;
}

.contact-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: rgba(79, 70, 229, 0.1);
    transform: translateX(5px);
}

.dark .contact-item {
    background: rgba(96, 165, 250, 0.08);
}

.dark .contact-item:hover {
    background: rgba(96, 165, 250, 0.15);
}


.intro {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(124, 58, 237, 0.1));
    border-left: 4px solid #4f46e5;
    padding: 1.5rem;
    border-radius: 0 15px 15px 0;
    font-style: italic;
    margin-top: 2rem;
    position: relative;
}

.dark .intro {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(167, 139, 250, 0.1));
    border-left-color: #60a5fa;
}

/* 右侧内容 */
.content-section {
    animation-duration: 1s;
    animation-delay: 0.3s;
}

.skills-section, .projects-section {
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 2px;
}

.dark h2 {
    color: #e2e8f0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.dark h2::after {
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
}

/* 技能栈 */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.skill-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

.skill-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(79, 70, 229, 0.15);
}

.dark .skill-item {
    background: rgba(45, 55, 72, 0.9);
    border: 1px solid rgba(139, 148, 158, 0.2);
}

.skill-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
}

.skill-header img {
    width: 1.75rem;
    height: 1.75rem;
    margin-right: 0.6rem;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.skill-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.3rem;
}

.dark .skill-header h3 {
    color: #e2e8f0;
}

.skill-bar {
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    height: 6px;
    position: relative;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 8px;
    width: 0%;
    transition: width 1.5s ease-in-out;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-20px); }
    100% { transform: translateX(20px); }
}

.skill-bar span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f46e5;
    margin-left: 0.4rem;
}

.dark .skill-bar {
    background: rgba(96, 165, 250, 0.1);
}

.dark .skill-progress {
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
}

.dark .skill-bar span {
    color: #60a5fa;
}

/* 项目 */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.project-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

.project-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.15);
}

.dark .project-item {
    background: rgba(45, 55, 72, 0.9);
    border: 1px solid rgba(139, 148, 158, 0.2);
}

.project-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
}

.project-header img {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.project-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2d3748;
}

.dark .project-header h3 {
    color: #e2e8f0;
}

.tech-stack {
    font-weight: 600;
    color: #4f46e5;
    margin-bottom: 0.4rem;
}

.dark .tech-stack {
    color: #60a5fa;
}

.description {
    color: #666;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.dark .description {
    color: #a0aec0;
}

.project-links {
    margin: 0.8rem 0;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    text-decoration: none;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.3);
}

.project-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.dark .project-links a {
    background: linear-gradient(135deg, #e3e7ec, #e0dbf1);
}

.tags {
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .tags {
    color: #a0aec0;
    border-top-color: rgba(255, 255, 255, 0.1);
}

code {
    background: rgba(79, 70, 229, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

.dark code {
    background: rgba(96, 165, 250, 0.2);
}

a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

a:hover {
    color: #5a67d8;
    transform: translateY(-1px);
}

.dark a {
    color: #60a5fa;
}

.dark a:hover {
    color: #4299e1;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 320px 1fr;
        gap: 1.5rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .nav-content {
        padding: 0.75rem 1rem;
    }
    
    .main-container {
        grid-template-columns: 1fr;
        padding: 4rem 1rem 2rem;
        gap: 2rem;
    }
    
    .profile-section {
        position: static;
    }
    
    .profile-card {
        padding: 1.5rem;
    }
    
    .profile-card h1 {
        font-size: 2rem;
    }
    
    .avatar img {
        width: 4rem;
        height: 4rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .skill-header h3 {
        font-size: 1rem;
    }
    
    .project-header h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 640px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skill-item, .project-item {
        padding: 1.25rem;
    }
    
    .skill-header img, .project-header img {
        width: 2rem;
        height: 2rem;
    }
    
    .skill-progress::after {
        display: none;
    }
}

/* 底部备案信息 */
.footer {
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.dark .footer {
    background: rgba(0, 0, 0, 0.1);
    border-top-color: rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer a {
    color: #2d3748;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.8;
    font-weight: 500;
}

.footer a:hover {
    opacity: 1;
    transform: none;
    color: #4f46e5;
}

.dark .footer a {
    color: #e2e8f0;
}

.dark .footer a:hover {
    color: #60a5fa;
}

@media (max-width: 640px) {
    .footer {
        padding: 1rem;
    }
    
    .footer a {
        font-size: 0.8rem;
    }
}