/**
 * 全局样式表 V3.0 — 精简务实版
 * 理财规划师题库管理系统
 * 风格：扁平、克制、信息优先（参考 Ant Design Pro）
 */

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色 */
    --primary: #1677ff;
    --primary-hover: #4096ff;
    --primary-active: #0958d9;
    --primary-bg: #e6f4ff;

    /* 功能色（仅用于状态标识） */
    --success: #52c41a;
    --success-light: #f6ffed;
    --success-border: #b7eb8f;
    --warning: #faad14;
    --warning-light: #fffbe6;
    --warning-border: #ffe58f;
    --danger: #ff4d4f;
    --danger-light: #fff2f0;
    --danger-border: #ffccc7;

    /* 中性色 */
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-hover: #fafafa;
    --border: #d9d9d9;
    --border-light: #f0f0f0;
    --text: #262626;
    --text-light: #8c8c8c;
    --text-lighter: #bfbfbf;

    /* 侧边栏 */
    --sidebar-bg: #001529;
    --sidebar-bg-hover: #000c17;

    /* 阴影（单一层级，轻微） */
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.08);

    /* 圆角（统一小圆角） */
    --radius-sm: 2px;
    --radius: 4px;
    --radius-lg: 6px;

    /* 布局 */
    --sidebar-width: 220px;
    --sidebar-collapsed: 56px;
    --header-height: 56px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5715;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover { color: var(--primary-hover); }

ul, ol { list-style: none; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bfbfbf; }

/* ========== 通用布局工具 ========== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-light); }
.fw-bold { font-weight: 600; }
.fw-normal { font-weight: 400; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-16 { font-size: 16px; }
.fs-18 { font-size: 18px; }
.fs-24 { font-size: 24px; }

/* ========== 页面标题区 ========== */
.page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.page-header-bar h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    padding-left: 0;
}
.page-header-bar .header-actions {
    display: flex;
    gap: 8px;
}

/* ========== 卡片（用边框代替阴影） ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: none;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}
.card:hover { box-shadow: none; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
/* 去掉左侧装饰竖条 */
.card-title::before { display: none; }

/* ========== 按钮（无涟漪、无位移） ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    background: var(--bg-card);
    color: var(--text);
    white-space: nowrap;
}
/* 去掉涟漪效果 */
.btn::after { display: none; }
.btn:hover { transform: none; box-shadow: none; }
.btn:active { transform: none; }

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

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: #73d13d; border-color: #73d13d; }

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

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover { background: #ffc53d; border-color: #ffc53d; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-bg); color: var(--primary-hover); }

.btn-default {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
}
.btn-default:hover { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 2px 8px; font-size: 12px; }
.btn-lg { padding: 8px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 表格操作按钮容器 */
.action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
}
.action-btns .btn-sm {
    padding: 2px 8px;
    font-size: 12px;
}

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 400;
    color: var(--text);
    font-size: 14px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}
.form-control:disabled { background: var(--bg-hover); color: var(--text-light); cursor: not-allowed; }
.form-control::placeholder { color: var(--text-lighter); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238c8c8c' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px; }

.form-row { display: flex; gap: 16px; }
.form-row > .form-group { flex: 1; }

/* ========== 表格 ========== */
.table-wrap {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: none;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #fafafa;
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-light);
}

.table td {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    color: var(--text);
    font-size: 14px;
    vertical-align: middle;
}

.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: #fafafa; }

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

/* ========== 标签/徽章（方角，去圆点感） ========== */
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    white-space: nowrap;
    vertical-align: middle;
    border: 1px solid transparent;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); border-color: #91caff; }
.badge-success { background: var(--success-light); color: var(--success); border-color: var(--success-border); }
.badge-warning { background: var(--warning-light); color: #d48806; border-color: var(--warning-border); }
.badge-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger-border); }
.badge-info { background: #e6fffb; color: #08979c; border-color: #87e8de; }
.badge-gray { background: #fafafa; color: var(--text-light); border-color: var(--border-light); }
/* 移除紫色徽章，统一用 primary 代替 */
.badge-purple { background: var(--primary-bg); color: var(--primary); border-color: #91caff; }

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}
.pagination button {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}
.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}
.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== 模态框（无弹入动画） ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: var(--text-lighter); width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center; transition: color 0.2s;
    border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 20px; border-top: 1px solid var(--border-light);
}

/* ========== 提示消息（无滑入动画） ========== */
.toast {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 400px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--primary); }

/* ========== 管理后台布局 ========== */
.admin-layout { display: flex; min-height: 100vh; }

/* 侧边栏：纯色，无渐变 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 100;
    box-shadow: none;
}

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
}
/* 隐藏 emoji logo 图标 */
.sidebar-logo .logo-icon { display: none; }

.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }

.sidebar-nav .nav-group-title,
.sidebar-nav .nav-section {
    padding: 12px 16px 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    transition: color 0.2s, background 0.2s;
    margin: 0;
    border-radius: 0;
    position: relative;
}
.sidebar-nav a:hover {
    background: var(--sidebar-bg-hover);
    color: #fff;
}
.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: none;
}
/* 隐藏 emoji 导航图标 */
.sidebar-nav .nav-icon { display: none; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: none;
}

.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); }

.topbar-user { display: flex; align-items: center; gap: 10px; }

/* 头像：纯色，无渐变 */
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 500;
    box-shadow: none;
}

.page-content { padding: 20px; flex: 1; }

/* ========== 筛选栏 ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: none;
    border: 1px solid var(--border-light);
}
.filter-bar .form-control { width: auto; min-width: 140px; }
.filter-bar .search-input { flex: 1; min-width: 200px; }

/* ========== 统计卡片（去图标，纯数字+标签） ========== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: none;
    display: block;
    border: 1px solid var(--border-light);
    transition: border-color 0.2s;
}
/* 去掉装饰圆圈 */
.stat-card::before { display: none; }
.stat-card:hover { border-color: var(--primary); box-shadow: none; }

/* 隐藏 emoji 图标列 */
.stat-icon { display: none; }

.stat-info h3 { font-size: 24px; font-weight: 600; color: var(--text); line-height: 1.3; }
.stat-info p { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* ========== 登录页（浅灰背景，无渐变光斑） ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
}
/* 去掉光斑动画伪元素 */
.login-page::before { display: none; }

.login-box {
    width: 400px;
    max-width: 90%;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

/* 隐藏 emoji logo */
.login-logo { display: none; }

.login-title { text-align: center; margin-bottom: 28px; }
.login-title h1 { font-size: 19px; color: var(--text); margin-bottom: 6px; font-weight: 600; }
.login-title p { color: var(--text-light); font-size: 13px; }

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 3px;
}
.login-tab {
    flex: 1; padding: 8px;
    text-align: center; cursor: pointer;
    color: var(--text-light); font-weight: 400; font-size: 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.login-tab.active {
    color: var(--primary);
    background: #fff;
    box-shadow: none;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* ========== 做题页面 ========== */
.question-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 12px;
    box-shadow: none;
    border: 1px solid var(--border-light);
}

.question-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.8;
    color: var(--text);
}

.question-meta { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--bg-card);
}
.option-item:hover { border-color: var(--primary); background: var(--primary-bg); transform: none; }
.option-item.selected { border-color: var(--primary); background: var(--primary-bg); }
.option-item.correct { border-color: var(--success); background: var(--success-light); }
.option-item.wrong { border-color: var(--danger); background: var(--danger-light); }

.option-label {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 500;
    flex-shrink: 0;
    font-size: 13px;
    transition: all 0.2s;
}
.option-item.selected .option-label { background: var(--primary); color: #fff; border-color: var(--primary); }
.option-item.correct .option-label { background: var(--success); color: #fff; border-color: var(--success); }
.option-item.wrong .option-label { background: var(--danger); color: #fff; border-color: var(--danger); }
.option-text { flex: 1; padding-top: 3px; line-height: 1.6; }

/* ========== 进度条（纯色，无渐变） ========== */
.progress-bar {
    width: 100%; height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ========== 空状态（隐藏大 emoji） ========== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
}
.empty-state .empty-icon { display: none; }
.empty-state p { font-size: 14px; }

/* ========== 数据条形图 ========== */
.bar-chart-item { margin-bottom: 12px; }
.bar-chart-label { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 13px; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar-logo span { display: none; }
    .sidebar-nav a span { display: none; }
    .sidebar-nav .nav-group-title,
    .sidebar-nav .nav-section { display: none; }
    .main-content { margin-left: var(--sidebar-collapsed); }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .form-row { flex-direction: column; }
    .page-content { padding: 12px; }
    .login-box { padding: 28px 20px; }
}
