/* ========================================
   证书查询系统 - 全局样式
   ======================================== */

/* === CSS Variables === */
:root {
    --primary: #c8a45c;
    --primary-dark: #a8873e;
    --primary-light: #f5eccc;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #3498db;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #f5f5f5;
    --bg-white: #fff;
    --border: #e0e0e0;
    --border-light: #eee;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--primary-dark); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* ========================================
   前端查询页面
   ======================================== */
.query-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdfcfb 0%, #f5eccc 50%, #fdfcfb 100%);
    padding: 20px;
}

.query-container {
    width: 100%;
    max-width: 500px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
}

.query-header {
    text-align: center;
    margin-bottom: 32px;
}

.query-logo {
    margin-bottom: 16px;
}

.query-logo-img {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
}

.query-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.query-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.query-form .form-group {
    margin-bottom: 18px;
}

.query-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
}

.query-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.query-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-query {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 4px;
}

.btn-query:hover { opacity: 0.9; }
.btn-query:active { transform: scale(0.98); }

.query-notice {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.query-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.admin-link {
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.2s;
}

.admin-link:hover { color: var(--primary-dark); }

/* ========================================
   证书结果页面
   ======================================== */
.result-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #fdfcfb 0%, #f5eccc 50%, #fdfcfb 100%);
    padding: 30px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.result-container {
    max-width: 720px;
    width: 100%;
}

/* 结果页返回查询链接（新标签页打开查询页时方便返回） */
.result-back-link {
    display: inline-block;
    margin-bottom: 16px;
    padding: 8px 16px;
    font-size: 14px;
    color: #8a6d3b;
    background: rgba(255,255,255,0.85);
    border: 1px solid #e0cfa0;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.result-back-link:hover {
    background: #8a6d3b;
    color: #fff;
}

/* === 证书样式 === */
.cert-wrapper {
    margin: 20px auto;
    max-width: 680px;
}

.cert-border-outer {
    border: 3px solid var(--primary);
    border-radius: 4px;
    padding: 8px;
    background: linear-gradient(135deg, #fffdf5 0%, #fff9e6 100%);
    box-shadow: 0 4px 20px rgba(200,164,92,0.2);
}

.cert-border-inner {
    border: 1px solid var(--primary);
    border-radius: 2px;
    padding: 40px 50px;
    position: relative;
}

.cert-border-inner::before,
.cert-border-inner::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
}

.cert-border-inner::before {
    top: 12px; left: 12px;
    border-right: none; border-bottom: none;
}

.cert-border-inner::after {
    bottom: 12px; right: 12px;
    border-left: none; border-top: none;
}

.cert-content {
    text-align: center;
}

.cert-top-decor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cert-line {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.cert-star {
    color: var(--primary);
    font-size: 18px;
}

.cert-logo-img {
    max-height: 60px;
    max-width: 120px;
    object-fit: contain;
}

.cert-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 16px;
    margin-bottom: 4px;
    font-family: "STZhongsong", "SimSun", "Songti SC", serif;
}

.cert-subtitle {
    font-size: 13px;
    color: var(--primary);
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.cert-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.cert-divider::before,
.cert-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.cert-divider-icon {
    color: var(--primary);
    padding: 0 12px;
    font-size: 12px;
}

.cert-body {
    text-align: left;
    padding: 10px 0;
}

.cert-body-name {
    text-align: center;
    margin-bottom: 20px;
}

.cert-label {
    display: inline-block;
    font-size: 13px;
    color: var(--primary);
    margin-right: 8px;
    min-width: 60px;
    text-align: right;
}

.cert-value {
    font-size: 16px;
    color: var(--text);
    font-weight: 500;
}

.cert-value-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 4px;
    font-family: "STZhongsong", "SimSun", "Songti SC", serif;
}

.cert-body-item {
    margin-bottom: 14px;
    padding-left: 40px;
}

.cert-name-highlight {
    margin: 20px 0;
    padding-left: 40px;
}

.cert-value-certname {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.cert-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    padding-right: 20px;
}

.cert-seal {
    width: 100px;
    height: 100px;
    position: relative;
}

.seal-circle {
    width: 100px;
    height: 100px;
    border: 3px solid #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transform: rotate(-15deg);
}

.seal-text {
    color: #e74c3c;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.3;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.btn-back {
    padding: 10px 28px;
    background: var(--bg-white);
    color: var(--primary-dark);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn-back:hover { background: var(--primary-light); }

.btn-print {
    padding: 10px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-print:hover { opacity: 0.9; }

/* ========================================
   证书样式 V2 - 正式证书模板
   ======================================== */
.cert-v2-wrapper {
    position: relative;
    background: #fff;
    max-width: 860px;
    margin: 0 auto;
    box-shadow: 0 6px 40px rgba(0,0,0,0.15);
}

.cert-frame-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    pointer-events: none;
}

.cert-v2 {
    position: relative;
    z-index: 2;
    padding: 55px 65px 45px;
    background: linear-gradient(180deg, #fefefe 0%, #faf9f6 100%);
}

/* --- 顶部信息行 --- */
.cert-v2-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    min-height: 130px;
}

.cert-v2-org {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cert-v2-org-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

.cert-v2-org-logo-default {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-v2-org-text {
    line-height: 1.5;
}

.cert-v2-org-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a5276;
    letter-spacing: 1px;
}

.cert-v2-org-name-en {
    font-size: 11px;
    color: #5d6d7e;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
}

.cert-v2-meta {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: right;
}

.cert-v2-num {
    line-height: 1.6;
    padding-top: 2px;
}

.cert-v2-num > div:first-child {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.cert-v2-num-en {
    font-size: 10px;
    color: #888;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
}

.cert-v2-num-val {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: 1px;
    margin-top: 2px;
    font-family: "Courier New", monospace;
}

.cert-v2-qr {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-v2-qr img {
    width: 68px;
    height: 68px;
}

/* --- 标题区 --- */
.cert-v2-title-area {
    text-align: center;
    margin-bottom: 10px;
    margin-top: 10px;
}

.cert-v2-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 12px;
    font-family: "STZhongsong", "SimSun", "Songti SC", "Noto Serif SC", serif;
    margin: 0;
}

.cert-v2-title-en {
    font-size: 14px;
    color: #555;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* --- 兹证明 --- */
.cert-v2-certify {
    text-align: center;
    font-size: 17px;
    color: #333;
    letter-spacing: 4px;
    margin-top: 18px;
    font-family: "STZhongsong", "SimSun", "Songti SC", serif;
}

.cert-v2-certify-en {
    text-align: center;
    font-size: 11px;
    color: #777;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* --- 姓名 --- */
.cert-v2-name {
    text-align: center;
    font-size: 38px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 6px;
    margin-top: 18px;
    font-family: "STZhongsong", "SimSun", "Songti SC", "Noto Serif SC", serif;
}

.cert-v2-name-en {
    text-align: center;
    font-size: 18px;
    color: #444;
    font-family: "Times New Roman", Georgia, serif;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* --- 身份证号 --- */
.cert-v2-idcard {
    text-align: center;
    margin-top: 16px;
    line-height: 1.6;
}

.cert-v2-idcard-label {
    font-size: 14px;
    color: #444;
}

.cert-v2-idcard-val {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a2e;
    font-family: "Courier New", monospace;
    letter-spacing: 1px;
}

.cert-v2-idcard-en {
    font-size: 11px;
    color: #888;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    margin-top: 2px;
}

/* --- 正文描述 --- */
.cert-v2-body {
    text-align: center;
    margin-top: 24px;
    padding: 0 20px;
}

.cert-v2-desc {
    font-size: 15px;
    color: #333;
    line-height: 2.2;
    letter-spacing: 1px;
    text-indent: 0;
}

.cert-v2-desc-en {
    font-size: 12px;
    color: #777;
    line-height: 1.8;
    margin-top: 8px;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
}

.cert-v2-highlight {
    font-weight: 600;
    color: #1a1a2e;
    border-bottom: 1px solid #999;
    padding: 0 2px;
}

/* --- 底部三栏 --- */
.cert-v2-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 36px;
    padding: 0 10px;
}

.cert-v2-footer-item {
    flex: 1;
    line-height: 1.7;
}

.cert-v2-sig {
    text-align: left;
}

.cert-v2-sig-name {
    font-size: 13px;
    color: #444;
}

.cert-v2-sig-en {
    font-size: 10px;
    color: #999;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    line-height: 1.4;
    max-width: 180px;
}

.cert-v2-date-col {
    text-align: center;
    font-size: 13px;
    color: #444;
}

.cert-v2-valid-col {
    text-align: right;
    font-size: 13px;
    color: #444;
}

.cert-v2-footer-en {
    font-size: 10px;
    color: #999;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
}

/* 未找到结果 */
.result-empty {
    text-align: center;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 60px 40px;
}

.empty-icon { margin-bottom: 24px; }

.result-empty h2 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 12px;
}

.result-empty p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ========================================
   登录页面
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50 0%, #3d5166 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--text);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-light);
}

.login-card input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2c3e50, #3d5166);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-login:hover { opacity: 0.9; }

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--text-muted);
    font-size: 13px;
}

.login-footer a:hover { color: var(--primary-dark); }

.alert {
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fde8e8;
    color: var(--danger);
    border: 1px solid #f5c6c6;
}

/* ========================================
   管理后台
   ======================================== */
.admin-page {
    background: var(--bg);
    min-height: 100vh;
}

.admin-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 24px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-header h1 {
    font-size: 20px;
    color: var(--text);
}

.admin-header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-sm:hover { border-color: var(--primary); color: var(--primary-dark); }

.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover { background: var(--danger); color: #fff; }

/* 统计卡片 */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--primary);
}

.stat-card.stat-green { border-top-color: var(--success); }
.stat-card.stat-orange { border-top-color: var(--warning); }

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Tab 导航 */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    background: var(--bg-white);
    padding: 8px 8px 0;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow);
}

.tab-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover { color: var(--primary-dark); }

.tab-btn.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

.admin-content {
    background: var(--bg-white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    min-height: 400px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 面板头部 */
.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pane-search input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    width: 300px;
    outline: none;
    transition: border-color 0.2s;
}

.pane-search input:focus { border-color: var(--primary); }

.btn-primary {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.9; }

.btn-default {
    padding: 8px 20px;
    background: var(--bg-white);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-default:hover { border-color: var(--primary); color: var(--primary-dark); }

/* 数据表格 */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #fafafa;
    padding: 12px 14px;
    text-align: left;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

.data-table tr:hover td { background: #fafafa; }

.table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

/* 审核状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending { background: #fff3e0; color: #e67e22; }
.status-approved { background: #e8f5e9; color: #27ae60; }
.status-rejected { background: #fde8e8; color: #e74c3c; }

/* 操作按钮 */
.action-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-light);
    cursor: pointer;
    margin-right: 4px;
    transition: all 0.2s;
}

.action-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.action-btn.btn-del:hover { border-color: var(--danger); color: var(--danger); }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-light);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.pagination button:hover { border-color: var(--primary); color: var(--primary-dark); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 设置页 */
.settings-card {
    background: #fafafa;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.settings-card h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.settings-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.settings-card .form-group {
    margin-bottom: 16px;
}

.settings-card label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
}

.settings-card input[type="text"],
.settings-card input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.settings-card input:focus { border-color: var(--primary); }

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ========================================
   弹窗 Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-sm { max-width: 400px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 5px;
}

.required { color: var(--danger); }

.modal-body input,
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus { border-color: var(--primary); }

.modal-body textarea { resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

/* ========================================
   表单分区样式
   ======================================== */
.form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-light);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 14px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

.modal-lg {
    max-width: 700px;
}

/* ========================================
   导入导出样式
   ======================================== */
.import-export-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.ie-card {
    background: #fafafa;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
}

.ie-card-icon {
    margin-bottom: 16px;
}

.ie-card h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
}

.ie-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.ie-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.ie-upload-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.ie-tips {
    background: #fafafa;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.ie-tips h4 {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 10px;
}

.ie-tips ul {
    list-style: none;
    padding: 0;
}

.ie-tips li {
    font-size: 13px;
    color: var(--text-light);
    line-height: 2;
    padding-left: 16px;
    position: relative;
}

.ie-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.import-result {
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: var(--radius);
    padding: 20px 24px;
}

.import-result h4 {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 12px;
}

.import-result-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
    font-size: 14px;
}

.irs-success { color: var(--success); }
.irs-fail { color: var(--danger); }

.import-errors {
    max-height: 200px;
    overflow-y: auto;
}

.import-error-item {
    font-size: 13px;
    color: var(--danger);
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

/* ========================================
   Logo上传样式
   ======================================== */
.logo-upload-area {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.logo-preview {
    width: 160px;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    font-size: 12px;
    color: var(--text-muted);
}

.logo-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    text-align: center;
}

.logo-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .pane-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .pane-search input { width: 100%; }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .cert-border-inner {
        padding: 24px 20px;
    }

    .cert-title { font-size: 32px; }

    .cert-body-item { padding-left: 0; }

    .cert-name-highlight { padding-left: 0; }

    /* V2 证书移动端适配 */
    .cert-v2 {
        padding: 35px 20px 30px;
    }

    .cert-v2-header {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 20px;
    }

    .cert-v2-meta {
        flex-direction: row-reverse;
        justify-content: space-between;
        width: 100%;
    }

    .cert-v2-title {
        font-size: 26px;
        letter-spacing: 6px;
    }

    .cert-v2-name {
        font-size: 28px;
    }

    .cert-v2-desc {
        font-size: 13px;
        line-height: 2;
    }

    .cert-v2-footer {
        flex-direction: column;
        gap: 16px;
        align-items: center;
        margin-top: 24px;
    }

    .cert-v2-footer-item {
        text-align: center !important;
    }

    .cert-v2-sig-en {
        max-width: none;
    }
}

/* ========================================
   多条匹配 - 脱敏结果列表
   ======================================== */
.result-list-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    margin: 0 auto;
}

.result-list-head {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.result-list-head h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1a5276;
}

.result-list-head p {
    margin: 0;
    font-size: 13px;
    color: #777;
    line-height: 1.6;
}

.result-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.result-list-item {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.result-list-item:hover {
    border-color: #b8941f;
    box-shadow: 0 3px 12px rgba(184, 148, 31, 0.15);
}

.result-list-item > a {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    gap: 16px;
}

.rli-main {
    flex: 0 0 180px;
}

.rli-name {
    font-size: 17px;
    font-weight: 600;
    color: #222;
}

.rli-cert {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.rli-meta {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
}

.rli-meta-item {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.rli-label {
    color: #999;
    margin-right: 8px;
    flex-shrink: 0;
}

.rli-value {
    color: #333;
    font-weight: 500;
}

.rli-mask {
    font-family: 'Courier New', Consolas, monospace;
    letter-spacing: 0.5px;
    color: #8a6d1f;
}

.rli-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: #b8941f;
}

.result-list-actions {
    margin-top: 20px;
    text-align: center;
}

/* ========================================
   证书详情 - 私密验证框
   ======================================== */
.verify-box {
    max-width: 620px;
    margin: 24px auto 0;
    background: #fffdf5;
    border: 1px solid #f0e2b8;
    border-radius: 10px;
    padding: 18px 22px;
}

.verify-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.verify-lock-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.verify-tip-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.verify-tip-text strong {
    font-size: 14px;
    color: #8a6d1f;
}

.verify-tip-text span {
    font-size: 13px;
    color: #777;
    line-height: 1.5;
}

.verify-error {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fdecea;
    border: 1px solid #f5c6c3;
    border-radius: 6px;
    color: #c0392b;
    font-size: 13px;
}

.verify-form {
    display: flex;
    gap: 10px;
}

.verify-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.verify-input:focus {
    border-color: #b8941f;
}

.btn-verify {
    padding: 10px 22px;
    background: #b8941f;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-verify:hover {
    background: #9c7c19;
}

@media (max-width: 768px) {
    .result-list-item > a {
        flex-wrap: wrap;
    }
    .rli-main {
        flex: 0 0 100%;
    }
    .rli-meta {
        grid-template-columns: 1fr;
        flex: 0 0 100%;
    }
    .verify-form {
        flex-direction: column;
    }
}

/* ========================================
   打印样式（放在响应式之后，确保优先级最高）
   ======================================== */
@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }
    html, body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }
    body.result-page {
        background: #fff;
        padding: 0;
        min-height: auto;
    }
    .result-container {
        max-width: 100%;
        width: 100%;
        height: 100%;
    }
    .result-actions { display: none; }
    .result-back-link { display: none !important; }
    /* 打印证书时隐藏验证框与脱敏列表，只保留证书本体 */
    .verify-box { display: none !important; }
    .result-list-box { display: none !important; }

    .cert-border-outer {
        box-shadow: none;
    }

    .cert-v2-wrapper {
        box-shadow: none;
        max-width: 100%;
        max-height: 100vh;
        margin: 0 auto;
        page-break-inside: avoid;
        page-break-after: avoid;
        page-break-before: avoid;
        overflow: hidden;
    }

    .cert-v2 {
        padding: 40px 55px 30px;
    }

    /* 头部：强制左右布局 */
    .cert-v2-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 20px;
        min-height: 70px;
    }

    .cert-v2-org {
        flex-direction: row !important;
    }

    .cert-v2-meta {
        flex-direction: row !important;
        gap: 12px !important;
        width: auto !important;
    }

    .cert-v2-org-logo {
        width: 100px;
        height: 100px;
    }

    .cert-v2-qr {
        width: 64px;
        height: 64px;
    }

    .cert-v2-qr img {
        width: 60px;
        height: 60px;
    }

    .cert-v2-title {
        font-size: 30px;
        letter-spacing: 10px;
    }

    .cert-v2-title-en {
        font-size: 12px;
    }

    .cert-v2-name {
        font-size: 32px;
    }

    .cert-v2-name-en {
        font-size: 16px;
    }

    .cert-v2-certify {
        font-size: 15px;
        margin-top: 12px;
    }

    .cert-v2-certify-en {
        font-size: 10px;
    }

    .cert-v2-body {
        margin-top: 16px;
    }

    .cert-v2-desc {
        font-size: 14px;
        line-height: 2;
    }

    .cert-v2-desc-en {
        font-size: 11px;
        margin-top: 6px;
    }

    .cert-v2-footer {
        flex-direction: row !important;
        margin-top: 24px;
    }

    .cert-v2-footer-item {
        text-align: center !important;
    }
}
