/* 后台管理 · 与前台门户统一风格 */
.portal-sidebar-label {
    padding: 12px 18px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: #fff;
    border-bottom: 1px solid #e8ecec;
    flex-shrink: 0;
}

html[data-theme="dark"] .admin-topbar {
    background: var(--bg-surface);
    border-color: var(--border);
}

.admin-topbar-left {
    min-width: 0;
}

.admin-page-title {
    font-size: 20px;
    font-weight: 800;
    color: #1a2e2e;
    margin: 6px 0 0;
    letter-spacing: -0.3px;
}

html[data-theme="dark"] .admin-page-title {
    color: var(--text-1);
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.admin-user-chip {
    padding: 8px 16px;
    background: #f5f8f8;
    border: 1px solid #e8ecec;
    border-radius: 999px;
    font-size: 13px;
    color: #1a2e2e;
}

html[data-theme="dark"] .admin-user-chip {
    background: var(--bg-subtle);
    border-color: var(--border);
    color: var(--text-1);
}

.admin-content {
    padding-top: 20px;
    padding-bottom: 24px;
    min-width: 0;
    overflow-x: hidden;
}

.admin-content-form,
.admin-page-form {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

.admin-panel-form {
    max-width: 100%;
}

.admin-form {
    max-width: 640px;
}

.admin-form-wide {
    max-width: none;
    width: 100%;
}
.admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1a3535 0%, #0f2424 100%);
    box-shadow: 0 8px 28px rgba(15, 36, 36, 0.2);
    flex-wrap: wrap;
}

.admin-hero-text h2 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
}

.admin-hero-text p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

.admin-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- 面板 / 表格 ---------- */
.admin-panel {
    background: #fff;
    border: 1px solid #e8ecec;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .admin-panel {
    background: var(--bg-surface);
    border-color: var(--border);
}

.admin-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid #e8ecec;
    flex-wrap: wrap;
}

html[data-theme="dark"] .admin-panel-head {
    border-color: var(--border);
}

.admin-panel-head h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1a2e2e;
    margin: 0;
}

html[data-theme="dark"] .admin-panel-head h2 {
    color: var(--text-1);
}

.admin-panel-head-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-panel-head-split .help-text {
    margin: 0;
    font-size: 12px;
    color: #8a9a9a;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    padding: 14px 24px;
    border-bottom: 1px solid #e8ecec;
    font-size: 14px;
    text-align: left;
    vertical-align: top;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

.info-table th {
    width: 160px;
    color: #8a9a9a;
    font-weight: 600;
    background: #fafbfb;
}

.info-table td {
    color: #1a2e2e;
    word-break: break-all;
}

html[data-theme="dark"] .info-table th,
html[data-theme="dark"] .info-table td {
    border-color: var(--border);
}

html[data-theme="dark"] .info-table th {
    background: var(--bg-subtle);
    color: var(--text-3);
}

html[data-theme="dark"] .info-table td {
    color: var(--text-1);
}

.admin-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.admin-info-grid .admin-panel {
    margin-bottom: 0;
}

.info-table-compact th,
.info-table-compact td {
    padding: 10px 16px;
    font-size: 13px;
}

.info-table-compact th {
    width: 100px;
}

.admin-panel-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #eef2f2;
    background: #fafbfb;
}

html[data-theme="dark"] .admin-panel-foot {
    border-top-color: var(--border);
    background: var(--bg-subtle);
}

.admin-panel-link {
    font-size: 13px;
    color: #34d399 !important;
    text-decoration: none !important;
}

.admin-panel-link:hover {
    text-decoration: underline !important;
}

.admin-panel-foot-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-panel-foot-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.license-verify-bar {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e8ecec;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.license-steps {
    margin: 8px 0 16px;
    padding-left: 22px;
    line-height: 1.8;
    color: #4a5c66;
}

.license-steps code {
    font-size: 12px;
    padding: 1px 6px;
    background: #eef5f3;
    border-radius: 3px;
}

.license-flow a {
    color: #0f766e;
}

html[data-theme="dark"] .license-verify-bar {
    border-color: var(--border);
}

.license-verify-bar .help-text a {
    color: #34d399 !important;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.admin-panel-body {
    padding: 24px;
}

.admin-panel-body.no-padding {
    padding: 0;
}

.admin-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e8ecec;
}

html[data-theme="dark"] .admin-form-actions {
    border-color: var(--border);
}

.data-table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #eef2f2;
}

html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .data-table td {
    border-color: var(--border);
}

.data-table th {
    background: #f5f8f8;
    font-weight: 600;
    color: #8a9a9a;
    font-size: 13px;
}

html[data-theme="dark"] .data-table th {
    background: var(--bg-subtle);
}

.data-table tbody tr:hover {
    background: rgba(52, 211, 153, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    vertical-align: middle;
}

.data-table code {
    font-size: 12px;
    padding: 2px 6px;
    background: #f0f5f5;
    border-radius: 4px;
    color: #1a3535;
}

html[data-theme="dark"] .data-table code {
    background: var(--bg-subtle);
}

/* ---------- 按钮（门户绿色主题） ---------- */
.portal-body .btn-primary {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(52, 211, 153, 0.25);
}

.portal-body .btn-primary:hover {
    opacity: 0.92;
    box-shadow: 0 6px 18px rgba(52, 211, 153, 0.35);
}

.portal-body .btn-success {
    background: linear-gradient(135deg, #34d399, #059669);
    color: #fff;
    border: none;
    border-radius: 10px;
}

.portal-body .btn-success:hover {
    opacity: 0.92;
}

.portal-body .btn-default {
    background: #fff;
    border: 1px solid #e0e8e8;
    color: #1a2e2e;
    border-radius: 10px;
}

html[data-theme="dark"] .portal-body .btn-default {
    background: var(--bg-subtle);
    border-color: var(--border);
    color: var(--text-1);
}

.portal-body .btn-default:hover {
    border-color: #34d399;
    color: #34d399;
}

.portal-body .btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 10px;
}

.portal-body .btn-danger:hover {
    opacity: 0.9;
}

.portal-body .btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.portal-body .form-control {
    border: 1px solid #e0e8e8;
    border-radius: 10px;
    padding: 10px 14px;
    background: #fff;
    color: #1a2e2e;
}

html[data-theme="dark"] .portal-body .form-control {
    background: var(--bg-subtle);
    border-color: var(--border);
    color: var(--text-1);
}

.portal-body .form-control:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
    outline: none;
}

.portal-body .form-group label {
    font-weight: 600;
    color: #1a2e2e;
    margin-bottom: 6px;
    font-size: 14px;
}

html[data-theme="dark"] .portal-body .form-group label {
    color: var(--text-1);
}

.portal-body .badge-success {
    background: rgba(52, 211, 153, 0.12);
    color: #059669;
}

.portal-body .badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.portal-body .badge-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.rewrite-hint {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.18);
    color: #166534;
    font-size: 13px;
    line-height: 1.6;
}

html[data-theme="dark"] .rewrite-hint {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.22);
    color: #6ee7b7;
}

.rewrite-code {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre;
    overflow-x: auto;
}

.rewrite-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.rewrite-sync-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5c6b6b;
    cursor: pointer;
}

.rewrite-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

html[data-theme="dark"] .rewrite-sync-check {
    color: var(--text-2);
}

.rewrite-file-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.rewrite-file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e8ecec;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f9fbfb;
}

html[data-theme="dark"] .rewrite-file-list li {
    background: var(--bg-subtle);
    border-color: var(--border);
}

.rewrite-file-label {
    font-size: 13px;
    color: #1a2e2e;
}

html[data-theme="dark"] .rewrite-file-label {
    color: var(--text-1);
}

.rewrite-apply-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.rewrite-url-examples {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rewrite-url-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.rewrite-url-row code {
    min-width: 180px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f0f4f4;
    color: #0f766e;
}

html[data-theme="dark"] .rewrite-url-row code {
    background: var(--bg-subtle);
    color: #5eead4;
}

/* ---------- 系统设置 TAB ---------- */
.setting-page {
    max-width: 980px;
    margin: 0 auto;
}

.setting-form .admin-panel {
    margin-bottom: 0;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e8ecec;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .admin-tabs {
    background: var(--bg-surface);
    border-color: var(--border);
}

.admin-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #5c6b6b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

a.admin-tab-btn:hover,
a.admin-tab-btn:focus {
    text-decoration: none;
    color: #1a2e2e;
}

.admin-tab-btn:hover {
    background: #f3f7f7;
    color: #1a2e2e;
}

.admin-tab-btn.is-active {
    background: rgba(52, 211, 153, 0.12);
    color: #059669;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.22);
}

html[data-theme="dark"] .admin-tab-btn {
    color: var(--text-2);
}

html[data-theme="dark"] .admin-tab-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-1);
}

html[data-theme="dark"] .admin-tab-btn.is-active {
    background: rgba(52, 211, 153, 0.14);
    color: #34d399;
}

.admin-tab-icon {
    font-size: 15px;
    line-height: 1;
}

.admin-tab-badge {
    margin-left: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.admin-tab-panels {
    min-height: 320px;
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.is-active {
    display: block;
    animation: settingTabIn 0.22s ease;
}

.admin-tab-panel .admin-panel + .admin-panel {
    margin-top: 18px;
}

@keyframes settingTabIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setting-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e8ecec;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    bottom: 16px;
    z-index: 5;
}

html[data-theme="dark"] .setting-form-actions {
    background: var(--bg-surface);
    border-color: var(--border);
}

.setting-form-actions-btns {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.setting-form-actions.is-hidden {
    display: none;
}

.setting-panel-foot-muted {
    justify-content: space-between;
}

.license-verify-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.setting-system-grid {
    margin-bottom: 18px;
}

.setting-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 1200;
    max-width: min(92vw, 420px);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #1a2e2e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    animation: settingToastIn 0.22s ease;
}

.setting-toast.is-success {
    background: #059669;
}

.setting-toast.is-error {
    background: #dc2626;
}

.setting-toast.is-info {
    background: #1a2e2e;
}

html[data-theme="dark"] .setting-toast.is-info {
    background: #243636;
}

@keyframes settingToastIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.setting-logo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.setting-logo-preview {
    width: 72px;
    height: 72px;
    border: 1px solid #e8ecec;
    border-radius: 12px;
    background: #f7fafa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.setting-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.setting-logo-row .form-control {
    max-width: 280px;
}

.setting-copy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.setting-copy-row .form-control {
    flex: 1 1 240px;
    min-width: 0;
}

html[data-theme="dark"] .setting-logo-preview {
    border-color: var(--border);
    background: var(--bg-subtle);
}

.setting-save-tip {
    margin: 0;
    font-size: 13px;
    color: #8a9a9a;
}

html[data-theme="dark"] .setting-save-tip {
    color: var(--text-3);
}

@media (max-width: 768px) {
    .admin-tabs {
        gap: 6px;
        padding: 4px;
    }

    .admin-tab-btn {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
        padding: 10px 12px;
    }

    .admin-tab-label {
        font-size: 13px;
    }

    .setting-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .setting-save-tip {
        text-align: center;
    }
}

/* ---------- 分页 ---------- */
.pagination {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid #eef2f2;
    background: #f9fbfb;
}

html[data-theme="dark"] .pagination {
    background: var(--bg-subtle);
    border-color: var(--border);
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border-radius: 8px;
    font-size: 13px;
    color: #8a9a9a;
    border: 1px solid #e0e8e8;
    background: #fff;
}

.pagination a:hover {
    border-color: #34d399;
    color: #34d399;
}

.pagination .current {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    border-color: transparent;
}

/* ---------- 登录页 ---------- */
.admin-login-body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(135deg, #0f2222 0%, #0a1818 100%);
    position: relative;
}

.admin-login-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 20% 30%, rgba(52, 211, 153, 0.12), transparent),
        radial-gradient(ellipse 50% 40% at 80% 70%, rgba(16, 185, 129, 0.08), transparent);
}

.admin-login-shell {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .admin-login-shell {
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.admin-login-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 40px 36px;
    color: #e7f7f2;
    background:
        linear-gradient(160deg, rgba(16, 185, 129, 0.28), rgba(10, 24, 24, 0.2)),
        #0f2424;
}

.admin-login-aside h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
}

.admin-login-aside p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
}

.admin-login-points {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.admin-login-points li {
    position: relative;
    padding: 6px 0 6px 16px;
}

.admin-login-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 13px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
}

.admin-login-card {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: none;
    padding: 36px 32px;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

html[data-theme="dark"] .admin-login-card {
    background: transparent;
    border: none;
}

.admin-login-brand-icon {
    display: none;
}

.admin-login-brand .admin-login-brand-icon {
    display: none;
}

.admin-login-form .form-control {
    height: 44px;
}

.admin-login-password {
    position: relative;
}

.admin-login-password .form-control {
    padding-right: 64px;
}

.admin-login-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #6b7c7c;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 8px;
}

.admin-login-captcha {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.admin-login-captcha .form-control {
    flex: 1;
    min-width: 0;
    letter-spacing: 2px;
}

.admin-login-captcha-img {
    flex-shrink: 0;
    width: 120px;
    height: 42px;
    border: 1px solid rgba(15, 40, 48, 0.12);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    background: #f5f8f7;
    transition: border-color 0.2s, opacity 0.2s;
}

.admin-login-captcha-img:hover {
    border-color: #1a9b8a;
    opacity: 0.9;
}

.admin-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 16px;
}

.admin-login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
    font-size: 13px;
    color: #5b6d6d;
}

.admin-login-home {
    font-size: 13px;
    color: #10b981 !important;
}

.admin-login-submit {
    width: 100%;
    padding: 12px;
}

.admin-login-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.admin-login-caps {
    color: #d97706;
}

@media (max-width: 800px) {
    .admin-login-shell {
        grid-template-columns: 1fr;
    }

    .admin-login-aside {
        display: none;
    }

    .admin-login-brand-icon,
    .admin-login-brand .admin-login-brand-icon {
        display: inline-flex;
    }

    .admin-login-card {
        padding: 32px 22px;
    }
}

.admin-login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.admin-login-brand .portal-brand-icon {
    display: inline-flex;
    margin-bottom: 14px;
}

.admin-login-brand h2 {
    font-size: 20px;
    font-weight: 800;
    color: #1a2e2e;
    margin: 0 0 6px;
}

html[data-theme="dark"] .admin-login-brand h2 {
    color: var(--text-1);
}

.admin-login-brand p {
    font-size: 13px;
    color: #8a9a9a;
    margin: 0;
}

.admin-login-theme {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 16px;
}

.admin-login-foot {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}

.admin-login-foot a {
    color: #34d399 !important;
}

.theme-toggle:hover {
    border-color: #34d399 !important;
    color: #34d399 !important;
}

.portal-body .help-text {
    font-size: 12px;
    color: #8a9a9a;
    margin-top: 4px;
}

.portal-body textarea.form-control {
    min-height: auto;
    resize: vertical;
    font-family: inherit;
}

.admin-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-form-actions-bar {
    margin-top: 0;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: #fff;
    border: 1px solid #e8ecec;
    border-radius: 14px;
}

html[data-theme="dark"] .admin-form-actions-bar {
    background: var(--bg-surface);
    border-color: var(--border);
}

@media (max-width: 1200px) {
    .admin-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-info-grid .admin-panel:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .admin-topbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .admin-content {
        padding: 16px !important;
    }

    .admin-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-stats-row {
        width: 100%;
    }

    .portal-shell {
        flex-direction: column;
    }

    .portal-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .portal-nav {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
    }

    .portal-nav-item {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
    }

    .admin-form .form-row {
        grid-template-columns: 1fr;
    }

    .admin-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- 赞助管理 ---------- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.admin-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.admin-stat-label {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 8px;
}

.admin-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-1);
}

.admin-panel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.admin-filter-bar .btn.active {
    background: var(--brand-1);
    color: #fff;
    border-color: var(--brand-1);
}

.cell-ellipsis {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.upload-qr-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-qr-preview {
    width: 180px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.upload-qr-preview img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.upload-qr-field .help-text {
    margin: 0;
    font-size: 12px;
    color: var(--text-3);
}

@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}

.sponsor-rows-table th,
.sponsor-rows-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.sponsor-rows-table .form-control {
    width: 100%;
    min-width: 0;
    padding: 7px 10px;
}

.sponsor-rows-table .sponsor-row-index {
    color: #8a9a9a;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.sponsor-rows-table .text-center {
    text-align: center;
}

.admin-panel-body.no-padding .admin-form-actions {
    margin-top: 0;
    padding: 16px 20px 20px;
}

.admin-page-form {
    max-width: 1180px;
}

.news-form-page .admin-panel-head .help-text {
    margin: 6px 0 0;
}

.news-compose-page {
    max-width: 1240px;
}

.news-compose-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.news-compose-head-actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.news-compose-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-3, #7a8d8d);
}

.news-compose-crumb a {
    color: var(--text-2, #4a5c5c);
    text-decoration: none;
}

.news-compose-crumb a:hover {
    color: #0f766e;
}

.news-compose-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.news-compose-head p {
    margin: 0;
    color: var(--text-2, #5b6d6d);
    font-size: 13px;
    line-height: 1.6;
}

.news-compose-form {
    padding: 22px 22px 8px;
    border: 1px solid var(--border, #e2e8e8);
    border-radius: 16px;
    background: var(--bg-surface, #fff);
    box-shadow: 0 8px 28px rgba(15, 36, 36, 0.05);
}

html[data-theme="dark"] .news-compose-form {
    box-shadow: none;
}

.news-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.news-form-alert {
    margin-bottom: 16px;
}

.news-title-input {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    padding: 12px 14px;
}

.news-form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.news-form-label-row label {
    margin-bottom: 0;
}

.news-form-count {
    text-align: right;
}

.news-form-page .required,
.news-form-page .text-danger {
    color: #e11d48;
}

.news-form-count.is-over,
.news-form-count.is-over span {
    color: #e11d48;
}

.tool-tdk-card {
    margin-top: 4px;
}

.news-form-side {
    position: sticky;
    top: 16px;
}

.news-side-card {
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid #e8ecec;
    border-radius: 12px;
    background: #f7fafa;
}

html[data-theme="dark"] .news-side-card {
    border-color: var(--border);
    background: var(--bg-subtle);
}

.news-side-card h3,
.news-side-more summary {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
}

.news-side-card .form-group:last-child {
    margin-bottom: 0;
}

.news-status-picks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.news-status-pick {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e0e8e8;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
}

.news-status-pick input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.news-status-pick span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.news-status-pick strong {
    font-size: 13px;
    font-weight: 700;
}

.news-status-pick em {
    font-style: normal;
    font-size: 11px;
    color: var(--text-3, #8a9a9a);
    font-weight: 400;
}

html[data-theme="dark"] .news-status-pick {
    background: var(--bg-surface);
    border-color: var(--border);
}

.news-status-pick:has(input:checked),
.news-status-pick:focus-within {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.news-side-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.news-form-actions {
    display: flex;
    gap: 8px;
}

.news-form-actions .btn {
    flex: 1;
}

.news-cover-drop {
    position: relative;
    min-height: 168px;
    border: 1px dashed #c5d4d4;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
}

html[data-theme="dark"] .news-cover-drop {
    background: var(--bg-surface);
    border-color: var(--border);
}

.news-cover-drop.is-drop,
.news-cover-drop:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
    outline: none;
}

.news-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 168px;
    padding: 16px;
    text-align: center;
    color: var(--text-3, #8a9a9a);
}

.news-cover-placeholder strong {
    color: var(--text-1, #1a2e2e);
    font-size: 13px;
}

.news-cover-placeholder span:last-child {
    font-size: 12px;
    line-height: 1.5;
}

.news-cover-icon {
    font-size: 28px;
    line-height: 1;
}

.news-cover-preview {
    position: relative;
    margin: 0;
}

.news-cover-preview img {
    display: block;
    width: 100%;
    height: 168px;
    object-fit: cover;
}

.news-cover-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    border: 0;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(15, 36, 36, 0.78);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.news-cover-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.news-cover-preview[hidden],
.news-cover-placeholder[hidden] {
    display: none !important;
}

.news-side-more {
    cursor: pointer;
}

.news-side-more summary {
    list-style: none;
    cursor: pointer;
    margin-bottom: 0;
}

.news-side-more summary::-webkit-details-marker {
    display: none;
}

.news-side-more[open] summary {
    margin-bottom: 12px;
}

.news-side-more summary:after {
    content: "▾";
    float: right;
    color: var(--text-3, #8a9a9a);
    font-weight: 400;
}

.news-side-more[open] summary:after {
    content: "▴";
}

@media (max-width: 960px) {
    .news-form-layout {
        grid-template-columns: 1fr;
    }

    .news-form-side {
        position: static;
    }

    .news-compose-head {
        flex-direction: column;
    }

    .news-compose-head-actions {
        width: 100%;
    }

    .news-title-input {
        font-size: 18px;
    }
}
