/* css/style.css - 完整版 */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif; background:#f0f2f5; color:#333; }
.container { max-width:1200px; margin:0 auto; padding:20px; }

header { background:#2c3e50; color:#fff; padding:15px 25px; border-radius:10px; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:15px; margin-bottom:25px; }
header h1 { font-size:22px; }
header nav { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
header nav a { color:#fff; text-decoration:none; padding:6px 14px; border-radius:6px; background:rgba(255,255,255,0.1); transition:0.3s; }
header nav a:hover { background:rgba(255,255,255,0.25); }
header nav .user-info { color:#fff; padding:6px 14px; background:rgba(255,255,255,0.15); border-radius:6px; }

.btn { display:inline-block; padding:8px 20px; border:none; border-radius:6px; cursor:pointer; text-decoration:none; font-size:14px; transition:0.3s; text-align:center; }
.btn-primary { background:#4A90D9; color:#fff; }
.btn-primary:hover { background:#357ABD; }
.btn-success { background:#27ae60; color:#fff; }
.btn-success:hover { background:#1e8449; }
.btn-danger { background:#e74c3c; color:#fff; }
.btn-danger:hover { background:#c0392b; }
.btn-info { background:#17a2b8; color:#fff; }
.btn-info:hover { background:#138496; }
.btn-warning { background:#f39c12; color:#fff; }
.btn-warning:hover { background:#d68910; }
.btn-sm { padding:4px 12px; font-size:13px; }
.btn-danger:disabled { background:#ccc; cursor:not-allowed; }

.stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:15px; margin-bottom:25px; }
.stat-card { background:#fff; padding:20px; border-radius:10px; text-align:center; box-shadow:0 2px 10px rgba(0,0,0,0.05); }
.stat-card .stat-number { font-size:32px; font-weight:bold; color:#2c3e50; }
.stat-card .stat-label { font-size:14px; color:#999; margin-top:5px; }

.alert { padding:15px 20px; border-radius:8px; margin-bottom:20px; }
.alert-success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.alert-error { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }
.alert-info { background:#d1ecf1; color:#0c5460; border:1px solid #bee5eb; }
.alert-warning { background:#fff3cd; color:#856404; border:1px solid #ffc107; }

.badge { display:inline-block; padding:2px 10px; border-radius:12px; font-size:12px; }
.badge-single { background:#e3f2fd; color:#1565c0; }
.badge-multiple { background:#fce4ec; color:#c62828; }
.badge-judge { background:#e8f5e9; color:#2e7d32; }
.badge-easy { background:#e8f5e9; color:#2e7d32; }
.badge-medium { background:#fff3e0; color:#e65100; }
.badge-hard { background:#fce4ec; color:#c62828; }

.table-wrap { background:#fff; border-radius:10px; overflow:auto; box-shadow:0 2px 10px rgba(0,0,0,0.05); }
table { width:100%; border-collapse:collapse; }
table th { background:#f8f9fa; padding:12px 15px; text-align:left; font-weight:600; border-bottom:2px solid #eee; white-space:nowrap; }
table td { padding:12px 15px; border-bottom:1px solid #f0f0f0; vertical-align:middle; }
table tr:hover { background:#f8f9fa; }

.form-group { margin-bottom:15px; }
.form-group label { display:block; font-weight:bold; margin-bottom:5px; font-size:14px; }
.form-group input, .form-group select, .form-group textarea { width:100%; padding:10px; border:1px solid #ddd; border-radius:6px; font-size:14px; }
.form-group textarea { min-height:80px; resize:vertical; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.form-row-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:20px; }
.form-box { background:#fff; padding:30px; border-radius:10px; box-shadow:0 2px 10px rgba(0,0,0,0.05); }

.select-all-col { width:40px; }
.id-col { width:50px; }
.type-col { width:90px; }
.cat-col { width:100px; }
.ans-col { width:80px; }
.action-col { width:160px; }

.msg { padding:12px 20px; border-radius:8px; margin-bottom:15px; }
.msg-success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.msg-warning { background:#fff3cd; color:#856404; border:1px solid #ffc107; }

.pagination { display:flex; justify-content:center; gap:8px; margin-top:20px; flex-wrap:wrap; }
.pagination a, .pagination span { padding:6px 14px; border:1px solid #ddd; border-radius:6px; text-decoration:none; color:#333; }
.pagination a:hover { background:#4A90D9; color:#fff; border-color:#4A90D9; }
.pagination .active { background:#4A90D9; color:#fff; border-color:#4A90D9; }
.pagination .disabled { color:#ccc; cursor:not-allowed; }

@media (max-width:768px) {
    .form-row, .form-row-3 { grid-template-columns:1fr; }
    header { flex-direction:column; align-items:stretch; }
    header nav { justify-content:center; }
    .stats-grid { grid-template-columns:repeat(2,1fr); }
}

/* ============ 统一导航栏样式 ============ */

/* 导航栏容器 */
header nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* 导航链接 - 统一样式 */
header nav a {
    color: #fff;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

header nav a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* 当前页面高亮 */
header nav a.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 -2px 0 #fff;
}

/* 管理后台特殊样式 */
header nav a.admin-link {
    background: #f39c12;
    color: #fff;
    font-weight: bold;
}

header nav a.admin-link:hover {
    background: #d68910;
}

/* 用户信息显示 */
header nav .nav-user-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    padding: 4px 12px 4px 16px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header nav .nav-user-info .role-tag {
    font-size: 11px;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 10px;
    border-radius: 10px;
}

/* 退出按钮 - 红色调 */
header nav a.logout-link {
    background: rgba(231, 76, 60, 0.5);
}

header nav a.logout-link:hover {
    background: rgba(231, 76, 60, 0.8);
}

/* 登录/注册按钮 */
header nav a.auth-link {
    background: rgba(52, 152, 219, 0.3);
}

header nav a.auth-link:hover {
    background: rgba(52, 152, 219, 0.6);
}

/* 移动端适配 */
@media (max-width: 768px) {
    header nav {
        gap: 5px;
    }
    header nav a,
    header nav .nav-user-info {
        padding: 4px 10px;
        font-size: 13px;
    }
    header nav .nav-user-info .role-tag {
        display: none;
    }
}