/* ===== 基础主题变量 - 全新调色板 (100%保留) ===== */
: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);
}

/* ===== 基础样式覆盖 ===== */
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;
}

.custom-max-width { max-width: 1200px; }

/* ===== 背景特效 (100%保留) ===== */
.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); } }

/* ===== 主题切换按钮 (100%保留) ===== */
.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; }

/* ===== 头部区域与头像特效 (100%保留) ===== */
.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; line-height: 1.2; letter-spacing: -0.5px;
    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;
}
.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; }

/* ===== 卡片设计体系 (100%保留) ===== */
.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; 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.library .card-icon { background: linear-gradient(135deg, var(--secondary-500), var(--accent-red)); }

/* ===== 页脚 (100%保留) ===== */
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; }

/* ===== 缩小的微调响应式 (删掉了大部分，因为网格交给 Bootstrap 了) ===== */
@media (max-width: 768px) {
    .avatar-container { width: 120px; height: 120px; margin-bottom: 24px; }
    .avatar { width: 108px; height: 108px; }
    .title { font-size: 2.25rem; }
    .theme-toggle { top: 20px; right: 20px; width: 48px; height: 48px; }
}

/* ===== 进场动画 (100%保留) ===== */
@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; } .link-card:nth-child(10) { animation-delay: 1s; }
.link-card:nth-child(11) { animation-delay: 1.1s; } .link-card:nth-child(12) { animation-delay: 1.2s; }