* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --ui-bg: #f0f2f6;
    --ui-card: #ffffff;
    --ui-text: #1e293b;
    --ui-muted: #64748b;
    --ui-accent: #3b82f6;
    --ui-accent-dark: #2563eb;
    --ui-radius: 14px;
    --ui-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--ui-bg); color: var(--ui-text); line-height: 1.5; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { background: linear-gradient(90deg, #0f172a, #1e293b); color: #fff; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 12px; box-shadow: 0 2px 16px rgba(0,0,0,.12); }
.topbar a { color: #cbd5e1; }
.topbar a:hover { color: #fff; }
.brand, .topbar-brand { font-weight: 700; font-size: 18px; flex: 0 0 auto; }
.topbar-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; flex: 1 1 auto; justify-content: flex-end; }
.topbar-nav a { margin-left: 0; font-size: 14px; white-space: nowrap; }
.admin-topbar { gap: 8px 16px; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.card { background: var(--ui-card); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); padding: 24px; margin-bottom: 20px; border: 1px solid rgba(226,232,240,.6); }
.card h2 { margin-bottom: 16px; font-size: 20px; }

.login-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse at top, #e0e7ff 0%, var(--ui-bg) 55%); }
.login-card { width: 100%; max-width: 420px; border: none; }
.login-card h2 { font-size: 22px; font-weight: 700; color: #0f172a; margin-bottom: 20px; }
.btn-block { width: 100%; }
.login-hint { margin-top: 16px; font-size: 13px; color: #64748b; }
.login-links { margin-top: 16px; text-align: center; font-size: 14px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}
.form-group textarea { min-height: 180px; resize: vertical; }

.btn { display: inline-block; padding: 10px 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-on { background: #16a34a; color: #fff; }
.btn-on:hover { background: #15803d; }
.btn-off { background: #ea580c; color: #fff; }
.btn-off:hover { background: #c2410c; }
.btn-confirm { background: #2563eb; color: #fff; }
.btn-confirm:hover { background: #1d4ed8; }
.btn-permanent { background: #7c3aed; color: #fff; }
.btn-permanent:hover { background: #6d28d9; }
.btn-convert { background: #0891b2; color: #fff; }
.btn-convert:hover { background: #0e7490; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
th { background: #f8fafc; font-weight: 600; }
tr:hover { background: #f8fafc; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-box { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-box .num { font-size: 28px; font-weight: 700; color: #2563eb; }
.stat-box .label { color: #64748b; margin-top: 4px; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.inline-form .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

.mail-list .unread { font-weight: 700; }
.mail-list .mail-subject-link { color: #1e293b; font-weight: 500; }
.mail-list .mail-subject-link:hover { color: #2563eb; }
.mail-list .mail-from { color: #334155; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .mail-date { color: #94a3b8; white-space: nowrap; text-align: right; }

/* 读信页 */
.mail-read-toolbar { margin-bottom: 16px; }
.mail-read-card { padding: 0; overflow: hidden; }
.mail-subject {
    font-size: 22px; font-weight: 700; color: #0f172a;
    padding: 24px 28px 16px; line-height: 1.4;
    border-bottom: 1px solid #e2e8f0;
}
.mail-info {
    padding: 16px 28px; background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.mail-info-row {
    display: flex; align-items: baseline; gap: 12px;
    padding: 6px 0; font-size: 14px;
}
.mail-info-label {
    flex: 0 0 56px; color: #64748b; font-weight: 600;
}
.mail-info-value { flex: 1; color: #1e293b; word-break: break-all; }
.mail-content {
    padding: 28px; min-height: 160px;
    font-size: 15px; line-height: 1.7; color: #334155;
}
.mail-content-text { white-space: pre-wrap; word-break: break-word; }
.mail-content-html { word-break: break-word; }
.mail-content-html img { max-width: 100%; height: auto; }
.mail-content-html table { max-width: 100%; }
.mail-content-html a { color: #2563eb; }
.mail-content-html blockquote {
    margin: 12px 0; padding: 8px 16px;
    border-left: 3px solid #cbd5e1; color: #64748b; background: #f8fafc;
}
.mail-content-html hr { border: none; border-top: 1px solid #e2e8f0; margin: 16px 0; }

.mail-view .meta { color: #64748b; margin-bottom: 16px; font-size: 14px; }
.mail-view .body { background: #f8fafc; padding: 16px; border-radius: 8px; min-height: 200px; }

.footer { text-align: center; color: #94a3b8; padding: 24px; font-size: 13px; }
.user-email { color: #94a3b8; margin-right: 12px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: #991b1b; }

.home-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.home-links a { display: block; background: #fff; padding: 32px; border-radius: 12px; text-align: center; font-size: 18px; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); color: #1e293b; }
.home-links a:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); text-decoration: none; }

@media (max-width: 900px) {
    .admin-topbar { flex-direction: column; align-items: stretch; }
    .admin-topbar .topbar-nav { justify-content: flex-start; }
}

@media (max-width: 640px) {
    .topbar { padding: 10px 12px; }
    .topbar-brand { font-size: 16px; width: 100%; }
    .topbar-nav { width: 100%; justify-content: flex-start; gap: 8px 12px; }
    .user-email { display: block; width: 100%; margin: 0 0 4px; word-break: break-all; }
    .inline-form { flex-direction: column; }
    .home-links { grid-template-columns: 1fr; }
    .settings-row { flex-direction: column; align-items: stretch; }
    .settings-label { flex: none; padding-top: 0; }
    .container { margin: 16px auto; padding: 0 12px; }
    .card { padding: 16px; }
    .card h2 { font-size: 18px; }
    .temp-email-display { font-size: 18px; }
    .temp-inbox-header { flex-direction: column; align-items: flex-start; }
    .mail-list table, .temp-inbox-card table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .mail-list th, .mail-list td, .temp-inbox-card th, .temp-inbox-card td { font-size: 13px; padding: 10px 8px; }
    .mail-list .mail-from { max-width: 120px; }
    .mail-subject { font-size: 18px; padding: 16px; }
    .mail-info, .mail-content { padding: 16px; }
    .mail-info-row { flex-direction: column; gap: 2px; }
    .mail-info-label { flex: none; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-box { padding: 14px; }
    .stat-box .num { font-size: 22px; }
    .pagination { flex-wrap: wrap; gap: 8px; }
    .mb-action-group { flex-direction: column; align-items: flex-start; }
    .mb-date-input { min-width: 0; width: 100%; }
}

/* 后台邮件配置 */
.settings-hint { color: #64748b; font-size: 13px; margin: -8px 0 20px; }
.form-hint { color: #94a3b8; font-size: 12px; margin: 6px 0 0; }
.settings-form { max-width: 720px; }
.settings-row {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 0; border-bottom: 1px solid #f1f5f9;
}
.settings-row:last-of-type { border-bottom: none; }
.settings-label {
    flex: 0 0 140px; font-size: 14px; color: #475569; font-weight: 500;
}
.settings-label .required { color: #ef4444; margin-right: 2px; }
.settings-field { flex: 1; }
.settings-field input,
.settings-field select {
    width: 100%; max-width: 400px;
    padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
    font-size: 14px; background: #fff; transition: border-color .15s;
}
.settings-field input:focus,
.settings-field select:focus {
    outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}
.settings-field input.readonly { background: #f8fafc; color: #64748b; cursor: not-allowed; }
.settings-actions { padding-top: 20px; }
.settings-actions-bar { margin-bottom: 20px; }
.settings-summary .settings-table { margin-top: 8px; }
.settings-summary .settings-table th { width: 140px; color: #64748b; font-weight: 500; background: transparent; }
.settings-summary .settings-table td { color: #1e293b; }

.text-muted { color: #94a3b8; font-size: 14px; font-weight: normal; }
.filter-form { margin-bottom: 0; }
.log-preview { max-width: 200px; color: #64748b; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-body-full { white-space: pre-wrap; word-break: break-word; max-height: 480px; overflow-y: auto; }
.pagination { margin-top: 16px; display: flex; gap: 16px; align-items: center; font-size: 14px; }
.pagination a { color: #2563eb; }
.badge-source { background: #e0e7ff; color: #3730a3; font-size: 12px; }
.badge-temp { background: #fef3c7; color: #92400e; font-size: 12px; }
.badge-permanent { background: #d1fae5; color: #065f46; font-size: 12px; }
.row-temp { background: #fffbeb; }
.temp-email-display { font-size: 22px; font-weight: 700; color: #1e40af; word-break: break-all; margin: 12px 0; }
.temp-expire { color: #b45309; margin-bottom: 8px; }
.temp-intro-card, .temp-info-card { margin-bottom: 20px; }
.temp-inbox-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.temp-inbox-header h2 { margin-bottom: 0; }
.temp-inbox-tools { display: flex; align-items: center; gap: 12px; }
.temp-updated-at { font-size: 13px; color: #64748b; }
.temp-inbox-card .empty-cell { text-align: center; color: #64748b; padding: 24px; }
.temp-action-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 12px; }
.temp-page .temp-action-stack { display: none; }
.temp-login-link { text-decoration: none; display: inline-block; }
.temp-login-link:hover { text-decoration: none; opacity: 0.92; }
.temp-ip-hint { margin-top: 10px; font-size: 13px; }
.mailbox-list-card { max-width: 100%; }
.mailbox-table-wrap { overflow-x: auto; }
.mailbox-table { min-width: 960px; }
.mailbox-table-compact { min-width: 880px; }
.mailbox-table .col-ip { font-size: 13px; white-space: nowrap; font-family: ui-monospace, monospace; }
.mailbox-table .col-login-at { font-size: 13px; white-space: nowrap; color: #64748b; }
.legal-editor { width: 100%; min-height: 220px; font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.6; }
.mailbox-table .col-actions { min-width: 320px; }
.mailbox-table .col-email { min-width: 200px; }
.mailbox-table .mb-email { font-weight: 600; word-break: break-all; }
.mailbox-table .mb-domain { font-size: 12px; margin-top: 2px; }
.mailbox-table .col-expire { white-space: nowrap; }
.mailbox-table .col-created { white-space: nowrap; font-size: 13px; color: #64748b; }
.mailbox-table .empty-cell { text-align: center; color: #64748b; padding: 32px; }
.mailbox-table tr.row-expired { background: #fef2f2; }
.mb-actions { display: flex; flex-direction: column; gap: 10px; }
.mb-action-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.mb-action-label { font-size: 12px; font-weight: 600; color: #64748b; min-width: 36px; }
.mb-action-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.mb-action-btns form { margin: 0; }
.mb-expire-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.mb-permanent-form { margin: 0; }
.mb-date-input { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; min-width: 180px; }
.mb-password-input { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; width: 110px; }
.mb-convert-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.mb-check-inline { font-size: 12px; color: #475569; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.mb-action-danger { background: #fff; border-color: #fecaca; justify-content: flex-end; }
.admin-body .container { max-width: 1280px; }
.form-group-check { display: flex; align-items: flex-end; }
.form-group-check label { margin-bottom: 10px; font-weight: normal; }

.site-footer {
    margin-top: 48px;
    padding: 28px 20px 32px;
    text-align: center;
    font-size: 12px;
    color: #9195a3;
    background: #f5f6f7;
    border-top: 1px solid #ebebeb;
}
.site-footer-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    max-width: 1100px;
    margin: 0 auto;
    line-height: 1.9;
    word-break: break-word;
}
.site-footer-link {
    color: #9195a3;
    text-decoration: none;
    transition: color .15s;
}
.site-footer-link:hover { color: #315efb; text-decoration: none; }
.site-footer-meta {
    max-width: 1100px;
    margin: 0 auto;
    line-height: 1.9;
    word-break: break-word;
}
.site-footer-brand,
.site-footer-entities { color: #9195a3; }
.site-footer-sep { margin: 0 6px; color: #c4c7ce; }
.site-footer-beian { color: #9195a3; text-decoration: none; }
.site-footer-beian:hover { color: #315efb; text-decoration: none; }
.site-footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; font-size: 12px; line-height: 1.8; color: #9195a3; }
.site-footer a { color: #9195a3; text-decoration: none; }
.site-footer a:hover { color: #315efb; text-decoration: none; }
.site-footer-preview { border-radius: 8px; border: 1px solid #ebebeb; padding: 16px; background: #f5f6f7; }
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main, body > .container, body > .login-wrap, body > .webmail-main { flex: 1; }
body.webmail-body > .webmail-main { max-width: none; margin: 0; padding: 0; width: 100%; }

.math-captcha { margin: 14px 0 16px; }
.math-captcha-label { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.math-captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.math-captcha-question {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    min-width: 120px;
    letter-spacing: 0.02em;
}
.math-captcha-input {
    width: 100px !important;
    flex: 0 0 auto;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}
.math-captcha-refresh {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    color: #64748b;
    transition: background .15s, border-color .15s;
}
.math-captcha-refresh:hover { background: #f8fafc; border-color: #cbd5e1; }
.math-captcha-status { margin-top: 8px; font-size: 12px; color: #64748b; }
.math-captcha-status.is-error { color: #dc2626; }

.slider-captcha { margin: 14px 0 16px; display: none; }
.slider-captcha-label { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.slider-captcha-track {
    position: relative; height: 42px; background: #e2e8f0; border-radius: 8px;
    overflow: hidden; touch-action: none; user-select: none;
}
.slider-captcha-marker {
    position: absolute; top: 4px; bottom: 4px; width: 3px; margin-left: -1px;
    background: #2563eb; border-radius: 2px; z-index: 2; pointer-events: none;
}
.slider-captcha-fill {
    position: absolute; left: 0; top: 0; bottom: 0; width: 0;
    background: rgba(37, 99, 235, 0.15); pointer-events: none;
}
.slider-captcha-knob {
    position: absolute; left: 0; top: 3px; width: 36px; height: 36px;
    background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: grab; z-index: 3; box-shadow: 0 1px 3px rgba(0,0,0,.12);
    font-size: 14px; color: #64748b;
}
.slider-captcha-knob.is-dragging { cursor: grabbing; border-color: #2563eb; }
.slider-captcha.is-verified .slider-captcha-knob { border-color: #16a34a; color: #16a34a; }
.slider-captcha-status { margin-top: 8px; font-size: 12px; color: #64748b; }
.slider-captcha-status.is-ok { color: #16a34a; }
.slider-captcha-status.is-error { color: #dc2626; }

.legal-agreements { margin: 12px 0 8px; }
.legal-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; color: #475569; cursor: pointer; }
.legal-check input { margin-top: 3px; flex: 0 0 auto; }
.temp-issue-form { width: 100%; max-width: 360px; }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px); z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }
.modal-panel {
    background: #fff; border-radius: 16px; width: 100%; max-width: 640px;
    max-height: 85vh; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 24px 48px rgba(0,0,0,.18);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #f1f5f9; }
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-close { border: none; background: #f1f5f9; width: 32px; height: 32px; border-radius: 8px; font-size: 20px; cursor: pointer; }
.modal-body { padding: 20px 22px 24px; overflow-y: auto; }
.legal-modal-body .legal-content h3 { margin: 16px 0 8px; font-size: 15px; }
.legal-modal-body .legal-content p { font-size: 14px; line-height: 1.7; color: #475569; margin-bottom: 8px; }

.legal-body .legal-page { margin-top: 16px; }
.legal-content h3 { margin: 20px 0 8px; font-size: 16px; color: #1e293b; }
.legal-content p { margin-bottom: 10px; color: #475569; font-size: 14px; line-height: 1.7; }
.legal-updated { color: #94a3b8; font-size: 13px; margin-bottom: 16px; }
.legal-back { margin-top: 20px; }

/* Theme & locale controls */
.ui-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.ui-control-group { position: relative; }
.ui-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.2;
    transition: background .15s, border-color .15s;
}
.ui-control-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.ui-locale-code { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.ui-locale-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 160px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    z-index: 200;
    padding: 6px;
}
.ui-locale-menu.is-open .ui-locale-dropdown { display: block; }
.ui-locale-dropdown a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: #334155;
    font-size: 13px;
    text-decoration: none;
}
.ui-locale-dropdown a:hover { background: #f1f5f9; text-decoration: none; }
.ui-locale-dropdown a.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.login-ui-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.topbar-nav .ui-controls { margin-left: 8px; }
.topbar-nav .ui-control-btn {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: #e2e8f0;
}
.topbar-nav .ui-control-btn:hover { background: rgba(255,255,255,.14); }
.topbar-nav .ui-locale-dropdown { background: #1e293b; border-color: #334155; }
.topbar-nav .ui-locale-dropdown a { color: #e2e8f0; }
.topbar-nav .ui-locale-dropdown a:hover { background: #334155; }
.topbar-nav .ui-locale-dropdown a.active { background: #1e40af; color: #fff; }

/* Night theme — soft blue-gray, easier on the eyes */
[data-theme="dark"] {
    --ui-bg: #2a2d3a;
    --ui-card: #353945;
    --ui-text: #e4e7ed;
    --ui-muted: #a8b0c0;
    --ui-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    color-scheme: dark;
}
[data-theme="dark"] body { background: var(--ui-bg); color: var(--ui-text); }
[data-theme="dark"] a { color: #7eb6ff; }
[data-theme="dark"] .card { border-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .card h2 { color: var(--ui-text); }
[data-theme="dark"] .form-group label { color: #c8ced8; }
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #2a2d3a;
    border-color: #4a5060;
    color: var(--ui-text);
}
[data-theme="dark"] table th { background: #3d4252; color: #c8ced8; }
[data-theme="dark"] table td { border-color: #4a5060; color: #e4e7ed; }
[data-theme="dark"] table tr:hover td { background: #3d4252; }
[data-theme="dark"] .alert-success { background: #2d4a38; color: #b8e6c8; }
[data-theme="dark"] .alert-error { background: #4a3238; color: #f0c0c8; }
[data-theme="dark"] .text-muted { color: #a8b0c0; }
[data-theme="dark"] .ui-control-btn {
    background: #3d4252;
    border-color: #4a5060;
    color: #e4e7ed;
}
[data-theme="dark"] .ui-control-btn:hover { background: #4a5060; }
[data-theme="dark"] .ui-locale-dropdown {
    background: #3d4252;
    border-color: #4a5060;
}
[data-theme="dark"] .ui-locale-dropdown a { color: #e4e7ed; }
[data-theme="dark"] .ui-locale-dropdown a:hover { background: #4a5060; }
[data-theme="dark"] .ui-locale-dropdown a.active { background: #3b5bdb; color: #fff; }
[data-theme="dark"] .login-wrap { background: radial-gradient(ellipse at top, #3d4252 0%, var(--ui-bg) 58%); }
[data-theme="dark"] .login-card h2 { color: var(--ui-text); }
[data-theme="dark"] .login-ui-controls { border-top-color: #4a5060; }
[data-theme="dark"] .modal-panel { background: #353945; }
[data-theme="dark"] .modal-header { border-bottom-color: #4a5060; }
[data-theme="dark"] .modal-header h3 { color: var(--ui-text); }
[data-theme="dark"] .modal-close { background: #4a5060; color: #e4e7ed; }
[data-theme="dark"] .permission-grid label { background: #3d4252; color: #e4e7ed; }
[data-theme="dark"] .math-captcha-question { color: #ffffff; font-weight: 800; }
[data-theme="dark"] .math-captcha-label { color: #d8dee9; }
[data-theme="dark"] .math-captcha-input { background: #3d4252; border-color: #5a6270; color: #ffffff; }
[data-theme="dark"] .math-captcha-refresh { background: #3d4252; border-color: #4a5060; color: #e8edf5; }
[data-theme="dark"] .site-footer-link { color: #8e96a8; }
[data-theme="dark"] .site-footer-link:hover { color: #9ec5ff; }
[data-theme="dark"] .site-footer {
    background: #252830;
    border-top-color: #3d4252;
    color: #8e96a8;
}
[data-theme="dark"] .site-footer-brand,
[data-theme="dark"] .site-footer-entities,
[data-theme="dark"] .site-footer-beian { color: #8e96a8; }
[data-theme="dark"] .site-footer-beian:hover { color: #9ec5ff; }
[data-theme="dark"] .site-footer-sep { color: #4a5060; }
