/* ===== 完全重新设计的样式 ===== */

/* 基础主题变量 - 全新调色板 */
:root {
    /* 主要品牌色 */
    --primary-50: #f5f3ff;
    --primary-100: #ede9fe;
    --primary-200: #ddd6fe;
    --primary-300: #c4b5fd;
    --primary-400: #a78bfa;
    --primary-500: #8b5cf6;
    --primary-600: #7c3aed;
    --primary-700: #6d28d9;
    --primary-800: #5b21b6;
    --primary-900: #4c1d95;

    --secondary-50: #fdf2f8;
    --secondary-100: #fce7f3;
    --secondary-200: #fbcfe8;
    --secondary-300: #f9a8d4;
    --secondary-400: #f472b6;
    --secondary-500: #ec4899;
    --secondary-600: #db2777;
    --secondary-700: #be185d;
    --secondary-800: #9d174d;
    --secondary-900: #831843;

    /* 中性色 - 亮色模式 */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;

    /* 功能色 */
    --accent-blue: #0ea5e9;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;

    /* 背景渐变 - 亮色模式 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-gradient-start: #e0f2fe;
    --bg-gradient-middle: #f0f9ff;
    --bg-gradient-end: #fdf4ff;

    /* 卡片和表面 */
    --surface-01: rgba(255, 255, 255, 0.95);
    --surface-02: rgba(255, 255, 255, 0.85);
    --surface-03: rgba(255, 255, 255, 0.75);

    /* 文字颜色 */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;

    /* 边框和阴影 */
    --border-light: rgba(0, 0, 0, 0.1);
    --border-medium: rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* 效果 */
    --blur-background: blur(20px);
    --transition-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
}

/* 深色模式主题变量 */
.dark-mode {
    /* 主要品牌色 - 稍亮一些 */
    --primary-50: #2e1065;
    --primary-100: #3b0764;
    --primary-200: #4c1d95;
    --primary-300: #5b21b6;
    --primary-400: #6d28d9;
    --primary-500: #7c3aed;
    --primary-600: #8b5cf6;
    --primary-700: #a78bfa;
    --primary-800: #c4b5fd;
    --primary-900: #ddd6fe;

    --secondary-50: #831843;
    --secondary-100: #9d174d;
    --secondary-200: #be185d;
    --secondary-300: #db2777;
    --secondary-400: #ec4899;
    --secondary-500: #f472b6;
    --secondary-600: #f9a8d4;
    --secondary-700: #fbcfe8;
    --secondary-800: #fce7f3;
    --secondary-900: #fdf2f8;

    /* 中性色 - 深色模式 */
    --neutral-50: #0a0a0a;
    --neutral-100: #171717;
    --neutral-200: #262626;
    --neutral-300: #404040;
    --neutral-400: #525252;
    --neutral-500: #737373;
    --neutral-600: #a3a3a3;
    --neutral-700: #d4d4d4;
    --neutral-800: #e5e5e5;
    --neutral-900: #f5f5f5;

    /* 背景渐变 - 深色模式 */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111827;
    --bg-gradient-start: #1e1b4b;
    --bg-gradient-middle: #1e293b;
    --bg-gradient-end: #312e81;

    /* 卡片和表面 */
    --surface-01: rgba(30, 41, 59, 0.95);
    --surface-02: rgba(30, 41, 59, 0.85);
    --surface-03: rgba(30, 41, 59, 0.75);

    /* 文字颜色 */
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-tertiary: #d1d5db;

    /* 边框和阴影 */
    --border-light: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ===== 基础样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 16px;
}

body {
    background: linear-gradient(135deg,
            var(--bg-gradient-start) 0%,
            var(--bg-gradient-middle) 50%,
            var(--bg-gradient-end) 100%);
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    transition: all 0.5s var(--transition-standard);
    position: relative;
    overflow-x: hidden;
}

/* ===== 新的背景效果 ===== */

/* 动态网格背景 */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, var(--primary-500) 0%, transparent 15%),
        radial-gradient(circle at 80% 70%, var(--secondary-500) 0%, transparent 15%),
        radial-gradient(circle at 40% 80%, var(--accent-blue) 0%, transparent 15%);
    opacity: 0.03;
    z-index: -3;
}

/* 几何图形背景 */
.geometric-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.1;
}

.geometric-shapes .shape {
    position: absolute;
    background: linear-gradient(45deg, var(--primary-500), var(--secondary-500));
    opacity: 0.05;
    animation: shapeFloat 20s infinite linear;
}

.shape:nth-child(1) {
    width: 300px;
    height: 300px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.shape:nth-child(3) {
    width: 200px;
    height: 200px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    top: 40%;
    left: 80%;
    animation-delay: -10s;
}

@keyframes shapeFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(100px, 50px) rotate(360deg);
    }
}

/* ===== 主题切换按钮 ===== */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface-01);
    backdrop-filter: var(--blur-background);
    -webkit-backdrop-filter: var(--blur-background);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s var(--transition-standard);
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-500);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* ===== 主容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
}

/* ===== 头部区域 ===== */
.header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.avatar-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 28px;
}

.avatar-glow {
    position: absolute;
    inset: -8px;
    background: linear-gradient(45deg,
            var(--primary-500),
            var(--secondary-500),
            var(--accent-blue));
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.4;
    animation: glowRotate 8s linear infinite;
    z-index: 0;
}

@keyframes glowRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.avatar {
    width: 124px;
    height: 124px;
    border-radius: 50%;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
    border: 4px solid var(--surface-01);
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 40px rgba(139, 92, 246, 0.3),
        var(--shadow-xl);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg,
            var(--primary-600) 0%,
            var(--secondary-600) 50%,
            var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-500), var(--secondary-500));
    border-radius: 2px;
    margin: 16px auto 0;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-weight: 400;
    line-height: 1.6;
}

.tech-badge {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.badge-item {
    background: var(--surface-01);
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    backdrop-filter: var(--blur-background);
    -webkit-backdrop-filter: var(--blur-background);
    transition: all 0.3s var(--transition-standard);
}

.badge-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-500);
    background: linear-gradient(135deg,
            var(--primary-500),
            var(--secondary-500));
    color: white;
}

/* ===== 分区标题 ===== */
.section-title {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-500), var(--secondary-500));
    border-radius: 2px;
}

/* ===== 卡片网格 ===== */
.link-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    margin-bottom: 48px;
}

/* ===== 卡片设计 ===== */
.link-card {
    background: var(--surface-01);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
    backdrop-filter: var(--blur-background);
    -webkit-backdrop-filter: var(--blur-background);
    transition: all 0.4s var(--transition-standard);
    display: flex;
    flex-direction: column;
    min-height: 240px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-md);
}

/* 卡片光晕效果 */
.link-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(139, 92, 246, 0.1) 0%,
            rgba(236, 72, 153, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.link-card:hover::before {
    opacity: 1;
}

/* 卡片悬停效果 */
.link-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-500);
}

/* 卡片内光晕 */
.card-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
            var(--primary-500),
            var(--secondary-500),
            var(--accent-blue));
    border-radius: calc(var(--border-radius-lg) + 2px);
    z-index: -2;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.link-card:hover .card-glow {
    opacity: 0.3;
}

/* 卡片内容布局 */
.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    color: white;
    transition: all 0.3s var(--transition-standard);
    flex-shrink: 0;
}

.link-card:hover .card-icon {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.card-content {
    flex: 1;
    margin-bottom: 24px;
}

.card-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-tag {
    background: var(--surface-02);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.card-tag:hover {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
    transform: translateY(-1px);
}

.card-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-02);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: all 0.3s var(--transition-standard);
}

.link-card:hover .card-arrow {
    transform: translateX(8px) rotate(-15deg);
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    color: white;
    border-color: transparent;
}

/* 卡片类型特定样式 */
.link-card.portfolio .card-icon {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-blue));
}

.link-card.contact .card-icon {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-green));
}

.link-card.testimonials .card-icon {
    background: linear-gradient(135deg, var(--secondary-500), var(--accent-red));
}

/* ===== 页脚 ===== */
footer {
    text-align: center;
    padding: 32px;
    margin-top: 64px;
    background: var(--surface-01);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-light);
    backdrop-filter: var(--blur-background);
    -webkit-backdrop-filter: var(--blur-background);
    box-shadow: var(--shadow-md);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

footer b {
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ===== 响应式设计 ===== */

/* 平板 */
@media (max-width: 1024px) {
    .container {
        padding: 32px 20px;
    }

    .title {
        font-size: 2.5rem;
    }

    .link-cards {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
    }
}

/* 大手机 */
@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    .header {
        margin-bottom: 40px;
    }

    .avatar-container {
        width: 120px;
        height: 120px;
        margin-bottom: 24px;
    }

    .avatar {
        width: 108px;
        height: 108px;
    }

    .title {
        font-size: 2.25rem;
    }

    .subtitle {
        font-size: 1.125rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .link-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .link-card {
        padding: 28px 24px;
    }

    .theme-toggle {
        top: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
}

/* 小手机 */
@media (max-width: 480px) {
    .container {
        padding: 20px 12px;
    }

    .title {
        font-size: 2rem;
    }

    .avatar-container {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }

    .avatar {
        width: 92px;
        height: 92px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .badge-item {
        padding: 6px 14px;
        font-size: 0.8125rem;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .link-card {
        padding: 24px 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-icon {
        margin-right: 0;
        margin-bottom: 16px;
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

/* ===== 性能优化和特殊模式 ===== */

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {

    :root,
    .dark-mode {
        --border-light: rgba(0, 0, 0, 0.8);
        --border-medium: rgba(0, 0, 0, 0.9);
        --surface-01: rgba(255, 255, 255, 0.98);
    }

    .dark-mode {
        --surface-01: rgba(0, 0, 0, 0.98);
    }

    .link-card,
    .theme-toggle,
    footer {
        border-width: 2px;
    }
}

/* ===== 加载动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeInUp 0.6s var(--transition-standard);
}

/* 卡片逐个出现动画 */
.link-card {
    animation: fadeInUp 0.6s var(--transition-standard) forwards;
    opacity: 0;
}

.link-card:nth-child(1) {
    animation-delay: 0.1s;
}

.link-card:nth-child(2) {
    animation-delay: 0.2s;
}

.link-card:nth-child(3) {
    animation-delay: 0.3s;
}

.link-card:nth-child(4) {
    animation-delay: 0.4s;
}

.link-card:nth-child(5) {
    animation-delay: 0.5s;
}

.link-card:nth-child(6) {
    animation-delay: 0.6s;
}

.link-card:nth-child(7) {
    animation-delay: 0.7s;
}

.link-card:nth-child(8) {
    animation-delay: 0.8s;
}

.link-card:nth-child(9) {
    animation-delay: 0.9s;
}