/* ==========================================
   Certificates 页专属样式
   ========================================== */

/* ---------- Hero (已对齐全站高级风格) ---------- */
.cert-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    padding: 100px 20px;
    overflow: hidden;
    color: #fff;
    background: #0a1f3d;
}
.cert-hero-bg {
    position: absolute; inset: 0;
    background: url('/images/banner/banner-heavy-duty-profile-cnc-machining.webp') center/cover no-repeat;
    opacity: 0.4;
    z-index: 1;
}
.cert-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(15,42,74,0.92) 0%, rgba(15,42,74,0.6) 55%, rgba(15,42,74,0.35) 100%);
    z-index: 2;
}
.cert-hero-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 标签小字 */
.cert-hero-label {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    letter-spacing: 1.5px;
    margin-bottom: 22px;
    font-weight: 600;
    text-transform: uppercase;
}

/* 主标题 */
.cert-hero h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin: 0 0 20px;
    color: #fff;
}

/* 副标题 */
.cert-hero p {
    font-size: 17px;
    color: #cbd5e1;
    line-height: 1.7;
    max-width: 680px;
    margin: 0 0 32px;
}

/* 按钮组 */
.cert-hero-cta { 
    display: flex; 
    gap: 14px; 
    flex-wrap: wrap; 
}
.cert-hero-btn { 
    display: inline-block; 
    background: #1d6fe8; 
    color: #fff; 
    padding: 14px 30px; 
    border-radius: 6px; 
    text-decoration: none; 
    font-size: 15px; 
    font-weight: 600; 
    transition: all 0.25s; 
    border: 1px solid #1d6fe8; 
}
.cert-hero-btn:hover { 
    background: #1557b8; 
    border-color: #1557b8; 
    transform: translateY(-2px); 
}
.cert-hero-btn-outline { 
    display: inline-block; 
    background: transparent; 
    color: #fff; 
    padding: 14px 30px; 
    border-radius: 6px; 
    text-decoration: none; 
    font-size: 15px; 
    font-weight: 600; 
    border: 1px solid rgba(255,255,255,0.4); 
    transition: all 0.25s; 
}
.cert-hero-btn-outline:hover { 
    background: rgba(255,255,255,0.1); 
    border-color: #fff; 
    transform: translateY(-2px); 
}

/* ---------- Certificates List ---------- */
.cert-list {
    padding: 80px 20px;
    background: var(--c-bg-soft);
}
.cert-list-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.cert-list-header {
    text-align: center;
    margin-bottom: 60px;
}
.cert-label {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--c-primary);
    font-weight: 700;
    margin-bottom: 12px;
}
.cert-list-header h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--c-dark);
    margin: 0 0 14px;
}
.cert-list-header p {
    font-size: 15px;
    color: var(--c-text-muted);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    align-items: stretch;
    max-width: 1100px;
    margin: 0 auto;
}

.cert-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    cursor: pointer;
}
.cert-card:hover {
    transform: translateY(-6px);
    border-color: #bfdbfe;
    box-shadow: 0 24px 40px -16px rgba(29, 111, 232, 0.22);
}

.cert-card-img {
    width: 100%;
    height: 320px;
    background: var(--c-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
    box-sizing: border-box;
    border-bottom: 1px solid #f1f5f9;
}
.cert-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
    box-shadow: 0 12px 32px -14px rgba(15, 23, 42, 0.28);
    border-radius: 3px;
    background: #fff;
}
.cert-card:hover .cert-card-img img {
    transform: scale(1.03);
}

.cert-card-body {
    padding: 22px 22px 26px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cert-card-body h3 {
    font-size: 17px;
    color: var(--c-dark);
    margin: 0 0 6px;
    font-weight: 700;
}
.cert-card-body p {
    font-size: 13px;
    color: var(--c-text-muted);
    margin: 0 0 14px;
    line-height: 1.5;
}
.cert-card-link {
    display: inline-block;
    margin-top: auto;
    font-size: 13px;
    color: var(--c-primary);
    font-weight: 600;
    transition: color 0.2s;
}
.cert-card:hover .cert-card-link {
    color: var(--c-primary-hover);
}

/* ---------- Why It Matters ---------- */
.cert-why {
    padding: 80px 20px;
    background: #ffffff;
}
.cert-why-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.cert-why-header {
    text-align: center;
    margin-bottom: 60px;
}
.cert-why-header h2 {
    font-size: 34px;
    font-weight: 800;
    color: var(--c-dark);
    margin: 0;
}
.cert-why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.cert-why-item {
    background: var(--c-bg-soft);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 30px 24px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.cert-why-item:hover {
    transform: translateY(-6px);
    border-color: #bfdbfe;
    box-shadow: 0 20px 40px -16px rgba(29, 111, 232, 0.18);
    background: #fff;
}
.cert-why-icon {
    width: 56px;
    height: 56px;
    background: #e0f2fe;
    color: var(--c-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 16px;
}
.cert-why-item h4 {
    font-size: 16px;
    color: var(--c-dark);
    margin: 0 0 8px;
    font-weight: 700;
}
.cert-why-item p {
    font-size: 13.5px;
    color: var(--c-text-muted);
    line-height: 1.55;
    margin: 0;
}

/* ---------- CTA ---------- */
.cert-cta {
    padding: 80px 20px;
    background: linear-gradient(135deg, #0a2540 0%, #1e3c72 100%);
    color: #fff;
    text-align: center;
}
.cert-cta h2 {
    font-size: 34px;
    font-weight: 800;
    margin: 0 0 16px;
}
.cert-cta p {
    font-size: 16px;
    color: #cbd5e1;
    margin: 0 auto 32px;
    max-width: 620px;
    line-height: 1.6;
}
.cert-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.cert-cta-primary {
    background: var(--c-primary);
    color: #fff;
    padding: 14px 32px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s;
}
.cert-cta-primary:hover { background: var(--c-primary-hover); }
.cert-cta-secondary {
    background: transparent;
    color: #fff;
    padding: 14px 32px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.4);
    transition: all 0.2s;
}
.cert-cta-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

/* ==========================================
   Lightbox
   ========================================== */
.cert-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 15, 30, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 40px 20px;
    box-sizing: border-box;
}
.cert-lightbox.is-open {
    display: flex;
    opacity: 1;
}
.cert-lb-stage {
    max-width: 90vw;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.96);
    transition: transform 0.3s ease;
}
.cert-lightbox.is-open .cert-lb-stage {
    transform: scale(1);
}
.cert-lb-stage img {
    max-width: 90vw;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
    background: #fff;
    display: block;
    user-select: none;
}
.cert-lb-caption {
    margin-top: 20px;
    text-align: center;
    color: #fff;
    max-width: 700px;
}
.cert-lb-caption h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
}
.cert-lb-caption p {
    font-size: 13px;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.5;
}
.cert-lb-counter {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: #cbd5e1;
    background: rgba(255,255,255,0.08);
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.cert-lb-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 0;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}
.cert-lb-close:hover { background: rgba(255,255,255,0.22); }

.cert-lb-prev,
.cert-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 0;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.cert-lb-prev { left: 24px; }
.cert-lb-next { right: 24px; }
.cert-lb-prev:hover,
.cert-lb-next:hover {
    background: rgba(255,255,255,0.22);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .cert-hero h1 { font-size: 42px; }
    .cert-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .cert-why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .cert-hero { min-height: 340px; padding: 60px 20px; }
    .cert-hero h1 { font-size: 34px; }
    .cert-hero p { font-size: 15px; }
    .cert-list { padding: 60px 20px; }
    .cert-list-header h2 { font-size: 24px; }
    .cert-grid { grid-template-columns: 1fr; gap: 20px; }
    .cert-card-img { height: 260px; padding: 16px; }
    .cert-why { padding: 60px 20px; }
    .cert-why-header h2 { font-size: 24px; }
    .cert-why-grid { grid-template-columns: 1fr; gap: 16px; }
    .cert-cta h2 { font-size: 24px; }
    .cert-cta-buttons { flex-direction: column; align-items: stretch; }

    .cert-lightbox { padding: 20px 12px; }
    .cert-lb-stage img { max-width: 96vw; max-height: 70vh; }
    .cert-lb-prev,
    .cert-lb-next {
        width: 42px;
        height: 42px;
        font-size: 26px;
    }
    .cert-lb-prev { left: 10px; }
    .cert-lb-next { right: 10px; }
    .cert-lb-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 22px; }
    .cert-lb-counter { top: 16px; font-size: 12px; padding: 5px 12px; }
    
    .cert-hero-cta { flex-direction: column; }
    .cert-hero-btn, .cert-hero-btn-outline { text-align: center; }
}