/* === 党群知识竞赛系统 - 纯白简约全局样式 === */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --border-color: #e5e7eb;
    --border-glow: #162c47;
    --border-glow-dim: rgba(22, 44, 71, 0.3);

    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --accent: #162c47;
    --accent-light: #26547c;
    --accent-glow: rgba(22, 44, 71, 0.15);
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.4);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.4);
    --yellow: #f59e0b;
    --orange: #f97316;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 浅色模式：无星空背景，纯净白底 */

/* === 布局 === */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* === 卡片 === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

.card-glow {
    border-color: var(--border-glow-dim);
    box-shadow: 0 0 0 1px rgba(22, 44, 71, 0.15), 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* === 标题 === */
.page-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #162c47, #26547c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* === 表单 === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder { color: var(--text-muted); }

.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    appearance: none;
    cursor: pointer;
    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='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #26547c);
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 44, 71, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22, 44, 71, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    transform: none;
    cursor: not-allowed;
}

.btn-block { width: 100%; }

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), #dc2626);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, var(--green), #059669);
    color: #fff;
}

/* === 进度条 === */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #26547c);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* === 倒计时 === */
.timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 8px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.timer.warning {
    color: var(--orange);
    border-color: rgba(249, 115, 22, 0.5);
    animation: pulse 1s infinite;
}

.timer.danger {
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.5);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* === 徽章 === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-correct { background: rgba(16, 185, 129, 0.15); color: var(--green); }
.badge-wrong { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge-info { background: rgba(22, 44, 71, 0.15); color: var(--accent-light); }

/* === Toast === */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

.toast-error { background: rgba(239, 68, 68, 0.9); color: #fff; }
.toast-success { background: rgba(16, 185, 129, 0.9); color: #fff; }
.toast-info { background: rgba(22, 44, 71, 0.9); color: #fff; }

@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* === 表格 === */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

td { font-size: 14px; }

tr:hover td { background: rgba(22, 44, 71, 0.04); }

/* === 管理后台布局 === */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.admin-main {
    margin-left: 240px;
    flex: 1;
    padding: 32px;
}

.sidebar-logo {
    padding: 0 20px 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-light);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover { color: var(--text-primary); background: rgba(0,0,0,0.03); }
.nav-item.active {
    color: var(--accent-light);
    background: rgba(22, 44, 71, 0.1);
    border-left-color: var(--accent);
}

/* === 统计卡片 === */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === 移动端适配 === */
@media (max-width: 768px) {
    .container, .container-wide { padding: 12px; }
    .card { padding: 20px; }
    .page-title { font-size: 22px; }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        display: flex;
        overflow-x: auto;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .sidebar-logo { display: none; }
    .nav-item { padding: 8px 14px; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
    .nav-item.active { border-left: none; border-bottom-color: var(--accent); }
    .admin-main { margin-left: 0; padding: 16px; }
}
