/* ============================================================
 * UI 精修层（ui.css）
 *
 * 定位：在 base.css（重置）+ themes.css（三角色配色）之上，
 * 补一层「工艺」——统一的圆角/阴影/间距刻度、按钮与徽章体系、
 * 卡片与列表、工具栏与分页、图标、页脚贴底。
 *
 * 三条硬规矩
 * ----------
 * 1. 只吃主题变量（--accent-* / --text-* / --bg-* / --border-*），
 *    不写死颜色 —— 否则管理端（粉紫）/ 选手端（浅蓝）/ 观察员（绿）
 *    会有一套被压成同色。确实需要中性灰时用 slate 系，三套主题通用。
 * 2. 加载顺序：base.css → themes.css → **ui.css** → 页面 page_css。
 *    页面自己的 <style> 永远排在后面，所以页面仍可覆盖本文件。
 *    ⚠️ 唯一例外：themes.css 里 `.btn-primary/.action-btn/.login-btn`
 *    带 `!important` 的渐变。为让 .action-btn 能当"次级按钮"用，
 *    该处已把 .action-btn 移出渐变名单（见 themes.css 注释）。
 * 3. 图标：全站没有 FontAwesome，模板里 130+ 个 <i class="fas fa-*">
 *    一直是**空标签**（不报错、不显示）。本文件用 mask + currentColor
 *    把它们画成单色线性图标，颜色随文字走，自动适配三套主题。
 * ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
    /* 圆角刻度：小控件 8 / 中控件 10 / 卡片 16 / 大容器 20 */
    --nx-r-xs: 6px;
    --nx-r-sm: 8px;
    --nx-r-md: 10px;
    --nx-r-lg: 16px;
    --nx-r-xl: 20px;
    --nx-r-pill: 999px;

    /* 阴影：1 贴地 / 2 卡片 / 3 悬浮 / 4 弹窗。全部带极淡冷色，避免发灰 */
    --nx-sh-1: 0 1px 2px rgba(16, 24, 40, .05);
    --nx-sh-2: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px -10px rgba(16, 24, 40, .12);
    --nx-sh-3: 0 2px 4px rgba(16, 24, 40, .05), 0 14px 32px -14px rgba(16, 24, 40, .20);
    --nx-sh-4: 0 24px 60px -20px rgba(16, 24, 40, .32);

    /* 中性色（三套主题共用，不参与换色） */
    --nx-line: rgba(15, 23, 42, .08);
    --nx-line-strong: rgba(15, 23, 42, .14);
    --nx-ink: #0f172a;
    --nx-ink-2: #334155;
    --nx-ink-3: #64748b;
    --nx-ink-4: #94a3b8;
    --nx-surface: #ffffff;
    --nx-surface-2: #f8fafc;

    /* 语义色（软底 + 深字，用于徽章/提示条） */
    --nx-ok-bg: #dcfce7;   --nx-ok-fg: #15803d;   --nx-ok-line: #bbf7d0;
    --nx-warn-bg: #fef3c7; --nx-warn-fg: #b45309; --nx-warn-line: #fde68a;
    --nx-bad-bg: #fee2e2;  --nx-bad-fg: #b91c1c;  --nx-bad-line: #fecaca;
    --nx-info-bg: #e0f2fe; --nx-info-fg: #0369a1; --nx-info-line: #bae6fd;

    --nx-dur: .18s;
    --nx-ease: cubic-bezier(.4, 0, .2, 1);
    --nx-page-max: 1280px;
}

/* ---------- 2. 图标图形（24×24 线性，mask 取 alpha → 用 currentColor 上色） ---------- */
:root {
    --nx-ico-check-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.6'/%3E%3Cpolyline points='8.4 12.4 11 15 15.7 9.3'/%3E%3C/svg%3E");
    --nx-ico-plus-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.6'/%3E%3Cline x1='12' y1='8' x2='12' y2='16'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3C/svg%3E");
    --nx-ico-exclamation-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.6'/%3E%3Cline x1='12' y1='7.6' x2='12' y2='13'/%3E%3Cline x1='12' y1='16.6' x2='12' y2='16.8'/%3E%3C/svg%3E");
    --nx-ico-info-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.6'/%3E%3Cline x1='12' y1='11' x2='12' y2='16.4'/%3E%3Cline x1='12' y1='7.6' x2='12' y2='7.8'/%3E%3C/svg%3E");
    --nx-ico-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8.2' r='3.7'/%3E%3Cpath d='M4.6 20c0-3.7 3.3-6.1 7.4-6.1s7.4 2.4 7.4 6.1'/%3E%3C/svg%3E");
    --nx-ico-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9.2' cy='8.4' r='3.2'/%3E%3Cpath d='M2.9 20c0-3.3 2.8-5.5 6.3-5.5s6.3 2.2 6.3 5.5'/%3E%3Cpath d='M16.3 6.1a3 3 0 0 1 0 5.9'/%3E%3Cpath d='M17.6 14.8c2.2.6 3.7 2.2 3.7 4.4'/%3E%3C/svg%3E");
    --nx-ico-video: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.6' y='6' width='12.8' height='12' rx='2.6'/%3E%3Cpath d='M15.4 10.6 21.4 7.4v9.2l-6-3.2z'/%3E%3C/svg%3E");
    --nx-ico-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.6 12S6.2 5.9 12 5.9 21.4 12 21.4 12 17.8 18.1 12 18.1 2.6 12 2.6 12z'/%3E%3Ccircle cx='12' cy='12' r='2.9'/%3E%3C/svg%3E");
    --nx-ico-code: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15.8 8 20.5 12 15.8 16'/%3E%3Cpolyline points='8.2 8 3.5 12 8.2 16'/%3E%3C/svg%3E");
    --nx-ico-upload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 15.2v3.4a2.2 2.2 0 0 1-2.2 2.2H5.6a2.2 2.2 0 0 1-2.2-2.2v-3.4'/%3E%3Cpolyline points='7.6 8.4 12 4 16.4 8.4'/%3E%3Cline x1='12' y1='4' x2='12' y2='15.6'/%3E%3C/svg%3E");
    --nx-ico-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 15.2v3.4a2.2 2.2 0 0 1-2.2 2.2H5.6a2.2 2.2 0 0 1-2.2-2.2v-3.4'/%3E%3Cpolyline points='7.6 11 12 15.4 16.4 11'/%3E%3Cline x1='12' y1='15.4' x2='12' y2='4'/%3E%3C/svg%3E");
    --nx-ico-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.6 3.2H7.2a2.2 2.2 0 0 0-2.2 2.2v13.2a2.2 2.2 0 0 0 2.2 2.2h9.6a2.2 2.2 0 0 0 2.2-2.2V8.6z'/%3E%3Cpolyline points='13.6 3.2 13.6 8.6 19 8.6'/%3E%3C/svg%3E");
    --nx-ico-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='7' x2='20' y2='7'/%3E%3Cpath d='M9.2 7V5.2A1.4 1.4 0 0 1 10.6 3.8h2.8a1.4 1.4 0 0 1 1.4 1.4V7'/%3E%3Cpath d='M6.2 7l1 12.4a1.8 1.8 0 0 0 1.8 1.6h6a1.8 1.8 0 0 0 1.8-1.6L17.8 7'/%3E%3C/svg%3E");
    --nx-ico-edit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4l10.4-10.4a2.1 2.1 0 0 0-3-3L5 17z'/%3E%3Cline x1='13.4' y1='7.6' x2='17.4' y2='11.6'/%3E%3C/svg%3E");
    --nx-ico-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.6'/%3E%3Cpolyline points='12 7.2 12 12.4 15.8 14.4'/%3E%3C/svg%3E");
    --nx-ico-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.6' y='5.2' width='16.8' height='15.4' rx='2.4'/%3E%3Cline x1='3.6' y1='10.2' x2='20.4' y2='10.2'/%3E%3Cline x1='8.2' y1='3' x2='8.2' y2='6.6'/%3E%3Cline x1='15.8' y1='3' x2='15.8' y2='6.6'/%3E%3C/svg%3E");
    --nx-ico-arrow-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='20' y1='12' x2='4.4' y2='12'/%3E%3Cpolyline points='10.6 5.6 4 12 10.6 18.4'/%3E%3C/svg%3E");
    --nx-ico-arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='12' x2='19.6' y2='12'/%3E%3Cpolyline points='13.4 5.6 20 12 13.4 18.4'/%3E%3C/svg%3E");
    --nx-ico-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.4 10.6 12 3.6l8.6 7'/%3E%3Cpath d='M5.6 9.4V20.2h12.8V9.4'/%3E%3C/svg%3E");
    --nx-ico-building: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.4' y='3.6' width='15.2' height='16.8' rx='2'/%3E%3Cline x1='8.4' y1='8.4' x2='9.8' y2='8.4'/%3E%3Cline x1='14.2' y1='8.4' x2='15.6' y2='8.4'/%3E%3Cline x1='8.4' y1='12.2' x2='9.8' y2='12.2'/%3E%3Cline x1='14.2' y1='12.2' x2='15.6' y2='12.2'/%3E%3Cpath d='M10.2 20.4v-3.2h3.6v3.2'/%3E%3C/svg%3E");
    --nx-ico-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.6C10.4 5 7.9 4.4 4 4.4v13.2c3.9 0 6.4.6 8 2.2 1.6-1.6 4.1-2.2 8-2.2V4.4c-3.9 0-6.4.6-8 2.2z'/%3E%3Cline x1='12' y1='6.6' x2='12' y2='19.8'/%3E%3C/svg%3E");
    --nx-ico-laptop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.6' y='5' width='14.8' height='10.6' rx='2'/%3E%3Cline x1='2.4' y1='19.2' x2='21.6' y2='19.2'/%3E%3C/svg%3E");
    --nx-ico-folder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.4 7.2a2 2 0 0 1 2-2h3.4l2 2.4h7.8a2 2 0 0 1 2 2v7.2a2 2 0 0 1-2 2H5.4a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
    --nx-ico-trophy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.4 4h9.2v4.8a4.6 4.6 0 0 1-9.2 0z'/%3E%3Cpath d='M7.4 6.2H4.8v1.4a3 3 0 0 0 2.9 3'/%3E%3Cpath d='M16.6 6.2h2.6v1.4a3 3 0 0 1-2.9 3'/%3E%3Cline x1='12' y1='13.4' x2='12' y2='17.6'/%3E%3Cline x1='9.4' y1='17.8' x2='14.6' y2='17.8'/%3E%3Cline x1='8.4' y1='20.4' x2='15.6' y2='20.4'/%3E%3C/svg%3E");
    --nx-ico-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.4' width='14' height='10.2' rx='2.2'/%3E%3Cpath d='M8.4 10.4V8a3.6 3.6 0 0 1 7.2 0v2.4'/%3E%3C/svg%3E");
    --nx-ico-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M8.2 5.4 18.6 12 8.2 18.6z'/%3E%3C/svg%3E");
    --nx-ico-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.8 3.2 3.4 10.4l6.6 2.8 2.8 6.6z'/%3E%3Cline x1='10' y1='13.4' x2='20.8' y2='3.2'/%3E%3C/svg%3E");
    --nx-ico-layers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2 20.6 8 12 12.8 3.4 8z'/%3E%3Cpolyline points='3.4 12.4 12 17.2 20.6 12.4'/%3E%3C/svg%3E");
    --nx-ico-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20.8s6.8-6 6.8-10.8a6.8 6.8 0 1 0-13.6 0c0 4.8 6.8 10.8 6.8 10.8z'/%3E%3Ccircle cx='12' cy='9.8' r='2.5'/%3E%3C/svg%3E");
    --nx-ico-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8.6' y='8.6' width='11.6' height='11.6' rx='2.2'/%3E%3Cpath d='M15.4 8.6v-2a2.2 2.2 0 0 0-2.2-2.2H5.8a2.2 2.2 0 0 0-2.2 2.2v7.4a2.2 2.2 0 0 0 2.2 2.2h2'/%3E%3C/svg%3E");
    --nx-ico-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.2 12a8.2 8.2 0 1 1-2.5-5.9'/%3E%3Cpolyline points='20.2 3.6 20.2 8.2 15.6 8.2'/%3E%3C/svg%3E");
    --nx-ico-robot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.4' y='7.6' width='15.2' height='11.2' rx='3'/%3E%3Cline x1='9' y1='12.4' x2='9' y2='13.8'/%3E%3Cline x1='15' y1='12.4' x2='15' y2='13.8'/%3E%3Cline x1='12' y1='3.4' x2='12' y2='7.6'/%3E%3Cline x1='2.6' y1='12.2' x2='4.4' y2='12.2'/%3E%3Cline x1='19.6' y1='12.2' x2='21.4' y2='12.2'/%3E%3C/svg%3E");
    --nx-ico-spinner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M12 3.4a8.6 8.6 0 1 1-6.1 2.5'/%3E%3C/svg%3E");
    --nx-ico-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.4' y='4.8' width='17.2' height='14.4' rx='2.4'/%3E%3Ccircle cx='8.6' cy='9.9' r='1.5'/%3E%3Cpath d='M4.2 17.6l4.7-4.3 3.1 2.7 3.4-3.6 4.4 4.6'/%3E%3C/svg%3E");
    --nx-ico-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2 19.4 6v5.4c0 4.3-3 7.9-7.4 9.4-4.4-1.5-7.4-5.1-7.4-9.4V6z'/%3E%3Cpolyline points='8.8 12 11.2 14.4 15.4 10.2'/%3E%3C/svg%3E");
    --nx-ico-archive: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.4' y='4.4' width='17.2' height='4.4' rx='1.5'/%3E%3Cpath d='M5.2 8.8v9.6a2.2 2.2 0 0 0 2.2 2.2h9.2a2.2 2.2 0 0 0 2.2-2.2V8.8'/%3E%3Cline x1='10' y1='12.6' x2='14' y2='12.6'/%3E%3C/svg%3E");
}

/* ---------- 2. 页面外壳：页脚永远贴底 ---------- */
/* 以前短页面（题目管理、竞赛中心）内容结束后页脚就在半空，下面一片空。
   用 flex 列 + footer 的 margin-top:auto 解决，不依赖任何页面结构改动。
   .container 的 auto 外边距在 flex 里同样能水平居中，不会跑偏。 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body > .container {
    width: 100%;
}

footer {
    margin-top: auto;
    /* 覆盖 base.css 的 3rem：贴底后不需要再额外留白 */
    padding: 1.25rem 2rem;
}

/* 全域细节：选区、滚动条、焦点环 */
::selection {
    background: var(--accent-color, #0ea5e9);
    color: #fff;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color-strong, #cbd5e1) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-color-strong, #cbd5e1);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--accent-color, #0ea5e9); }

:focus-visible {
    outline: 2px solid var(--accent-color, #0ea5e9);
    outline-offset: 2px;
    border-radius: var(--nx-r-xs);
}

/* ---------- 3. 图标：把空的 <i class="fas fa-*"> 画出来 ---------- */
/* mask 用 alpha 通道：SVG 里的描边颜色不重要，最终取 currentColor，
   于是图标颜色 = 文字颜色，hover / 徽章 / 深色页头都能自动跟随。 */
i.fas,
i.far,
i.fab,
.nx-i {
    --nx-ico: none;
    display: inline-block;
    inline-size: 1em;
    block-size: 1em;
    flex: none;
    vertical-align: -.145em;
    background-color: currentColor;
    -webkit-mask: var(--nx-ico) center / contain no-repeat;
    mask: var(--nx-ico) center / contain no-repeat;
}

/* 图标后面紧跟文字时给个呼吸（纯图标按钮不受影响） */
i.fas + span,
i.fas + a,
.nx-i + span {
    margin-inline-start: .1em;
}

.btn > i.fas,
.action-btn > i.fas,
button > i.fas {
    margin-inline-end: .45em;
}

/* —— 基础图形（24×24，Feather 风格线性） —— */
i.fas.fa-check,
i.fas.fa-check-circle,
i.fas.fa-file-check {
    --nx-ico: var(--nx-ico-check-circle);
}

i.fas.fa-plus,
i.fas.fa-plus-circle {
    --nx-ico: var(--nx-ico-plus-circle);
}

i.fas.fa-times-circle,
i.fas.fa-exclamation-circle {
    --nx-ico: var(--nx-ico-exclamation-circle);
}

i.fas.fa-exclamation-triangle,
i.fas.fa-info-circle {
    --nx-ico: var(--nx-ico-info-circle);
}

i.fas.fa-user,
i.fas.fa-user-circle {
    --nx-ico: var(--nx-ico-user);
}

i.fas[class*="fa-users"],
i.fas.fa-handshake {
    --nx-ico: var(--nx-ico-users);
}

i.fas.fa-video {
    --nx-ico: var(--nx-ico-video);
}

i.fas[class*="fa-eye"] {
    --nx-ico: var(--nx-ico-eye);
}

i.fas[class*="fa-code"] {
    --nx-ico: var(--nx-ico-code);
}

i.fas[class*="fa-upload"],
i.fas[class*="fa-cloud-upload"],
i.fas[class*="fa-file-upload"],
i.fas[class*="fa-file-input"],
i.fas[class*="fa-file-import"] {
    --nx-ico: var(--nx-ico-upload);
}

i.fas[class*="fa-download"],
i.fas[class*="fa-file-output"],
i.fas[class*="fa-file-arrow-down"] {
    --nx-ico: var(--nx-ico-download);
}

i.fas[class*="fa-file"] {
    --nx-ico: var(--nx-ico-file);
}

i.fas.fa-trash {
    --nx-ico: var(--nx-ico-trash);
}

i.fas.fa-edit,
i.fas.fa-save {
    --nx-ico: var(--nx-ico-edit);
}

i.fas.fa-clock,
i.fas[class*="fa-hourglass"] {
    --nx-ico: var(--nx-ico-clock);
}

i.fas[class*="fa-calendar"] {
    --nx-ico: var(--nx-ico-calendar);
}

i.fas.fa-arrow-left,
i.fas.fa-sign-out-alt {
    --nx-ico: var(--nx-ico-arrow-left);
}

i.fas.fa-arrow-right,
i.fas.fa-external-link-alt {
    --nx-ico: var(--nx-ico-arrow-right);
}

i.fas.fa-home {
    --nx-ico: var(--nx-ico-home);
}

i.fas.fa-building {
    --nx-ico: var(--nx-ico-building);
}

i.fas.fa-book {
    --nx-ico: var(--nx-ico-book);
}

i.fas.fa-laptop {
    --nx-ico: var(--nx-ico-laptop);
}

i.fas.fa-inbox,
i.fas[class*="fa-folder"] {
    --nx-ico: var(--nx-ico-folder);
}

i.fas.fa-trophy,
i.fas.fa-flag,
i.fas.fa-flag-checkered {
    --nx-ico: var(--nx-ico-trophy);
}

i.fas.fa-lock {
    --nx-ico: var(--nx-ico-lock);
}

i.fas.fa-play {
    --nx-ico: var(--nx-ico-play);
}

i.fas.fa-paper-plane {
    --nx-ico: var(--nx-ico-send);
}

i.fas.fa-network-wired,
i.fas.fa-layer-group,
i.fas.fa-puzzle-piece {
    --nx-ico: var(--nx-ico-layers);
}

i.fas.fa-map-marker-alt {
    --nx-ico: var(--nx-ico-pin);
}

i.fas.fa-copy {
    --nx-ico: var(--nx-ico-copy);
}

i.fas.fa-sync-alt,
i.fas.fa-superscript {
    --nx-ico: var(--nx-ico-refresh);
}

i.fas.fa-robot {
    --nx-ico: var(--nx-ico-robot);
}

i.fas.fa-spinner,
i.fas.fa-circle-notch {
    --nx-ico: var(--nx-ico-spinner);
    animation: nx-spin 1s linear infinite;
}

i.fas.fa-image {
    --nx-ico: var(--nx-ico-image);
}

/* —— 系统更新页新增：FA6 命名与 FA5 命名两套都认 ——
   ⚠️ 页面里的图标名混着两代写法（`fa-check-circle` 与 `fa-circle-check` 是同一个图标），
   映射表只写一套就有一半是空标签。以下别名全部指向已有图形，不新增请求。 */
i.fas[class*="fa-cloud-arrow-up"] { --nx-ico: var(--nx-ico-upload); }
i.fas[class*="fa-circle-check"] { --nx-ico: var(--nx-ico-check-circle); }
i.fas[class*="fa-circle-xmark"] { --nx-ico: var(--nx-ico-exclamation-circle); }
i.fas[class*="fa-triangle-exclamation"] { --nx-ico: var(--nx-ico-info-circle); }
i.fas[class*="fa-circle-info"] { --nx-ico: var(--nx-ico-info-circle); }
i.fas[class*="fa-redo"] { --nx-ico: var(--nx-ico-refresh); }
i.fas[class*="fa-rotate-left"] { --nx-ico: var(--nx-ico-refresh); }
i.fas[class*="fa-clock-rotate"] { --nx-ico: var(--nx-ico-clock); }
i.fas[class*="fa-shield"] { --nx-ico: var(--nx-ico-shield); }
/* 放在 [class*="fa-file"] 之后：同特异性靠后者胜出，才能盖掉"普通文件"图标 */
i.fas[class*="fa-box-archive"],
i.fas[class*="fa-file-zipper"] { --nx-ico: var(--nx-ico-archive); }

@keyframes nx-spin {
    to { transform: rotate(360deg); }
}

/* ---------- 4. 页面头部（page head） ---------- */
.dashboard-container {
    /* 4 个页面（题目管理 / 竞赛中心 / 观察员列表 / 监考台）没有引 dashboard.css，
       却照样用了 .dashboard-container —— 以前题目管理页标题直接顶在 x=0。
       这里补一份外壳兜底，dashboard.css 后加载仍是同一套值。 */
    max-width: var(--nx-page-max);
    margin: 0 auto;
    padding: 1.75rem 1.5rem 0;
    width: 100%;
}

.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
    margin-bottom: .35rem;
    color: var(--text-primary);
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: .95rem;
    margin-bottom: 1.25rem;
}

/* 标题旁的小色条：让"这是哪个角色的页面"一眼可辨 */
.dashboard-title::before {
    content: "";
    display: inline-block;
    inline-size: .28em;
    block-size: .78em;
    border-radius: 3px;
    background: var(--accent-gradient);
    margin-inline-end: .5rem;
    vertical-align: -.04em;
}

/* 页头一行式：标题在左、操作在右。
   比"标题 + 副标题 + 下面排一排按钮"省一整行高度，也让主操作有了明确位置。 */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.page-head-text { min-width: 0; }

.page-head .dashboard-subtitle { margin-bottom: 0; }

.page-head-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ---------- 5. 按钮体系 ---------- */
/* 统一高度 38 / 圆角 10 / 14px / 600 字重。
   .btn 是老按钮（各页 inline style 也定义了它，页面会覆盖本层，属预期）。 */
.btn,
.action-btn,
.nx-btn {
    --_bg: var(--nx-surface);
    --_fg: var(--nx-ink-2);
    --_bd: var(--nx-line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4em;
    min-height: 38px;
    padding: .5rem 1rem;
    border: 1px solid var(--_bd);
    border-radius: var(--nx-r-md);
    background: var(--_bg);
    color: var(--_fg);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--nx-dur) var(--nx-ease),
                box-shadow var(--nx-dur) var(--nx-ease),
                background-color var(--nx-dur) var(--nx-ease),
                border-color var(--nx-dur) var(--nx-ease),
                color var(--nx-dur) var(--nx-ease);
    box-shadow: var(--nx-sh-1);
}

.btn:hover,
.action-btn:hover,
.nx-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--nx-sh-2);
    border-color: var(--border-color-strong);
}

.btn:active,
.action-btn:active,
.nx-btn:active {
    transform: translateY(0) scale(.99);
    box-shadow: none;
}

.btn:disabled,
.action-btn:disabled,
.nx-btn:disabled,
.btn[disabled] {
    /* 以前是 opacity:.45 —— 琥珀色的"取消交卷"半透明后变成一团脏黄色，
       看着像渲染出错。现在直接换成中性灰底灰字，明确"不可点"。 */
    --_bg: var(--nx-surface-2);
    --_fg: var(--nx-ink-4);
    --_bd: var(--nx-line);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover {
    --_bg: var(--nx-surface-2);
    --_bd: var(--nx-line);
}

/* 主按钮的强调色由 --btn-primary-bg 提供；这几个修饰类需要在
   「加载更晚的同名规则」面前站得住（dashboard.css 曾用 .action-btn 覆盖过），
   所以这里显式写出 background，而不只改自定义属性。 */
.action-btn.action-btn--primary,
button.action-btn--primary,
a.action-btn--primary {
    background: var(--btn-primary-bg);
    color: #fff;
    border-color: transparent;
}

/* 主按钮：走主题渐变（themes.css 已用 !important 绑定 --btn-primary-bg） */
.btn-primary,
.action-btn--primary,
.nx-btn--primary,
.action-btn.primary {
    --_bg: var(--btn-primary-bg);
    --_fg: #fff;
    --_bd: transparent;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08),
                0 8px 18px -10px var(--accent-shadow-strong);
}

.btn-primary:hover,
.action-btn--primary:hover,
.nx-btn--primary:hover {
    box-shadow: 0 2px 6px rgba(16, 24, 40, .10),
                0 14px 26px -12px var(--accent-shadow-strong);
    border-color: transparent;
}

/* 次级：白底描边 */
.btn-secondary,
.nx-btn--ghost,
.action-btn--ghost {
    --_bg: var(--nx-surface);
    --_fg: var(--nx-ink-2);
    --_bd: var(--nx-line-strong);
}

.action-btn--ghost {
    --_fg: var(--text-muted);
}

/* 语义色 */
.btn-success,
.action-btn--success {
    --_bg: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --_fg: #fff;
    --_bd: transparent;
}

.btn-info,
.action-btn--info {
    --_bg: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --_fg: #fff;
    --_bd: transparent;
}

.btn-warning {
    --_bg: #fffbeb;
    --_fg: var(--nx-warn-fg);
    --_bd: var(--nx-warn-line);
}

.btn-danger {
    --_bg: #fff5f5;
    --_fg: var(--nx-bad-fg);
    --_bd: var(--nx-bad-line);
}

.btn-danger:hover {
    --_bg: #fee2e2;
    --_bd: #fca5a5;
}

.btn-success:hover,
.btn-info:hover {
    filter: brightness(1.04);
}

/* 小尺寸（卡片内操作） */
.btn-sm,
.user-actions .btn,
.nx-btn--sm {
    min-height: 30px;
    padding: .3rem .7rem;
    font-size: .8125rem;
    border-radius: var(--nx-r-sm);
}

/* 纯图标按钮 */
.btn-icon {
    padding: .45rem;
    min-width: 38px;
}

/* ---------- 6. 卡片 ---------- */
.dashboard-section,
.nx-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    padding: 1.5rem;
    box-shadow: var(--nx-sh-2);
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 1.25rem;
    padding-bottom: 2rem;
    /* 默认 stretch 会把"管理员列表"和"危险区"拉成等高，
       较矮那块底部就留一大片空白。改成按内容高度。 */
    align-items: start;
}

/* 只有一块内容时铺满，不要留一条空列 */
.dashboard-sections > :only-child {
    grid-column: 1 / -1;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: -0.25rem 0 1.25rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--nx-line);
}

.section-header h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0;
    color: var(--text-primary);
}

/* 计数类小字（"共 3 个竞赛"）统一成弱化标签 */
.section-header > span,
.section-header .section-count {
    font-size: .8125rem !important;
    color: var(--nx-ink-3) !important;
    background: var(--nx-surface-2);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-pill);
    padding: .15rem .6rem;
    white-space: nowrap;
}

/* ---------- 7. 徽章 ---------- */
.status-badge,
.badge,
.sub-state,
.ip-state,
.nx-badge {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    padding: .12rem .55rem;
    border-radius: var(--nx-r-pill);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.7;
    white-space: nowrap;
    vertical-align: middle;
    border: 1px solid transparent;
}

/* 状态徽章里的圆点：渐变底上也能看清状态 */
.status-badge::before {
    content: "";
    inline-size: .42em;
    block-size: .42em;
    border-radius: 50%;
    background: currentColor;
    flex: none;
    opacity: .85;
}

.status-badge.status-upcoming,
.badge-success,
.sub-state.submitted,
.ip-state.on {
    background: var(--nx-ok-bg);
    color: var(--nx-ok-fg);
    border-color: var(--nx-ok-line);
}

.status-badge.status-ongoing,
.sub-state.ongoing,
.ip-state.pending,
.badge-warning {
    background: var(--nx-warn-bg);
    color: var(--nx-warn-fg);
    border-color: var(--nx-warn-line);
}

.status-badge.status-ended,
.sub-state.idle,
.ip-state.off,
.badge-secondary {
    background: var(--nx-surface-2);
    color: var(--nx-ink-3);
    border-color: var(--nx-line);
}

.badge-danger,
.ip-state.rejected {
    background: var(--nx-bad-bg);
    color: var(--nx-bad-fg);
    border-color: var(--nx-bad-line);
}

.badge-info {
    background: var(--nx-info-bg);
    color: var(--nx-info-fg);
    border-color: var(--nx-info-line);
}

/* ---------- 8. 列表 / 行卡片 ---------- */
/* 管理端竞赛列表、选手列表、管理员列表共用的"一行"外观：
   左侧主信息，右侧操作；行与行之间用间距分开，不再用高对比边框。 */
.contest-item,
.contest-card,
.user-item,
.nx-row {
    background: var(--bg-card, #fff);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    padding: 1.125rem 1.25rem;
    box-shadow: var(--nx-sh-1);
    transition: border-color var(--nx-dur) var(--nx-ease),
                box-shadow var(--nx-dur) var(--nx-ease);
}

.contest-item:hover,
.contest-card:hover,
.user-item:hover {
    border-color: var(--border-color-strong);
    box-shadow: var(--nx-sh-2);
}

.contest-item + .contest-item,
.user-item + .user-item {
    margin-top: .75rem;
}

.contest-item h3,
.contest-card h3,
.user-item h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.contest-item h3 .status-badge,
.user-item h4 .sub-state {
    /* 标题里的徽章不要跟着标题字号缩放 */
    font-size: .75rem;
    font-weight: 600;
}

/* 元信息行（主办方 / 时长 / 时间窗）：弱化成灰蓝小字 + 自动换行 */
.contest-item .meta,
.contest-meta,
.nx-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.25rem;
    color: var(--nx-ink-3);
    font-size: .8125rem;
    line-height: 1.9;
}

.contest-item .meta span {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    white-space: nowrap;
}

.contest-item .meta i.fas {
    color: var(--accent-color);
    opacity: .75;
}

/* 行内操作区 */
.contest-actions,
.user-actions,
.nx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

/* ---------- 9. 工具栏：搜索 / 每页条数 / 批量 ---------- */
.search-bar {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.search-input,
.page-size-select {
    min-height: 38px;
    padding: .45rem .8rem;
    border: 1px solid var(--nx-line-strong);
    border-radius: var(--nx-r-md);
    background: var(--nx-surface);
    font-size: .875rem;
    color: var(--nx-ink);
    transition: border-color var(--nx-dur) var(--nx-ease),
                box-shadow var(--nx-dur) var(--nx-ease);
}

.search-input { flex: 1; min-width: 220px; }

.search-input:focus,
.page-size-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.search-input::placeholder { color: var(--nx-ink-4); }

.batch-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.select-all {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .9rem;
    padding: .55rem .75rem;
    background: var(--nx-surface-2);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-md);
    font-size: .8125rem;
    color: var(--nx-ink-3);
}

.select-all label { cursor: pointer; user-select: none; }

/* 复选框统一尺寸与强调色 */
input[type="checkbox"] {
    inline-size: 16px;
    block-size: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

/* ---------- 10. 选项卡 ---------- */
.tabs {
    display: inline-flex;
    gap: .25rem;
    padding: .25rem;
    background: var(--nx-surface-2);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-md);
    margin-bottom: 0;
}

.tab-btn {
    padding: .4rem 1rem;
    border: none;
    border-radius: var(--nx-r-sm);
    background: transparent;
    color: var(--nx-ink-3);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--nx-dur) var(--nx-ease);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(15, 23, 42, .04);
}

.tab-btn.active {
    background: var(--nx-surface);
    color: var(--accent-color);
    box-shadow: var(--nx-sh-1);
}

/* ---------- 11. 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.125rem;
    padding: .7rem .9rem;
    background: var(--nx-surface-2);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-md);
    font-size: .8125rem;
}

.pagination-info { color: var(--nx-ink-3); }

.pagination-controls {
    display: flex;
    gap: .35rem;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 34px;
    min-height: 32px;
    padding: .25rem .6rem;
    border: 1px solid var(--nx-line-strong);
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface);
    color: var(--nx-ink-2);
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--nx-dur) var(--nx-ease);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.pagination-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ---------- 12. 提示条 ---------- */
.ip-hint,
.attach-hint,
.nx-hint {
    margin: 0 0 1rem;
    padding: .7rem .95rem;
    background: var(--nx-surface-2);
    border: 1px solid var(--nx-line);
    border-left: 3px solid var(--accent-color);
    border-radius: var(--nx-r-sm);
    color: var(--nx-ink-3);
    font-size: .8125rem;
    line-height: 1.75;
}

.ip-hint b,
.attach-hint b {
    color: var(--nx-ink-2);
    font-weight: 600;
}

/* ---------- 13. 表单控件（页面可覆盖） ---------- */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    margin-bottom: .35rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--nx-ink-2);
}

.form-control,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%;
    min-height: 40px;
    padding: .5rem .8rem;
    border: 1px solid var(--nx-line-strong);
    border-radius: var(--nx-r-md);
    background: var(--nx-surface);
    font-size: .875rem;
    font-family: inherit;
    color: var(--nx-ink);
    transition: border-color var(--nx-dur) var(--nx-ease),
                box-shadow var(--nx-dur) var(--nx-ease);
}

.form-control:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ---------- 14. 表格 ---------- */
.table,
table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .875rem;
}

.table thead th,
table.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--nx-surface-2);
    color: var(--nx-ink-3);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-align: left;
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--nx-line-strong);
}

.table tbody td,
table.data-table tbody td {
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--nx-line);
    color: var(--nx-ink-2);
}

.table tbody tr:hover,
table.data-table tbody tr:hover {
    background: var(--accent-ring);
}

/* ---------- 15. 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 2.75rem 1rem;
    color: var(--nx-ink-3);
    border: 1px dashed var(--nx-line-strong);
    border-radius: var(--nx-r-lg);
    background: var(--nx-surface-2);
}

.empty-state i.fas,
.empty-state .empty-icon {
    display: block;
    margin: 0 auto .75rem;
    font-size: 2rem;
    color: var(--nx-ink-4);
    opacity: .9;
}

.empty-state p {
    margin: .2rem 0;
    font-size: .9rem;
}

/* ---------- 16. 弹窗（各页自己的 .modal 会覆盖细节） ---------- */
.modal {
    background: var(--nx-surface);
    border-radius: var(--nx-r-lg);
    box-shadow: var(--nx-sh-4);
    border: 1px solid var(--nx-line);
}

.modal-header {
    padding: 1rem 1.25rem;
    border-radius: var(--nx-r-lg) var(--nx-r-lg) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.modal-body { padding: 1.25rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: .9rem 1.25rem;
    border-top: 1px solid var(--nx-line);
    background: var(--nx-surface-2);
    border-radius: 0 0 var(--nx-r-lg) var(--nx-r-lg);
}

/* 弹窗里的关闭按钮别再用 20 年前的 &times; 小叉 */
.modal .close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 30px;
    block-size: 30px;
    border: none;
    border-radius: var(--nx-r-sm);
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--nx-dur) var(--nx-ease);
}

.modal .close-btn:hover { background: rgba(255, 255, 255, .32); }

/* ---------- 17. 统计卡 ---------- */
.stat-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--nx-line);
    border-left: none;
    border-radius: var(--nx-r-lg);
    padding: 1.125rem 1.25rem;
    box-shadow: var(--nx-sh-1);
    position: relative;
    overflow: hidden;
    transition: transform var(--nx-dur) var(--nx-ease),
                box-shadow var(--nx-dur) var(--nx-ease);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    inline-size: 3px;
    block-size: 100%;
    background: var(--stat-accent, var(--accent-gradient));
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--nx-sh-3);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    color: var(--nx-ink-3);
    font-size: .8125rem;
    font-weight: 500;
}

/* ---------- 18. 动画与可访问性 ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- 19. 响应式 ---------- */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1.25rem .9rem 0;
    }

    .dashboard-title { font-size: 1.4rem; }

    .dashboard-section,
    .nx-card { padding: 1rem; }

    .contest-item,
    .user-item { padding: .9rem 1rem; }

    .user-item {
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
    }

    .user-actions,
    .contest-actions {
        justify-content: flex-start;
    }

    footer { padding: 1rem; }
}
