/* ===================================================
   教培结业证书官方查询系统 - 官方正规与移动端响应式样式
   Mobile-First / WeChat / iOS / Android / Desktop Responsive
   =================================================== */

:root {
    --primary: #122646;
    --primary-gradient: linear-gradient(135deg, #0d1e38 0%, #1e3a66 100%);
    --accent-gold: #c5a059;
    --accent-gold-light: #f7eed8;
    --accent-gold-gradient: linear-gradient(135deg, #d4af37 0%, #aa8026 100%);
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --border-subtle: #e2e8f0;
    --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
    --shadow-elevated: 0 10px 30px -4px rgba(18, 38, 70, 0.14);
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --btn-height: 46px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ===================================================
   1. 顶部导航与机构标识
   =================================================== */
.site-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(197, 160, 89, 0.3);
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.header-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo-emblem {
    width: 34px;
    height: 34px;
    background: var(--primary-gradient);
    color: var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(18, 38, 70, 0.2);
    border: 1.5px solid var(--accent-gold);
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: 0.3px;
}

.logo-text p {
    font-size: 9px;
    color: var(--accent-gold);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.header-badge .dot {
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* ===================================================
   2. 官方主题头部横幅区 (Hero)
   =================================================== */
.hero-bg-section {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 26px 16px 36px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-bg-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 16px;
    background: var(--bg-page);
    border-radius: 16px 16px 0 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(197, 160, 89, 0.4);
    color: #fde047;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    margin-bottom: 8px;
    backdrop-filter: blur(4px);
}

.hero-content h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.hero-content p {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.4;
    color: #e2e8f0;
}

/* ===================================================
   3. 主内容容器
   =================================================== */
.main-wrapper {
    flex: 1;
    max-width: 860px;
    width: 100%;
    margin: -14px auto 0;
    padding: 0 14px 30px;
    position: relative;
    z-index: 10;
}

/* ===================================================
   4. 核心查询卡片
   =================================================== */
.query-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-subtle);
    margin-bottom: 18px;
}

.card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-sub-tip {
    font-size: 11px;
    color: var(--text-secondary);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: var(--btn-height);
    padding: 0 38px 0 42px;
    font-size: 15px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
}

.search-input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(18, 38, 70, 0.12);
}

.search-input::placeholder {
    color: #94a3b8;
    font-size: 13.5px;
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: #cbd5e1;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.clear-btn:hover {
    background: #94a3b8;
}

.search-btn {
    width: 100%;
    height: var(--btn-height);
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 15.5px;
    font-weight: 600;
    border: 1px solid #132a4e;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(18, 38, 70, 0.16);
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.search-btn:active {
    transform: scale(0.98);
    opacity: 0.95;
}

.search-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* 快捷测试标签 */
.demo-tips {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.demo-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.demo-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.demo-tag {
    background: #f1f5f9;
    color: var(--primary);
    padding: 4px 9px;
    border-radius: 6px;
    font-family: -apple-system, monospace;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: all 0.15s;
    font-weight: 600;
}

.demo-tag:hover {
    background: #e2e8f0;
}

.demo-tag:active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ===================================================
   5. 加载与错误反馈
   =================================================== */
.loading-box {
    display: none;
    text-align: center;
    padding: 28px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 18px;
    border: 1px solid var(--border-subtle);
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(18, 38, 70, 0.12);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-box p {
    font-size: 13.5px;
    color: var(--primary);
    font-weight: 600;
}

.error-box {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===================================================
   6. 查询结果展示区 (细节精细化对齐)
   =================================================== */
.result-section {
    display: none;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    border: 1.5px solid rgba(197, 160, 89, 0.35);
    overflow: hidden;
    margin-bottom: 18px;
}

.result-header {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 15px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.result-badge-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.verified-icon-badge {
    width: 30px;
    height: 30px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    flex-shrink: 0;
}

.result-status-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.result-status-sub {
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 2px;
}

.status-pill {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(110, 231, 183, 0.4);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* 学员信息 3 核心卡片列表 */
.student-info-section {
    padding: 14px 14px 6px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-card {
    background: #ffffff;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.info-card-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-tag-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-value.highlight {
    color: var(--primary);
    font-size: 16px;
    letter-spacing: 0.3px;
}

.info-value.monospace {
    font-family: -apple-system, monospace;
    color: #0f172a;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13.5px;
}

/* 证书预览区域 */
.cert-preview-area {
    padding: 16px 14px;
    text-align: center;
    background: #ffffff;
}

.cert-frame-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    padding: 0 2px;
}

.zoom-tip {
    font-size: 11px;
    color: var(--accent-gold);
    font-weight: 500;
}

.cert-image-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    border: 1.5px solid #d1d5db;
    background: #fdfdfd;
    cursor: zoom-in;
    line-height: 0;
}

.cert-image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

.mobile-save-tip {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    color: #475569;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
}

/* ===================================================
   操作按钮组 (高度与样式严格 1:1 精确对齐)
   =================================================== */
.action-buttons {
    padding: 14px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #ffffff;
    align-items: stretch;
}

.btn-primary,
.btn-secondary {
    height: var(--btn-height);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.15s ease;
    line-height: 1;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: 1px solid #132a4e;
    box-shadow: 0 2px 6px rgba(18, 38, 70, 0.16);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a172c 0%, #162d50 100%);
}

.btn-primary:active {
    transform: translateY(1px);
    opacity: 0.95;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-secondary:active {
    background: #f1f5f9;
    transform: translateY(1px);
}

.btn-primary svg,
.btn-secondary svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

/* ===================================================
   7. 官方防伪与说明卡片
   =================================================== */
.notice-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.notice-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notice-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notice-num {
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    color: var(--primary);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.notice-item p {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===================================================
   8. 全屏大图灯箱 (Lightbox)
   =================================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    padding: 20px 10px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ffffff;
    font-size: 26px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.15s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.lightbox-body {
    max-width: 95%;
    max-height: 90vh;
    text-align: center;
}

.lightbox-body img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-tip {
    color: #cbd5e1;
    font-size: 12px;
    margin-top: 12px;
}

/* ===================================================
   9. 页脚
   =================================================== */
.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-subtle);
    padding: 18px 16px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-inner {
    max-width: 860px;
    margin: 0 auto;
}

.footer-links {
    margin-top: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-links .sep {
    color: #cbd5e1;
}

/* ===================================================
   10. PC 端大屏自适应精确对齐 (min-width: 640px)
   =================================================== */
@media (min-width: 640px) {
    .main-wrapper {
        padding: 0 20px 40px;
    }

    .query-card {
        padding: 24px 22px;
    }

    .search-form {
        flex-direction: row;
    }

    .search-btn {
        width: auto;
        min-width: 175px;
        flex-shrink: 0;
    }

    .student-info-section {
        flex-direction: row;
        gap: 12px;
        padding: 16px 16px 8px;
    }

    .info-card {
        flex: 1;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px 14px;
    }

    .action-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 14px;
        padding: 16px 20px 24px;
    }

    .btn-primary, 
    .btn-secondary {
        width: auto;
        min-width: 200px;
        height: var(--btn-height);
        padding: 0 24px;
    }
}
