/* ===== 案例展示页面 ===== */
.case-page {
    padding: 100px 5% 4rem;
    background: #f8fafc;
    min-height: 100vh;
}

.case-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* 页面标题 */
.case-header {
    text-align: center;
    margin-bottom: 3rem;
}

.case-header-tag {
    display: inline-block;
    padding: 4px 14px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.case-header h2 {
    font-size: 2.2rem;
    color: #1e293b;
    margin: 0 0 10px;
    font-weight: 700;
}

.case-header p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

/* 空状态 */
.case-empty {
    text-align: center;
    padding: 4rem 0;
    color: #94a3b8;
    font-size: 1rem;
}

/* 案例列表 - 横向卡片布局 */
.case-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 案例卡片 - 左右布局 */
.case-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.case-card-image {
    flex-shrink: 0;
    width: 280px;
    overflow: hidden;
}

.case-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.case-card:hover .case-card-image img {
    transform: scale(1.05);
}

.case-card-content {
    flex: 1;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.case-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.case-card-category {
    display: inline-block;
    padding: 3px 10px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.case-card-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.case-card-content h3 {
    font-size: 1.2rem;
    color: #1e293b;
    margin: 0 0 8px;
    font-weight: 700;
}

.case-card-content p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.case-card-link {
    font-size: 0.85rem;
    color: #2563eb;
    font-weight: 600;
    transition: color 0.2s;
}

.case-card:hover .case-card-link {
    color: #1d4ed8;
}

/* ===== 抽屉面板 ===== */
.case-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    visibility: hidden;
}

.case-drawer.active {
    pointer-events: auto;
    visibility: visible;
}

/* 遮罩 */
.case-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.case-drawer.active .case-drawer-backdrop {
    opacity: 1;
}

.case-drawer.closing .case-drawer-backdrop {
    opacity: 0;
}

/* 面板 */
.case-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 72%;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.case-drawer.active .case-drawer-panel {
    transform: translateX(0);
}

.case-drawer.closing .case-drawer-panel {
    transform: translateX(100%);
}

/* 关闭按钮 */
.case-drawer-close {
    position: sticky;
    top: 16px;
    float: right;
    margin: 16px 16px 0 0;
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-drawer-close:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: rotate(90deg);
}

/* 面板内容 */
.case-drawer-body {
    padding: 2rem 2.5rem 3rem;
    clear: both;
}

/* 第一行：图片 + 信息 */
.case-drawer-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.case-drawer-img {
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.case-drawer-img img {
    width: 100%;
    height: auto;
    display: block;
}

.case-drawer-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.case-drawer-cat {
    display: inline-block;
    padding: 4px 14px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    margin-bottom: 12px;
    width: fit-content;
}

.case-drawer-info h2 {
    font-size: 1.6rem;
    color: #1e293b;
    margin: 0 0 12px;
    font-weight: 700;
}

.case-drawer-date {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.case-drawer-date span {
    color: #94a3b8;
}

.case-drawer-date em {
    color: #64748b;
    font-style: normal;
}

.case-drawer-desc {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border-left: 3px solid #2563eb;
}

.case-drawer-desc p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.8;
    margin: 0;
}

/* 第二行起：案例信息 */
.case-drawer-specs {
    margin-top: 8px;
}

.case-drawer-specs-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px;
}

.spec-group {
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.spec-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    letter-spacing: 0.5px;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: #fff;
}

.spec-item {
    display: flex;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
}

.spec-item:nth-child(even) {
    border-right: none;
}

.spec-item:last-child,
.spec-item:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
}

.spec-label {
    color: #64748b;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-right: 12px;
}

.spec-val {
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .case-card-image {
        width: 220px;
    }

    .case-drawer-panel {
        width: 85%;
    }
}

@media (max-width: 768px) {
    .case-page {
        padding: 80px 4% 2rem;
    }

    .case-header h2 {
        font-size: 1.6rem;
    }

    .case-card {
        flex-direction: column;
    }

    .case-card-image {
        width: 100%;
        height: 180px;
    }

    .case-card-content {
        padding: 1.25rem;
    }

    .case-drawer-panel {
        width: 100%;
    }

    .case-drawer-body {
        padding: 1.5rem;
    }

    .case-drawer-top {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .case-drawer-info h2 {
        font-size: 1.3rem;
    }

    .spec-grid {
        grid-template-columns: 1fr;
    }

    .spec-item {
        border-right: none;
    }

    .spec-item:nth-last-child(2):nth-child(odd) {
        border-bottom: 1px solid #f1f5f9;
    }

    .spec-item:last-child {
        border-bottom: none;
    }
}
