@font-face {
    font-family: "Lato";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/static/vendor/fonts/lato-400.ttf") format("truetype");
}

@font-face {
    font-family: "Lato";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/static/vendor/fonts/lato-700.ttf") format("truetype");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4183c4;
    --primary-dark: #285f8f;
    --primary-light: #e7f0fa;
    --link: #4183c4;
    --success: #228b22;
    --danger: #d00;
    --warning: #cd853f;
    --purple: #9932cc;
    --teal: #00b5ad;
    --info: #6cf;
    --ce-color: #004488;
    --gray: #808080;
    --border: rgba(34, 36, 38, 0.15);
    --bg: #fff;
    --text: rgba(0, 0, 0, 0.87);
    --text-light: rgba(0, 0, 0, 0.55);
    --radius: 4px;
    --shadow: none;
}

html {
    font-size: 14px;
}

body {
    font-family: "Lato", -apple-system, "PingFang SC", "Source Han Sans SC",
        "Noto Sans CJK SC", "Microsoft Yahei", "Lantinghei SC", "Hiragino Sans GB",
        "WenQuanYi Micro Hei", sans-serif;
    background: url("/static/img/bg.jpg") no-repeat center center fixed;
    background-size: cover;
    color: var(--text);
    line-height: 1.6;
    padding-top: 46px;
}

/* 内容容器：毛玻璃效果（参考站 .padding 风格） */
.container {
    max-width: 1100px;
    margin: 16px auto;
    padding: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.4);
    border-right: 3px solid rgba(255, 255, 255, 0.4);
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 10px -10px 20px rgba(255, 255, 255, 0.2), -10px 10px 20px rgba(255, 255, 255, 0.1);
}

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

a:hover {
    color: #285f8f;
    text-decoration: underline;
}

/* ---------- 顶部导航（Semantic UI menu 风格） ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 46px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.navbar-inner {
    max-width: 1100px;
    height: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.navbar .logo {
    font-family: "Exo 2", "Lato", sans-serif;
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
    margin-right: 14px;
    display: flex;
    align-items: center;
}

.navbar .logo span {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.8em;
    margin-left: 6px;
}

.nav-link {
    padding: 9px 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    transition: color 0.15s, background 0.15s;
    border-radius: 3px;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #333;
    text-decoration: none;
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.navbar .spacer {
    flex: 1;
}

.navbar .user-area {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.btn-user {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    transition: all 0.15s;
}

.btn-user:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text);
    text-decoration: none;
}

/* ---------- 按钮（Semantic UI button 风格） ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 0 rgba(34, 36, 38, 0.15) inset;
    transition: background 0.1s;
    font-family: inherit;
}

.btn-primary:hover {
    background: #2f6ea8;
    text-decoration: none;
}

.btn-primary:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    transition: all 0.1s;
    font-family: inherit;
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text);
    text-decoration: none;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: #db2828;
    color: #fff;
    transition: background 0.1s;
    font-family: inherit;
}

.btn-danger:hover {
    background: #c01919;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
}

/* ---------- 布局 ---------- */
.card {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 16px;
}

.row {
    display: flex;
    gap: 14px;
}

.col-2 {
    flex: 2;
}

.col-3 {
    flex: 3;
}

.col-7 {
    flex: 7;
}

/* ---------- 表格（Semantic UI table 风格） ---------- */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(34, 36, 38, 0.15);
    border-radius: var(--radius);
    background: #fff;
}

.data-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid rgba(34, 36, 38, 0.1);
    background: #f9fafb;
    white-space: nowrap;
}

.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(34, 36, 38, 0.1);
    font-size: 14px;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f7fafc;
}

.data-table .num {
    color: var(--text);
    font-family: "Lato", "Consolas", monospace;
}

.center-table th, .center-table td {
    text-align: center !important;
}

.center-table .left-aligned {
    text-align: left !important;
}

.center-table .dot {
    font-style: normal;
    font-weight: 700;
}

/* ---------- 状态（参考站文字颜色风格） ---------- */
.badge {
    display: inline-block;
    font-weight: 700;
    white-space: nowrap;
}

.badge-AC {
    color: forestgreen;
}

.badge-WA {
    color: red;
}

.badge-RE {
    color: darkorchid;
}

.badge-TLE, .badge-MLE, .badge-OLE {
    color: sandybrown;
}

.badge-PE {
    color: sandybrown;
}

.badge-CE {
    color: #004488;
}

.badge-SE {
    color: grey;
}

.badge-PENDING {
    color: grey;
}

.badge-JUDGING {
    color: #6cf;
}

/* 难度 */
.diff {
    display: inline-block;
    font-weight: 700;
}

.diff-1 { color: forestgreen; }
.diff-2 { color: #3d9400; }
.diff-3 { color: #f0ad4e; }
.diff-4 { color: #f39c12; }
.diff-5 { color: #d00; }

/* 标签 */
.tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    background: #e8f0f8;
    color: #4183c4;
    margin-right: 4px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(34, 36, 38, 0.15);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.1s, box-shadow 0.1s;
    background: #fff;
    color: var(--text);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

textarea.form-control {
    resize: vertical;
    font-family: "Consolas", "Ubuntu Mono", "Fira Mono", monospace;
    font-size: 13px;
}

select.form-control {
    cursor: pointer;
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 12px;
}

.alert-error {
    background: #fff6f6;
    color: #9f3a38;
    border: 1px solid #e0b4b4;
}

.alert-success {
    background: #fcfff5;
    color: #2c662d;
    border: 1px solid #a3c293;
}

.alert-info {
    background: #f8ffff;
    color: #276f86;
    border: 1px solid #a9d5de;
}

/* ---------- 页码分页（参考站 pagination menu 风格） ---------- */
.num-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 18px;
}

.num-pagination button {
    min-width: 30px;
    padding: 6px 9px;
    border: 1px solid rgba(34, 36, 38, 0.15);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.87);
    font-family: inherit;
    border-radius: 2px;
}

.num-pagination button:hover:not(:disabled):not(.active) {
    background: rgba(0, 0, 0, 0.04);
}

.num-pagination button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.num-pagination button.active {
    background: #d6d6d6;
    border-color: #d6d6d6;
    font-weight: 700;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    font-family: inherit;
}

.pagination button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.03);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-light);
}

/* ---------- 工具条 ---------- */
.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar .form-control {
    width: auto;
}

.toolbar .grow {
    flex: 1;
}

/* ---------- 统计卡片 ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-card .value {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ---------- 首页（参考站布局） ---------- */
.home-grid {
    display: grid;
    grid-template-columns: 11fr 5fr;
    gap: 14px;
}

.home-main, .home-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    font-size: 15px;
    font-weight: 700;
}

.block-header .bi {
    width: 15px;
    height: 15px;
    color: #333;
}

.block-body {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 0 0 16px 16px;
    padding: 6px 14px;
}

.block-body table.data-table {
    border: none;
}

.block-body table.data-table th {
    background: transparent;
    font-size: 13px;
}

.announce-list td:first-child {
    font-weight: 500;
}

.star-table td {
    text-align: center;
}

.star-table td:first-child a {
    font-weight: 700;
}

.home-side .block-body table td {
    font-size: 13px;
}

.countdown-box {
    text-align: center;
    padding: 10px 0;
    font-size: 15px;
}

.countdown-box .cd-red {
    color: red;
    font-weight: 700;
}

.countdown-box .cd-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.marquee-bar {
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 6px 14px;
    margin-bottom: 14px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
}

.marquee-bar span {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@media (max-width: 900px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

/* 首页做题情况图表 */
.activity-chart {
    flex: 1;
    min-width: 0;
    height: 210px;
    background: #fff;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    padding: 0 4px;
    font-size: 13px;
    color: var(--text);
}

.chart-legend > div {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.chart-legend .lg {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chart-legend .lg-1 {
    background: #f0ad4e;
}

.chart-legend .lg-2 {
    background: #5bc0de;
}

/* ---------- 题目详情 ---------- */
.problem-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 10px 0 14px;
}

.problem-meta .meta-item {
    background: rgba(0, 0, 0, 0.04);
    border: none;
    border-radius: 4px;
    padding: 5px 11px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.6);
}

.problem-meta .meta-item b {
    color: var(--text);
    font-weight: 700;
}

.markdown-body {
    font-size: 15px;
    line-height: 1.7;
}

.markdown-body h2 {
    font-size: 15px;
    margin: 16px 0 0;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    background: #fff;
}

.markdown-body h2 + * {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 12px 14px;
    margin: 0 0 4px;
}

.markdown-body pre {
    background: #f6f6f6;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    overflow-x: auto;
    font-size: 13px;
    margin: 8px 0;
}

.markdown-body code {
    font-family: "Consolas", "Ubuntu Mono", "Fira Mono", monospace;
}

.sample-box {
    background: #f6f6f6;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 8px 0;
}

.sample-box .sample-head {
    font-size: 12px;
    color: var(--text-light);
    padding: 5px 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.sample-box pre {
    padding: 8px 12px;
    margin: 0;
    background: transparent;
    border: none;
    overflow-x: auto;
}

/* ---------- 代码编辑器区 ---------- */
.editor-panel {
    position: sticky;
    top: 60px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.editor-toolbar .form-control {
    width: 120px;
}

#code-editor {
    width: 100%;
    height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: "Consolas", "Ubuntu Mono", "Fira Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px;
    background: #fff;
    resize: vertical;
    tab-size: 4;
}

#code-editor:focus {
    outline: none;
    border-color: var(--primary);
}

/* ---------- 登录页（参考站全屏背景+居中卡片） ---------- */
.auth-box {
    min-height: calc(100vh - 46px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    padding: 32px 34px;
    text-align: center;
}

.auth-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 22px;
}

.auth-card .field {
    position: relative;
    margin-bottom: 14px;
}

.auth-card .field .f-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: #999;
}

.auth-card .field input {
    width: 100%;
    padding: 11px 12px 11px 38px;
    border: 1px solid rgba(34, 36, 38, 0.2);
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.1s, box-shadow 0.1s;
}

.auth-card .field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.auth-card .auth-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.87);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    font-family: inherit;
    transition: background 0.1s;
}

.auth-card .auth-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

.auth-card .auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-card .forgot-btn {
    display: block;
    margin-top: 14px;
    padding: 10px;
    border: 1px solid rgba(34, 36, 38, 0.15);
    border-radius: 4px;
    color: #4183c4;
    font-size: 14px;
    background: #fff;
}

.auth-card .forgot-btn:hover {
    background: rgba(0, 0, 0, 0.02);
    text-decoration: none;
}

.auth-card .auth-links {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.auth-card .auth-links a {
    font-weight: 700;
}

/* ---------- 登录页 ---------- */
.auth-wrap {
    max-width: 380px;
    margin: 40px auto;
}

.auth-wrap .card {
    padding: 26px 28px;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.auth-tabs a {
    flex: 1;
    text-align: center;
    padding: 9px;
    border-radius: var(--radius);
    font-weight: 700;
    color: var(--text-light);
}

.auth-tabs a.active {
    background: var(--primary);
    color: #fff;
}

/* ---------- 讨论 ---------- */
.topic-content {
    background: #f9fafb;
    border-radius: var(--radius);
    padding: 14px;
    white-space: pre-wrap;
    font-size: 14px;
}

.reply-item {
    border-top: 1px solid var(--border);
    padding: 12px 0;
}

/* ---------- 竞赛 ---------- */
.contest-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: #fff;
    transition: background 0.1s;
}

.contest-item:hover {
    background: #f7fafc;
}

.contest-state {
    padding: 2px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
}

.state-running {
    background: #e8f5e9;
    color: #2c662d;
}

.state-upcoming {
    background: #fff8e1;
    color: #935116;
}

.state-ended {
    background: #f3f4f5;
    color: var(--gray);
}

/* ---------- 代码查看 ---------- */
pre.code-block {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 14px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    font-family: "Consolas", "Ubuntu Mono", "Fira Mono", monospace;
    margin: 8px 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .row {
        flex-direction: column;
    }
    .editor-panel {
        position: static;
    }
    .navbar .nav-link {
        padding: 8px 6px;
        font-size: 13px;
    }
    .navbar .logo span {
        display: none;
    }
}

/* ---------- 其他 ---------- */
.muted {
    color: var(--text-light);
}

.small {
    font-size: 12px;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

.flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.justify-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.empty {
    text-align: center;
    color: var(--gray);
    padding: 36px 0;
    font-size: 14px;
}

.loading {
    text-align: center;
    color: var(--gray);
    padding: 28px 0;
}

.loading::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

/* 管理后台 */
.admin-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 14px;
}

.admin-sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    align-self: start;
    position: sticky;
    top: 60px;
}

.admin-sidebar a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--primary-light);
    color: var(--primary);
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
}

/* CodeMirror 覆盖 */
.CodeMirror {
    border-radius: var(--radius);
    border: 1px solid var(--border) !important;
    height: 420px !important;
    font-size: 13px;
    font-family: "Consolas", "Ubuntu Mono", "Fira Mono", monospace;
}

.CodeMirror-focused {
    border-color: var(--primary) !important;
}

.badge-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--primary);
}

/* 底部 footer（参考站风格） */
.site-footer {
    text-align: center;
    padding: 20px 16px;
    margin: 20px auto 0;
    max-width: 1280px;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.45);
    color: var(--text-light);
    font-size: 13px;
    line-height: 2;
}

.site-footer .footer-logo {
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
}

/* 排行榜周期 tab */
.period-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: fit-content;
    overflow: hidden;
}

.period-tabs button {
    padding: 7px 18px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    border-right: 1px solid var(--border);
}

.period-tabs button:last-child {
    border-right: none;
}

.period-tabs button.active {
    background: var(--primary);
    color: #fff;
}

/* ---------- 标签（参考站 label 风格） ---------- */
.label-danger {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 11px;
    background: #d9534f;
    color: #fff;
    margin: 0 2px 2px 0;
}

.label-default {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 11px;
    background: #e0e0e0;
    color: #333;
    margin: 0 2px 2px 0;
}

/* ---------- 通过率进度条（参考站风格） ---------- */
.progress {
    position: relative;
    height: 18px;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    min-width: 90px;
}

.progress-bar {
    height: 100%;
    background: #4cae4c;
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 40px 40px;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
    border-radius: 4px;
    animation: progress-striped 0.6s linear infinite;
}

@keyframes progress-striped {
    from { background-position: 40px 0; }
    to { background-position: 0 0; }
}

/* 题库分类标签栏 */
.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.category-bar .cat-chip {
    padding: 3px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    background: #fff;
    font-family: inherit;
}

.category-bar .cat-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-bar .cat-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
