/* =============================================
 * IDC行业基本素养测试平台 - 全局样式
 * 设计规范：仿国家人事/职业资格考试官网
 * 深蓝主色调、庄重严肃、无圆角、方正布局
 * ============================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary:      #1a5276;
    --primary-dark: #1a4a66;
    --primary-light:#2980b9;
    --accent:       #c8102e;
    --text:         #333333;
    --text-muted:   #666666;
    --border:       #d0d5dd;
    --border-dark:  #aab2bd;
    --bg:           #f5f6fa;
    --bg-white:     #ffffff;
    --bg-header:    #1a5276;
    --success:      #155724;
    --danger:       #a92020;
    --warning:      #856404;
    --info:         #0c5460;
    --sidebar-w:    220px;
    --footer-bg:    #e8ecf1;
    --footer-text:  #555555;
}

html, body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); text-decoration: underline; }

/* ===== 全局Footer（备案号） ===== */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 18px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--footer-text);
    line-height: 2;
    margin-top: 0;
}
.site-footer a { color: var(--primary); }
.site-footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.site-footer .icp-link {
    margin-left: 10px;
}
.site-footer-divider {
    display: inline-block;
    margin: 0 8px;
    color: #ccc;
}

/* ===== 布局（带Footer空间） ===== */
.layout-wrap { 
    display: flex; 
    min-height: calc(100vh - 56px); 
}
.main-content { 
    flex: 1; 
    margin-left: var(--sidebar-w); 
    padding-bottom: 60px; /* footer space */
}

/* ===== 顶部导航栏 ===== */
.topbar {
    background: linear-gradient(135deg, #002244 0%, #003366 50%, #004080 100%);
    color: #fff;
    height: 58px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 3px solid var(--accent);
}
.topbar-logo {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-logo span { color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.topbar-right a { color: #c8d8e8; font-size: 13px; transition: color 0.2s; }
.topbar-right a:hover { color: #fff; text-decoration: none; }
.topbar-user { color: #e0e8f0; font-size: 13px; }

/* ===== 侧边栏 ===== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #1a2535 0%, #0f1825 100%);
    color: #ccc;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 58px;
    overflow-y: auto;
    z-index: 90;
    border-right: 1px solid #2a3a4d;
}
.sidebar-menu { list-style: none; padding: 12px 0; }
.sidebar-menu li a {
    display: block;
    padding: 12px 22px;
    color: #9aacbf;
    font-size: 13px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: all 0.15s;
    letter-spacing: 0.5px;
}
.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(26,77,128,0.15);
    color: #fff;
    border-left-color: #e6b800;
    text-decoration: none;
}
.sidebar-section {
    padding: 16px 22px 8px;
    font-size: 11px;
    color: #506578;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: bold;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: bold;
    font-size: 14px;
    background: linear-gradient(to bottom, #f8fafc 0%, #f0f2f5 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--primary);
}
.card-body { padding: 20px; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none;
    letter-spacing: 0.5px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #8b1515; color: #fff; }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #0f4315; color: #fff; }
.btn-secondary { background: #5a6268; color: #fff; border-color: #545b62; }
.btn-secondary:hover { background: #484e53; color: #fff; }
.btn-outline   { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-lg { padding: 12px 32px; font-size: 15px; }
.btn[disabled], .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-label { 
    display: block; 
    margin-bottom: 6px; 
    font-size: 13px; 
    font-weight: 600; 
    color: #444; 
    letter-spacing: 0.5px;
}
.form-control {
    display: block;
    width: 100%;
    padding: 9px 13px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(0,51,102,0.12); 
}
.form-control[readonly] { background: #f5f6fa; color: #888; }
.form-hint { font-size: 12px; color: #999; margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
select.form-control { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* 验证码行 */
.code-row { display: flex; gap: 10px; align-items: flex-start; }
.code-row .form-control { flex: 1; }
.btn-send-code { white-space: nowrap; flex-shrink: 0; padding: 9px 16px; font-size: 13px; height: 38px; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th, .table td {
    padding: 11px 14px;
    border: 1px solid #e0e0e0;
    text-align: left;
}
.table th {
    background: linear-gradient(to bottom, #edf0f5 0%, #e4e8ef 100%);
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.table tbody tr { transition: background 0.15s; }
.table tbody tr:nth-child(even) { background: #fafbfc; }
.table tbody tr:hover { background: #f0f4fa; }

/* ===== 徽章 ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid currentColor;
    vertical-align: middle;
    letter-spacing: 0.5px;
}
.badge-success  { color: var(--success); background: #e8f5e9; border-color: #a5d6a7; }
.badge-danger   { color: var(--danger); background: #fce4ec; border-color: #ef9a9a; }
.badge-warning  { color: #856404; background: #fff8e1; border-color: #ffe082; }
.badge-info     { color: var(--info); background: #e0f2f1; border-color: #80cbc4; }
.badge-secondary{ color: #555; background: #f0f0f0; border-color: #bbb; }

/* ===== 警告框 ===== */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid;
    font-size: 13px;
    border-left-width: 4px;
}
.alert-success { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.alert-danger  { background: #fce4ec; border-color: #ef9a9a; color: #b71c1c; }
.alert-warning { background: #fff8e1; border-color: #ffe082; color: #8d6e63; }
.alert-info    { background: #e0f2f1; border-color: #80cbc4; color: #00695c; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-block;
    padding: 7px 13px;
    font-size: 13px;
    border: 1px solid var(--border);
    color: var(--primary);
    background: #fff;
    min-width: 38px;
    text-align: center;
    transition: all 0.15s;
}
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { color: #aaa; cursor: not-allowed; pointer-events: none; }

/* ===== 进度条 ===== */
.progress-bar-wrap {
    height: 10px;
    background: #e0e0e0;
    border: 1px solid #ccc;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.3s;
}
.progress-bar.pass   { background: linear-gradient(90deg, #2e7d32, #43a047); }
.progress-bar.danger { background: linear-gradient(90deg, #c62828, #e53935); }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 20px 22px;
    border-top: 3px solid var(--primary);
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card .stat-label { font-size: 12px; color: #888; margin-bottom: 8px; letter-spacing: 1px; }
.stat-card .stat-value { font-size: 32px; font-weight: bold; color: var(--primary); line-height: 1.2; font-family: "Helvetica Neue", Arial, sans-serif; }
.stat-card .stat-sub { font-size: 12px; color: #aaa; margin-top: 6px; }

/* =============================================
 * 登录注册页面 - 国家考试官网风格
 * ============================================= */
.auth-page-bg {
    background: linear-gradient(135deg, #1a5276 0%, #2471a3 40%, #2980b9 70%, #3498db 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.auth-page-header {
    background: rgba(26,82,118,0.85);
    padding: 0 40px;
    height: 56px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
}
.auth-page-header span { 
    color: #fff; 
    font-size: 17px; 
    font-weight: bold; 
    letter-spacing: 3px; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.auth-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}
.auth-notice {
    background: rgba(255,255,255,0.95);
    border: 1px solid #d0d5dd;
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text);
    max-width: 420px;
    width: 100%;
    line-height: 1.8;
}
.auth-box {
    background: #fff;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.auth-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 28px 30px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.auth-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.auth-header h1 { font-size: 19px; margin-bottom: 6px; letter-spacing: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.auth-header p { font-size: 12px; color: rgba(255,255,255,0.75); letter-spacing: 1px; }
.auth-body { padding: 30px; }
.auth-tabs { 
    display: flex; 
    border-bottom: 2px solid #e0e5eb; 
    margin-bottom: 24px; 
    background: #f8f9fb;
}
.auth-tabs a {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: #666;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    transition: all 0.2s;
}
.auth-tabs a.active { 
    color: var(--primary); 
    border-bottom-color: var(--primary); 
    font-weight: bold; 
    background: #fff;
}

/* 登录页面底部信息 */
.auth-page-footer {
    background: rgba(0,15,30,0.9);
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 16px 20px;
    font-size: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 0.5px;
    line-height: 2;
}
.auth-page-footer a { color: rgba(255,255,255,0.65); }

/* =============================================
 * 考试页面
 * ============================================= */
.exam-page {
    background: #f0f2f5;
    min-height: 100vh;
}
.exam-topbar {
    background: linear-gradient(135deg, #002244 0%, #003366 100%);
    color: #fff;
    padding: 0 24px;
    height: 54px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border-bottom: 3px solid var(--accent);
}
.exam-topbar-title { font-size: 15px; font-weight: bold; letter-spacing: 1px; }
.exam-timer {
    margin-left: auto;
    font-size: 24px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    letter-spacing: 3px;
    font-family: "Courier New", monospace;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.3);
}
.exam-timer.warning { color: #ff6b6b; animation: pulse 1s infinite; }
@keyframes pulse {
    0%,100%{opacity:1} 50%{opacity:0.5}
}
.exam-body { display: flex; padding-top: 54px; min-height: 100vh; }
.exam-sidebar {
    width: 210px;
    background: #fff;
    border-right: 1px solid #ddd;
    padding: 16px;
    position: fixed;
    top: 54px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.exam-content { margin-left: 210px; flex: 1; padding: 20px; padding-bottom: 80px; }
.question-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.question-nav-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid #bbb;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s;
}
.question-nav-btn:hover  { background: #e8ecf1; border-color: #999; }
.question-nav-btn.answered { background: var(--primary); color: #fff; border-color: var(--primary); }
.question-nav-btn.current  { border: 2px solid var(--accent); font-weight: bold; }

.question-block {
    background: #fff;
    border: 1px solid #ddd;
    padding: 22px;
    margin-bottom: 16px;
    border-left: 3px solid transparent;
    transition: border-color 0.2s;
}
.question-block:hover { border-left-color: var(--primary); }
.question-index {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.question-content { font-size: 15px; font-weight: 500; margin-bottom: 16px; line-height: 1.8; color: #222; }
.question-type-tag {
    font-size: 11px;
    border: 1px solid;
    padding: 2px 8px;
    margin-right: 8px;
    vertical-align: middle;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.type-single   { color: #0c5460; border-color: #80cbc4; background: #e0f2f1; }
.type-multiple { color: #856404; border-color: #ffe082; background: #fff8e1; }
.type-fill     { color: #155724; border-color: #a5d6a7; background: #e8f5e9; }

.option-list { list-style: none; }
.option-list li { margin-bottom: 10px; }
.option-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
    background: #fafbfc;
}
.option-label:hover { background: #f0f4fa; border-color: #bcc8d8; }
.option-label input { flex-shrink: 0; margin-top: 3px; cursor: pointer; width: 16px; height: 16px; accent-color: var(--primary); }
.option-label.selected { 
    background: #eaf0fa; 
    border-color: var(--primary); 
    border-left: 3px solid var(--primary);
    font-weight: 500;
}
.fill-input { 
    width: 100%; 
    padding: 11px 14px; 
    border: 1px solid var(--border); 
    font-size: 14px; 
    font-family: inherit; 
    outline: none; 
    resize: vertical; 
    min-height: 70px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.fill-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,51,102,0.1); }

/* 摄像头区域 */
.camera-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 150;
    border: 2px solid var(--primary);
    background: #000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.camera-wrap video { display: block; width: 180px; height: 135px; object-fit: cover; }
.camera-label {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    text-align: center;
    padding: 4px 0;
    letter-spacing: 1px;
}
.camera-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4caf50;
    margin-right: 5px;
    border-radius: 50%;
    animation: blink 1.2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* 切屏警告弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff;
    border: 2px solid var(--danger);
    padding: 34px 40px;
    max-width: 500px;
    width: 92%;
    text-align: center;
    border-top: 4px solid var(--danger);
}
.modal-box h2 { color: var(--danger); font-size: 18px; margin-bottom: 14px; letter-spacing: 1px; }
.modal-box p  { font-size: 14px; color: #444; margin-bottom: 24px; line-height: 1.7; }

/* ===== 页面内容区域 ===== */
.page-wrap { padding: 24px 28px; }
.page-title { 
    font-size: 18px; 
    font-weight: bold; 
    color: var(--primary); 
    margin-bottom: 22px; 
    border-bottom: 2px solid var(--primary); 
    padding-bottom: 10px; 
    letter-spacing: 1px;
    position: relative;
}
.page-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--accent);
}

/* ===== 成绩页面 ===== */
.score-big {
    font-size: 72px;
    font-weight: bold;
    text-align: center;
    line-height: 1;
    padding: 24px 0;
    font-family: "Helvetica Neue", Arial, sans-serif;
}
.score-pass   { color: #2e7d32; }
.score-fail   { color: #c62828; }
.score-result-label { text-align: center; font-size: 22px; font-weight: bold; margin-bottom: 10px; letter-spacing: 1px; }

/* ===== 管理后台 ===== */
.admin-header {
    background: linear-gradient(135deg, #001830 0%, #002244 100%);
    color: #fff;
    padding: 0 28px;
    height: 56px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.admin-header-title { font-size: 16px; font-weight: bold; letter-spacing: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* 视频预览 */
.video-preview { max-width: 100%; border: 1px solid #ccc; display: block; }

/* 答题结果 */
.answer-correct { color: #155724; background: #e8f5e9; padding: 2px 10px; border: 1px solid #a5d6a7; font-size: 12px; font-weight: 600; }
.answer-wrong   { color: #a92020; background: #fce4ec; padding: 2px 10px; border: 1px solid #ef9a9a; font-size: 12px; font-weight: 600; }
.answer-pending { color: #856404; background: #fff8e1; padding: 2px 10px; border: 1px solid #ffe082; font-size: 12px; font-weight: 600; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .exam-sidebar { display: none; }
    .exam-content { margin-left: 0; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .camera-wrap { width: 120px; }
    .camera-wrap video { width: 120px; height: 90px; }
    .auth-box { max-width: 100%; margin: 0 12px; }
    .topbar { padding: 0 16px; }
    .page-wrap { padding: 16px; }
}
