/* ============================================
   个人网站 - 主样式文件
   黑白风格设计
   ============================================ */

/* CSS变量定义 - 便于主题管理 */
:root {
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-gray-dark: #333333;
    --color-gray-medium: #666666;
    --color-gray-light: #E5E5E5;
    --font-size-h1: 72px;
    --font-size-h2: 48px;
    --font-size-h3: 24px;
    --font-size-body: 18px;
    --spacing-section: 160px;
    --spacing-element: 60px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--color-black);
    background-color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* ============================================
   导航栏样式
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-gray-light);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.nav-logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-black);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-link {
    color: var(--color-gray-medium);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-black);
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--color-black);
    transition: all 0.3s ease;
}

/* ============================================
   Hero区域样式
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
    background-color: var(--color-white);
}

.hero-content {
    max-width: 800px;
    padding: 0 40px;
}

.hero-title {
    font-size: var(--font-size-h1);
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 20px;
    letter-spacing: -2px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 28px;
    color: var(--color-gray-medium);
    font-weight: 300;
    margin-bottom: 60px;
}

.scroll-indicator {
    margin-top: 80px;
    animation: bounce 2s infinite;
    color: var(--color-gray-medium);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

.section-title {
    font-size: var(--font-size-h2);
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: var(--spacing-element);
    text-align: center;
    letter-spacing: -1px;
}

/* ============================================
   关于我区域样式
   ============================================ */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: var(--font-size-body);
    color: var(--color-gray-dark);
    line-height: 1.8;
    margin-bottom: 40px;
}

.quote {
    font-size: 24px;
    font-style: italic;
    color: var(--color-black);
    margin: 60px 0;
    padding: 40px;
    border-left: 3px solid var(--color-black);
    text-align: left;
    background-color: #FAFAFA;
}

/* ============================================
   作品展示区域样式
   ============================================ */
.works-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 60px;
}

.work-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-gray-light);
    transition: all 0.3s ease;
    overflow: hidden;
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 视频容器样式（兼容图片） */
.work-image,
.work-video {
    width: 100%;
    height: 150px;
    background-color: var(--color-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* 图片自适应样式 */
.work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例，填充容器 */
    object-position: center; /* 图片居中显示 */
    display: block;
    transition: transform 0.3s ease;
}

/* 视频自适应样式 */
.work-video video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例，填充容器 */
    object-position: center; /* 视频居中显示 */
    display: block;
    background-color: var(--color-black);
}

/* iframe视频自适应样式 */
.work-video iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

/* 视频封面层样式 */
.video-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-black);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.video-cover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    z-index: 1;
}

.video-cover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    width: 0;
    height: 0;
    border-left: 20px solid var(--color-black);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    z-index: 2;
}

.video-cover.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 视频容器添加相对定位 */
.work-video {
    position: relative;
}

/* 图片悬停效果 */
.work-card:hover .work-image img {
    transform: scale(1.05); /* 悬停时轻微放大 */
}

.work-placeholder {
    color: var(--color-gray-medium);
    font-size: 18px;
}

.work-info {
    padding: 30px;
}

.work-title {
    font-size: var(--font-size-h3);
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: 15px;
}

.work-description {
    font-size: 16px;
    color: var(--color-gray-medium);
    line-height: 1.6;
    margin-bottom: 20px;
    /* 默认只显示3行，超过部分用省略号 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

/* 展开状态：显示全部内容 */
.work-description.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.work-link {
    color: var(--color-black);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.work-link:hover {
    transform: translateX(5px);
}

/* ============================================
   时间线区域样式
   ============================================ */
.timeline-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: 40px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--color-gray-light);
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    padding-left: 60px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-black);
    border: 2px solid var(--color-white);
}

.timeline-year {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: 10px;
}

.timeline-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: 10px;
}

.timeline-description {
    font-size: 16px;
    color: var(--color-gray-medium);
    line-height: 1.6;
}

/* ============================================
   技能区域样式
   ============================================ */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.skill-tag {
    padding: 12px 24px;
    background-color: var(--color-white);
    border: 1px solid var(--color-black);
    color: var(--color-black);
    font-size: 16px;
    border-radius: 0;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tag:hover {
    background-color: var(--color-black);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* ============================================
   联系方式区域样式
   ============================================ */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: var(--font-size-body);
    color: var(--color-gray-dark);
    margin-bottom: 40px;
    line-height: 1.8;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-black);
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
    padding: 15px 30px;
    border: 1px solid var(--color-black);
}

.contact-link:hover {
    background-color: var(--color-black);
    color: var(--color-white);
    transform: translateY(-3px);
}

.contact-link svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   页脚样式
   ============================================ */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--color-gray-light);
    text-align: center;
}

.footer-text {
    font-size: 14px;
    color: var(--color-gray-medium);
}

/* ============================================
   动画效果
   ============================================ */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* 滚动条样式（可选） */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* ============================================
   作品详情模态框样式
   ============================================ */
.work-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.work-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background-color: var(--color-white);
    z-index: 10001;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--color-black);
    color: var(--color-white);
    border: none;
    font-size: 30px;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background-color: var(--color-gray-dark);
    transform: rotate(90deg);
}

.modal-video-container {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 比例 */
    position: relative;
    background-color: var(--color-black);
}

.modal-video-container iframe,
.modal-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-info {
    padding: 40px;
}

.modal-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 20px;
}

.modal-description {
    font-size: 18px;
    color: var(--color-gray-dark);
    line-height: 1.8;
}

/* 移动端模态框样式 */
@media screen and (max-width: 767px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }

    .modal-info {
        padding: 30px 20px;
    }

    .modal-title {
        font-size: 28px;
    }

    .modal-description {
        font-size: 16px;
    }
}

