/* 内审员证书查询页 */
.cert-page-hero {
    background: linear-gradient(135deg, #002d72 0%, #0045ad 55%, #2a6edb 100%);
    color: #fff;
    padding: 120px 0 70px;
    text-align: center;
}
.cert-page-hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 12px; }
.cert-page-hero p { font-size: 16px; opacity: 0.9; max-width: 560px; margin: 0 auto; }

.cert-query-box {
    max-width: 680px;
    margin: -40px auto 0;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0,45,114,0.15);
    position: relative;
    z-index: 2;
}
.cert-query-form { display: flex; gap: 12px; }
.cert-query-form input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e8edf5;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.2s;
}
.cert-query-form input:focus { outline: none; border-color: var(--primary); }
.cert-query-form button {
    padding: 16px 32px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.cert-query-form button:hover { background: var(--primary-light); }
.cert-query-hint { margin-top: 14px; font-size: 13px; color: var(--text-muted); text-align: center; }

.cert-result-area { padding: 50px 0 80px; }
.cert-result-empty, .cert-result-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.cert-result-error { color: var(--accent); }

/* 证书展示容器 */
.cert-display-wrap {
    max-width: 920px;
    margin: 0 auto;
    animation: certFadeIn 0.5s ease;
}
@keyframes certFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.cert-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
}
.cert-status-bar.valid { background: #e8f8ef; color: #1a7a3a; }
.cert-status-bar.expired { background: #fff3e0; color: #c65d00; }
.cert-status-bar.revoked { background: #fde8ea; color: #b91c1c; }

#certExportArea {
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.cert-action-bar {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.cert-btn-save {
    padding: 14px 32px;
    background: linear-gradient(135deg, #0045ad, #2a6edb);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,69,173,0.3);
}
.cert-btn-save:hover:not(:disabled) { transform: translateY(-2px); }
.cert-btn-save:disabled { opacity: 0.7; cursor: wait; }
.cert-btn-print {
    padding: 14px 28px;
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* ============================================================
   正式培训合格证书 · 统一高端版式
   ============================================================ */
.cert-doc {
    --cert-accent: #0045ad;
    --cert-gold: #b8860b;
    --cert-paper: #fdfbf7;
    font-family: "PingFang SC", "Microsoft YaHei", "STSong", "SimSun", serif;
}

/* 固定证书画布宽度，防止后台预览被挤压变形 */
.cert-preview-stage {
    width: 920px;
    min-width: 920px;
    max-width: 920px;
    margin: 0 auto;
    flex-shrink: 0;
    box-sizing: border-box;
}
.cert-preview-stage .cert-doc {
    width: 920px;
    box-sizing: border-box;
}

.cert-doc.variant-blue { --cert-accent: #0045ad; --cert-gold: #b8860b; }
.cert-doc.variant-teal { --cert-accent: #0e7490; --cert-gold: #0891b2; }
.cert-doc.variant-slate { --cert-accent: #1e3a5f; --cert-gold: #475569; }
.cert-doc.variant-red { --cert-accent: #b91c1c; --cert-gold: #dc2626; }

.cert-frame {
    position: relative;
    padding: 14px;
    background: linear-gradient(145deg, var(--cert-accent) 0%, #1a1a2e 100%);
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.1) inset;
}

.cert-frame-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 3px solid #d4af37;
    z-index: 2;
    pointer-events: none;
}
.cert-frame-corner-tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.cert-frame-corner-tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.cert-frame-corner-bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.cert-frame-corner-br { bottom: 8px; right: 8px; border-left: none; border-top: none; }

.cert-paper {
    position: relative;
    background: var(--cert-paper);
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(255,255,255,0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0,69,173,0.03) 0%, transparent 50%);
    padding: 48px 52px 36px;
    overflow: hidden;
    min-height: 680px;
    display: flex;
    flex-direction: column;
}

.cert-watermark-bg {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 56px;
    font-weight: 900;
    color: rgba(0,69,173,0.035);
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 12px;
    user-select: none;
}

/* 头部 */
.cert-head {
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 32px;
}
.cert-emblem {
    color: var(--cert-accent);
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}
.cert-org-name {
    font-size: 16px;
    color: #444;
    letter-spacing: 4px;
    margin-bottom: 4px;
    font-weight: 600;
}
.cert-org-en {
    font-size: 10px;
    color: #999;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.cert-main-title {
    font-size: 36px;
    font-weight: 900;
    color: var(--cert-accent);
    letter-spacing: 10px;
    margin: 0 0 8px;
    line-height: 1.3;
}
.cert-main-subtitle {
    font-size: 11px;
    color: var(--cert-gold);
    letter-spacing: 4px;
    font-weight: 700;
    margin: 0;
}
.cert-title-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}
.cert-title-ornament span:first-child,
.cert-title-ornament span:last-child {
    flex: 1;
    max-width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cert-gold), transparent);
}
.cert-diamond {
    width: 8px !important;
    height: 8px !important;
    max-width: 8px !important;
    background: var(--cert-gold) !important;
    transform: rotate(45deg);
    flex: none !important;
}

/* 正文 */
.cert-body {
    position: relative;
    z-index: 1;
    flex: 1;
}
.cert-statement {
    font-size: 16px;
    line-height: 2.4;
    color: #333;
    text-indent: 2em;
    margin: 0 0 28px;
    text-align: justify;
}
.cert-holder {
    font-size: 22px;
    font-weight: 900;
    color: var(--cert-accent);
    font-style: normal;
    border-bottom: 2px solid var(--cert-gold);
    padding: 0 4px 2px;
}
.cert-course {
    color: #222;
    font-weight: 700;
}

/* 信息表格 */
.cert-detail-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid var(--cert-accent);
    font-size: 14px;
    background: rgba(255,255,255,0.6);
}
.cert-detail-table th,
.cert-detail-table td {
    border: 1px solid rgba(0,69,173,0.15);
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}
.cert-detail-table th {
    width: 18%;
    background: rgba(0,69,173,0.06);
    color: #555;
    font-weight: 700;
    white-space: nowrap;
}
.cert-detail-table td {
    color: #1a1a1a;
    font-weight: 600;
    width: 32%;
}
.cert-no-cell {
    font-family: "Courier New", Consolas, monospace;
    font-weight: 800 !important;
    color: var(--cert-accent) !important;
    letter-spacing: 1px;
}

/* 页脚 + 公章（重置全站 footer 样式，避免深蓝底+深字） */
.cert-doc footer.cert-foot {
    background: none !important;
    color: inherit !important;
    padding: 0 !important;
    border-top: none !important;
    margin-top: 32px;
    position: relative;
    z-index: 1;
}

.cert-foot-divider {
    height: 1px;
    margin-bottom: 28px;
    background: linear-gradient(90deg, transparent 0%, var(--cert-gold) 20%, var(--cert-accent) 50%, var(--cert-gold) 80%, transparent 100%);
    opacity: 0.85;
}

.cert-foot-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
}

.cert-foot-meta {
    flex: 1;
    max-width: 58%;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(248,250,252,0.95));
    border: 1px solid rgba(0, 69, 173, 0.08);
    border-radius: 8px;
}

.cert-foot-note {
    font-size: 13px;
    color: #444;
    line-height: 1.85;
    margin: 0 0 8px;
}

.cert-foot-note strong {
    color: var(--cert-accent);
    font-weight: 800;
}

.cert-foot-verify {
    font-size: 11px;
    color: #888;
    line-height: 1.7;
    margin: 0;
    padding-left: 10px;
    border-left: 2px solid var(--cert-gold);
}

.cert-sign-block {
    flex-shrink: 0;
    text-align: right;
    min-width: 210px;
    position: relative;
    padding: 0 8px 0 100px;
}

.cert-sign-label {
    font-size: 11px;
    color: #999;
    letter-spacing: 2px;
    margin: 0 0 6px;
}

.cert-sign-org {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    letter-spacing: 1px;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: inline-block;
    min-width: 168px;
}

.cert-sign-block .cert-seal {
    position: absolute;
    right: -6px;
    top: 4px;
    width: 118px;
    height: 118px;
    margin: 0;
    z-index: 2;
    opacity: 0.92;
}

.cert-sign-date {
    font-size: 12px;
    color: #555;
    margin: 12px 0 0;
    letter-spacing: 0.5px;
}

.cert-seal {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    position: relative;
}
.cert-seal img,
.cert-seal svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.cert-seal--official svg {
    filter: drop-shadow(0 1px 2px rgba(198, 0, 0, 0.18));
}
.cert-seal--image img {
    filter: drop-shadow(0 2px 6px rgba(224, 32, 32, 0.28));
}

.cert-bottom-bar {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    text-align: center;
    font-size: 11px;
    color: #aaa;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}
.cert-bottom-dot { margin: 0 8px; opacity: 0.45; }

/* 打印 */
@media print {
    header, footer:not(.cert-foot), .cert-page-hero, .cert-query-box, .cert-status-bar, .cert-action-bar, .floating-menu, .m-tabbar { display: none !important; }
    .cert-result-area { padding: 0; }
    .cert-display-wrap { max-width: 100%; }
    .cert-frame { box-shadow: none; padding: 8px; }
}

/* 移动端（仅前台查询页，不影响后台预览） */
@media (max-width: 768px) {
    .cert-page-hero { padding: 100px 0 60px; }
    .cert-page-hero h1 { font-size: 24px; }
    .cert-query-box { margin: -30px 16px 0; padding: 24px 20px; }
    .cert-query-form { flex-direction: column; }
    .cert-query-form button { width: 100%; }
    .cert-result-area { padding: 36px 0 60px; }

    .cert-display-wrap .cert-paper,
    #certExportArea .cert-paper { padding: 28px 20px 24px; min-height: auto; }
    .cert-display-wrap .cert-main-title,
    #certExportArea .cert-main-title { font-size: 24px; letter-spacing: 4px; }
    .cert-display-wrap .cert-statement,
    #certExportArea .cert-statement { font-size: 14px; line-height: 2; text-indent: 0; }
    .cert-display-wrap .cert-holder,
    #certExportArea .cert-holder { font-size: 18px; }
    .cert-display-wrap .cert-detail-table,
    #certExportArea .cert-detail-table { font-size: 12px; }
    .cert-display-wrap .cert-detail-table th,
    .cert-display-wrap .cert-detail-table td,
    #certExportArea .cert-detail-table th,
    #certExportArea .cert-detail-table td { padding: 10px 8px; display: block; width: 100% !important; }
    .cert-display-wrap .cert-detail-table tr,
    #certExportArea .cert-detail-table tr { display: block; margin-bottom: 0; border-bottom: 1px solid rgba(0,69,173,0.1); }
    .cert-display-wrap .cert-detail-table th,
    #certExportArea .cert-detail-table th { background: rgba(0,69,173,0.08); padding-bottom: 4px; border-bottom: none; }
    .cert-display-wrap .cert-detail-table td,
    #certExportArea .cert-detail-table td { padding-top: 4px; padding-bottom: 12px; border: none; }
    .cert-display-wrap .cert-foot-inner,
    #certExportArea .cert-foot-inner { flex-direction: column; align-items: stretch; gap: 24px; }
    .cert-display-wrap .cert-foot-meta,
    #certExportArea .cert-foot-meta { max-width: 100%; }
    .cert-display-wrap .cert-sign-block,
    #certExportArea .cert-sign-block {
        align-self: center;
        text-align: center;
        padding: 0;
        min-width: 0;
    }
    .cert-display-wrap .cert-sign-org,
    #certExportArea .cert-sign-org { min-width: 0; display: block; border-bottom: none; padding-bottom: 0; }
    .cert-display-wrap .cert-sign-block .cert-seal,
    #certExportArea .cert-sign-block .cert-seal {
        position: relative;
        right: auto;
        top: auto;
        width: 108px;
        height: 108px;
        margin: 8px auto 0;
    }
    .cert-action-bar { flex-direction: column; }
    .cert-btn-save, .cert-btn-print { width: 100%; }

    .cert-display-wrap .cert-preview-stage,
    #certExportArea .cert-preview-stage {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}
