/* 考试系统全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; background: #f5f6fa; color: #333; min-height: 100vh; }

/* 顶部导航 */
.topbar { background: linear-gradient(135deg, #1a5276, #2980b9); color: #fff; padding: 0 30px; height: 60px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 10px rgba(0,0,0,0.15); position: sticky; top: 0; z-index: 100; }
.topbar h1 { font-size: 1.2rem; font-weight: 600; letter-spacing: 0.05em; }
.topbar-nav { display: flex; gap: 5px; }
.topbar-nav a { color: rgba(255,255,255,0.85); text-decoration: none; padding: 8px 16px; border-radius: 6px; font-size: 0.9rem; transition: all 0.2s; }
.topbar-nav a:hover, .topbar-nav a.active { background: rgba(255,255,255,0.2); color: #fff; }
.topbar-user { display: flex; align-items: center; gap: 15px; font-size: 0.9rem; }
.topbar-user a { color: rgba(255,255,255,0.8); text-decoration: none; }
.topbar-user a:hover { color: #fff; }

/* 主内容区 */
.main { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); padding: 25px; margin-bottom: 20px; }
.card-title { font-size: 1.15rem; font-weight: 600; color: #1a5276; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid #f0f0f0; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border: none; border-radius: 8px; font-size: 0.9rem; cursor: pointer; text-decoration: none; transition: all 0.2s; font-weight: 500; }
.btn-primary { background: linear-gradient(135deg, #c8a032, #d4af37); color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #b8941f, #c8a032); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(200,160,50,0.3); }
.btn-success { background: #27ae60; color: #fff; }
.btn-danger  { background: #e74c3c; color: #fff; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-outline { background: transparent; border: 1px solid #c8a032; color: #c8a032; }
.btn-outline:hover { background: #c8a032; color: #fff; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: #f8f9fa; color: #555; font-weight: 600; padding: 12px 14px; text-align: left; border-bottom: 2px solid #e9ecef; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; }
tr:hover td { background: #fafbff; }

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: #444; font-size: 0.9rem; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem; transition: border-color 0.2s; background: #fff; }
.form-control:focus { outline: none; border-color: #c8a032; box-shadow: 0 0 0 3px rgba(200,160,50,0.15); }
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 80px; resize: vertical; }
.form-row { display: flex; gap: 15px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a5276 0%, #2980b9 50%, #3498db 100%); }
.login-box { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); padding: 40px; width: 400px; max-width: 90vw; }
.login-box h2 { text-align: center; color: #1a5276; margin-bottom: 8px; font-size: 1.5rem; }
.login-box .subtitle { text-align: center; color: #888; margin-bottom: 28px; font-size: 0.9rem; }
.login-box .btn { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.9rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* 标签/徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #cce5ff; color: #004085; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 25px; }
.stat-card { background: linear-gradient(135deg, #1a5276, #2980b9); color: #fff; border-radius: 12px; padding: 22px; text-align: center; }
.stat-card.gold { background: linear-gradient(135deg, #b8860b, #d4af37); }
.stat-card.green { background: linear-gradient(135deg, #1e8449, #27ae60); }
.stat-card.red { background: linear-gradient(135deg, #922b21, #e74c3c); }
.stat-card h3 { font-size: 2rem; margin-bottom: 6px; }
.stat-card p { font-size: 0.9rem; opacity: 0.9; }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 14px; padding: 28px; width: 600px; max-width: 95vw; max-height: 85vh; overflow-y: auto; }
.modal h3 { margin-bottom: 18px; color: #1a5276; }
.modal .btn-close { float: right; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: #999; }

/* 考试界面 */
.exam-page { max-width: 900px; margin: 0 auto; padding: 20px; }
.exam-timer { position: fixed; top: 70px; right: 30px; background: #e74c3c; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 1.1rem; font-weight: bold; z-index: 99; box-shadow: 0 4px 15px rgba(231,76,60,0.3); }
.exam-timer.warning { background: #f39c12; }
.question-card { background: #fff; border-radius: 12px; padding: 25px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.question-card .q-num { color: #c8a032; font-weight: bold; margin-right: 8px; }
.question-card textarea { width: 100%; min-height: 100px; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem; }
.question-card label { display: block; padding: 8px 12px; border-radius: 6px; cursor: pointer; margin-bottom: 6px; transition: background 0.15s; }
.question-card label:hover { background: #f9f9f9; }
.question-card input[type=radio], .question-card input[type=checkbox] { margin-right: 8px; }

/* 分页 */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: 6px; text-decoration: none; font-size: 0.88rem; }
.pagination a { background: #f0f0f0; color: #333; }
.pagination a:hover { background: #c8a032; color: #fff; }
.pagination .current { background: #c8a032; color: #fff; }

/* 搜索栏 */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 200px; }
.search-bar select { min-width: 140px; }

/* 响应式 */
@media (max-width: 768px) {
    .topbar { padding: 0 15px; flex-wrap: wrap; height: auto; padding: 10px 15px; }
    .topbar-nav { flex-wrap: wrap; }
    .main { padding: 0 10px; margin: 15px auto; }
    .form-row { flex-direction: column; gap: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
