/* 自定义变量 */
:root {
    --primary-color: #4a6fa5;
    --primary-light: #6b8cb8;
    --primary-dark: #345681;
    --secondary-color: #ff85a2;
    --secondary-light: #ff9db5;
    --secondary-dark: #e56c89;
    --text-color: #333333;
    --light-bg: #f9f9f9;
    --dark-bg: #2c3e50;
    --white: #ffffff;
    --gray: #e0e0e0;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 工具类 */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.border-primary { border-color: var(--primary-color); }
.border-secondary { border-color: var(--secondary-color); }

/* 基础样式 */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 导航栏样式 */
header {
    transition: var(--transition-smooth);
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hamburger span {
    transition: var(--transition-smooth);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu {
    height: 0;
    opacity: 0;
    pointer-events: none;
    background-color: rgba(255, 255, 255, 0.98);
}

.mobile-menu.active {
    height: 100vh;
    opacity: 1;
    pointer-events: auto;
    background-color: rgba(255, 255, 255, 0.98);
}

/* 时间轴样式 - 响应式设计 */
.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* 桌面端时间轴 */
@media (min-width: 768px) {
    .timeline-container::before {
        content: '';
        position: absolute;
        width: 4px;
        background-color: var(--gray);
        top: 0;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 2px;
    }

    .timeline-item {
        position: relative;
        width: 50%;
        padding: 20px 40px;
        box-sizing: border-box;
        margin-bottom: 30px;
        opacity: 0;
        transform: translateY(30px);
        transition: var(--transition-smooth);
    }

    .timeline-item.animated {
        opacity: 1;
        transform: translateY(0);
    }

    .timeline-item:nth-child(odd) {
        left: 0;
        text-align: right;
    }

    .timeline-item:nth-child(even) {
        left: 50%;
        text-align: left;
    }

    .timeline-content {
        position: relative;
        padding: 20px;
        background-color: var(--white);
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        transition: var(--transition-smooth);
    }

    .timeline-content:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

    .timeline-dot {
        position: absolute;
        width: 20px;
        height: 20px;
        background-color: var(--white);
        border: 4px solid var(--primary-color);
        border-radius: 50%;
        top: 30px;
        z-index: 1;
        transition: var(--transition-smooth);
    }

    .timeline-item:nth-child(odd) .timeline-dot {
        right: -10px;
    }

    .timeline-item:nth-child(even) .timeline-dot {
        left: -10px;
    }

    .timeline-content:hover + .timeline-dot,
    .timeline-dot:hover {
        transform: scale(1.2);
        background-color: var(--primary-light);
    }

    .timeline-date {
        display: inline-block;
        padding: 5px 15px;
        background-color: var(--primary-color);
        color: var(--white);
        border-radius: 20px;
        font-weight: 600;
        font-size: 0.9rem;
        margin-bottom: 10px;
        box-shadow: 0 3px 10px rgba(74, 111, 165, 0.2);
    }

    /* 恋爱记录特殊样式 */
    .love-timeline::before {
        background-color: var(--secondary-light);
    }

    .love-timeline .timeline-dot {
        border-color: var(--secondary-color);
    }

    .love-timeline .timeline-date {
        background-color: var(--secondary-color);
        box-shadow: 0 3px 10px rgba(255, 133, 162, 0.2);
    }

    .love-timeline .timeline-content:hover + .timeline-dot,
    .love-timeline .timeline-dot:hover {
        background-color: var(--secondary-light);
    }
}

/* 移动端时间轴 */
@media (max-width: 767px) {
    .timeline-container {
        padding: 0 20px;
    }

    .timeline-container::before {
        content: '';
        position: absolute;
        width: 4px;
        background-color: var(--gray);
        top: 0;
        bottom: 0;
        left: 20px;
        border-radius: 2px;
    }

    .timeline-item {
        position: relative;
        width: 100%;
        padding-left: 50px;
        padding-right: 15px;
        margin-bottom: 30px;
        opacity: 0;
        transform: translateY(30px);
        transition: var(--transition-smooth);
    }

    .timeline-item.animated {
        opacity: 1;
        transform: translateY(0);
    }

    .timeline-content {
        position: relative;
        padding: 15px;
        background-color: var(--white);
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        transition: var(--transition-smooth);
    }

    .timeline-content:active {
        transform: scale(0.98);
    }

    .timeline-dot {
        position: absolute;
        width: 16px;
        height: 16px;
        background-color: var(--white);
        border: 3px solid var(--primary-color);
        border-radius: 50%;
        top: 24px;
        left: 14px;
        z-index: 1;
    }

    .timeline-date {
        display: inline-block;
        padding: 4px 12px;
        background-color: var(--primary-color);
        color: var(--white);
        border-radius: 16px;
        font-weight: 600;
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    /* 恋爱记录特殊样式 */
    .love-timeline::before {
        background-color: var(--secondary-light);
    }

    .love-timeline .timeline-dot {
        border-color: var(--secondary-color);
    }

    .love-timeline .timeline-date {
        background-color: var(--secondary-color);
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* 触摸优化 */
@media (hover: none) {
    a:active, button:active {
        transform: scale(0.98);
    }
    
    .timeline-content:active {
        transform: translateY(-2px);
    }
}

/* 响应式排版 */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .timeline-content h3 {
        font-size: 1.2rem;
    }
}

/* 滚动指示器 */
.scroll-down {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* 触摸反馈优化 */
a, button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}