/* 
 * 潮流个人网站样式
 * 设计理念：年轻、活力、现代
 */

/* ========== 基础变量 ========== */
:root {
    /* 颜色系统 - 浅色模式 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --accent-color: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-gradient: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    
    /* 彩色强调色 */
    --color-pink: #ec4899;
    --color-purple: #8b5cf6;
    --color-blue: #3b82f6;
    --color-green: #10b981;
    --color-orange: #f59e0b;
    
    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* 圆角 */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* 暗色模式 */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent-color: #a78bfa;
    --accent-hover: #8b5cf6;
    --card-gradient: linear-gradient(135deg, #667eea25 0%, #764ba225 100%);
}

/* ========== 重置与基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: var(--bg-gradient);
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

/* 光标跟随背景 - 隐藏光圈 */
.cursor-glow {
    display: none;
}

/* 光标轨迹粒子 - 简约版 */
.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 998;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: trailFade 0.6s ease-out forwards;
    background: var(--accent-color);
}

@keyframes trailFade {
    0% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
}

[data-theme="dark"] .cursor-trail {
    background: rgba(167, 139, 250, 0.8);
}

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========== 导航栏 ========== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    padding: 1rem 0;
    box-shadow: 0 4px 24px -2px rgba(139, 92, 246, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav.scrolled {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 32px -4px rgba(139, 92, 246, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .nav {
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid rgba(167, 139, 250, 0.1);
}

[data-theme="dark"] .nav.scrolled {
    background: rgba(15, 23, 42, 0.85);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: default;
}

.logo-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3), 0 0 0 4px rgba(139, 92, 246, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-avatar:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4), 0 0 0 6px rgba(139, 92, 246, 0.15);
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
    position: relative;
    padding-bottom: 0.25rem;
}

/* 下划线效果 */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.sun-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* ========== Hero 区域 ========== */
.hero {
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.avatar {
    width: 140px;
    height: 140px;
    margin: 0 auto var(--spacing-sm);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 5px var(--bg-primary), 
                0 0 0 7px var(--accent-color), 
                0 12px 40px -8px rgba(139, 92, 246, 0.4),
                0 0 60px rgba(139, 92, 246, 0.15);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: avatarFloat 3s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.avatar::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: var(--accent-gradient);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s;
    animation: rotate 6s linear infinite;
}

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

.avatar:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 0 5px var(--bg-primary), 
                0 0 0 7px var(--accent-color), 
                0 16px 52px -12px rgba(139, 92, 246, 0.6),
                0 0 80px rgba(139, 92, 246, 0.25);
    animation-play-state: paused;
}

.avatar:hover::before {
    opacity: 0.3;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.avatar-upload-btn {
    display: block;
    margin: 0 auto var(--spacing-md);
    padding: 0.5rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.avatar-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgb(0 0 0 / 0.2);
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-tagline {
    font-size: 1.35rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.social-links a svg,
.social-links a img {
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-links a:hover {
    color: white;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 16px -4px rgb(0 0 0 / 0.2);
}

.social-links a:hover img {
    transform: scale(1.1);
}

.social-links a:hover::before {
    opacity: 1;
}

/* ========== 功能卡片网格 ========== */
.features {
    padding: var(--spacing-lg) 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.feature-card {
    display: block;
    padding: var(--spacing-lg);
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.08);
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--card-gradient);
    opacity: 0;
    transition: opacity 0.5s;
}

.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: var(--accent-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 24px 48px -16px rgba(139, 92, 246, 0.25), 0 12px 24px -8px rgba(0, 0, 0, 0.12);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-sm);
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.3));
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(8deg);
    filter: drop-shadow(0 8px 16px rgba(139, 92, 246, 0.5));
}

.feature-card h3 {
    font-size: 1.35rem;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* ========== 通用区块 ========== */
.section {
    padding: var(--spacing-lg) 0;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* ========== 文章网格 ========== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.post-card {
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all 0.3s;
    animation: fadeInUp 0.6s ease-out;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.post-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
}

.post-card .post-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.post-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========== 照片网格 ========== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-sm);
}

.photo-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    animation: fadeInUp 0.6s ease-out;
}

.photo-card:hover {
    transform: scale(1.05);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== 页脚 ========== */
.footer {
    padding: var(--spacing-lg) 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-note {
    margin-top: var(--spacing-xs);
    opacity: 0.7;
}

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

/* ========== 留言板样式 ========== */
.comments-container {
    max-width: 800px;
    margin: 0 auto;
}

.comment-form-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: flex-start;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(139, 92, 246, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.clear-comments-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-comments-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: scale(1.05);
}

/* 图片上传区域 */
.image-upload-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-image-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    color: var(--accent-color);
    border: 2px dashed var(--accent-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.upload-image-btn:hover {
    background: var(--accent-color);
    color: white;
    border-style: solid;
    transform: translateY(-2px);
}

.image-upload-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.image-preview {
    margin-top: 0.5rem;
    position: relative;
}

.image-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    object-fit: cover;
}

.image-preview .remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.image-preview .remove-image:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.1);
}

/* 留言列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
}

.comment-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.delete-comment-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.delete-comment-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    opacity: 1;
    transform: scale(1.1);
}

.comment-item:hover .delete-comment-btn {
    opacity: 1;
}

.comment-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.comment-image {
    margin-top: 0.75rem;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.comment-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-image img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .post-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .comment-form-card {
        padding: 1.5rem;
    }
    
    .comment-item {
        padding: 1rem;
    }
    
    .comment-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

