/*
 * Portfolio Website Styles
 * Version: 1.1
 * Last Updated: 2025-06-30
 */

/* 重置和基础样式 */
:root {
    /* 浅色主题 */
    --bg-color: #fff;
    --text-color: #000;
    --text-secondary: #666;
    --text-light: #333;
    --border-color: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.7);
    --card-bg: #fff;
    --shadow: rgba(0, 0, 0, 0.1);
    --accent-color: #3354FF;
    --hero-bg: rgb(246, 248, 253);
}

[data-theme="dark"] {
    /* 深色主题 */
    --bg-color: #000000;
    --text-color: #fff;
    --text-secondary: #ccc;
    --text-light: #ddd;
    --border-color: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(26, 26, 26, 0.7);
    --card-bg: #2d2d2d;
    --shadow: rgba(0, 0, 0, 0.3);
    --accent-color: #3354FF;
    --hero-bg: #2d2d2d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-width: 390px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: auto;
    min-width: 390px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 导航栏 */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    width: 100%;
    min-width: 390px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    font-size: 16px;
    transition: opacity 0.15s linear, color 0.15s linear;
}

.nav-links a:hover {
    opacity: 0.6;
}

/* 主题切换开关 */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: none;
}

.theme-label {
    position: relative;
    display: block;
    width: 60px;
    height: 30px;
    background: #ddd;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.theme-label::before {
    content: '☀️';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.theme-switch:checked + .theme-label {
    background: #333;
}

.theme-switch:checked + .theme-label::before {
    content: '🌙';
    background: #666;
    transform: translateX(30px);
}

/* 主页英雄区域 */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 120px 40px 60px;
    background-color: var(--hero-bg);
    width: 100%;
    min-width: 390px;
    transition: background-color 0.3s ease;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 80px;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-text h1 {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
    color: var(--text-color);
    transition: color 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
    transition: color 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.btn-primary {
    display: inline-block;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 16px 32px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    border: 2px solid var(--text-color);
    transition: transform 0.1s linear, box-shadow 0.1s ease-out;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.btn-primary:hover {
    background: transparent;
    color: var(--text-color);
}

.hero-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    opacity: 0;
    transform: scale(0.8);
    animation: fadeInScale 0.8s ease 0.6s forwards;
}

.avatar-circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3354FF 0%, #0b2cbd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    transition: transform 0.1s linear;
}

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

.avatar-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 关于我部分 */
.about {
    padding: 100px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.about h2 {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 60px;
    letter-spacing: -1px;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.about-text p {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-light);
    width: 100%;
    font-weight: 400;
    margin: 10px 0;
    transition: color 0.3s ease;
}

.skills-section h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    background: #f0f0f0;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.skill-tag:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
}

/* 作品集部分 */
.portfolio {
    padding: 100px 40px;
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.portfolio-header {
    text-align: center;
    margin-bottom: 80px;
}

.portfolio-header h2 {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.portfolio-subtitle {
    font-size: 18px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.portfolio-item {
    background: var(--card-bg);
    padding: 0;
    transition: all 0.1s linear, opacity 0.5s ease, transform 0.5s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
}

.portfolio-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3354FF 0%, #0b2cbd 100%);
    transform: scaleX(0);
    transition: transform 0.1s linear;
}

.portfolio-item:hover::before {
    transform: scaleX(1);
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px var(--shadow);
    border-color: var(--border-color);
}

/* 作品项目链接样式 */
.portfolio-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.portfolio-link:hover {
    text-decoration: none;
    color: inherit;
}

.portfolio-item.featured {
    grid-column: span 2;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

[data-theme="dark"] .portfolio-item.featured {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

.project-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

[data-theme="dark"] .project-image {
    background: #3a3a3a;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

[data-theme="dark"] .image-placeholder {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    color: #aaa;
}

.project-info {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

.project-category {
    display: inline-block;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    width: auto;
    flex-shrink: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.project-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.project-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    align-items: flex-start;
    transition: color 0.3s ease;
}

.project-year {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    transition: color 0.3s ease;
}

/* 联系部分/页脚 */
.contact {
    background: linear-gradient(135deg, #000000 0%, #2d2d2d 100%);
    color: #fff;
    padding: 50px 40px 30px;
    text-align: center;
}

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

.contact h2 {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 30px;
    letter-spacing: -1px;
    color: #fff;
}

.contact p {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 8px;
    line-height: 1.6;
}

.contact-info {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.contact-info p {
    font-size: 16px;
    margin-bottom: 0;
}

.contact a {
    color: #3354FF;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s linear;
}

.contact a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.social-icon {
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.15s linear;
    background: rgba(255, 255, 255, 0.05);
}

.social-icon:hover {
    background: #3354FF;
    color: #fff;
    border-color: #3354FF;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* 法律保护 - 版权声明样式 */
.copyright-notice {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 14px;
    color: #ccc;
    line-height: 1.6;
}

.copyright-notice p {
    margin: 8px 0;
}

.copyright-notice p:first-child {
    font-weight: 500;
    color: #fff;
}

/* 图片保护措施 */
img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

/* 禁用图片右键菜单 */
img::selection {
    background: transparent;
}

img::-moz-selection {
    background: transparent;
}

/* AIGC页面专用样式 */
.aigc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.aigc-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.15s linear;
    border: 1px solid var(--border-color);
}

.aigc-item .project-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.aigc-item .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.15s linear;
}

.aigc-item:hover .project-image img {
    transform: scale(1.05);
}

.aigc-item .project-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-item .project-image {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-item video {
    border-radius: 0;
}

/* AIGC项目信息样式 */
.aigc-item .project-info {
    padding: 24px;
}

.aigc-item .project-category {
    background: linear-gradient(135deg, #3354FF 0%, #0b2cbd 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    width: auto;
    display: inline-block;
}

.aigc-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
    line-height: 1.3;
}

.aigc-item .project-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* AIGC响应式设计 */
@media (max-width: 768px) {
    .aigc-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 40px;
    }

    .aigc-item .project-image {
        height: 200px;
    }

    .aigc-item .project-info {
        padding: 20px;
    }
}



/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        padding: 20px;
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .hero {
        padding: 100px 20px 50px;
        min-height: 50vh;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .avatar-circle {
        width: 180px;
        height: 180px;
    }
    
    .about, .portfolio, .contact {
        padding: 40px 20px;
    }
    
    .about h2, .contact h2, .portfolio-header h2 {
        font-size: 36px;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .portfolio-item.featured {
        grid-column: span 1;
    }
    
    .skills-tags {
        justify-content: center;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-info {
        flex-direction: column;
        gap: 20px;
    }
    
    /* 联系部分/页脚 */
    .contact {
        padding: 40px 20px 20px;
    }
    
    .footer-content {
        padding-bottom: 30px;
    }
    
    .contact h2 {
        font-size: 32px;
        margin-bottom: 20px;
    }
    
    .contact p {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .contact-info {
        margin-bottom: 30px;
    }
    
    .contact-info p {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .social-links {
        flex-wrap: wrap;
        gap: 15px;
        margin-top: 20px;
    }
    
    .social-icon {
        padding: 10px 20px;
        font-size: 14px;
    }
    

    
    .portfolio-header {
        margin-bottom: 40px;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .portfolio-item {
        padding: 0;
    }

    .project-info {
        padding: 20px;
    }
    
    .project-info h3 {
        font-size: 16px;
    }
}

/* 滚动动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 统一的滚动触发动画 - 硬件加速优化 */
.animate-on-scroll {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    will-change: opacity, transform;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* 作品集项目动画 - 硬件加速优化 */
.portfolio-item {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.portfolio-item.animate {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* 移除复杂的nth-child选择器，改用JavaScript动态设置延迟 */

/* 技能标签动画 */
.about:not(.animate) .skill-tag {
    opacity: 0;
    transform: translateY(30px);
}

.about.animate .skill-tag {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.about.animate .skill-tag:nth-child(1) { transition-delay: 0.1s; }
.about.animate .skill-tag:nth-child(2) { transition-delay: 0.15s; }
.about.animate .skill-tag:nth-child(3) { transition-delay: 0.2s; }
.about.animate .skill-tag:nth-child(4) { transition-delay: 0.25s; }
.about.animate .skill-tag:nth-child(5) { transition-delay: 0.3s; }
.about.animate .skill-tag:nth-child(6) { transition-delay: 0.35s; }
.about.animate .skill-tag:nth-child(7) { transition-delay: 0.4s; }
.about.animate .skill-tag:nth-child(8) { transition-delay: 0.45s; }

/* 导航栏滚动效果 */
.nav-links a {
    position: relative;
    overflow: hidden;
}

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

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



/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选择文本样式 */
::selection {
    background: #3354FF;
    color: #fff;
}

::-moz-selection {
    background: #3354FF;
    color: #fff;
}

/* 暗色模式适配 - 只修改portfolio顶部分割线 */
body.dark-theme .portfolio {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}