/* ==============================
   项目17：项目展示平台
   Project Showcase Platform
   ============================== */

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
    background: #1a1a1a;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 网格背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* 颜色变量 */
:root {
    --primary-color: #ff6600;
    --secondary-color: #333333;
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --text-secondary: #999999;
}

/* ========== 顶部导航栏 ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 2px solid var(--secondary-color);
    position: relative;
    z-index: 100;
}

.nav-left .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.logo-icon {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    user-select: none;           /* 禁止选中 */
    pointer-events: none;        /* 禁止鼠标事件 */
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    user-select: none; /* 禁止选中文字 */
    pointer-events: none; /* 禁止鼠标事件 */
}

.logo-underline {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.control-group {
    display: flex;
    gap: 20px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-item label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.control-item input[type="range"] {
    width: 100px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.control-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.control-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 8px 16px;
    background: var(--secondary-color);
    border: none;
    color: var(--text-color);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
}

.view-btn.active {
    background: var(--primary-color);
    color: var(--text-color);
}

.view-btn:hover {
    background: var(--primary-color);
}

/* ========== 分类标签栏 ========== */
.category-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px 40px;
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 1px solid var(--secondary-color);
    position: relative;
    z-index: 99;
    flex-wrap: wrap;
}

.category-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.3s;
    position: relative;
}

.category-tab:hover {
    color: var(--text-color);
}

.category-tab.active {
    color: var(--text-color);
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

/* ========== 搜索框 ========== */
.search-container {
    display: flex;
    justify-content: center;
    padding: 20px 40px;
    background: rgba(26, 26, 26, 0.95);
    position: relative;
    z-index: 98;
}

.search-box {
    width: 300px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-box::placeholder {
    color: var(--text-secondary);
}

.search-box:focus {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.3);
}

/* ========== 项目网格区域 ========== */
.projects-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 40px; /* 左右各40px间距 */
    position: relative;
    z-index: 1;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    width: 100%; /* 确保网格占满容器宽度 */
}

/* 时间线视图下的网格样式 */
.projects-grid .timeline-wrapper {
    width: 100%;
}

.project-card {
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    transition: filter 0.3s, box-shadow 0.3s, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    filter: brightness(0.6); /* 默认变暗 */
    position: relative; /* 为project-info的绝对定位提供参考 */
}

/* 新卡片进入动画 */
.project-card.slide-in {
    animation: slideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 卡片移出动画 */
.project-card.slide-out {
    animation: slideOut 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-50px);
    }
}

.project-card:hover {
    filter: brightness(1); /* hover时恢复亮度 */
    box-shadow: 0 10px 30px rgba(255, 102, 0, 0.2);
}

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.1) 100%);
    animation: shimmer 3s infinite;
}

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

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    /* 从底部往上约1/5就完全透明*/
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
    opacity: 0; /* 默认隐藏 */
    transition: opacity 0.5s;
    pointer-events: none; /* 让鼠标事件穿透蒙版 */
}

.project-card:hover .project-info {
    opacity: 1; /* hover时显示 */
}

.project-number {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.project-title {
    font-size: 16px;
    color: var(--text-color);
    font-weight: 500;
}

.project-category {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* ========== 无结果提示 ========== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results-text {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.no-results-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== 分页区域 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--secondary-color);
    border: none;
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    background: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: var(--text-color);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn:disabled:hover {
    background: var(--secondary-color);
}

/* ========== 时间线视图样式 ========== */
.timeline-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px;
    border: none;
    background: transparent;
}

.timeline-row {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.timeline-projects {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.timeline-projects .project-card {
    margin: 0;
    height: 250px; /* 固定高度 */
    display: flex;
    flex-direction: column;
}

.timeline-projects .project-card .project-image {
    flex: 1;
    height: auto;
}

.timeline-projects .empty-slot {
    background: transparent;
    border: 2px dashed rgba(255, 102, 0, 0.2);
    box-sizing: border-box;
    height: 250px; /* 固定高度 */
}

/* 时间线视图：卡片信息使用渐变背景 */
.timeline-projects .project-card .project-info {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 70%);
    opacity: 1;
}

/* 时间线视图：日期卡片样式 */
.timeline-date-box {
    width: 80px;
    height: 100px;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.timeline-date-box.empty-date {
    background: transparent;
    border: none;
}

.date-day {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
}

.date-month-year {
    font-size: 14px;
    color: #ff6600;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.3);
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .nav-right {
        flex-wrap: wrap;
        gap: 15px;
    }

    .control-group {
        flex-wrap: wrap;
        gap: 10px;
    }

    .category-bar {
        gap: 15px;
        padding: 15px 20px;
    }

    .category-tab {
        font-size: 12px;
        padding: 6px 10px;
    }

    .search-box {
        width: 100%;
        max-width: 300px;
    }

    .projects-container {
        padding: 30px 20px; /* 移动端左右20px间距 */
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* 时间线响应式 - 平板 */
    .timeline-wrapper {
        padding: 30px 20px;
        max-width: 100%;
    }

    .timeline-row {
        gap: 15px;
    }

    .timeline-projects {
        gap: 15px;
    }

    .timeline-date-box {
        width: 70px;
        height: 90px;
    }

    .date-day {
        font-size: 40px;
    }

    .date-month-year {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 10px 15px;
    }

    .control-item {
        flex: 1;
    }

    .control-item input[type="range"] {
        width: 80px;
    }

    .view-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .projects-container {
        padding: 20px 15px; /* 小屏手机左右15px间距 */
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* 时间线响应式 - 手机 */
    .timeline-wrapper {
        padding: 20px 15px;
        max-width: 100%;
    }

    .timeline-row {
        flex-direction: column;
        gap: 15px;
    }

    .timeline-projects {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .timeline-date-box {
        width: 100%;
        height: 60px;
        flex-direction: row;
        gap: 10px;
    }

    .date-day {
        font-size: 32px;
        margin-bottom: 0;
    }

    .date-month-year {
        font-size: 13px;
    }
}
