/* ═══════════════════════════════════════
   VOICE PAGE — cases.css
   案例展示：5 Tab + 横版卡片 + 详情模态框
════════════════════════════════════════ */

:root {
    --card-radius: 12px;
    --card-bg:     #fff;
}

/* ═══════════════════════════════════════
   GALLERY 主区域
════════════════════════════════════════ */
#gallery {
    padding: 48px 0 80px;
    background: #f7f7f5;
    min-height: 60vh;
}

@keyframes fadeUpCard {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.tab-pane.active .case-card { animation: fadeUpCard 0.32s ease both; }

/* 最多 21 张卡片（美术生 Tab） */
.tab-pane.active .case-card:nth-child(1)  { animation-delay:   0ms; }
.tab-pane.active .case-card:nth-child(2)  { animation-delay:  45ms; }
.tab-pane.active .case-card:nth-child(3)  { animation-delay:  88ms; }
.tab-pane.active .case-card:nth-child(4)  { animation-delay: 128ms; }
.tab-pane.active .case-card:nth-child(5)  { animation-delay: 166ms; }
.tab-pane.active .case-card:nth-child(6)  { animation-delay: 202ms; }
.tab-pane.active .case-card:nth-child(7)  { animation-delay: 236ms; }
.tab-pane.active .case-card:nth-child(8)  { animation-delay: 268ms; }
.tab-pane.active .case-card:nth-child(9)  { animation-delay: 298ms; }
.tab-pane.active .case-card:nth-child(10) { animation-delay: 326ms; }
.tab-pane.active .case-card:nth-child(11) { animation-delay: 352ms; }
.tab-pane.active .case-card:nth-child(12) { animation-delay: 376ms; }
.tab-pane.active .case-card:nth-child(13) { animation-delay: 398ms; }
.tab-pane.active .case-card:nth-child(14) { animation-delay: 418ms; }
.tab-pane.active .case-card:nth-child(15) { animation-delay: 436ms; }
.tab-pane.active .case-card:nth-child(16) { animation-delay: 452ms; }
.tab-pane.active .case-card:nth-child(17) { animation-delay: 466ms; }
.tab-pane.active .case-card:nth-child(18) { animation-delay: 478ms; }
.tab-pane.active .case-card:nth-child(19) { animation-delay: 488ms; }
.tab-pane.active .case-card:nth-child(20) { animation-delay: 496ms; }
.tab-pane.active .case-card:nth-child(21) { animation-delay: 502ms; }

/* ── 案例网格 ─────────────────────────────────────────────── */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding-top: 8px;
}

/* ── 案例卡片 ─────────────────────────────────────────────── */
.case-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    cursor: pointer;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    display: flex;
    flex-direction: column;
}

.case-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,.13);
    transform: translateY(-3px);
}

.card-img {
    overflow: hidden;
    background: #e8e8e5;
    flex-shrink: 0;
}

.card-img img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

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

.card-info {
    padding: 10px 14px 12px;
    text-align: center;
}

.card-name {
    font-size: var(--font-size-14);
    font-weight: 600;
    color: #333;
    letter-spacing: .04em;
    margin: 0 0 3px;
}

.card-school {
    font-size: var(--font-size-14);
    font-weight: 700;
    color: var(--timeline-accent);
    margin: 1px 0 0;
    line-height: 1.3;
    letter-spacing: .04em;
}

/* ═══════════════════════════════════════
   案例详情模态框（容器由 sheetModal 提供）
════════════════════════════════════════ */

/* 桌面 center 变体：960px 两栏面板 */
#modal-case[data-variant="center"] .modal-inner {
    max-width: min(960px, 100%);
    width: min(960px, 100%);
    max-height: 88vh;
    overflow-y: hidden;
    border-radius: 16px;
    background: #fff;
    border-color: rgba(0,0,0,.06);
    box-shadow: 0 40px 100px rgba(0,0,0,.28);
    display: flex;
    flex-direction: column;
}

/* 两栏布局 */
.cm-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.cm-left {
    width: 55%;
    flex-shrink: 0;
    overflow: hidden;
    background: #111;
    position: relative;
}

.cm-right {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    border-left: 1px solid #eee;
}

/* ── 左栏图片轮播 ─────────────────────────────────────────── */
.cm-slider {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    touch-action: pan-y pinch-zoom;
}

.cm-slider:active { cursor: grabbing; }

.cm-slides {
    display: flex;
    height: 100%;
    will-change: transform;
}

.cm-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #111;
}

.cm-slide-bg {
    position: absolute;
    inset: -30px;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.4) saturate(0.6);
}

.cm-slide img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    -webkit-user-drag: none;
}

.cm-slide-prev,
.cm-slide-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, background 0.2s;
    padding: 0;
}

.cm-slide-prev { left: 14px; }
.cm-slide-next { right: 14px; }
.cm-slide-prev:hover,
.cm-slide-next:hover { background: rgba(0,0,0,.65); }

.cm-slide-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    max-width: 80%;
}

.cm-slide-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    box-shadow: 0 1px 3px rgba(0,0,0,.5);
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s;
}

.cm-slide-dot.active {
    background: #fff;
}

.cm-slide-counter {
    position: absolute;
    top: 12px;
    left: 12px;          /* 移到左上，避开右上的关闭按钮 */
    z-index: 20;
    font-size: var(--font-size-14);
    font-weight: 500;
    color: rgba(255,255,255,.88);
    background: rgba(0,0,0,.38);
    padding: 3px 9px;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    line-height: 1.5;
}

.cm-slider:hover .cm-slide-prev,
.cm-slider:hover .cm-slide-next {
    opacity: 1;
    pointer-events: auto;
}

.cm-slider:hover .cm-slide-dots { opacity: 1; }
.cm-slider:hover .cm-slide-counter { opacity: 1; }

/* 触屏设备：箭头/dots/counter 常驻可见（hover 不可达） */
@media (hover: none), (max-width: 768px) {
    .cm-slide-prev,
    .cm-slide-next {
        opacity: 1;
        pointer-events: auto;
    }
    .cm-slide-dots,
    .cm-slide-counter { opacity: 1; }
}

/* 右栏各节 */
.cm-section { border-bottom: 1px solid #f0f0f0; }
.cm-section:last-child { border-bottom: none; }

.cm-section img {
    display: block;
    width: 100%;
    height: auto;
}

/* sticky 文字标题（随右栏滚动区固定） */
.cm-sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    padding: 8px 14px;
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.cm-sticky-header.scrolled {
    background-color: rgba(247, 246, 244, 0.8);
    border-bottom-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,.09);
}

.cm-sticky-header .cm-sticky-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cm-sticky-text {
    flex: 1;
    min-width: 0;
}

.cm-sticky-name {
    font-size: var(--font-size-14);
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.cm-sticky-school {
    font-size: var(--font-size-14);
    font-weight: 700;
    color: var(--timeline-accent);
    margin: 1px 0 0;
    line-height: 1.3;
}

.cm-sticky-meta {
    font-size: var(--font-size-14);
    color: #aaa;
    margin: 2px 0 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 至臻寄语 — 分隔标题 */
.cm-quote-divider {
    padding: 12px 14px 10px;
    font-size: var(--font-size-14);
    font-weight: 700;
    color: #fff;
    background: var(--timeline-accent);
    letter-spacing: .08em;
}

/* ═══════════════════════════════════════
   响应式
════════════════════════════════════════ */
@media (max-width: 1024px) {
    .cases-grid { gap: 18px; }
}

/* #tabs sticky top 由 style.css 的 .tab-nav 全局 var(--header-height) !important 统一管理 */

@media (max-width: 768px) {
    .tab-btn {
        padding: 16px 22px 14px;
        font-size: var(--font-size-16);
    }

    .tab-btn.active::after {
        left: 14px;
        right: 14px;
    }

    #gallery { padding: 28px 0 60px; }

    .cases-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cm-layout {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
    }

    .cm-left {
        width: 100%;
        height: 75vw;
        min-height: 200px;
        max-height: 48vh;
        flex-shrink: 0;
        overflow: hidden;
    }

    .cm-right {
        overflow: visible;
        border-left: none;
        border-top: 2px solid #eee;
    }

    .cm-slide-dots,
    .cm-slide-counter {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ═══════════════════════════════════════
   培训过程 — HTML 时间轴组件
════════════════════════════════════════ */
:root { --timeline-accent: var(--clr-primary); }

.process-timeline { padding: 20px 20px 12px; }

.process-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
}

.process-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 34px;
    width: 2px;
    bottom: 0;
    background: #e8e8e8;
    transform: translateX(-50%);
}

.step-icon-col { flex-shrink: 0; width: 34px; }

.step-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--timeline-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.step-icon svg path,
.step-icon svg polygon,
.step-icon svg polyline,
.step-icon svg rect,
.step-icon svg circle {
    fill: white !important;
}

.step-body { flex: 1; padding-bottom: 22px; }
.process-step:last-child .step-body { padding-bottom: 8px; }

.step-title {
    font-size: var(--font-size-14);
    font-weight: 700;
    color: #1a1a1a;
    margin: 6px 0 4px;
}

.step-content {
    font-size: var(--font-size-14);
    color: #888;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .process-timeline { padding: 16px 16px 8px; }
}

/* ═══════════════════════════════════════
   寄语 — HTML 卡片组件
════════════════════════════════════════ */
.quote-card {
    padding: 20px 20px 16px;
}

.quote-title {
    font-size: var(--font-size-16);
    font-weight: 700;
    color: var(--timeline-accent);
    line-height: 1.5;
    margin: 0 0 10px;
}

.quote-body p {
    font-size: var(--font-size-14);
    color: #555;
    line-height: 1.85;
    margin: 0 0 8px;
    text-indent: 2em;
}

.quote-body p:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
    .quote-card { padding: 16px 16px 12px; }
}

@media (max-width: 768px) {
    #gallery {
        padding: 34px 0 58px;
    }

    .cases-grid {
        gap: 12px;
        padding-top: 4px;
    }

    .case-card {
        border-radius: 12px;
        overflow: hidden;
    }

    /* 卡片配图：源图已统一比例，保持自然 width/height，不再强制 aspect-ratio + cover */
    .case-card img {
        width: 100%;
        height: auto;
    }

    .card-info {
        padding: 8px 10px 10px;
    }
}
