/* ==============================================
   CSS 重构 - 按功能模块组织
   ============================================== */

/* ==============================================
   1. CSS 变量和全局样式
   ============================================== */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS 变量定义 */
:root {
    /* 颜色系统 */
    --primary-color: #007AFF;
    --secondary-color: #5AC8FA;
    --accent-color: #FF3B30;
    --background-color: #0A0A0A;
    --surface-color: #1E1E1E;
    --card-color: #2A2A2A;
    --text-primary: #F8F8F8;
    --text-secondary: #D1D1D6;
    --text-tertiary: #B8B8C0;
    --border-color: #4A4A4C;
    --shadow-color: rgba(0, 0, 0, 0.4);

    /* 区域背景颜色 */
    --hero-bg: radial-gradient(circle at 20% 50%, rgba(0, 122, 255, 0.15) 0%, transparent 50%),
                  radial-gradient(circle at 80% 80%, rgba(90, 200, 250, 0.15) 0%, transparent 50%);
    --works-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --articles-bg: linear-gradient(135deg, #2d1b69 0%, #0f0c29 50%, #24243e 100%);
    --about-bg: linear-gradient(135deg, #141e30 0%, #243b55 100%);
    --contact-bg: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);

    /* 渐变定义 */
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-5: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-6: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);

    /* 尺寸和动画 */
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ==============================================
   2. 导航栏样式
   ============================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.nav {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.5rem;
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 2rem;
    margin-right: 0.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

/* ==============================================
   3. 主要内容区域
   ============================================== */

/* Hero 区域 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 50px;
    background: var(--hero-bg);
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 2;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ==============================================
   4. 按钮样式
   ============================================== */

.btn {
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: #0051D5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.btn-secondary, .btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover, .btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
}

/* ==============================================
   5. 通用组件样式
   ============================================== */

/* 章节标题样式 */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 卡片样式 */
.work-card, .article-card, .profile-card {
    background: var(--card-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.work-card:hover, .article-card:hover, .profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow-color);
    border-color: var(--primary-color);
}

/* ==============================================
   6. 作品区域样式
   ============================================== */

.works {
    padding: 100px 0;
    background: var(--works-bg);
    position: relative;
}

.works::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.works .container {
    position: relative;
    z-index: 1;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2.5rem;
    margin: 0 auto 3rem;
    max-width: 1200px;
}

/* ==============================================
   7. 文章区域样式
   ============================================== */

.articles {
    padding: 100px 0;
    background: var(--articles-bg);
    position: relative;
}

.articles::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.articles .container {
    position: relative;
    z-index: 1;
}

.articles-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2.5rem;
    margin: 0 auto 3rem;
    max-width: 1200px;
}

/* ==============================================
   8. 目录系统样式
   ============================================== */

.articles-catalog {
    background: var(--card-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: fit-content;
    position: sticky;
    top: 100px;
    transition: var(--transition);
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 122, 255, 0.05);
}

.catalog-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.catalog-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-toggle:hover {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.toggle-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

/* 目录内容区域 */
.catalog-content {
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.catalog-content::-webkit-scrollbar {
    width: 6px;
}

.catalog-content::-webkit-scrollbar-track {
    background: var(--surface-color);
}

.catalog-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.catalog-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 一级目录（分类） */
.catalog-category {
    margin-bottom: 1.5rem;
}

.catalog-category:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.category-header:hover {
    background: rgba(0, 122, 255, 0.15);
}

.category-icon {
    font-size: 1.25rem;
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

/* 计数徽章基础样式 */
.badge-count {
    background: var(--primary-color);
    color: white !important;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    -webkit-text-fill-color: white !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
}

.category-count {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 1.3rem;
    height: 1.3rem;
    background: var(--primary-color);
    color: white !important;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    -webkit-text-fill-color: white !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
}

/* 二级目录（分区） */
.catalog-section {
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.catalog-section-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    display: flex;
    align-items: center;
    cursor: pointer;
}

.catalog-section-title .section-text {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
}

.catalog-section-title:hover {
    transform: translateX(5px);
}

.catalog-section-title:hover .section-text {
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 折叠图标 */
.section-toggle-icon {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.section-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.section-text {
    flex: 1;
}

.section-count {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    min-width: 1.2rem;
    height: 1.2rem;
    background: var(--primary-color);
    opacity: 1;
    color: white !important;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    -webkit-text-fill-color: white !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
}

.catalog-section-title:hover .section-count {
    opacity: 1;
    background: var(--secondary-color);
}

/* 三级目录（子分区） */
.subsection {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(0, 122, 255, 0.2);
}

.subsection-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    opacity: 0.8;
}

.subsection:hover .subsection-title {
    color: var(--primary-color);
    opacity: 1;
}

/* 文章列表 */
.catalog-articles {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.catalog-article {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.875rem;
    line-height: 1.4;
}

.catalog-article:hover {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.catalog-article.active {
    background: rgba(0, 122, 255, 0.2);
    color: var(--primary-color);
    font-weight: 500;
}

/* ==============================================
   9. 文章卡片样式
   ============================================== */

.article-image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.article-gradient {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.8;
    transition: var(--transition);
}

.article-gradient.gradient-1 { background: var(--gradient-1); }
.article-gradient.gradient-2 { background: var(--gradient-2); }
.article-gradient.gradient-3 { background: var(--gradient-3); }
.article-gradient.gradient-4 { background: var(--gradient-4); }
.article-gradient.gradient-5 { background: var(--gradient-5); }
.article-gradient.gradient-6 { background: var(--gradient-6); }

.article-card:hover .article-gradient {
    opacity: 1;
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.article-date {
    color: var(--text-tertiary);
}

.article-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.article-link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* 新增文章卡片样式 */
.article-section {
    background: rgba(255, 59, 48, 0.1);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-read-time {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.article-read-time-badge {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(0, 122, 255, 0.2);
    transition: var(--transition);
}

.article-link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* ==============================================
   10. About 区域样式
   ============================================== */

.about {
    padding: 100px 0;
    background: var(--about-bg);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 0;
}

.about .container {
    position: relative;
    z-index: 1;
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.about-intro {
    flex: 1;
}

.about-details {
    display: flex;
    justify-content: center;
}

.skills {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    width: 100%;
}

.skills-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.about-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* 技能条样式 */
.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skill-name {
    font-weight: 500;
    color: var(--text-primary);
}

.skill-bar {
    height: 8px;
    background: var(--card-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 4px;
    transition: width 1s ease-out;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.profile-card {
    text-align: center;
    min-width: 200px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3);
    transition: var(--transition);
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 122, 255, 0.4);
}

.profile-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* ==============================================
   11. Contact 区域样式
   ============================================== */

.contact {
    padding: 100px 0;
    background: var(--contact-bg);
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.contact .container {
    position: relative;
    z-index: 1;
}

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

.contact-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--card-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.contact-method:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 122, 255, 0.3);
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-text {
    font-weight: 500;
}

/* ==============================================
   12. Footer 样式
   ============================================== */

.footer {
    background: var(--background-color);
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
}

/* ==============================================
   13. 动画效果
   ============================================== */

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

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ==============================================
   14. 响应式设计
   ============================================== */

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        left: 0;
    }

    .hero {
        padding: 80px 20px 50px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .about-header {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .articles-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .articles-catalog {
        position: static;
        order: 2;
    }

    .articles-main {
        order: 1;
    }

    .articles-grid, .works-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 100%;
    }

    .container {
        padding: 0 20px;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    .contact-methods {
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .about-title, .contact-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title, .about-title, .contact-title {
        font-size: 2rem;
    }
}

/* ==============================================
   15. 加载动画
   ============================================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

/* ==============================================
   16. 自定义滚动条
   ============================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--card-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ==============================================
   17. 涟漪效果
   ============================================== */

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
}

/* ==============================================
   18. 作品卡片特殊样式
   ============================================== */

.video-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.work-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.work-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.work-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
    transition: var(--transition);
}

.work-card:hover .play-icon {
    transform: scale(1.1);
    background: var(--primary-color);
    color: white;
}

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

.work-content {
    padding: 1.5rem;
}

.work-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.work-date {
    color: var(--text-tertiary);
}

.work-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.work-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
    transition: var(--transition);
}

.work-card:hover .work-title {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

.work-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.work-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tag {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 工作卡片内容切换动画 */
.work-content {
    position: relative;
    min-height: 180px;
    padding-bottom: 1rem;
}

.work-title, .work-excerpt, .work-details, .work-description {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.work-excerpt-default, .work-details-hover, .work-description-hover {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.work-meta, .work-tech {
    transition: opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease;
}

.work-details-hover, .work-description-hover {
    opacity: 0;
    transform: translateY(10px);
    position: absolute;
    width: calc(100% - 3rem);
    left: 1.5rem;
}

.work-card:hover .work-excerpt-default {
    opacity: 0;
    transform: translateY(-10px);
    position: absolute;
    width: calc(100% - 3rem);
    left: 1.5rem;
}

.work-card:hover .work-details-hover,
.work-card:hover .work-description-hover {
    opacity: 1;
    transform: translateY(0);
    position: relative;
    width: 100%;
    left: 0;
}

/* 悬停时隐藏元数据和技术栈 */
.work-card:hover .work-meta {
    opacity: 0;
    transform: translateY(-10px);
    position: absolute;
    margin-bottom: 0;
}

.work-card:hover .work-tech {
    opacity: 0;
    transform: translateY(10px);
    position: absolute;
    bottom: 1.5rem;
    margin-top: 0;
}

/* 为描述和详细信息添加样式 */
.work-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.work-details {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* ==============================================
   19. 搜索功能样式
   ============================================== */

/* 搜索按钮 */
.search-item {
    margin-left: 1rem;
}

.search-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.search-btn:hover {
    background: var(--surface-color);
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.search-btn:active {
    transform: scale(0.95);
}

.search-icon {
    font-size: 1.1rem;
}

/* 搜索模态框 */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.search-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--surface-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px var(--shadow-color);
    overflow: hidden;
    transition: var(--transition);
}

.search-modal.active .search-container {
    transform: translate(-50%, -50%) scale(1);
}

/* 搜索头部 */
.search-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-color);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-tertiary);
    font-size: 1.1rem;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 3rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.1rem;
    padding: 0.4rem;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
}

.search-clear:hover {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.search-clear.visible {
    opacity: 1;
    visibility: visible;
}

.search-separator {
    width: 1px;
    height: 2.5rem;
    background: var(--border-color);
    margin: 0 1rem;
}

.search-close {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.2);
    color: var(--accent-color);
    font-size: 1.1rem;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.search-close:hover {
    background: rgba(255, 59, 48, 0.2);
    color: var(--accent-color);
    transform: scale(1.05);
}

/* 搜索内容 */
.search-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}

.search-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-placeholder p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.search-placeholder small {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 搜索结果 */
.search-results {
    animation: fadeIn 0.3s ease;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-query {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-result-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.search-result-item::after {
    content: '点击查看';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.search-result-item:hover::after {
    opacity: 1;
}

.search-result-item:hover {
    background: var(--card-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.15);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.video-indicator {
    background: rgba(255, 59, 48, 0.2);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: auto;
    white-space: nowrap;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.result-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-tag {
    background: rgba(0, 122, 255, 0.2);
    color: var(--primary-color);
}

.work-tag {
    background: rgba(255, 59, 48, 0.2);
    color: var(--accent-color);
}

.result-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.result-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.result-category, .result-section, .result-date, .result-read-time {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.result-category {
    font-weight: 500;
}

.result-read-time {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

/* 高亮文本 */
mark {
    background: rgba(255, 204, 0, 0.3);
    color: #FFD700;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 500;
}

/* 无结果 */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.no-results small {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 搜索动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-container {
        width: 95%;
        max-height: 90vh;
    }

    .search-header {
        padding: 1rem;
    }

    .search-input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.95rem;
    }

    .search-content {
        max-height: 70vh;
        padding: 0.75rem;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-title {
        font-size: 1rem;
    }

    .result-description {
        font-size: 0.9rem;
    }

    .result-meta {
        gap: 0.75rem;
    }
}

/* 滚动条样式 */
.search-content::-webkit-scrollbar {
    width: 6px;
}

.search-content::-webkit-scrollbar-track {
    background: var(--background-color);
}

.search-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.search-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ==============================================
   20. 工具类和杂项样式
   ============================================== */

.load-more {
    text-align: center;
    margin-top: 3rem;
}

.hero-visual {
    display: none;
}

.floating-card {
    background: var(--card-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
    animation: float 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.floating-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-1);
    opacity: 0.1;
    border-radius: 20px;
}

.code-snippet {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}