/* Hmoob Audio — 后台控制台（现代深色布局 v2） */
:root {
    --bg-deep: #06080d;
    --bg: #0a0d14;
    --surface: rgba(16, 20, 30, 0.85);
    --surface-solid: #10141e;
    --surface-hover: #161c2a;
    --elevated: #1a2030;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.10);
    --border-focus: rgba(124, 156, 255, 0.45);
    --text: #eef0f6;
    --text-secondary: #c4c9d8;
    --muted: #8490aa;
    --muted2: #556078;
    --accent: #7c9cff;
    --accent-light: #a8bfff;
    --accent-dim: rgba(124, 156, 255, 0.12);
    --accent-glow: rgba(124, 156, 255, 0.25);
    --danger: #f07178;
    --danger-dim: rgba(240, 113, 120, 0.10);
    --ok: #5fd4a8;
    --ok-dim: rgba(95, 212, 168, 0.10);
    --warn: #e8b86a;
    --warn-dim: rgba(232, 184, 106, 0.10);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --sidebar-w: 272px;
    --header-h: 68px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", monospace;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.18);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.28);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.38);
    --shadow-glow: 0 0 20px rgba(124,156,255,0.08);
}

/* ---- 浅色主题（变量 + 少量硬编码覆盖）---- */
[data-theme="light"] {
    --bg-deep: #eef1f8;
    --bg: #ffffff;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-solid: #ffffff;
    --surface-hover: #e8edf7;
    --elevated: #e2e8f4;
    --border: rgba(15, 23, 42, 0.09);
    --border-strong: rgba(15, 23, 42, 0.14);
    --border-focus: rgba(79, 109, 245, 0.45);
    --text: #0f172a;
    --text-secondary: #334155;
    --muted: #64748b;
    --muted2: #94a3b8;
    --accent: #4f6df5;
    --accent-light: #657ef7;
    --accent-dim: rgba(79, 109, 245, 0.12);
    --accent-glow: rgba(79, 109, 245, 0.14);
    --danger: #dc2626;
    --danger-dim: rgba(220, 38, 38, 0.08);
    --ok: #059669;
    --ok-dim: rgba(5, 150, 105, 0.1);
    --warn: #d97706;
    --warn-dim: rgba(217, 119, 6, 0.1);
    --shadow-sm: 0 1px 4px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.09);
    --shadow-lg: 0 16px 44px rgba(15, 23, 42, 0.1);
    --shadow-glow: 0 0 28px rgba(79, 109, 245, 0.1);
}

html[data-theme="light"] {
    color-scheme: light;
}
html[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="light"] body {
    background-image:
        radial-gradient(ellipse 100% 70% at 20% -15%, rgba(79, 109, 245, 0.09), transparent 52%),
        radial-gradient(ellipse 55% 45% at 95% 100%, rgba(5, 150, 105, 0.05), transparent 45%),
        radial-gradient(ellipse 45% 35% at 55% 45%, rgba(79, 109, 245, 0.04), transparent 50%);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.12);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.2);
}

[data-theme="light"] ::selection {
    background: rgba(79, 109, 245, 0.22);
    color: var(--text);
}

[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.99) 100%);
}
[data-theme="light"] .sidebar::after {
    background: linear-gradient(180deg, rgba(79, 109, 245, 0.12), transparent 35%, transparent 65%, rgba(5, 150, 105, 0.06));
}
[data-theme="light"] .sidebar-brand-icon {
    background: linear-gradient(135deg, rgba(79, 109, 245, 0.18), rgba(79, 109, 245, 0.05));
    border-color: rgba(79, 109, 245, 0.22);
    box-shadow: 0 4px 14px rgba(79, 109, 245, 0.08);
}
[data-theme="light"] .sidebar-brand-name {
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
[data-theme="light"] .nav-item.active {
    box-shadow: inset 0 0 0 1px rgba(79, 109, 245, 0.22);
}
[data-theme="light"] .nav-item.active::before {
    background: linear-gradient(180deg, var(--accent), #3d5ae8);
    box-shadow: 2px 0 8px rgba(79, 109, 245, 0.2);
}

[data-theme="light"] .main-header {
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="light"] .msg.error {
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.25);
}
[data-theme="light"] .msg.ok {
    color: #047857;
    border-color: rgba(5, 150, 105, 0.28);
}

[data-theme="light"] .panel:hover {
    border-color: rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .panel h3::before {
    background: linear-gradient(180deg, var(--accent), #3d5ae8);
}

[data-theme="light"] .hint-block {
    background: rgba(79, 109, 245, 0.06);
    border-color: rgba(79, 109, 245, 0.12);
    border-left-color: rgba(79, 109, 245, 0.28);
}
[data-theme="light"] .hint-block code,
[data-theme="light"] .panel code {
    background: rgba(15, 23, 42, 0.06);
    border-color: var(--border);
    color: #334155;
}

[data-theme="light"] .table-wrap {
    background: rgba(15, 23, 42, 0.03);
}
[data-theme="light"] th {
    background: rgba(15, 23, 42, 0.04);
}
[data-theme="light"] tbody tr:hover td {
    background: rgba(79, 109, 245, 0.05);
}

[data-theme="light"] .form-grid input,
[data-theme="light"] .form-grid textarea,
[data-theme="light"] .form-grid select {
    background: #fff;
    border-color: var(--border);
}
[data-theme="light"] .form-grid input:hover,
[data-theme="light"] .form-grid textarea:hover,
[data-theme="light"] .form-grid select:hover {
    background: #fafbfc;
    border-color: var(--border-strong);
}
[data-theme="light"] .form-grid input:focus,
[data-theme="light"] .form-grid textarea:focus,
[data-theme="light"] .form-grid select:focus {
    background: #fff;
}

[data-theme="light"] .btn::after {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.04), transparent);
}
[data-theme="light"] .btn-ghost:hover {
    background: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #5f73f7 0%, #4a5ee5 100%);
    box-shadow: 0 4px 14px rgba(79, 109, 245, 0.22);
}
[data-theme="light"] .btn-primary:hover {
    box-shadow: 0 6px 18px rgba(79, 109, 245, 0.28);
    background: linear-gradient(135deg, #5f73f7 0%, #4a5ee5 100%);
}

[data-theme="light"] .restart-log-pre,
[data-theme="light"] #dbStatus.restart-log-pre {
    background: #f8fafc;
    border-color: var(--border);
}

[data-theme="light"] .restart-lines-label input {
    background: #fff;
}
[data-theme="light"] .restart-lines-label {
    background: rgba(15, 23, 42, 0.04);
    border-color: var(--border);
}

[data-theme="light"] .admin-overlay {
    background: rgba(15, 23, 42, 0.38);
}

[data-theme="light"] .admin-overlay-panel textarea {
    background: #fff;
}

[data-theme="light"] .selfcheck-log-details {
    background: rgba(15, 23, 42, 0.03);
}
[data-theme="light"] .selfcheck-log-details[open] {
    background: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .search-filter-check {
    background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .login-wrap input {
    background: #fff;
}

@media (max-width: 960px) {
    [data-theme="light"] .restart-lines-label {
        background: rgba(15, 23, 42, 0.05);
    }
}

/* 主题切换按钮图标：深色模式下显示太阳（点按切浅色），浅色模式下显示月亮 */
.theme-toggle .theme-icon-moon {
    display: none;
}
[data-theme="light"] .theme-toggle .theme-icon-sun {
    display: none;
}
[data-theme="light"] .theme-toggle .theme-icon-moon {
    display: block;
}

.theme-toggle {
    gap: 0.35rem;
}
.theme-toggle .theme-toggle-label {
    font-size: 0.86rem;
}
@media (max-width: 480px) {
    .theme-toggle .theme-toggle-label {
        display: none;
    }
}

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

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

/* 使用 class 而非 :has()，避免旧版移动浏览器布局/滚动异常 */
body.admin-ui { height: 100vh; overflow: hidden; }

body.admin-ui {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 100% 70% at 20% -20%, rgba(124, 156, 255, 0.08), transparent 50%),
        radial-gradient(ellipse 60% 50% at 95% 95%, rgba(95, 212, 168, 0.04), transparent 40%),
        radial-gradient(ellipse 40% 30% at 60% 50%, rgba(124, 156, 255, 0.03), transparent 50%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

::selection { background: rgba(124, 156, 255, 0.3); color: #fff; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}
a:hover { color: var(--accent-light); }

/* ---- 登录页 ---- */
.login-wrap {
    max-width: 420px;
    margin: 5rem auto;
    padding: 2.5rem;
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.login-wrap h1 { margin-top: 0; font-size: 1.3rem; font-weight: 700; }
.login-wrap input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    margin: 0.35rem 0 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-wrap input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.login-wrap button {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #5a7cff);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}
.login-wrap button:hover { filter: brightness(1.1); }
.login-wrap button:active { transform: scale(0.98); }
.login-wrap .hint { margin-top: 1rem; font-size: 0.85rem; color: var(--muted); }

/* ---- 应用布局 ---- */
.admin-app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
}

/* ---- 侧边栏 ---- */
.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1.25rem 0.85rem;
    background: linear-gradient(180deg, rgba(14, 18, 28, 0.97) 0%, rgba(10, 13, 20, 0.99) 100%);
    border-right: 1px solid var(--border);
    position: relative;
    z-index: 2;
    overflow: hidden;
    backdrop-filter: blur(12px);
}
.sidebar::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(180deg, rgba(124,156,255,0.12), transparent 30%, transparent 70%, rgba(95,212,168,0.08));
    pointer-events: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.25rem 0.6rem 1.5rem;
    margin-bottom: 0.25rem;
}
.sidebar-brand-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(124, 156, 255, 0.22), rgba(90, 124, 255, 0.06));
    border: 1px solid rgba(124, 156, 255, 0.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(124, 156, 255, 0.08);
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.sidebar-brand:hover .sidebar-brand-icon {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 6px 20px rgba(124, 156, 255, 0.15);
}
.sidebar-brand-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.sidebar-brand-name {
    font-weight: 700;
    font-size: 1.08rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-brand-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted2);
}

.sidebar-section-title {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted2);
    padding: 0.5rem 0.7rem 0.4rem;
    margin: 0;
}

/* 小屏顶栏：汉堡按钮（仅 ≤960px 显示，见响应式段） */
.admin-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--elevated);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.admin-menu-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.admin-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.admin-app.admin-drawer-open .admin-drawer-backdrop {
    display: block;
}
.admin-drawer-backdrop.hidden {
    display: none !important;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.75rem;
    margin: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    overflow: hidden;
}
.nav-item .nav-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}
.nav-item:hover .nav-icon { opacity: 0.8; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-secondary);
}
.nav-item.active {
    background: var(--accent-dim);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(124, 156, 255, 0.2);
    font-weight: 600;
}
.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 1.4rem;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent), #5a7cff);
    box-shadow: 2px 0 10px rgba(124, 156, 255, 0.3);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--muted);
    transition: all 0.2s var(--ease);
}
.sidebar-link:hover { background: var(--surface-hover); color: var(--accent); }
.sidebar-link .nav-icon { width: 18px; height: 18px; opacity: 0.5; }
.sidebar-link:hover .nav-icon { opacity: 0.8; }

/* ---- 主栏 ---- */
.main-column {
    display: flex;
    flex-direction: column;
    min-width: 0; min-height: 0;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

.main-header {
    flex-shrink: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-h);
    padding: 0.75rem 2rem;
    background: rgba(6, 8, 13, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.main-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.main-header-actions { display: flex; align-items: center; gap: 0.5rem; }

.main-body {
    flex: 1;
    min-height: 0;
    padding: 1.5rem 2rem 3rem;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- 消息条 ---- */
.msg {
    margin: 0 0 1rem;
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    animation: msg-in 0.35s var(--ease-spring);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.msg::before {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.msg.error::before { content: "✕"; }
.msg.ok::before { content: "✓"; }

@keyframes msg-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.msg.error {
    background: var(--danger-dim);
    border: 1px solid rgba(240, 113, 120, 0.25);
    color: #ffb8bb;
}
.msg.ok {
    background: var(--ok-dim);
    border: 1px solid rgba(95, 212, 168, 0.25);
    color: #b8f0de;
}

.hidden { display: none !important; }

/* 未登录或非管理员：全屏拦截 */
.admin-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top, 0px))
        max(1rem, env(safe-area-inset-right, 0px))
        max(1rem, env(safe-area-inset-bottom, 0px))
        max(1rem, env(safe-area-inset-left, 0px));
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.admin-gate.hidden {
    display: none !important;
}
.admin-gate-panel {
    max-width: 420px;
    width: 100%;
    max-height: min(92vh, 100dvh);
    overflow-y: auto;
    padding: 1.5rem 1.65rem;
    border-radius: var(--radius);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.admin-gate-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
}
.admin-gate-msg {
    margin: 0 0 1.1rem;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}
.admin-gate-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
}
.admin-gate-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
}
.admin-gate-field input {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}
.admin-gate-field input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
[data-theme="light"] .admin-gate-field input {
    background: #fff;
}
.admin-gate-submit {
    width: 100%;
    margin-top: 0.25rem;
    min-height: 44px;
    font-weight: 600;
}
.admin-gate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
}
.admin-gate-actions .btn {
    text-decoration: none;
}
.admin-gate-link-home {
    font-size: 0.88rem;
}

/* ---- 概览统计卡片 ---- */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* 概览：后端 / Cookies / 数据库 紧凑横排 */
.overview-compact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}
.overview-compact-row .stat-card--mini {
    flex: 1 1 0;
    min-width: 5.25rem;
    padding: 0.45rem 0.55rem;
    border-radius: calc(var(--radius) - 2px);
}
.overview-compact-row .stat-card--mini .stat-card-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 0.25rem;
    border-radius: 8px;
}
.overview-compact-row .stat-card--mini .stat-card-icon svg {
    width: 15px;
    height: 15px;
}
.overview-compact-row .stat-card--mini .stat-card-label {
    font-size: 0.6rem;
    margin-bottom: 0.08rem;
    letter-spacing: 0.03em;
    line-height: 1.2;
}
.overview-compact-row .stat-card--mini .stat-card-value {
    font-size: 0.78rem;
    line-height: 1.25;
}
.stat-card-sub {
    font-size: 0.58rem;
    line-height: 1.35;
    margin-top: 0.18rem;
    word-break: break-word;
    color: var(--muted);
}
[data-theme="light"] .stat-card-sub {
    color: var(--muted);
}
.overview-grid--online {
    grid-template-columns: 1fr;
    max-width: 100%;
}

/* 概览统计：平板/手机「在线设备」等大卡片避免多列挤一行 */
@media (max-width: 1100px) {
    .overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }
    .overview-grid--online {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 520px) {
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
        margin-bottom: 0.85rem;
    }
    /* 每张卡片横向排布，避免纵向过长列表（仅大卡片区域，不含紧凑横排） */
    .overview-grid .stat-card:not(.stat-card--mini) {
        display: grid;
        grid-template-columns: 44px 1fr;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 0.85rem;
        row-gap: 0.15rem;
        padding: 0.8rem 1rem;
    }
    .overview-grid .stat-card:not(.stat-card--mini) .stat-card-icon {
        grid-column: 1;
        grid-row: 1 / span 2;
        margin-bottom: 0;
        width: 44px;
        height: 44px;
    }
    .overview-grid .stat-card:not(.stat-card--mini) .stat-card-label {
        grid-column: 2;
        grid-row: 1;
        margin-bottom: 0;
        font-size: 0.72rem;
    }
    .overview-grid .stat-card:not(.stat-card--mini) .stat-card-value {
        grid-column: 2;
        grid-row: 2;
        font-size: 1.02rem;
    }
    .overview-compact-row {
        gap: 0.35rem;
        margin-bottom: 0.55rem;
    }
    .overview-compact-row .stat-card--mini {
        min-width: 4.75rem;
        padding: 0.4rem 0.45rem;
    }
}
.stat-card {
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    overflow: hidden;
    transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
@media (hover: hover) and (pointer: fine) {
    .stat-card:hover {
        border-color: var(--border-strong);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md), var(--shadow-glow);
    }
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0.7;
}
.stat-card.card-ok::before { background: linear-gradient(90deg, var(--ok), rgba(95,212,168,0.2)); }
.stat-card.card-warn::before { background: linear-gradient(90deg, var(--warn), rgba(232,184,106,0.2)); }
.stat-card.card-error::before { background: linear-gradient(90deg, var(--danger), rgba(240,113,120,0.2)); }
.stat-card.card-info::before { background: linear-gradient(90deg, var(--accent), rgba(124,156,255,0.2)); }

.stat-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.85rem;
    font-size: 1.1rem;
}
.stat-card.card-ok .stat-card-icon { background: var(--ok-dim); color: var(--ok); }
.stat-card.card-warn .stat-card-icon { background: var(--warn-dim); color: var(--warn); }
.stat-card.card-error .stat-card-icon { background: var(--danger-dim); color: var(--danger); }
.stat-card.card-info .stat-card-icon { background: var(--accent-dim); color: var(--accent); }

.stat-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted2);
    margin-bottom: 0.3rem;
}
.stat-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: -0.02em;
}
.stat-card.card-ok .stat-card-value { color: var(--ok); }
.stat-card.card-warn .stat-card-value { color: var(--warn); }
.stat-card.card-error .stat-card-value { color: var(--danger); }
.stat-card.card-info .stat-card-value { color: var(--accent); }

/* ---- 面板 / 卡片 ---- */
.panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.65rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s;
    animation: panel-in 0.4s var(--ease) both;
}
@keyframes panel-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.panel:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-md);
}
.panel h3 {
    margin: 0 0 1.1rem;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.panel h3::before {
    content: "";
    width: 3px; height: 1.1em;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), #5a7cff);
    flex-shrink: 0;
}
.panel h4 {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.hint-block {
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.7;
    margin: 0 0 1.25rem;
    max-width: 54rem;
    padding: 0.85rem 1rem;
    background: rgba(124, 156, 255, 0.04);
    border: 1px solid rgba(124, 156, 255, 0.08);
    border-radius: var(--radius-sm);
    border-left: 3px solid rgba(124, 156, 255, 0.25);
}
.hint-block code, .panel code {
    font-family: var(--mono);
    font-size: 0.82em;
    padding: 0.15em 0.45em;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    color: #c8d0e0;
}

/* ---- 表格 ---- */
.table-wrap {
    position: relative;
    overflow-x: auto;
    margin: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 0.5rem;
}
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86rem;
}
th, td {
    padding: 0.7rem 0.95rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--muted2);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1;
}
th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover td { background: rgba(124, 156, 255, 0.04); }
tbody tr:last-child td { border-bottom: none; }

.mono {
    font-family: var(--mono);
    font-size: 0.82rem;
    word-break: break-word;
}

/* ---- 表单 ---- */
.form-grid {
    display: grid;
    gap: 1.1rem;
    max-width: 560px;
}
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
}
.form-grid input,
.form-grid textarea,
.form-grid select {
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.25);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.form-grid input:hover,
.form-grid textarea:hover,
.form-grid select:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(0,0,0,0.3);
}
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: rgba(0,0,0,0.35);
}
.form-grid textarea { min-height: 120px; resize: vertical; }
.form-grid select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238490aa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.2rem;
}

.sc-check {
    flex-direction: row !important;
    align-items: center;
    gap: 0.65rem !important;
}
.sc-check input[type="checkbox"] {
    width: 18px !important; height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ---- 按钮 ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.05rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--elevated);
    color: var(--text);
    cursor: pointer;
    font-size: 0.86rem;
    font-family: inherit;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s var(--ease);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}
.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #6b8cff 0%, #5570f0 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(90, 118, 245, 0.3);
    font-weight: 600;
}
.btn-primary:hover {
    filter: brightness(1.08);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(90, 118, 245, 0.4);
    background: linear-gradient(135deg, #6b8cff 0%, #5570f0 100%);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}
.btn-ghost:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

.btn-danger {
    border-color: rgba(240, 113, 120, 0.3);
    color: var(--danger);
    background: var(--danger-dim);
}
.btn-danger:hover {
    background: rgba(240, 113, 120, 0.15);
    border-color: rgba(240, 113, 120, 0.5);
    box-shadow: 0 4px 16px rgba(240, 113, 120, 0.12);
}

td .btn {
    margin-right: 0.35rem;
    margin-bottom: 0.25rem;
    padding: 0.38rem 0.75rem;
    font-size: 0.8rem;
}

.pager {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.cookies-selected-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

/* ---- 日志 pre ---- */
.restart-log-pre {
    max-height: min(70vh, 520px);
    overflow: auto;
    margin: 0;
    padding: 1rem 1.2rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--mono);
}

.restart-lines-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.restart-lines-label input {
    padding: 0.4rem 0.55rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.25);
    color: var(--text);
    font-family: var(--mono);
}

/* 重启 API 令牌：使用 text + 圆点遮挡，避免 type=password 触发浏览器「保存密码」 */
.admin-restart-token-form {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}
input.admin-restart-token-input {
    -webkit-text-security: disc;
}

/* ---- 分类 pill ---- */
.sc-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}
.sc-pill.on {
    background: var(--ok-dim);
    color: var(--ok);
    border: 1px solid rgba(95, 212, 168, 0.3);
}
.sc-pill.off {
    background: rgba(139, 146, 168, 0.08);
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-sc-toggle-on { border-color: rgba(95, 212, 168, 0.35); color: var(--ok); }
.btn-sc-toggle-off { border-color: var(--border); color: var(--muted); }

/* ---- 弹层 ---- */
.admin-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    animation: overlay-in 0.25s var(--ease);
}
@keyframes overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.admin-overlay.hidden { display: none !important; }
.admin-overlay-panel {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.5rem;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    animation: overlay-panel-in 0.3s var(--ease-spring);
}
@keyframes overlay-panel-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.admin-overlay-panel h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.admin-overlay-panel textarea {
    width: 100%;
    min-height: 160px;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.25);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--mono);
    resize: vertical;
}
.admin-overlay-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ---- API 自检 ---- */
.muted { color: var(--muted); }
.warn-text { color: var(--warn) !important; }

.selfcheck-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.selfcheck-meta .selfcheck-time {
    font-size: 0.85rem;
    color: var(--muted);
}
.selfcheck-subtitle {
    margin: 1.25rem 0 0.65rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}
.selfcheck-table { width: 100%; font-size: 0.86rem; }
.selfcheck-table th:nth-child(3),
.selfcheck-table td:nth-child(3) { min-width: 8rem; }
.selfcheck-table th:nth-child(4),
.selfcheck-table td:nth-child(4) { min-width: 12rem; }
.selfcheck-table td { vertical-align: top; }

.selfcheck-log-details {
    margin-top: 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    transition: background 0.2s;
}
.selfcheck-log-details[open] { background: rgba(0, 0, 0, 0.25); }
.selfcheck-log-details summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.88rem;
    user-select: none;
    transition: color 0.2s;
    font-weight: 500;
}
.selfcheck-log-details summary:hover { color: var(--text); }
.selfcheck-log-pre {
    margin: 0.6rem 0 0;
    max-height: 16rem;
    overflow: auto;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---- 搜索过滤复选框 ---- */
.search-filter-check {
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}
.search-filter-check:hover { border-color: var(--border-strong); }

/* 小屏见 @media (max-width: 960px) 内：横向菜单需 pan-x，勿在此处写死 manipulation */
@media (min-width: 961px) {
    .nav-item,
    .sidebar-link {
        touch-action: manipulation;
    }
}

/* ---- 加载动画 ---- */
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.loading-text { animation: pulse 1.5s ease-in-out infinite; }

/* ---- 响应式 ---- */
@media (max-width: 960px) {
    body.admin-ui {
        height: auto !important;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* 首行高度为 0：侧栏改为 fixed 抽屉，不占主内容上方空间 */
    .admin-app {
        grid-template-columns: 1fr;
        grid-template-rows: 0px minmax(0, auto);
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }
    .main-column {
        grid-row: 2;
        grid-column: 1;
        height: auto;
        min-height: 0;
        overflow: visible;
    }
    .main-body { overflow: visible; min-height: 0; }

    .admin-menu-btn {
        display: inline-flex;
    }

    .sidebar {
        grid-row: 1;
        grid-column: 1;
        /* 勿写 height:0：fixed 子项若 height:0 会整栏高度为 0，菜单文字/按钮全不可见 */
        height: 100dvh;
        min-height: -webkit-fill-available;
        max-height: 100dvh;
        overflow: hidden;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(300px, calc(100vw - 48px));
        max-width: 100%;
        z-index: 10002;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: max(0.85rem, env(safe-area-inset-top, 0px)) 0.85rem max(0.75rem, env(safe-area-inset-bottom, 0px))
            max(0.85rem, env(safe-area-inset-left, 0px));
        border-right: 1px solid var(--border);
        border-bottom: none;
        background: linear-gradient(180deg, rgba(14, 18, 28, 0.98) 0%, rgba(10, 13, 20, 1) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
        transform: translateX(-105%);
        transition: transform 0.28s var(--ease);
        pointer-events: none;
        visibility: hidden;
    }
    .admin-app.admin-drawer-open .sidebar {
        transform: translateX(0);
        pointer-events: auto;
        visibility: visible;
    }
    .sidebar::after {
        display: none;
    }
    .sidebar-brand {
        padding: 0 0.25rem 0.85rem;
        margin-bottom: 0;
        flex: none;
        min-width: 0;
    }
    /* 抽屉内渐变字在部分 WebKit 上会「透明失败」，改为实色字保证可见 */
    .sidebar .sidebar-brand-name {
        background: none;
        -webkit-background-clip: border-box;
        background-clip: border-box;
        -webkit-text-fill-color: currentColor;
        color: var(--text);
    }
    .sidebar-nav {
        flex: 1;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.2rem;
        width: 100%;
        min-height: 0;
        min-width: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 0.35rem 0.15rem 0.5rem 0;
        border-top: 1px solid var(--border);
        margin-top: 0.25rem;
        -webkit-overflow-scrolling: touch;
        touch-action: manipulation;
    }
    .sidebar-nav::-webkit-scrollbar {
        width: 4px;
    }
    .sidebar-section-title {
        display: block;
        width: 100%;
        padding: 0 0.25rem 0.35rem;
    }
    .nav-item {
        display: flex;
        width: 100%;
        min-width: 0;
        padding: 0.65rem 0.8rem;
        font-size: 0.88rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(124, 156, 255, 0.2);
    }
    .nav-item .nav-icon {
        width: 18px;
        height: 18px;
    }
    .sidebar-footer {
        flex-direction: column;
        flex-wrap: nowrap;
        padding-top: 0.75rem;
        margin-top: 0.35rem;
        border-top: 1px solid var(--border);
        gap: 0.35rem;
        flex-shrink: 0;
    }
    .sidebar-link {
        padding: 0.55rem 0.75rem;
        font-size: 0.86rem;
    }
    .main-header {
        position: relative;
        top: auto;
        padding: 0.7rem 1rem;
        z-index: 10;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.75rem;
    }
    .main-title {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 1.2rem;
    }
    .main-header-actions {
        margin-left: auto;
    }
    .main-body {
        padding: 0.9rem 1rem max(2rem, env(safe-area-inset-bottom, 0px));
    }
    .msg { margin: 0 0 0.65rem; }
    .panel { padding: 1.1rem 1.15rem; }
    .panel h3 {
        font-size: 1rem;
        margin-bottom: 0.9rem;
    }
    .hint-block {
        padding: 0.75rem 0.85rem;
        font-size: 0.84rem;
        line-height: 1.6;
    }
    .form-grid {
        gap: 0.9rem;
        max-width: none !important;
    }
    .form-grid input,
    .form-grid textarea,
    .form-grid select,
    .btn {
        min-height: 44px;
    }
    .pager {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }
    .pager > .btn,
    .pager > label {
        width: 100%;
        margin: 0;
    }
    .restart-lines-label {
        justify-content: space-between;
        width: 100%;
        padding: 0.65rem 0.8rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: rgba(0,0,0,0.18);
    }
    .restart-lines-label input {
        width: 5.5rem !important;
        min-height: 38px;
    }
    td .btn {
        min-height: 36px;
    }
    .table-wrap {
        margin-inline: -0.15rem;
    }
    table {
        min-width: 640px;
    }
    .selfcheck-table {
        min-width: 760px;
    }
}

@media (max-width: 480px) {
    /* iOS：输入框字号 < 16px 时聚焦会放大整页 */
    .admin-gate-field input,
    .form-grid input:not([type="checkbox"]):not([type="radio"]),
    .form-grid textarea,
    .form-grid select {
        font-size: 16px;
    }
    .admin-gate {
        align-items: flex-start;
        padding-top: max(1rem, env(safe-area-inset-top, 0px));
    }
    .admin-gate-panel {
        margin-block: auto;
        padding: 1.25rem 1.15rem;
    }
    .sidebar {
        padding: 0.75rem 0.7rem 0.65rem;
    }
    .sidebar-brand {
        padding: 0 0 0.55rem;
    }
    .sidebar-brand-icon {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }
    .sidebar-brand-name { font-size: 1rem; }
    .nav-item.active::before {
        display: none;
    }
    .main-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.55rem 0.65rem;
    }
    .main-title {
        font-size: 1.12rem;
        flex: 1 1 auto;
        min-width: 0;
    }
    .main-header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
        flex: 1 1 100%;
        margin-left: 0;
    }
    .main-header-actions .btn {
        width: 100%;
        min-height: 44px;
    }
    .main-body {
        padding: 0.8rem 0.8rem max(1.5rem, env(safe-area-inset-bottom, 0px));
    }
    .panel {
        padding: 0.95rem;
        border-radius: 12px;
    }
    .stat-card-value {
        font-size: 1rem;
    }
    .pager {
        grid-template-columns: 1fr;
    }
    .sc-check {
        align-items: flex-start;
    }
    .sc-check input[type="checkbox"] {
        margin-top: 0.15rem;
    }
    .cookies-selected-hint,
    .mono {
        font-size: 0.78rem;
    }
    table {
        min-width: 560px;
        font-size: 0.82rem;
    }
    th,
    td {
        padding: 0.6rem 0.75rem;
    }
    .restart-log-pre {
        padding: 0.85rem 0.95rem;
        font-size: 0.74rem;
    }
}
