.admin-body, .login-body { --danger: #bc3e4d; }
[data-theme="dark"] .admin-body, [data-theme="dark"] .login-body { --danger: #ee8b95; }
.admin-main { width: min(1000px, calc(100% - 64px)); margin: 35px auto 0; flex: 1; min-width: 0; outline: none; }
.admin-body .site-footer { width: min(1000px, calc(100% - 64px)); }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; flex-wrap: wrap; }
.page-title { font-size: 28px; font-weight: 550; line-height: 1.6; margin-bottom: 26px; }
.admin-toolbar .page-title { margin: 0; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 5px; background: transparent; font-size: 13px; color: var(--text); white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--soft); color: var(--accent); border-color: var(--quiet); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--bg); filter: brightness(.93); border-color: var(--accent); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.admin-body .page-title { font-size: 22px; font-weight: 500; }
.admin-body .btn { background: var(--bg); border-radius: 3px; color: var(--text); }
.admin-body .btn-primary { border-color: var(--quiet); }
.admin-body .btn:hover { background: var(--soft); border-color: var(--muted); color: var(--text); filter: none; }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.btn-danger { color: var(--danger); }
.danger-button:hover { color: var(--danger); }
.optional { font-size: 11px; color: var(--muted); }
.column-editor { max-width: 660px; margin: 0 auto; }
.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset legend { padding: 0; margin-bottom: 12px; font-size: 12px; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.logout-form { display: inline-flex; margin: 0; }
.logout-button { cursor: pointer; font: inherit; font-size: 12px; }
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; line-height: 1.7; }
.admin-table th { font-size: 11px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 12px 10px; white-space: nowrap; }
.admin-table td { padding: 20px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th:first-child, .admin-table td:first-child { padding-left: 0; }
.admin-table td:first-child { min-width: 185px; max-width: 350px; overflow-wrap: anywhere; }
.admin-table td:nth-child(2), .admin-table td:nth-last-child(2) { white-space: nowrap; }
.row-actions { white-space: nowrap; }
.inline-form { display: inline; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; }
.badge:before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-on { color: #397d60; }
[data-theme="dark"] .badge-on { color: #8abcaa; }
.badge-off { color: var(--muted); }
.tag { color: var(--muted); font-size: 11px; display: inline-block; margin-right: 8px; }
.empty { text-align: center; padding: 70px 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.editor-form { display: grid; gap: 22px; }
.editor-page { --accent: var(--text); --accent-soft: var(--soft); }
.editor-page .editor-form { gap: 20px; }
.editor-page .field input:not([type="checkbox"]):not([type="radio"]), .editor-page .field select, .editor-page .field textarea { border-radius: 3px; padding: 10px 12px; }
.editor-page .field input:focus, .editor-page .field select:focus, .editor-page .field textarea:focus { outline: none; border-color: var(--muted); }
.field { display: grid; gap: 9px; min-width: 0; }
.field > label, .field-label { font-size: 12px; color: var(--text); }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--text); padding: 12px 13px; line-height: 1.5; font: inherit; font-size: 14px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
.field textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-page .field input.title-input { font-size: 18px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 3px; min-width: 0; }
.editor-pane { min-width: 0; }
.editor-pane + .editor-pane { border-left: 1px solid var(--line); }
.editor-toolbar { min-height: 46px; border-bottom: 1px solid var(--line); padding: 5px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); background: var(--bg); font-size: 12px; }
.editor-toolbar label span { color: var(--quiet); margin-left: 5px; font-size: 10px; }
.editor textarea { display: block; border: 0; resize: vertical; width: 100%; height: 460px; min-height: 320px; padding: 20px 18px; background: var(--bg); color: var(--text); font: 13px/1.9 "Cascadia Code", Consolas, monospace; }
.editor textarea:focus { outline: 1px solid var(--accent); outline-offset: -1px; }
#preview { padding: 4px 20px 20px; min-height: 460px; max-height: 720px; overflow: auto; font-size: 14px; }
.editor-page #preview pre { padding-top: 20px; }
.editor-page #preview pre code.hljs { padding: 0; background: transparent; color: var(--text); }
#preview img { max-width: 100%; }
#preview:empty:before { content: '正文预览'; display: block; color: var(--quiet); padding-top: 20px; font-size: 13px; }
.editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.editor-page .editor-actions { justify-content: flex-end; padding: 16px 0; margin: 0; border-top: 1px solid var(--line); }
.color-options, .connection-options { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.color-option { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.color-swatch { display: block; width: 22px; height: 22px; border-radius: 4px; }
.connection-options label { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.connection-options input, .color-option input { accent-color: var(--accent); }
.form-error { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.8; padding: 12px 0; color: var(--danger); border-block: 1px solid var(--line); }
.form-error svg { margin-top: 3px; width: 16px; height: 16px; }
.login-main { width: 100%; flex: 1; padding: 72px 24px; outline: none; }
.login-section { width: min(340px, 100%); margin: 0 auto; }
.login-section h1 { font-size: 22px; line-height: 1.5; font-weight: 550; }
.login-form { display: grid; gap: 20px; margin-top: 28px; }
.login-form .field input { border-radius: 3px; padding-block: 10px; }
.password-field { position: relative; }
.password-field input { padding-right: 50px !important; }
.password-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.login-submit { width: 100%; margin-top: 4px; min-height: 42px; border-radius: 3px; background: var(--text); border-color: var(--text); color: var(--bg); }
.login-submit:hover { background: var(--muted); border-color: var(--muted); color: var(--bg); }
.login-submit:disabled { opacity: .6; cursor: wait; }
.caps-lock { color: var(--muted); font-size: 11px; margin-top: -12px; }
.login-footer { text-align: center; padding: 0 24px 30px; color: var(--quiet); font-size: 11px; }
@media(max-width: 700px) {
 .admin-main, .admin-body .site-footer { width: calc(100% - 40px); }
 .admin-main { margin-top: 28px; }
 .admin-toolbar { gap: 16px; }
 .admin-toolbar > div { flex-wrap: wrap; }
 .page-title { font-size: 24px; }
 .form-grid { grid-template-columns: 1fr; gap: 22px; }
 .editor { grid-template-columns: 1fr; }
 .editor-pane + .editor-pane { border-left: 0; border-top: 1px solid var(--line); }
 .editor textarea { height: 320px; min-height: 320px; }
 #preview { min-height: 220px; max-height: 450px; }
 .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { font-size: 16px; }
 .login-main { padding: 48px 24px; }
 .login-body .header-inner { flex-wrap: nowrap; min-height: 72px; }
 .login-body .navigation { flex-basis: auto; justify-content: flex-end; gap: 18px; }
 .login-body .navigation #theme-toggle { margin-left: 0; }
}
