/* ===== 项目页面公共样式（项目一览 & 项目详情） ===== */

/* ============================================================
   1. 页面标题 & 面包屑
   ============================================================ */
.page-header {
    padding: 32px 0 20px;
    background: white;
    border-bottom: 1px solid #eef2f7;
}

.breadcrumb {
    font-size: 0.85rem;
    color: #6b7f99;
    margin-bottom: 12px;
}

.breadcrumb a {
    color: #0071c5;
    text-decoration: none;
}

.breadcrumb i {
    margin: 0 8px;
    font-size: 0.6rem;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0b1e33;
    margin-bottom: 8px;
}

.page-desc {
    color: #4d627a;
    font-size: 1rem;
    max-width: 600px;
}


/* ============================================================
   2. 项目统计 & 卡片网格（项目一览）
   ============================================================ */
.project-stats {
    color: #6b7f99;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.project-stats strong {
    color: #0b1e33;
}

.project-grid {
    margin: 24px 0 40px;
}

/* ----- 项目卡片 ----- */
.project-card {
    background: white;
    border-radius: 20px;
    padding: 20px 20px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f7;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 60, 120, 0.08);
    border-color: #cbd9e9;
}

.project-card.featured {
    border-color: #ffb81c;
    background: #fffcf0;
}

/* ----- 卡片徽章 ----- */
.project-badge {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.badge-status,
.badge-type {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-status {
    background: #e6edf6;
    color: #4d627a;
}

.badge-status.hot {
    background: #ff6b6b;
    color: white;
}

.badge-status.new {
    background: #4ecdc4;
    color: white;
}

.badge-type.open-source {
    background: #2d8b46;
    color: white;
}

.badge-type.closed-source {
    background: #6c7a8a;
    color: white;
}

/* ----- 卡片缩略图 ----- */
.project-thumbnail {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: #f0f3f8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

/* 缩略图图标（占位用） */
.project-thumbnail i {
    font-size: 3.2rem;
    color: #0071c5;
    opacity: 0.5;
}

/* 缩略图真实图片 */
.project-thumbnail .thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover .project-thumbnail .thumb-img {
    transform: scale(1.05);
}

/* ----- 卡片内容 ----- */
.project-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0b1e33;
    margin-bottom: 6px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 10px;
}

.project-tags span {
    font-size: 0.65rem;
    background: #f0f3f8;
    color: #4d627a;
    padding: 1px 10px;
    border-radius: 12px;
}

.project-card .project-desc {
    font-size: 0.82rem;
    color: #4d627a;
    line-height: 1.5;
    flex: 1;
    margin-bottom: 12px;
}

.project-meta {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid #eef2f7;
    margin-bottom: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #6b7f99;
}

.meta-item i {
    font-size: 0.7rem;
}

/* ----- 卡片操作按钮 ----- */
.project-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.link-btn {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    background: #f0f3f8;
    color: #4d627a;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.link-btn:hover:not(.disabled) {
    background: #e3ecf5;
    color: #0071c5;
}

.link-btn.primary {
    background: #0071c5;
    color: white;
}

.link-btn.primary:hover:not(.disabled) {
    background: #005a9e;
}

.link-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ============================================================
   3. 项目详情页（main.html）
   ============================================================ */

/* ----- 详情区块容器 ----- */
.detail-section {
    background: white;
    border-radius: 28px;
    padding: 36px 40px;
    margin: 32px 0;
    border: 1px solid #eef2f7;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.detail-section h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #0b1e33;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-section h2 i {
    color: #0071c5;
    font-size: 1.4rem;
}

/* ----- 综述（摘要 + 元数据） ----- */
.summary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.summary-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #1f3349;
}

.summary-text p {
    margin-bottom: 16px;
}

.summary-meta {
    background: #f5f8fc;
    border-radius: 20px;
    padding: 24px 28px;
    border: 1px solid #e9edf2;
}

.summary-meta .meta-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.summary-meta .meta-row:last-child {
    border-bottom: none;
}

.summary-meta .meta-label {
    color: #6b7f99;
}

.summary-meta .meta-value {
    font-weight: 500;
    color: #0b1e33;
}

.summary-meta .meta-value .badge-tag {
    background: #e3ecf5;
    color: #0052a5;
    padding: 2px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ----- 技术规格表格 ----- */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.spec-table th {
    text-align: left;
    padding: 12px 16px 12px 0;
    font-weight: 600;
    color: #0b1e33;
    width: 160px;
    border-bottom: 1px solid #eef2f7;
}

.spec-table td {
    padding: 12px 16px 12px 0;
    color: #2d4059;
    border-bottom: 1px solid #eef2f7;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
    border-bottom: none;
}

/* ----- 照片网格 ----- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.photo-item {
    border-radius: 16px;
    overflow: hidden;
    background: #f0f3f8;
    border: 1px solid #e9edf2;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 60, 120, 0.10);
    border-color: #0071c5;
}

.photo-item i {
    font-size: 2.8rem;
    color: #0071c5;
    opacity: 0.4;
}

.photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(11, 30, 51, 0.75));
    color: white;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 24px 14px 10px 14px;
    text-align: center;
    backdrop-filter: blur(2px);
    letter-spacing: 0.3px;
    transition: opacity 0.3s ease;
}

/* ----- 占位符样式（用于暂无图片的项目） ----- */
.photo-placeholder {
    width: 100%;
    height: 220px;
    background: #f0f3f8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7f99;
    border: 2px dashed #dce3ec;
    border-radius: 0;
    transition: all 0.3s ease;
}

.photo-placeholder i {
    font-size: 2.8rem;
    color: #0071c5;
    opacity: 0.35;
    margin-bottom: 8px;
}

.photo-placeholder span {
    font-size: 0.8rem;
    color: #8fa3bb;
}

.photo-item:hover .photo-placeholder {
    border-color: #0071c5;
    background: #f8faff;
}

/* ----- 真实图片样式 ----- */
.photo-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: #f5f7fa;
    transition: transform 0.4s ease;
}

.photo-item:hover .photo-img {
    transform: scale(1.03);
}

/* ----- 资源链接网格（视频 & 文档） ----- */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: #f5f8fc;
    border-radius: 16px;
    border: 1px solid #e9edf2;
    text-decoration: none;
    color: #1f3349;
    transition: all 0.2s;
}

.resource-link:hover {
    background: #e7f0fa;
    border-color: #0071c5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 113, 197, 0.06);
}

.resource-link i:first-child {
    font-size: 1.6rem;
    color: #0071c5;
    width: 36px;
    text-align: center;
}

.resource-link .link-info {
    display: flex;
    flex-direction: column;
}

.resource-link .link-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.resource-link .link-desc {
    font-size: 0.75rem;
    color: #6b7f99;
}

.resource-link .link-arrow {
    margin-left: auto;
    color: #b0c7df;
    transition: 0.2s;
}

.resource-link:hover .link-arrow {
    color: #0071c5;
    transform: translateX(4px);
}


/* ============================================================
   4. 分页
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 32px 0 16px;
}

.page-btn {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #4d627a;
    font-size: 0.85rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: #f0f3f8;
    border-color: #dce3ec;
}

.page-btn.active {
    background: #0071c5;
    color: white;
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================================
   6. 图片放大查看器（Lightbox）
   ============================================================ */

.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 40px 60px;
}

.image-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-overlay img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
    -webkit-user-drag: none;
}

.image-overlay.active img {
    transform: scale(1);
}

/* 关闭按钮 */
.image-overlay .close-btn {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 2.8rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    line-height: 1;
}

.image-overlay .close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

/* 图片说明文字 */
.image-overlay .overlay-caption {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 400;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 24px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
    text-align: center;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .image-overlay {
        padding: 16px;
    }
    
    .image-overlay .close-btn {
        top: 12px;
        right: 16px;
        font-size: 2rem;
        width: 40px;
        height: 40px;
    }
    
    .image-overlay .overlay-caption {
        font-size: 0.8rem;
        padding: 6px 16px;
        bottom: 16px;
        white-space: normal;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .image-overlay .close-btn {
        top: 8px;
        right: 12px;
        font-size: 1.6rem;
        width: 34px;
        height: 34px;
    }
    
    .image-overlay .overlay-caption {
        font-size: 0.7rem;
        padding: 4px 12px;
        bottom: 12px;
    }
}
/* ============================================================
   5. 响应式适配
   ============================================================ */

/* ----- 平板 (≤992px) ----- */
@media (max-width: 992px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .photo-img,
    .photo-placeholder {
        height: 180px;
    }
}

/* 手机 (≤600px) */
@media (max-width: 600px) {
    .photo-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .photo-img,
    .photo-placeholder {
        height: 140px;
    }

    .photo-placeholder i {
        font-size: 2rem;
    }

    .photo-placeholder span {
        font-size: 0.7rem;
    }

    .photo-label {
        font-size: 0.7rem;
        padding: 16px 10px 8px 10px;
    }
}

/* 小手机 (≤400px) */
@media (max-width: 400px) {
    .photo-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .photo-img,
    .photo-placeholder {
        height: 110px;
    }

    .photo-placeholder i {
        font-size: 1.6rem;
    }

    .photo-placeholder span {
        font-size: 0.6rem;
    }

    .photo-label {
        font-size: 0.6rem;
        padding: 12px 8px 6px 8px;
    }
}