/* =========================================================
   Swk 赞助中心 - 后台样式
   与前台同源的设计语言：暖纸 / 墨色 / 朱砂，侧边栏用深墨色
   ========================================================= */

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC",
        Georgia, "Times New Roman", serif;

    --paper: #f6f3ed;
    --paper-deep: #ece7dd;
    --surface: #fffefb;
    --surface-2: #faf7f1;
    --ink: #232019;
    --ink-2: #565046;
    --ink-3: #8c8477;
    --line: #e4ddcf;
    --line-strong: #cec4b0;
    --accent: #c2402a;
    --accent-deep: #a5331f;
    --accent-soft: rgba(194, 64, 42, 0.09);
    --gold: #b98a2f;
    --green: #3d7a5c;
    --green-soft: rgba(61, 122, 92, 0.1);
    --red: #b3392a;
    --red-soft: rgba(179, 57, 42, 0.1);

    --side-bg: #211c14;
    --side-ink: #d8cfbc;
    --side-ink-2: #9c917e;
    --side-line: rgba(255, 255, 255, 0.07);
    --side-active: rgba(194, 64, 42, 0.18);

    --shadow-sm: 0 1px 2px rgba(66, 52, 32, 0.05), 0 2px 10px rgba(66, 52, 32, 0.05);
    --shadow-md: 0 2px 6px rgba(66, 52, 32, 0.06), 0 14px 32px rgba(66, 52, 32, 0.09);
    --shadow-lg: 0 10px 24px rgba(66, 52, 32, 0.12), 0 36px 80px rgba(66, 52, 32, 0.18);

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --sidebar-w: 236px;
}

[data-theme="dark"] {
    --paper: #16140f;
    --paper-deep: #100e0a;
    --surface: #1f1c16;
    --surface-2: #262219;
    --ink: #ece5d6;
    --ink-2: #b5ac9a;
    --ink-3: #8b8272;
    --line: #352f24;
    --line-strong: #4a4233;
    --accent: #e0684e;
    --accent-deep: #c9543c;
    --accent-soft: rgba(224, 104, 78, 0.14);
    --gold: #d3a652;
    --green: #67a987;
    --green-soft: rgba(103, 169, 135, 0.14);
    --red: #e0684e;
    --red-soft: rgba(224, 104, 78, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 10px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 14px 32px rgba(0, 0, 0, 0.36);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.4), 0 36px 80px rgba(0, 0, 0, 0.5);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* 按要求移除所有页面元素的 outline */
*, *::before, *::after { outline: none !important; }
:focus, :focus-visible, a:focus, button:focus, input:focus,
textarea:focus, select:focus, [tabindex]:focus {
    outline: none !important;
}

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    transition: background-color 0.35s ease, color 0.35s ease;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

/* ---------- 布局 ---------- */
.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--side-bg);
    color: var(--side-ink);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    transition: transform 0.32s var(--ease);
    z-index: 60;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--side-line);
}
.sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.sidebar-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #f2ebda;
}
.sidebar-sub {
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--side-ink-2);
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 14px 12px;
    flex: 1;
    overflow-y: auto;
}
.sidebar-item { margin-bottom: 3px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border-radius: 11px;
    color: var(--side-ink-2);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    position: relative;
    transition: 0.25s var(--ease);
}
.sidebar-link i { width: 16px; text-align: center; font-size: 13px; }
.sidebar-link:hover {
    color: var(--side-ink);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}
.sidebar-link.active {
    color: #fff;
    background: var(--side-active);
}
.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.menu-badge {
    margin-left: auto;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--side-line);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sidebar-footer .sidebar-link { justify-content: center; }
.sidebar-footer .danger { color: #d98a76; }
.sidebar-footer .danger:hover { color: #ffb19c; background: rgba(194, 64, 42, 0.16); }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 22, 14, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 55;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.main-content {
    flex: 1;
    min-width: 0;
    padding: 0 28px 46px;
    position: relative;
    z-index: 1;
}

/* ---------- 顶栏 ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 0 18px;
    flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
/* 图标按钮 / 日夜切换 */
.icon-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: 0.25s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle { position: relative; overflow: hidden; }
.theme-ic { width: 18px; height: 18px; display: block; }
.theme-ic-sun { display: none; }
[data-theme="dark"] .theme-ic-sun { display: block; animation: themePop 0.4s ease; }
[data-theme="dark"] .theme-ic-moon { display: none; }
[data-theme="light"] .theme-ic-moon { animation: themePop 0.4s ease; }
@keyframes themePop {
    0% { transform: rotate(-40deg) scale(0.5); opacity: 0; }
    100% { transform: rotate(0) scale(1); opacity: 1; }
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-3);
    font-size: 12.5px;
    letter-spacing: 0.03em;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    place-items: center;
    transition: 0.25s var(--ease);
}
.mobile-menu-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 550;
    border: 1px solid transparent;
    transition: 0.25s var(--ease);
    white-space: nowrap;
    user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn i { font-size: 12px; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 5px 14px rgba(194, 64, 42, 0.22); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(194, 64, 42, 0.28); }

.btn-success { background: var(--green); color: #fff; box-shadow: 0 5px 14px rgba(61, 122, 92, 0.22); }
.btn-success:hover { filter: brightness(1.07); transform: translateY(-1px); }

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

.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(120, 104, 80, 0.1); color: var(--ink); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 650;
    font-size: 15px;
    letter-spacing: 0.02em;
}
.card-title i { color: var(--accent); font-size: 13px; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 20px; }

/* ---------- 统计卡片 ---------- */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.admin-stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 17px 18px 15px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: 0.3s var(--ease);
}
.admin-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
}
.admin-stat-card::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
}
.admin-stat-card:hover::after { opacity: 1; }
.admin-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 11px;
}
.admin-stat-value {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    line-height: 1.25;
}
.admin-stat-label { color: var(--ink-3); font-size: 12px; letter-spacing: 0.07em; margin-top: 3px; }
.admin-stat-sub { color: var(--ink-3); font-size: 11px; margin-top: 6px; }

/* ---------- 图表 ---------- */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 168px;
    padding: 8px 4px 0;
}
.chart-col {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.chart-val {
    font-size: 10.5px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.chart-bar {
    width: 100%;
    max-width: 34px;
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--paper-deep)));
    min-height: 4px;
    transition: height 0.7s var(--ease);
    opacity: 0.88;
}
.chart-bar:hover { opacity: 1; }
.chart-day {
    font-size: 10.5px;
    color: var(--ink-3);
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
}

/* ---------- 表格 ---------- */
.table-container { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.data-table th {
    text-align: left;
    padding: 11px 14px;
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.11em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: var(--surface-2);
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.data-table tbody tr { transition: background-color 0.22s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.table-user {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.table-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.table-avatar img { width: 100%; height: 100%; object-fit: cover; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.badge-soft { background: var(--accent-soft); color: var(--accent); }

/* ---------- 搜索 ---------- */
.search-bar {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.search-bar i {
    position: absolute;
    left: 11px;
    font-size: 12px;
    color: var(--ink-3);
    pointer-events: none;
}
.search-bar input {
    padding: 7px 12px 7px 30px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 13px;
    width: 190px;
    transition: 0.25s var(--ease);
}
.search-bar input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- 表单 ---------- */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink-2);
}
.form-label em {
    font-style: normal;
    font-weight: 400;
    color: var(--ink-3);
    font-size: 11px;
    margin-left: 4px;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 13.5px;
    transition: 0.25s var(--ease);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--ink-3); }
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-textarea { resize: vertical; min-height: 84px; line-height: 1.7; }

.form-hint {
    margin: 8px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.7;
}
.form-hint i { color: var(--accent); margin-right: 5px; }

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    margin-bottom: 10px;
    transition: 0.25s var(--ease);
    cursor: pointer;
}
.form-check:hover { border-color: var(--line-strong); }
.form-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--accent);
    flex-shrink: 0;
}
.form-check-text strong { display: block; font-size: 13px; }
.form-check-text span { color: var(--ink-3); font-size: 11.5px; }

/* ---------- 开关 ---------- */
.switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    display: inline-block;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 99px;
    background: var(--line-strong);
    transition: 0.28s var(--ease);
}
.switch-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    transition: 0.28s var(--ease);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ---------- 提示条 ---------- */
.alert {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    animation: fadeDown 0.35s var(--ease);
}
.alert-success {
    background: var(--green-soft);
    color: var(--green);
    border-color: color-mix(in srgb, var(--green) 26%, transparent);
}
.alert-error {
    background: var(--red-soft);
    color: var(--red);
    border-color: color-mix(in srgb, var(--red) 26%, transparent);
}
.alert i { font-size: 14px; }

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(32, 25, 16, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: none;
    overflow-y: auto;
    padding: 4vh 16px;
}
.modal-overlay.active { display: block; animation: fadeIn 0.25s ease; }
.modal-content {
    width: min(520px, 100%);
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 26px 24px 22px;
    position: relative;
    animation: modalUp 0.32s var(--ease);
}
.modal-content.wide { width: min(720px, 100%); }
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--line);
    color: var(--ink-3);
    display: grid;
    place-items: center;
    transition: 0.25s var(--ease);
    background: var(--surface);
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); transform: rotate(90deg); }
.modal-title {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 16px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* ---------- 空状态 ---------- */
.empty-state {
    padding: 40px 18px;
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
    letter-spacing: 0.04em;
}
.empty-state i { font-size: 24px; opacity: 0.45; display: block; margin-bottom: 10px; }

/* ---------- 管理员卡片 ---------- */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}
.admin-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: 0.3s var(--ease);
    position: relative;
}
.admin-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
}
.admin-card.is-super { border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.admin-card-top {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 12px;
}
.admin-card-name { font-weight: 650; font-size: 14.5px; }
.admin-card-user { color: var(--ink-3); font-size: 11.5px; }
.admin-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 13px;
}

/* ---------- 等级行 ---------- */
.level-row {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr 1fr 0.8fr auto;
    gap: 10px;
    align-items: end;
    padding: 13px;
    margin-bottom: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: 0.25s var(--ease);
}
.level-row:hover { border-color: var(--line-strong); }

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
    position: relative;
    z-index: 1;
}
.login-card {
    width: min(384px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px 30px;
    text-align: center;
    animation: modalUp 0.5s var(--ease);
}
.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.login-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.login-subtitle {
    margin: 6px 0 22px;
    color: var(--ink-3);
    font-size: 12px;
    letter-spacing: 0.16em;
}
.login-card .form-group { text-align: left; margin-bottom: 13px; }
.login-card .btn { width: 100%; margin-top: 6px; padding: 11px 18px; }
.login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    color: var(--ink-3);
    font-size: 12.5px;
    transition: color 0.25s;
}
.login-back:hover { color: var(--accent); }

/* ---------- 杂项 ---------- */
.muted { color: var(--ink-3); font-size: 12px; }
.strong { font-weight: 700; }
.text-accent { color: var(--accent); }
.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.record-detail {
    background: var(--surface-2);
    border-top: 1px solid var(--line);
}
.record-detail[hidden] { display: none; }
.record-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 52px;
    border-bottom: 1px dashed var(--line);
    font-size: 12.5px;
}
.record-row:last-child { border-bottom: 0; }
.record-row .grow { flex: 1; min-width: 0; color: var(--ink-2); }
.record-row time { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
    .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .level-row { grid-template-columns: 1fr 1fr; }
    .level-row .level-del { grid-column: 1 / -1; justify-self: end; }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu-btn { display: grid; }
    .main-content { padding: 0 18px 40px; }
    .topbar { padding: 16px 0 14px; }
    .topbar-title { font-size: 19px; }
}

@media (max-width: 640px) {
    .admin-stat-grid { gap: 10px; }
    .admin-stat-card { padding: 14px 13px 12px; }
    .admin-stat-value { font-size: 20px; }
    .card-body { padding: 15px 13px; }
    .card-header { padding: 13px 14px; }

    /* 表格转卡片 */
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr {
        border: 1px solid var(--line);
        border-radius: 12px;
        margin-bottom: 11px;
        padding: 8px 12px;
        background: var(--surface);
    }
    .data-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        border: 0;
        padding: 6px 2px;
        text-align: right;
    }
    .data-table td::before {
        content: attr(data-label);
        color: var(--ink-3);
        font-size: 11px;
        letter-spacing: 0.08em;
        flex-shrink: 0;
        text-align: left;
    }
    .data-table td > * { margin-left: auto; }
    .table-user { justify-content: flex-end; }
    .table-actions { justify-content: flex-end; }
    .record-row { padding-left: 14px; }

    .modal-overlay { padding: 0; }
    .modal-content {
        width: 100%;
        min-height: 60vh;
        margin-top: 18vh;
        border-radius: 20px 20px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }
    .chart { height: 136px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 全站强制移除 outline（置于文件末尾，最高优先级）===== */
*, *::before, *::after,
:focus, :focus-visible, :focus-within,
a, a:focus, a:active, a:hover,
button, button:focus, button:active,
input, input:focus, input:active,
textarea, textarea:focus, textarea:active,
select, select:focus, select:active,
[tabindex], [tabindex]:focus {
    outline: none !important;
    outline: 0 !important;
}
::-moz-focus-inner { border: 0 !important; }
