@charset "UTF-8";

/*
 * LiteNote Admin Styles
 *
 * Structure:
 * 1. Design tokens and global base
 * 2. Admin shell: sidebar, header, content frame
 * 3. Shared controls: buttons, forms, tables, dialogs, pagination
 * 4. Page modules: dashboard, posts, comments, talk, music, attachments, settings
 * 5. Responsive overrides
 *
 * Keep broad primitives before page modules. Keep narrow page fixes near their
 * module unless the rule is a deliberate responsive override.
 */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-muted: #f9fafb;
    --surface-raised: #ffffff;
    --text: #111827;
    --text-soft: #4b5563;
    --text-muted: #8a93a3;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --primary: #0052d9;
    --primary-hover: #003cab;
    --primary-soft: #e8f1ff;
    --primary-border: #97bfff;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --info: #0052d9;
    --info-soft: #e8f1ff;
    --sidebar: #ffffff;
    --sidebar-soft: #f4f5f7;
    --sidebar-muted: #7b8494;
    --radius-sm: 4px;
    --radius: 4px;
    --shadow-sm: none;
    --shadow-md: 0 8px 18px rgba(17, 24, 39, 0.06);
    --ring: 0 0 0 2px rgba(0, 82, 217, 0.18);
    --control-height: 38px;
    --admin-header-height: 51px;
    --admin-sidebar-width: 210px;
    --admin-content-width: min(1280px, calc(100vw - var(--admin-sidebar-width) - 56px));
    --admin-action-column-width: 110px;
    --admin-action-buttons-width: 74px;
    --font:
        -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --loader-blue: #0052d9;
}

/* --------------------------------------------------------------------------
   4. Page Modules: Activity Integrations
   -------------------------------------------------------------------------- */

.activity-integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 14px;
    align-items: start;
    margin-bottom: 18px;
}

.activity-integration-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.activity-integration-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.activity-integration-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    font-size: 18px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: var(--radius);
}

.activity-integration-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 760;
}

.activity-integration-head p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.activity-integration-form {
    padding: 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.activity-integration-form .form-group {
    min-width: 100%;
    margin-bottom: 12px;
}

.activity-integration-form textarea {
    height: auto;
}

.activity-integration-actions,
.activity-sync-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.activity-sync-form {
    padding: 0 16px 16px;
}

.activity-sync-log {
    margin-top: 18px;
}

.activity-integration-table td {
    vertical-align: middle;
}

.activity-provider-cell {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 190px;
}

.activity-provider-cell strong,
.activity-provider-cell small {
    display: block;
}

.activity-integration-form-head {
    margin: -22px -22px 18px;
}

/* --------------------------------------------------------------------------
   1. Global Base
   -------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body.admin-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body.admin-body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    scrollbar-width: none;
    background: var(--bg);
    -ms-overflow-style: none;
    -webkit-font-smoothing: antialiased;
}

body.admin-body::before {
    content: none;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
}

.site-loading-spinner,
.admin-loading-spinner {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
    color: var(--loader-blue);
}
.site-loading-spinner svg,
.admin-loading-spinner svg {
    display: block;
    width: 100%;
    height: 100%;
}

code {
    padding: 2px 6px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-soft);
    background: var(--surface-muted);
    border-radius: 0;
}

[hidden],
.hidden {
    display: none !important;
}

.muted {
    color: var(--text-muted);
}

.small,
small {
    font-size: 12px;
}

.admin-check-icon {
    display: inline-flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 12px;
    line-height: 1;
    vertical-align: middle;
    color: #fff;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.22);
}

.admin-check-icon i {
    font-size: inherit;
    line-height: 1;
    color: inherit;
}

.admin-check-icon-sm {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.admin-check-icon-xs,
.status .admin-check-icon {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
    font-size: 8px;
}

.btn .admin-check-icon,
button .admin-check-icon {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
    font-size: 9px;
}

.admin-action-btn .admin-check-icon {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
    font-size: 11px;
}

.admin-action-approve:hover .admin-check-icon,
.btn:hover .admin-check-icon,
button:hover .admin-check-icon {
    color: var(--success);
    background: #fff;
}

.empty {
    padding: 26px;
    margin: 0;
    color: var(--text-muted);
    text-align: center;
}

/* --------------------------------------------------------------------------
   2. Admin Shell
   -------------------------------------------------------------------------- */

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: var(--admin-sidebar-width);
    padding: 0 10px 12px;
    overflow: hidden;
    color: var(--text);
    background: var(--sidebar);
    border-right: 0;
    box-shadow: none;
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(17, 24, 39, 0.14);
    border-radius: 0;
}

.admin-brand {
    display: flex;
    align-items: center;
    height: var(--admin-header-height);
    padding: 0 8px;
    border-bottom: 0;
}

.admin-brand-link {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0;
    color: var(--text);
    border-radius: var(--radius);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.admin-brand-link:hover {
    color: var(--text);
    background: transparent;
}

.admin-brand-link:focus,
.admin-brand-link:focus-visible {
    outline: none;
}

.admin-brand-link:focus-visible .admin-brand-logo {
    box-shadow: var(--ring);
}

.admin-brand-avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    object-fit: cover;
    background: var(--sidebar-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.litenote-logo-svg {
    display: block;
    width: 1em;
    height: 1em;
}

.admin-brand-logo {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 32px;
    height: 32px;
    font-size: 28px;
    color: var(--primary);
    background: transparent;
    border: 0;
    border-radius: 0;
}

.admin-brand-logo .litenote-logo-svg {
    width: 30px;
    height: 30px;
}

.admin-brand-text {
    min-width: 0;
}

.admin-brand h1 {
    display: flex;
    gap: 7px;
    align-items: center;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.admin-brand p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--sidebar-muted);
}

.admin-mobile-menu-toggle {
    display: none;
}

.admin-menu {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow-y: auto;
}

.admin-menu::-webkit-scrollbar {
    width: 6px;
}

.admin-menu::-webkit-scrollbar-thumb {
    background: rgba(17, 24, 39, 0.14);
    border-radius: 0;
}

.admin-version-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
}

.menu-group {
    padding: 18px 7px 6px;
    font-size: 12px;
    font-weight: 650;
    color: #374151;
}

.admin-menu a {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 34px;
    padding: 7px 8px;
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.admin-menu a i {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 12px;
    color: var(--sidebar-muted);
    border-radius: var(--radius-sm);
}

.admin-menu a:hover {
    color: var(--text);
    background: #f3f4f6;
}

.admin-menu a:hover i {
    color: var(--text);
    background: transparent;
}

.admin-menu a.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 0;
    box-shadow: none;
}

.admin-menu a.active i {
    color: #fff;
    background: transparent;
}

.admin-menu-branch {
    margin: 0;
}

.admin-menu-branch-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
}

.admin-menu-branch-head a {
    min-width: 0;
    padding-right: 8px;
}

.admin-menu-branch-toggle {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin: 0 0 2px;
    color: var(--sidebar-muted);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    transition:
        color 0.16s ease,
        background 0.16s ease;
}

.admin-menu-branch-toggle:hover {
    color: var(--text);
    background: #f3f4f6;
}

.admin-menu-branch-toggle i {
    transition: transform 0.18s ease;
}

.admin-menu-branch.is-open .admin-menu-branch-toggle i {
    transform: rotate(180deg);
}

.admin-menu-children {
    display: none;
    padding: 3px 0 5px 13px;
}

.admin-menu-branch.is-open .admin-menu-children {
    display: block;
}

.admin-menu-children a {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 12px;
    color: var(--text-soft);
}

.admin-menu-children a i {
    width: 20px;
    height: 20px;
    font-size: 12px;
}

.admin-sidebar-footer {
    flex: 0 0 auto;
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
}

.admin-sidebar-logout {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 34px;
    padding: 7px 8px;
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
    border: 1px solid transparent;
}

.admin-sidebar-logout i {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 13px;
    color: var(--sidebar-muted);
}

.admin-sidebar-logout:hover {
    color: var(--text);
    background: #f3f4f6;
}

.admin-sidebar-logout:hover i {
    color: var(--text);
}

.admin-wrapper {
    position: relative;
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--admin-sidebar-width);
}

.admin-wrapper::before {
    position: fixed;
    top: var(--admin-header-height);
    bottom: 0;
    left: var(--admin-sidebar-width);
    z-index: 1;
    width: 1px;
    content: "";
    background: var(--border-strong);
}

.admin-wrapper::after {
    position: fixed;
    top: var(--admin-header-height);
    right: 0;
    left: var(--admin-sidebar-width);
    z-index: 1;
    height: 1px;
    content: "";
    background: var(--border-strong);
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: flex-start;
    min-height: var(--admin-header-height);
    padding: 0 16px;
    margin: 0;
    background: #fff;
    border: 0;
    border-bottom: 0;
    border-radius: var(--radius);
    box-shadow: none;
}

.admin-page-title {
    display: flex;
    gap: 4px;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    padding-right: 84px;
    padding-left: 0;
    text-align: left;
}

.admin-page-title h2,
.admin-header h2 {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    color: var(--text);
    letter-spacing: 0;
}

.admin-page-title h2 i {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 13px;
    color: var(--primary);
}

.admin-page-title p {
    margin: 0 0 0 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.admin-user {
    position: absolute;
    right: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-preview-link {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    color: var(--text-soft);
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-radius: var(--radius);
    box-shadow: none;
}

.admin-user i {
    color: var(--primary);
}

.admin-preview-link:hover {
    color: var(--primary);
    background: #f3f4f6;
}

.admin-account-chip {
    display: inline-flex;
    gap: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    font-size: 12px;
    font-weight: 650;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
}

.admin-account-chip:hover {
    color: var(--text);
    background: #f3f4f6;
    border-color: var(--border);
}

.admin-account-chip img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 0;
}

.admin-content {
    width: var(--admin-content-width);
    padding: 24px 24px 42px;
    margin: 0 auto;
    background: transparent;
    border-top: 0;
    border-right: 0;
    border-left: 0;
    box-shadow: none;
}

.admin-content:has(.post-editor-form) {
    width: calc(100vw - var(--admin-sidebar-width));
    max-width: none;
    padding: 24px;
    margin: 0;
}

.btn,
.link-btn,
.btn-icon {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 7px;
    align-items: center;
    justify-content: center;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    color: #374151;
    white-space: nowrap;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    writing-mode: horizontal-tb;
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s,
        box-shadow 0.15s;
}

.btn:hover,
.link-btn:hover,
.btn-icon:hover {
    color: var(--text);
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: none;
}

.btn-primary:hover {
    color: #fff;
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-dark {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.btn-dark:hover {
    color: #fff;
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-danger,
.link-danger {
    color: var(--danger);
}

.btn-danger:hover,
.link-danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #fecaca;
}

.btn-sm {
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn[disabled],
.btn:disabled,
.link-btn[disabled],
.link-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.link-btn {
    height: var(--control-height);
    min-height: var(--control-height);
    color: #374151;
    background: #fff;
    border-color: var(--border-strong);
    box-shadow: none;
}

.link-btn:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.btn-icon {
    width: var(--control-height);
    height: var(--control-height);
    padding: 0;
}

body.admin-body.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: #f3f0ea;
}

.auth-container {
    width: min(100%, 440px);
}

.login-card {
    position: relative;
    padding: 28px;
    overflow: hidden;
    text-align: left;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(26, 26, 26, 0.08);
    border-radius: 18px;
    box-shadow:
        0 24px 70px rgba(26, 26, 26, 0.14),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
    backdrop-filter: blur(18px);
}

.login-hero {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
}

.login-card h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    color: #1f2937;
}

.login-card h1 i {
    color: #1f2937;
}

.login-logo {
    display: inline-grid;
    flex: 0 0 54px;
    place-items: center;
    width: 54px;
    height: 54px;
    font-size: 30px;
    color: #e65a4c;
    background: rgba(230, 90, 76, 0.1);
    border: 1px solid rgba(230, 90, 76, 0.18);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(230, 90, 76, 0.12);
}

.login-logo .litenote-logo-svg {
    width: 30px;
    height: 30px;
}

.login-title-block {
    min-width: 0;
}

.login-card .subtitle {
    margin: 5px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
}

.login-card .form-group {
    margin-bottom: 14px;
    text-align: left;
}

.login-form {
    margin: 0;
}

.login-card .passkey-btn {
    margin-top: 12px;
}

.login-foot {
    margin: 16px 0 0;
    font-size: 13px;
    text-align: center;
}

.login-foot a {
    color: #6b7280;
    border-bottom: 0;
}

.login-foot a:hover {
    color: #e65a4c;
}

.login-card .btn {
    width: 100%;
    height: 44px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 750;
    border-radius: 10px;
    box-shadow: none;
}

.login-card .btn-primary {
    color: #fff;
    background: #e65a4c;
    border-color: #e65a4c;
    box-shadow: 0 12px 28px rgba(230, 90, 76, 0.18);
}

.login-card .btn-primary:hover {
    color: #fff;
    background: #d84d40;
    border-color: #d84d40;
    transform: translateY(-1px);
}

.login-card .btn-dark {
    color: #374151;
    background: #fff;
    border-color: #e5e7eb;
    box-shadow: none;
}

.login-card .btn-dark:hover {
    color: #111827;
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   3. Shared Forms and Controls
   -------------------------------------------------------------------------- */

.admin-form,
.settings-section,
.admin-col,
.stat-card,
.upload-area,
.attachment-card,
.social-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.admin-form {
    padding: 22px;
}

.admin-form-title {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
}

.admin-form-title i {
    color: var(--primary);
}

.admin-form-section h3 {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 750;
    color: var(--text);
}

.admin-form-section h3 i,
.admin-modal-head h3 i {
    color: var(--primary);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.form-group {
    flex: 1 1 0;
    min-width: 220px;
    margin-bottom: 16px;
}

.form-group.flex-2 {
    flex: 2 1 420px;
}

.admin-form label,
.login-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 650;
    color: #374151;
}

.login-card label {
    font-weight: 700;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    width: 18px;
    color: #9ca3af;
    text-align: center;
    pointer-events: none;
    transform: translateY(-50%);
    transition: color 0.15s ease;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="url"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="datetime-local"],
.admin-form input[type="file"],
.admin-form select,
.admin-form textarea,
.login-card input,
.admin-search input,
.admin-search select,
.bulk-bar select,
.social-row-grid input {
    width: 100%;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 8px 11px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: var(--radius);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}

.admin-form textarea {
    line-height: 1.65;
    resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.login-card input:focus,
.admin-search input:focus,
.admin-search select:focus,
.social-row-grid input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: var(--ring);
}

.admin-form input:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    background: var(--surface-muted);
}

.login-card input {
    height: 44px;
    min-height: 44px;
    padding: 10px 13px 10px 42px;
    color: #111827;
    background: #fff;
    border-color: #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.login-card input::placeholder {
    color: #9ca3af;
}

.login-card input:focus {
    background: #fff;
    border-color: #f18a7e;
    box-shadow: 0 0 0 4px rgba(230, 90, 76, 0.12);
}

.login-input-wrap:focus-within i {
    color: #e65a4c;
}

@media (max-width: 520px) {
    body.admin-body.auth-body {
        padding: 16px;
    }

    .login-card {
        padding: 22px;
        border-radius: 16px;
    }

    .login-hero {
        gap: 12px;
        margin-bottom: 20px;
    }

    .login-logo {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .login-card h1 {
        font-size: 21px;
    }
}

.field-hint,
.hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 22px;
    margin: 18px -22px -22px;
    background: #fff;
    border-top: 1px solid var(--border);
}

.post-editor-form {
    padding: 0;
    overflow: visible;
}

.post-editor-title-row {
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.post-editor-title-row input[type="text"] {
    height: 52px;
    min-height: 52px;
    padding: 0 18px;
    font-size: 20px;
    font-weight: 750;
    color: var(--text);
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.post-editor-title-row input[type="text"]:focus {
    box-shadow: inset 0 -2px 0 var(--primary-border);
}

.post-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    min-height: calc(100vh - 124px);
}

.post-editor-main {
    min-width: 0;
    padding: 0;
}

.post-editor-main .markdown-editor {
    margin: 0;
}

.post-editor-main .editor-head {
    display: none;
}

.post-editor-main .editor-toolbar {
    border-top: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: 0;
    border-radius: 0;
}

.post-editor-main .editor-pane {
    min-height: max(600px, calc(100vh - 232px));
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

.post-editor-main .editor-pane textarea,
.post-editor-main .editor-preview {
    min-height: max(600px, calc(100vh - 232px));
}

.post-editor-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border-left: 0;
}

.post-editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    align-items: center;
    min-height: 53px;
    padding: 7px 10px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.post-editor-actions .btn {
    min-width: 0;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 8px;
    font-size: 13px;
}

.post-editor-panel {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
}

.post-editor-panel h3 {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.post-editor-panel .form-group {
    min-width: 0;
    margin-bottom: 14px;
}

.post-editor-panel textarea {
    height: auto;
    min-height: 82px;
}

.post-editor-panel .cover-preview {
    margin-top: 8px;
}

.post-option-check {
    width: 100%;
    margin: 0 0 10px;
}

.page-system-empty {
    display: grid;
    place-items: center;
    min-height: max(600px, calc(100vh - 232px));
    margin: 0;
    background: #fff;
    border-right: 1px solid var(--border);
    border-radius: 0;
}

.compact-flags {
    gap: 18px;
    align-items: center;
}

.compact-flags label,
.admin-form label:has(input[type="checkbox"]) {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    margin-right: 14px;
    color: var(--text-soft);
}

.admin-form input[type="checkbox"],
.admin-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.resource-page-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.resource-page-head > div {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    font-size: 13px;
    color: var(--text-soft);
}

.resource-page-head strong {
    font-size: 15px;
    font-weight: 750;
    color: var(--text);
}

.x-tweet-capture-form {
    padding: 0;
    margin: 0 0 14px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.x-tweet-capture-row {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.x-tweet-url-field {
    display: flex;
    flex: 1 1 520px;
    gap: 9px;
    align-items: center;
    min-width: 240px;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 12px;
    margin: 0;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}

.x-tweet-url-field:focus-within {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.x-tweet-url-field i {
    flex: 0 0 auto;
    font-size: 14px;
    color: var(--text-soft);
}

.x-tweet-url-field input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    outline: 0;
    background: transparent;
    border: 0;
}

.x-tweet-url-field input::placeholder {
    color: var(--text-soft);
}

.x-tweet-capture-submit {
    min-width: 126px;
}

.x-admin-tweet-content {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 68px;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.x-admin-tweets-table th,
.x-admin-tweets-table td {
    vertical-align: middle;
    text-align: center;
}

.x-admin-tweets-table .admin-inline-stat,
.x-admin-tweets-table .admin-action-bar {
    justify-content: center;
    white-space: nowrap;
}

.x-admin-tweets-table th:nth-child(3),
.x-admin-tweets-table td:nth-child(3) {
    white-space: nowrap;
}

.x-admin-tweet-content > span {
    grid-column: 2;
    min-width: 0;
    text-align: center;
}

.x-admin-tweet-thumbs {
    display: inline-flex;
    flex-wrap: wrap;
    grid-column: 3;
    gap: 5px;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.x-admin-tweet-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    overflow: hidden;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.x-admin-tweet-thumb:hover {
    border-color: var(--primary);
}

.x-admin-tweet-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.resource-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.theme-card.is-active {
    border-color: var(--primary-border);
    box-shadow: inset 0 0 0 1px var(--primary-border);
}

.resource-shot {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

.resource-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-shot-empty {
    display: flex;
    flex-direction: column;
    gap: 9px;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-muted);
    background:
        linear-gradient(135deg, rgba(0, 82, 217, 0.08), transparent 42%),
        var(--surface-muted);
}

.resource-shot-empty i {
    font-size: 28px;
    color: var(--primary);
}

.resource-shot-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    color: #fff;
    background: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: var(--radius);
}

.resource-card-body {
    flex: 1 1 auto;
    padding: 14px;
}

.resource-card-title {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
}

.resource-card-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 760;
    line-height: 1.35;
    color: var(--text);
}

.resource-card-title p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-soft);
}

.resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.resource-meta span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.plugin-card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.plugin-card {
    display: block;
    position: relative;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    cursor: pointer;
}

.plugin-card.is-enabled {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.plugin-card.is-enabled .plugin-name {
    color: #14532d;
}

.plugin-card .resource-card-body {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 220px) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
}

.plugin-main,
.plugin-meta,
.plugin-state {
    min-width: 0;
}

.plugin-main {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.plugin-name {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 760;
    color: var(--text);
    white-space: nowrap;
}

.plugin-desc,
.plugin-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
    white-space: nowrap;
}

.plugin-desc {
    min-width: 0;
    color: var(--text-soft);
}

.plugin-state {
    display: flex;
    justify-content: flex-start;
}

.plugin-card .plugin-toggle-form {
    justify-self: end;
    margin: 0;
}

.plugin-meta-row {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.plugin-state-toggle {
    font: inherit;
    cursor: pointer;
}

.plugin-state-text {
    display: none;
}

.plugin-card-submit {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    background: transparent;
    border: 0;
    opacity: 0;
}

.plugin-card .resource-card-body {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.resource-meta i {
    color: var(--primary);
}

.resource-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 14px;
    background: var(--surface-muted);
    border-top: 1px solid var(--border);
}

.resource-actions form {
    display: inline-flex;
    margin: 0;
}

.settings-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 6px;
    margin: 0 auto 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.settings-subtabs a {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 14px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    color: var(--text-soft);
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.settings-subtabs a:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.settings-subtabs a.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.settings-subtabs a.active i {
    color: inherit;
}

.settings-page-shell {
    width: 100%;
    max-width: 1180px;
    margin-right: auto;
    margin-left: auto;
}

.settings-page-shell > .admin-form,
.settings-page-shell > .settings-section,
.settings-page-shell > .settings-group-title,
.settings-page-shell > .mail-status-grid,
.settings-page-shell > .mail-log-panel,
.settings-page-shell > .admin-toolbar,
.settings-page-shell > .alert,
.settings-page-shell > .stat-grid,
.settings-page-shell > .admin-row,
.settings-page-shell > .admin-col,
.settings-page-shell > .resource-page-head,
.settings-page-shell > .resource-card-grid,
.settings-page-shell > .admin-empty-state {
    width: 100%;
}

.setting-upload-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.setting-upload-field .btn {
    height: var(--control-height);
    white-space: nowrap;
}

.favicon-settings-panel {
    margin-bottom: 18px;
}

.settings-page-shell .admin-form > .settings-group-title:first-of-type,
.settings-page-shell .mail-log-panel > .settings-group-title:first-of-type {
    margin-top: 0;
}

.favicon-settings-body {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.favicon-preview-box {
    position: relative;
    display: inline-grid;
    flex: 0 0 108px;
    place-items: center;
    width: 108px;
    height: 108px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.favicon-preview-box img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.favicon-preview-upload {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(209, 213, 219, 0.92);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(8px);
}

.favicon-preview-upload i {
    display: inline-grid;
    place-items: center;
    width: 15px;
    height: 15px;
    margin: 0;
    font-size: 14px;
    line-height: 15px;
}

.favicon-settings-main {
    flex: 1 1 auto;
    min-width: 0;
}

.favicon-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.favicon-alert {
    margin: 12px 0 0;
}

.favicon-asset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.favicon-asset {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.favicon-asset.is-ready {
    color: var(--success);
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.admin-search {
    display: flex;
    flex: 1 1 420px;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    margin-left: auto;
}

.admin-search input {
    flex: 1 1 220px;
    width: auto;
    min-width: 180px;
}

.admin-search select {
    flex: 0 1 190px;
    width: auto;
    min-width: 150px;
}

.admin-search button,
.bulk-bar button {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 7px;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
    cursor: pointer;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    writing-mode: horizontal-tb;
}

.admin-search button:hover,
.bulk-bar button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.bulk-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 10px 12px;
    margin-top: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.bulk-bar select {
    flex: 0 1 220px;
    width: auto;
    min-width: 180px;
}

/* --------------------------------------------------------------------------
   3. Shared Tables
   -------------------------------------------------------------------------- */

.admin-table {
    width: 100%;
    overflow: hidden;
    border-spacing: 0;
    border-collapse: separate;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.admin-table th,
.admin-table td {
    padding: 13px 15px;
    font-size: 13px;
    vertical-align: middle;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-size: 12px;
    font-weight: 700;
    color: #4b5563;
    text-align: center;
    background: #f4f6f9;
}

.admin-table thead th {
    text-align: center !important;
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover {
    background: #f8fbff;
}

.post-admin-table {
    --post-col-check: 4%;
    --post-col-id: 4%;
    --post-col-category: 10%;
    --post-col-views: 5%;
    --post-col-comments: 5%;
    --post-col-status: 10%;
    --post-col-date: 15%;
    --post-col-actions: 15%;
    table-layout: fixed;
}

.post-admin-table .post-col-check {
    width: var(--post-col-check);
}
.post-admin-table .post-col-id {
    width: var(--post-col-id);
}
.post-admin-table .post-col-title {
    width: auto;
}
.post-admin-table .post-col-category {
    width: var(--post-col-category);
}
.post-admin-table .post-col-views {
    width: var(--post-col-views);
}
.post-admin-table .post-col-comments {
    width: var(--post-col-comments);
}
.post-admin-table .post-col-status {
    width: var(--post-col-status);
}
.post-admin-table .post-col-date {
    width: var(--post-col-date);
}
.post-admin-table .post-col-actions {
    width: var(--post-col-actions);
}

.post-admin-table th,
.post-admin-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-admin-table th:nth-child(1),
.post-admin-table td:nth-child(1),
.post-admin-table th:nth-child(2),
.post-admin-table td:nth-child(2),
.post-admin-table th:nth-child(3),
.post-admin-table td:nth-child(3),
.post-admin-table th:nth-child(4),
.post-admin-table td:nth-child(4),
.post-admin-table th:nth-child(5),
.post-admin-table td:nth-child(5),
.post-admin-table th:nth-child(6),
.post-admin-table td:nth-child(6),
.post-admin-table th:nth-child(7),
.post-admin-table td:nth-child(7),
.post-admin-table th:nth-child(8),
.post-admin-table td:nth-child(8) {
    padding-right: 8px;
    padding-left: 8px;
    text-align: center;
}

.post-admin-table th:nth-child(3),
.post-admin-table td:nth-child(3) {
    white-space: normal;
}

.post-admin-table th:nth-child(4),
.post-admin-table td:nth-child(4),
.post-admin-table th:nth-child(8),
.post-admin-table td:nth-child(8) {
    white-space: nowrap;
}

.post-admin-table th:nth-child(9),
.post-admin-table td:nth-child(9) {
    padding-right: 8px;
    padding-left: 8px;
    overflow: visible;
    text-align: center;
}

.admin-action-table th:last-child,
.admin-action-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    width: var(--admin-action-column-width);
    min-width: var(--admin-action-column-width);
    max-width: var(--admin-action-column-width);
    background: #fff;
    box-shadow: none;
}

.admin-action-table th:last-child {
    z-index: 3;
    text-align: center;
    background: #f4f6f9;
}

.admin-action-table td:last-child {
    text-align: right;
}

.admin-action-table tbody tr:hover td:last-child {
    background: #f8fbff;
}

.admin-action-table .admin-action-bar,
.admin-action-table .post-action-bar {
    justify-content: flex-end;
    width: var(--admin-action-buttons-width);
    margin-left: auto;
}

.admin-action-table-medium {
    --admin-action-column-width: 148px;
    --admin-action-buttons-width: 114px;
}

.admin-action-table-wide {
    --admin-action-column-width: 184px;
    --admin-action-buttons-width: 154px;
}

.post-admin-table {
    --admin-action-column-width: var(--post-col-actions);
    --admin-action-buttons-width: 160px;
}

.post-admin-table th:last-child,
.post-admin-table td:last-child {
    width: var(--post-col-actions);
    min-width: var(--post-col-actions);
    max-width: var(--post-col-actions);
    text-align: center;
}

.admin-table .comment-cell {
    max-width: 520px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.comment-admin-table {
    --admin-action-column-width: 8%;
    --admin-action-buttons-width: 114px;
    table-layout: fixed;
}

.comment-admin-table th:nth-child(1),
.comment-admin-table td:nth-child(1) {
    width: 5%;
    text-align: center;
}

.comment-admin-table th:nth-child(2),
.comment-admin-table td:nth-child(2) {
    width: 20%;
    min-width: 0;
    overflow: hidden;
    text-align: center;
}

.comment-admin-table th:nth-child(3),
.comment-admin-table td:nth-child(3) {
    width: 15%;
    min-width: 0;
    overflow: hidden;
    text-align: center;
}

.comment-admin-table th:nth-child(4),
.comment-admin-table td:nth-child(4) {
    width: auto;
    text-align: center;
}

.comment-admin-table th:nth-child(5),
.comment-admin-table td:nth-child(5) {
    width: 5%;
    padding-right: 4px;
    padding-left: 4px;
    text-align: center;
}

.comment-admin-table td:nth-child(5) .status {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 11px;
}

.comment-admin-table th:nth-child(6),
.comment-admin-table td:nth-child(6) {
    width: 15%;
    text-align: center;
    white-space: nowrap;
}

.comment-admin-table td:nth-child(6) .time-tag {
    white-space: nowrap;
}

.comment-admin-table th:last-child,
.comment-admin-table td:last-child {
    width: var(--admin-action-column-width);
    min-width: var(--admin-action-column-width);
    max-width: var(--admin-action-column-width);
    padding-right: 6px;
    padding-left: 6px;
    text-align: center;
}

.comment-admin-table .admin-action-bar {
    gap: 4px;
    justify-content: center;
    width: max-content;
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
}

.comment-admin-table .admin-action-btn {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 12px;
}

.comment-admin-table .cmt-user-cell {
    width: 100%;
    min-width: 0;
    justify-content: center;
}

.comment-admin-table .cmt-user-main {
    min-width: 0;
    overflow: hidden;
}

.comment-admin-table .cmt-user-head {
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.comment-admin-table .cmt-user-name {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comment-admin-table .cmt-user-ip {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comment-admin-table .cmt-user-email {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comment-admin-table td:nth-child(3) a {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.comment-toolbar {
    gap: 8px;
}

.activity-admin-table {
    --admin-action-column-width: 8%;
    --admin-action-buttons-width: 74px;
    table-layout: fixed;
}

.activity-admin-table th,
.activity-admin-table td {
    text-align: center;
}

.activity-admin-table th:nth-child(1),
.activity-admin-table td:nth-child(1) {
    width: 5%;
}

.activity-admin-table th:nth-child(2),
.activity-admin-table td:nth-child(2) {
    width: auto;
}

.activity-admin-table th:nth-child(3),
.activity-admin-table td:nth-child(3) {
    width: 10%;
}

.activity-admin-table th:nth-child(4),
.activity-admin-table td:nth-child(4) {
    width: 12%;
}

.activity-admin-table th:nth-child(5),
.activity-admin-table td:nth-child(5) {
    width: 8%;
}

.activity-admin-table th:nth-child(6),
.activity-admin-table td:nth-child(6) {
    width: 15%;
    white-space: nowrap;
}

.activity-admin-table .comment-cell {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.activity-admin-table .admin-action-bar {
    justify-content: center;
    margin-right: auto;
    margin-left: auto;
}

.page-admin-table th,
.page-admin-table td {
    text-align: center;
}

.page-admin-table td:nth-child(2) a {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

.page-admin-table td:nth-child(5) .nav-toggle-form,
.page-admin-table .admin-action-bar {
    justify-content: center;
    margin-right: auto;
    margin-left: auto;
}

.comment-toolbar-settings {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.comment-toggle-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-soft);
    white-space: nowrap;
}

.comment-toggle-form.is-saving {
    opacity: 0.66;
}

.comment-toggle-label {
    line-height: 1;
}

.talk-admin-table th,
.talk-admin-table td,
.talk-admin-table th:last-child,
.talk-admin-table td:last-child {
    text-align: center;
}

.talk-admin-table {
    --admin-action-column-width: 148px;
    --admin-action-buttons-width: 114px;
    table-layout: fixed;
}

.talk-admin-table th:nth-child(1),
.talk-admin-table td:nth-child(1) {
    width: 8%;
}

.talk-admin-table th:nth-child(2),
.talk-admin-table td:nth-child(2) {
    width: auto;
}

.talk-admin-table th:nth-child(3),
.talk-admin-table td:nth-child(3) {
    width: 10%;
}

.talk-admin-table th:nth-child(4),
.talk-admin-table td:nth-child(4) {
    width: 16%;
    white-space: nowrap;
}

.talk-admin-table .comment-cell {
    margin-inline: auto;
    text-align: center;
}

.talk-admin-table .admin-action-bar {
    justify-content: center;
    margin-inline: auto;
}

.admin-inline-stat {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-right: 10px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-inline-stat i {
    font-size: 13px;
    color: var(--text-soft);
}

.admin-inline-stat:last-child {
    margin-right: 0;
}

.link-actions,
.attachment-actions,
.admin-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.link-actions form,
.admin-action-bar form,
.admin-inline-action-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.post-action-bar,
.admin-action-bar {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

.post-action-btn,
.admin-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 0;
    box-shadow: none;
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s,
        opacity 0.15s;
}

.admin-action-table .post-action-btn,
.admin-action-table .admin-action-btn,
.post-admin-table .post-action-btn,
.post-admin-table .admin-action-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    aspect-ratio: 1 / 1;
    border-radius: 0;
}

.post-action-btn:hover,
.admin-action-btn:hover {
    text-decoration: none;
}

.post-action-btn:disabled,
.admin-action-btn:disabled {
    cursor: wait;
    opacity: 0.62;
}

.post-action-edit,
.admin-action-edit {
    color: var(--primary);
    background: #e8f1ff;
    border-color: #b7d2ff;
}

.post-action-edit:hover,
.admin-action-edit:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.admin-action-copy {
    color: var(--primary);
    background: #e8f1ff;
    border-color: #b7d2ff;
}

.admin-action-copy:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.post-action-top {
    color: #d97706;
    background: #fff7e6;
    border-color: #fde3aa;
}

.post-action-top:hover,
.post-action-top.is-active {
    color: #fff;
    background: #d97706;
    border-color: #d97706;
}

.post-action-recommend {
    color: #16a34a;
    background: #ecfdf3;
    border-color: #c9f2d8;
}

.post-action-recommend:hover,
.post-action-recommend.is-active {
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}

.admin-action-approve {
    color: #16a34a;
    background: #ecfdf3;
    border-color: #c9f2d8;
}

.admin-action-approve:hover {
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}

.admin-action-spam {
    color: #d97706;
    background: #fff7e6;
    border-color: #fde3aa;
}

.admin-action-spam:hover {
    color: #fff;
    background: #d97706;
    border-color: #d97706;
}

.admin-action-refresh {
    color: #0284c7;
    background: #ecfeff;
    border-color: #bae6fd;
}

.admin-action-refresh:hover {
    color: #fff;
    background: #0284c7;
    border-color: #0284c7;
}

.post-action-delete,
.admin-action-delete {
    color: var(--danger);
    background: #fff1f2;
    border-color: #fecaca;
}

.post-action-delete:hover,
.admin-action-delete:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.post-action-btn.is-saving i,
.admin-action-btn.is-saving i {
    opacity: 0.55;
}

.admin-select-col {
    width: 42px;
    text-align: center;
}

.link-admin-table .rss-url {
    display: inline-block;
    min-width: 0;
    max-width: 360px;
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.rss-result {
    display: inline-flex;
    align-items: center;
    margin-top: 0;
    font-size: 12px;
    line-height: 1;
    color: var(--text-muted);
    white-space: nowrap;
}

.rss-result-error {
    color: var(--danger);
}

.rss-updated {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.link-mobile-rss-state {
    display: none;
}

.link-admin-table {
    min-width: 1120px;
}

.link-admin-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
}

.link-admin-toolbar > * {
    flex: 0 0 auto;
}

.link-admin-table th,
.link-admin-table td {
    white-space: nowrap;
}

.link-admin-table td:nth-child(3) {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-admin-table td:nth-child(4) {
    max-width: 320px;
}

.link-admin-table td:nth-child(5) {
    max-width: 320px;
}

.link-admin-table td:nth-child(4) a {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.link-rss-cell {
    min-width: 420px;
}

.link-rss-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
}

.link-rss-progress {
    padding: 14px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.link-rss-progress-head,
.link-rss-progress-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.link-rss-progress-head strong {
    font-size: 14px;
    font-weight: 750;
    color: var(--text);
}

.link-rss-progress-head span,
.link-rss-progress-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.link-rss-progress-track {
    height: 8px;
    margin: 12px 0 9px;
    overflow: hidden;
    background: var(--surface-muted);
    border-radius: 0;
}

.link-rss-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--primary);
    transition: width 0.2s ease;
}

.link-rss-errors {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 12px 0 0;
    list-style: none;
}

.link-rss-errors li {
    display: grid;
    grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 10px;
    font-size: 12px;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #fecaca;
}

.link-rss-errors strong {
    overflow: hidden;
    text-overflow: ellipsis;
    color: #991b1b;
    white-space: nowrap;
}

.status,
.badge {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 0;
}

.status {
    min-width: 56px;
}

.badge {
    min-width: 24px;
    min-height: 22px;
    padding: 3px 7px;
}

.status-published {
    color: #15803d;
    background: var(--success-soft);
    border-color: #bbf7d0;
}

.status-approved {
    color: #15803d;
    background: var(--success-soft);
    border-color: #bbf7d0;
}

.status-draft {
    color: #4b5563;
    background: #f9fafb;
    border-color: #d1d5db;
}

.status-pending {
    color: #b45309;
    background: var(--warning-soft);
    border-color: #fde68a;
}

.status-spam {
    color: #b91c1c;
    background: var(--danger-soft);
    border-color: #fecaca;
}

/* --------------------------------------------------------------------------
   4. Page Modules: Dashboard and Settings
   -------------------------------------------------------------------------- */

.badge-top {
    margin-right: 6px;
    color: #92400e;
    background: var(--warning-soft);
}

.badge-recommend {
    margin-right: 6px;
    color: #15803d;
    background: var(--success-soft);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    position: relative;
    padding: 18px;
    overflow: hidden;
}

.stat-card::after {
    content: none;
}

.dashboard-stat-grid .stat-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 126px;
}

.stat-card-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    display: inline-grid;
    flex: 0 0 38px;
    place-items: center;
    width: 38px;
    height: 38px;
    font-size: 16px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: var(--radius);
}

.stat-card-green .stat-icon {
    color: var(--success);
    background: var(--success-soft);
}

.stat-card-amber .stat-icon {
    color: var(--warning);
    background: var(--warning-soft);
}

.stat-card-cyan .stat-icon {
    color: #0284c7;
    background: #e0f7ff;
}

.stat-card-violet .stat-icon {
    color: #6d28d9;
    background: #ede9fe;
}

.stat-num {
    font-size: 31px;
    font-weight: 780;
    line-height: 1.1;
}

.dashboard-stat-grid .stat-num {
    margin-top: auto;
}

.stat-label {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-muted);
}

.dashboard-stat-grid .stat-label {
    margin-top: 0;
    text-align: right;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.dashboard-action {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 12px 14px;
    color: var(--text);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition:
        border-color 0.15s,
        background 0.15s,
        color 0.15s;
}

.dashboard-action:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.dashboard-action span {
    display: inline-grid;
    flex: 0 0 34px;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: var(--radius);
}

.dashboard-action strong {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 750;
}

.dashboard-action > i {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-muted);
}

.admin-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 22px;
    align-items: start;
}

.admin-col {
    min-width: 0;
    padding: 18px;
}

.admin-col h3,
.settings-group-title {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 12px;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 750;
    border-bottom: 1px solid var(--border);
}

.admin-col h3 i,
.settings-group-title i {
    color: var(--primary);
}

.admin-col-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--border);
}

.admin-col-head h3 {
    padding-bottom: 0;
    margin: 0;
    border-bottom: 0;
}

.admin-col-head .btn {
    flex: 0 0 auto;
}

.pending-comments {
    padding: 0;
    margin: 0;
    list-style: none;
}

.pending-comments li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.pending-comments li:last-child {
    border-bottom: 0;
}

.pending-comments p {
    margin: 5px 0 8px;
    color: var(--text-soft);
}

.dashboard-post-link,
.pending-comment-head {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.dashboard-post-link {
    max-width: 100%;
    color: var(--text);
}

.dashboard-post-link i,
.pending-comment-head i {
    color: var(--primary);
}

.dashboard-post-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-metric {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    font-size: 13px;
    color: var(--text-soft);
    white-space: nowrap;
}

.dashboard-metric i {
    color: var(--primary);
}

.pending-comment-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.pending-comment-head a,
.pending-comment-head span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.dashboard-more {
    gap: 7px;
}

.dashboard-empty {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.dashboard-empty i {
    color: inherit;
}

.dashboard-empty .admin-check-icon {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    font-size: 13px;
}

.table-empty {
    color: var(--text-muted);
    text-align: center;
}

.settings-group-title {
    padding-bottom: 0;
    margin: 24px 0 10px;
    border-bottom: 0;
}

.settings-group-title::before {
    width: 3px;
    height: 16px;
    content: "";
    background: var(--primary);
    border-radius: 0;
}

.settings-section {
    padding: 16px;
}

.mail-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.mail-status-card {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 78px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.mail-status-icon {
    display: inline-grid;
    flex: 0 0 38px;
    place-items: center;
    width: 38px;
    height: 38px;
    font-size: 16px;
    color: var(--primary);
    background: var(--primary-soft);
}

.mail-status-icon-danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.mail-status-icon-success {
    color: var(--success);
    background: var(--success-soft);
}

.mail-status-card strong {
    display: block;
    font-size: 16px;
    font-weight: 760;
    line-height: 1.3;
    color: var(--text);
}

.mail-status-card small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-muted);
}

.mail-settings-form,
.mail-test-form,
.mail-log-panel {
    margin-bottom: 18px;
}

.mail-log-panel .settings-section {
    margin-top: 0;
}

.mail-settings-section textarea {
    min-height: 76px;
}

.mail-event-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mail-event-grid .form-group-toggle {
    margin: 0;
}

.mail-provider-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
    background: transparent;
    border: 0;
}

.mail-provider-card {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.mail-provider-card h4 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 760;
    color: var(--text);
}

.mail-provider-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.mail-provider-actions .btn {
    min-width: 150px;
    justify-content: center;
}

.mail-test-action {
    flex: 0 0 auto;
    align-self: end;
}

.setting-key {
    margin-left: 6px;
}

.form-group-toggle {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.form-group-toggle > label {
    margin: 0;
}

.admin-empty-state {
    padding: 14px 16px;
    margin: 16px 0 0;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-soft);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 0;
}

.toggle-switch {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.toggle-track,
.cat-switch-slider {
    position: relative;
    display: inline-block;
    flex: 0 0 48px;
    width: 48px;
    height: 27px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    appearance: none;
    cursor: pointer;
    background: #cfd4dc;
    border: 0;
    border-radius: 27px;
    transition:
        background-color 0.2s,
        box-shadow 0.2s,
        opacity 0.2s;
}

.toggle-thumb,
.cat-switch-slider::before {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 23px;
    height: 23px;
    content: "";
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.24);
    transition: transform 0.2s;
}

.toggle-switch.on .toggle-track,
.cat-switch input:checked + .cat-switch-slider {
    background: var(--primary);
}

.toggle-switch.on .toggle-thumb,
.cat-switch input:checked + .cat-switch-slider::before {
    transform: translateX(21px);
}

.toggle-track:focus-visible,
.cat-switch input:focus-visible + .cat-switch-slider {
    outline: none;
    box-shadow: var(--ring);
}

.toggle-state {
    min-width: 48px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-soft);
}

.toggle-switch.on .toggle-state {
    color: var(--primary);
}

.cat-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 27px;
    vertical-align: middle;
}

.cat-switch input {
    position: absolute;
    opacity: 0;
}

.nav-toggle-form {
    margin: 0;
}

.nav-toggle-form.is-saving .cat-switch-slider,
.cat-switch input:disabled + .cat-switch-slider {
    cursor: wait;
    opacity: 0.58;
}

/* --------------------------------------------------------------------------
   4. Page Modules: Import, Editor, Music and Attachments
   -------------------------------------------------------------------------- */

.import-panel {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 18px;
    margin-bottom: 18px;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
}

.import-panel h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.import-panel p {
    margin: 0;
    color: var(--text-soft);
}

.cover-upload {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cover-upload input {
    min-width: 0;
}

.admin-upload-field {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.admin-form .admin-upload-field input[type="text"],
.admin-form .admin-upload-field input[type="url"] {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-upload-field-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-height);
    min-width: var(--control-height);
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0;
    color: var(--text-soft);
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s,
        opacity 0.15s;
}

.admin-upload-field-btn:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.admin-upload-field.is-uploading .admin-upload-field-btn,
.admin-upload-field-btn:disabled {
    cursor: wait;
    opacity: 0.78;
}

.admin-icon-upload-btn,
.admin-upload-field-btn,
.setting-upload-field .btn {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: var(--control-height);
    min-width: var(--control-height);
    max-width: var(--control-height);
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0;
    overflow: hidden;
    font-size: 0;
    line-height: 1;
}

.favicon-preview-upload {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    line-height: 1;
}

.admin-icon-upload-btn > i,
.admin-upload-field-btn > i,
.setting-upload-field .btn > i,
.favicon-preview-upload > i {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin: 0;
    font-size: 14px;
    line-height: 16px;
    text-align: center;
}

.admin-icon-upload-btn > i::before,
.admin-upload-field-btn > i::before,
.setting-upload-field .btn > i::before,
.favicon-preview-upload > i::before {
    display: block;
    line-height: 1;
}

.cover-preview {
    margin-top: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.cover-preview img {
    display: block;
    width: 100%;
    max-height: 190px;
    object-fit: cover;
}

.music-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.music-editor-form {
    min-width: 0;
}

.music-admin-shell {
    width: 100%;
    max-width: none;
    margin-right: auto;
    margin-left: auto;
}

.music-online-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.music-online-form {
    min-width: 0;
}

.admin-form-head {
    margin-bottom: 16px;
}

.admin-form-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 760;
    color: var(--text);
}

.admin-form-head p {
    margin: 5px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.meting-search-panel {
    position: sticky;
    top: calc(var(--admin-header-height) + 24px);
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.meting-search-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.meting-search-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 760;
}

.meting-search-head p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.meting-search-head > i {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: var(--radius);
}

.meting-search-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.meting-search-controls select,
.meting-search-box input {
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 8px 11px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: var(--radius);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}

.meting-search-controls select:focus,
.meting-search-box input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: var(--ring);
}

.meting-search-controls select {
    flex: 0 0 118px;
    width: 118px;
}

.meting-search-box {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
}

.meting-search-box input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.meting-search-box .btn {
    justify-content: center;
    width: var(--control-height);
    min-width: var(--control-height);
    padding: 0;
}

.meting-search-box .btn .admin-loading-spinner svg,
.admin-loading-spinner-light svg {
    stroke: #fff;
}

.meting-search-status {
    min-height: 22px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.meting-search-status[data-tone="success"] {
    color: var(--success);
}

.meting-search-status[data-tone="error"] {
    color: var(--danger);
}

.meting-result-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.meting-result-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 10px 11px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.meting-result-item:hover {
    background: var(--surface-muted);
    border-color: var(--border);
}

.meting-result-item.is-loading {
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.meting-result-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.meting-result-main strong,
.meting-result-main em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meting-result-main strong {
    font-size: 13px;
    font-weight: 720;
}

.meting-result-main em {
    font-size: 12px;
    font-style: normal;
    color: var(--text-muted);
}

.meting-result-side {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.meting-result-duration {
    min-width: 38px;
    font-size: 12px;
    font-style: normal;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.meting-result-action {
    color: var(--text-muted);
    text-align: right;
}

.meting-result-item:hover .meting-result-action {
    color: var(--text-muted);
}

.meting-result-item.is-loading .meting-result-action {
    color: var(--primary);
}

.music-admin-toolbar {
    gap: 12px;
    align-items: stretch;
}

.music-admin-search {
    max-width: 620px;
}

.music-admin-search .btn {
    height: var(--control-height);
    min-height: var(--control-height);
}

.admin-empty-card {
    padding: 18px;
    font-size: 14px;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.music-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.music-admin-card {
    position: relative;
    cursor: pointer;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    padding: 13px;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        transform 0.15s;
}

.music-admin-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.music-admin-cover {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    overflow: hidden;
    color: var(--primary);
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-soft), #f7f8fb);
    border-radius: calc(var(--radius) - 2px);
}

.music-admin-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-admin-cover span {
    font-size: 28px;
    font-weight: 760;
}

.music-admin-card-main {
    display: grid;
    gap: 10px;
    align-content: space-between;
    min-width: 0;
}

.music-admin-card-head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
    min-width: 0;
}

.music-admin-title-block {
    display: grid;
    gap: 3px;
    min-width: 0;
    text-decoration: none;
}

/* 整张卡片可点击进入编辑:把标题链接拉伸覆盖整卡;操作按钮置于其上保持可点 */
.music-admin-title-block::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.music-admin-card-actions {
    position: relative;
    z-index: 2;
}

.music-admin-title-block strong,
.music-admin-title-block span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-admin-title-block strong {
    font-size: 15px;
    font-weight: 760;
    color: var(--text);
}

.music-admin-title-block:hover strong {
    color: var(--primary);
}

.music-admin-title-block span,
.music-admin-stats {
    font-size: 12px;
    color: var(--text-muted);
}

.music-admin-stats i {
    width: 14px;
    color: var(--text-soft);
    text-align: center;
}

.music-admin-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.music-admin-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.music-admin-stats span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.music-admin-card-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.music-share-trigger {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-color: var(--border-strong);
}

.music-share-trigger:hover {
    color: var(--text);
    background: #eef1f5;
    border-color: #9ca3af;
}

.music-share-trigger.is-shared {
    color: #15803d;
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(22, 163, 74, 0.28);
}

.music-share-trigger.is-shared:hover {
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}

.music-share-dialog-panel textarea {
    width: 100%;
    min-height: 112px;
    margin-top: 14px;
    resize: vertical;
}

.music-delete-panel {
    margin-top: 16px;
}

.music-delete-panel-body {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}

.music-delete-panel h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 760;
    color: var(--danger);
}

.music-delete-panel p {
    margin: 5px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.music-delete-panel .music-delete-warning {
    color: var(--danger);
}

@media (max-width: 1180px) {
    .music-admin-shell {
        width: 100%;
    }

    .music-editor-grid,
    .music-online-layout {
        grid-template-columns: 1fr;
    }

    .meting-search-panel {
        position: static;
        order: -1;
    }
}

@media (max-width: 560px) {
    .meting-search-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .meting-search-controls select {
        flex-basis: auto;
        width: 100%;
    }

    .music-admin-grid {
        grid-template-columns: 1fr;
    }

    .music-admin-card {
        grid-template-columns: 74px minmax(0, 1fr);
        gap: 11px;
        padding: 11px;
    }

    .music-admin-cover {
        width: 74px;
        height: 74px;
    }

    .music-admin-card-head,
    .music-admin-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .music-delete-panel-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .music-admin-card-main {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .music-admin-footer {
        display: inline-flex;
        width: fit-content;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
    }
}

.editor-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.editor-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.editor-stats span {
    padding: 2px 8px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 0;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 7px 12px;
    background: #fbfbfc;
    border: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.editor-toolbar-label {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    height: var(--control-height);
    margin-right: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.editor-toolbar button,
.editor-toolbar .editor-file {
    display: inline-flex;
    flex: 0 0 var(--control-height);
    align-items: center;
    justify-content: center;
    width: var(--control-height);
    height: var(--control-height);
    margin: 0;
    font-size: 13px;
    line-height: 1;
    color: var(--text-soft);
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.editor-heading-menu {
    position: relative;
    flex: 0 0 var(--control-height);
    width: var(--control-height);
    height: var(--control-height);
}

.editor-heading-menu > [data-heading-toggle] {
    width: 100%;
    height: 100%;
}

.editor-heading-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    display: grid;
    gap: 4px;
    min-width: 82px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.editor-toolbar .editor-heading-dropdown button {
    flex: none;
    justify-content: flex-start;
    width: 100%;
    height: 30px;
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-align: left;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.editor-toolbar button:hover,
.editor-toolbar .editor-file:hover {
    color: var(--primary);
    background: #fff;
    border-color: var(--primary-border);
}

.editor-toolbar .editor-file i {
    font-size: 14px;
}

.editor-toolbar .editor-file input {
    display: none;
}

.editor-toolbar .editor-md-import {
    flex: 0 0 auto;
    gap: 5px;
    width: auto;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.editor-toolbar .editor-md-import i {
    font-size: 12px;
}

.editor-toolbar-spacer {
    flex: 1 1 auto;
    min-width: 12px;
}

.editor-toolbar-meta {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-height: var(--control-height);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.editor-toolbar-meta a {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
}

.editor-toolbar-meta a:hover {
    color: var(--primary);
}

.editor-toolbar-separator {
    width: 1px;
    height: 15px;
    background: var(--border);
}

.editor-pane {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 600px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
}

.editor-pane textarea {
    min-height: 600px;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.7;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
}

.editor-pane textarea:focus {
    box-shadow: inset 0 0 0 2px var(--primary-border);
}

.editor-preview {
    padding: 22px 26px;
    overflow: auto;
    line-height: 1.8;
    background: #f7f9fc;
    border-left: 0;
}

.editor-preview pre {
    padding: 14px;
    overflow: auto;
    color: #e5e7eb;
    background: #111827;
    border-radius: var(--radius);
}

.editor-preview code {
    background: var(--surface-muted);
}

.editor-preview blockquote {
    padding: 8px 14px;
    margin: 14px 0;
    color: var(--text-soft);
    background: var(--primary-soft);
    border-left: 3px solid var(--primary);
}

.editor-preview img {
    border-radius: var(--radius);
}

.upload-area {
    display: grid;
    gap: 10px;
    place-items: center;
    padding: 32px;
    margin-bottom: 16px;
    text-align: center;
    border-style: dashed;
}

.upload-area.drag,
.upload-area:hover {
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.upload-area .btn {
    justify-content: center;
    margin-bottom: 4px;
}

.upload-area .btn i {
    color: currentColor;
}

.upload-area p {
    margin: 0;
}

.upload-area i {
    color: var(--primary);
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.attachment-toolbar {
    gap: 8px;
    align-items: center;
}

.attachment-toolbar .btn {
    gap: 6px;
}

.attachment-toolbar .btn span {
    font-size: 12px;
    font-weight: 650;
    color: var(--text-muted);
}

.attachment-toolbar .btn.is-active {
    color: var(--primary);
    border-color: var(--primary);
}

.attachment-toolbar .btn.is-active span {
    color: var(--primary);
}

.attachment-card {
    overflow: hidden;
}

.attachment-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.attachment-card-head .attachment-name {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-info {
    padding: 9px 10px 10px;
}

.attachment-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
}

.attachment-meta .attachment-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

.attachment-meta .admin-action-btn {
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
}

.attachment-preview-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.attachment-card img,
.attachment-file-icon {
    width: 100%;
    height: 132px;
    object-fit: cover;
    background: var(--surface-muted);
}

.attachment-file-icon {
    display: grid;
    place-items: center;
    font-size: 42px;
    color: var(--text-muted);
}

.attachment-video-preview {
    cursor: zoom-in;
}

.attachment-type-audio {
    color: #0f766e;
}

.attachment-type-lyrics {
    color: #7c3aed;
}

.attachment-type-x {
    color: #111827;
}

.attachment-info {
    padding: 11px 12px;
}

.attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 650;
    color: var(--text);
    white-space: nowrap;
}

.attachment-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.attachment-type-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 650;
    color: var(--text-soft);
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.attachment-type-badge.attachment-type-image {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.attachment-type-badge.attachment-type-video {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}

.attachment-type-badge.attachment-type-audio {
    color: #0f766e;
    background: #f0fdfa;
    border-color: #99f6e4;
}

.attachment-type-badge.attachment-type-lyrics {
    color: #6d28d9;
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.attachment-type-badge.attachment-type-x {
    color: #111827;
    background: #f9fafb;
    border-color: #d1d5db;
}

.attachment-settings-panel {
    width: 100%;
    background: var(--surface);
}

.attachment-settings-lead {
    margin: -6px 0 18px;
}

.attachment-settings-grid {
    display: grid;
    gap: 14px;
}

.attachment-settings-section {
    display: grid;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.attachment-settings-section-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.attachment-settings-section h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 760;
    color: var(--text);
}

.attachment-settings-section .form-group {
    margin: 0;
}

.attachment-settings-section .form-row {
    gap: 14px;
}

.attachment-settings-panel .form-group label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text);
}

.attachment-settings-section input[type="text"],
.attachment-settings-section input[type="url"],
.attachment-settings-section input[type="password"],
.attachment-settings-section input[type="number"],
.attachment-settings-section input[type="time"],
.attachment-settings-section select,
.attachment-settings-section textarea {
    width: 100%;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 8px 11px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.3;
    color: var(--text);
    background: var(--surface);
    border: 1px solid #dfe3ea;
    border-radius: var(--radius);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}

.attachment-settings-section input::placeholder,
.attachment-settings-section textarea::placeholder {
    color: var(--text-muted);
}

.attachment-settings-panel input[type="checkbox"] {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.attachment-settings-panel .admin-inline-check {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
    color: var(--text-soft);
}

.attachment-settings-grid .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.attachment-setting-toggle {
    margin: 0;
}

.attachment-backup-toggle-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.attachment-s3-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.attachment-s3-status {
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-soft);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.attachment-s3-status.is-success {
    color: #15803d;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.attachment-s3-status.is-error {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}

.attachment-s3-status.is-info {
    color: var(--primary);
    background: var(--info-soft);
    border-color: var(--primary-border);
}

.cat-ico-cell {
    font-size: 18px;
    color: var(--primary);
    text-align: center;
}

.icon-field {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-preview {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    font-size: 18px;
    color: var(--primary);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.icon-presets,
.color-presets,
.socials-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.icon-preset,
.color-preset,
.preset-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    color: var(--text-soft);
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.icon-preset {
    width: 38px;
    height: 38px;
    font-size: 16px;
}

.icon-preset:hover,
.preset-chip:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.color-preset {
    width: var(--control-height);
    height: var(--control-height);
    padding: 0;
    background: rgb(var(--cat-color, 120, 120, 130));
    border-radius: 0;
}

.color-preset.color-auto {
    width: auto;
    padding: 0 12px;
    font-size: 12px;
    background: var(--surface-muted);
    border-radius: var(--radius);
}

.color-preset.is-active {
    box-shadow:
        0 0 0 3px #fff,
        0 0 0 5px rgb(var(--cat-color, 37, 99, 235));
}

.color-auto.is-active {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.spell-color-selector {
    gap: 10px;
    align-items: center;
}

.spell-color-option.color-preset {
    width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    background: rgb(var(--cat-color, 120, 120, 130));
    border: 0;
    border-radius: 50%;
    transform: scale(1);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.spell-color-selector-lg .spell-color-option.color-preset {
    width: 24px;
    height: 24px;
    min-height: 24px;
}

.spell-color-option.color-preset:hover {
    filter: saturate(1.08);
    transform: scale(1.08);
}

.spell-color-option.color-preset:active {
    transform: scale(0.9);
}

.spell-color-option.color-preset:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.spell-color-option.color-preset.is-active {
    box-shadow:
        inset 0 0 0 2px #fff,
        0 0 0 2px rgb(var(--cat-color, 37, 99, 235));
}

.spell-color-option.color-auto {
    width: auto;
    height: 28px;
    min-height: 28px;
    padding: 0 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.spell-color-option.color-auto.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cat-color-0 {
    --cat-color: 52, 199, 89;
}
.cat-color-1 {
    --cat-color: 73, 146, 255;
}
.cat-color-2 {
    --cat-color: 245, 158, 11;
}
.cat-color-3 {
    --cat-color: 236, 72, 153;
}
.cat-color-4 {
    --cat-color: 149, 128, 255;
}
.cat-color-5 {
    --cat-color: 20, 184, 166;
}

.profile-header {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.profile-form,
.profile-settings-section,
.profile-section-title {
    width: 100%;
    max-width: none;
}

.profile-form,
.profile-settings-section,
.profile-section-title {
    margin-right: auto;
    margin-left: auto;
}

.profile-section-title-actions {
    gap: 12px;
    justify-content: space-between;
    text-align: left;
}

.profile-section-title-actions > span {
    display: inline-flex;
    flex: 1 1 auto;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    text-align: left;
}

.profile-section-title-actions .btn {
    flex: 0 0 auto;
    margin-left: auto;
}

.profile-section-title-actions .btn i {
    color: currentColor;
}

.avatar,
.avatar-preview {
    object-fit: cover;
    background: #fff;
    border-radius: var(--radius);
}

.avatar-sm {
    width: 36px;
    height: 36px;
}

.cmt-user-cell {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 300px;
}

.cmt-user-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.cmt-user-head {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    align-items: center;
    min-width: 0;
    line-height: 1.3;
}

.cmt-user-name {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--text);
}

.cmt-user-email,
.cmt-user-ip {
    min-width: 0;
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-muted);
}

.cmt-user-email {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmt-user-name-link:hover {
    color: var(--primary);
}

.cmt-user-ip {
    flex: 0 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmt-user-flag {
    display: block;
    flex: 0 0 auto;
    width: 18px;
    height: 12px;
    cursor: help;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
}

.profile-avatar-tools {
    flex: 1;
    min-width: 220px;
}

.avatar-upload-row,
.socials-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.socials-toolbar .btn,
.socials-toolbar .preset-chip {
    align-self: center;
    height: var(--control-height);
}

.socials-toolbar .socials-presets {
    align-items: center;
    margin-top: 0;
}

.socials-toolbar .muted {
    display: inline-flex;
    align-items: center;
    height: var(--control-height);
}

#socials-list {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.social-row {
    padding: 12px;
}

.social-row-grid {
    display: grid;
    grid-template-columns: 34px 1.2fr 2.2fr 1.6fr var(--control-height);
    gap: 8px;
    align-items: center;
}

.social-row-qr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--control-height);
    grid-column: 2 / 5;
    gap: 8px;
    align-items: center;
}

.social-row-qr[hidden] {
    display: none;
}

.social-row.is-wechat-social .input-url {
    display: none;
}

.social-qr-upload {
    display: grid;
    place-items: center;
    width: var(--control-height);
    min-width: var(--control-height);
    height: var(--control-height);
    padding: 0;
}

.social-row-preview {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: var(--control-height);
    font-size: 16px;
    line-height: 1;
    color: var(--text-soft);
}

.social-row-preview .muted {
    display: none;
}

.text-danger {
    color: var(--danger);
}

/* --------------------------------------------------------------------------
   3. Feedback, Dialogs and Overlays
   -------------------------------------------------------------------------- */

.alert {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid;
    border-radius: var(--radius);
}

.alert-success {
    color: #15803d;
    background: var(--success-soft);
    border-color: #86efac;
}

.alert-error {
    color: #b91c1c;
    background: var(--danger-soft);
    border-color: #fecaca;
}

.alert-info {
    color: var(--primary);
    background: var(--info-soft);
    border-color: var(--primary-border);
}

.admin-toast-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    width: auto;
    max-width: calc(100vw - 48px);
    pointer-events: none;
}

.admin-toast {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    pointer-events: auto;
    background: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    animation: toast-in 0.2s ease-out;
}

.admin-toast > i,
.admin-toast > .admin-check-icon {
    display: inline-grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
    transform: translateY(-1px);
}

.admin-toast > .admin-toast-message {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #fff;
    overflow-wrap: anywhere;
}

.admin-toast-success {
    background: #0f172a;
    border-color: rgba(15, 23, 42, 0.1);
}

.admin-toast-success > i {
    color: #22c55e;
}

.admin-toast-error {
    background: #0f172a;
    border-color: rgba(15, 23, 42, 0.1);
}

.admin-toast-error > i {
    color: #ef4444;
}

.admin-toast.is-leaving {
    animation: toast-out 0.18s ease-in forwards;
}

.admin-upload-toast {
    align-items: flex-start;
    width: min(320px, calc(100vw - 48px));
}

.admin-upload-toast-icon {
    display: inline-grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.admin-upload-toast-success .admin-upload-toast-icon {
    color: #22c55e;
}

.admin-upload-toast-error .admin-upload-toast-icon {
    color: #ef4444;
}

.admin-upload-toast-body {
    display: grid;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.admin-upload-toast-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: baseline;
    min-width: 0;
}

.admin-upload-toast-title {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.admin-upload-toast-percent {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.72);
}

.admin-upload-toast-bar {
    height: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.admin-upload-toast-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: #60a5fa;
    border-radius: inherit;
    transition: width 0.16s ease;
}

.admin-upload-toast-success .admin-upload-toast-bar span {
    background: #22c55e;
}

.admin-upload-toast-error .admin-upload-toast-bar span {
    background: #ef4444;
}

.admin-dialog-open {
    overflow: hidden;
}

.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(15, 23, 42, 0.42);
}

.admin-modal {
    display: flex;
    flex-direction: column;
    width: min(1120px, 100%);
    max-height: min(86vh, 860px);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.admin-modal-head {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.admin-modal-head h3 {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    font-size: 18px;
    font-weight: 780;
    color: var(--text);
}

.admin-modal-head p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-modal-close {
    display: inline-grid;
    flex: 0 0 34px;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--text-muted);
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.admin-modal-close:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.admin-category-dialog-body {
    min-height: 0;
    padding: 16px 18px 20px;
    overflow: auto;
}

.category-dialog-toolbar {
    margin-bottom: 14px;
}

.category-dialog-form {
    margin-bottom: 16px;
}

.category-dialog-table {
    margin: 0;
}

.category-dialog-table td:nth-child(4) code {
    white-space: nowrap;
}

.post-font-dialog {
    width: min(760px, 100%);
    border-radius: var(--radius);
}

.post-font-dialog-body {
    padding: 16px 18px 0;
    overflow: auto;
}

.post-font-options {
    display: grid;
    gap: 10px;
}

.post-font-option {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 14px;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition:
        border-color 0.15s,
        background 0.15s,
        box-shadow 0.15s;
}

.post-font-option:hover {
    border-color: var(--primary-border);
}

.post-font-option.is-active {
    background: var(--primary-soft);
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.post-font-option input {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--primary);
}

.post-font-option-main {
    display: grid;
    gap: 5px;
}

.post-font-option-title {
    font-size: 14px;
    font-weight: 750;
    color: var(--text);
}

.post-font-option-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.post-font-option-preview {
    display: block;
    padding-top: 4px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
}

.post-font-actions {
    padding: 14px 0 16px;
}

.admin-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2600;
    width: 100vw;
    min-height: 100vh;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.48);
    animation: dialog-backdrop-in 0.16s ease-out;
}

.admin-dialog-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    text-align: center;
}

.admin-dialog {
    width: min(100%, 500px);
    overflow: hidden;
    text-align: left;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
    transform-origin: center;
    animation: dialog-in 0.18s ease-out;
}

.admin-dialog-body {
    padding: 22px 24px 18px;
    background: #fff;
}

.admin-dialog-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.admin-dialog-icon {
    display: inline-flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 999px;
}

.admin-dialog-icon-danger {
    color: #dc2626;
    background: #fee2e2;
}

.admin-dialog-icon-primary {
    color: var(--primary);
    background: var(--primary-soft);
}

.admin-dialog-copy {
    min-width: 0;
    padding-top: 1px;
}

.admin-dialog-copy h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.45;
    color: var(--text);
}

.admin-dialog-copy p {
    margin: 7px 0 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-soft);
}

.admin-dialog-actions {
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    align-items: center;
    padding: 10px 24px 18px;
    background: #fff;
    border-top: 0;
}

.admin-dialog-actions .btn {
    min-width: 86px;
    height: 36px;
    min-height: 36px;
    padding: 0 16px;
    border-radius: var(--radius);
    box-shadow: none;
}

.admin-dialog-confirm-danger {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

.admin-dialog-confirm-danger:hover {
    color: #fff;
    background: #b91c1c;
    border-color: #b91c1c;
}

.admin-dialog-confirm-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.admin-dialog-confirm-primary:hover {
    color: #fff;
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.talk-keyword-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    margin: 2px 5px 2px 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary);
    white-space: nowrap;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
}

.admin-action-toggle {
    color: var(--text-muted);
    background: #fff;
    border-color: var(--border);
}

.admin-action-toggle:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.talk-edit-dialog-panel {
    width: min(720px, calc(100vw - 32px));
}

.talk-edit-dialog-layout {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0 14px;
    align-items: center;
}

.talk-edit-dialog-layout .admin-dialog-icon {
    grid-column: 1;
    grid-row: 1;
}

.talk-edit-dialog-copy {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    padding-top: 0;
}

.talk-edit-form-grid {
    grid-column: 1 / -1;
    display: grid;
    gap: 14px;
    width: 100%;
    margin-top: 18px;
}

.talk-edit-form-grid label {
    display: grid;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.talk-edit-form-grid input[type="text"],
.talk-edit-form-grid textarea {
    box-sizing: border-box;
    width: 100%;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 8px 11px;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}

.talk-edit-form-grid input[type="text"]:focus,
.talk-edit-form-grid textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: var(--ring);
}

.talk-edit-form-grid textarea {
    height: auto;
    min-height: 132px;
    line-height: 1.65;
    resize: vertical;
}

.talk-edit-image-field {
    width: 100%;
}

.talk-edit-control-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--control-height);
    gap: 8px;
    align-items: stretch;
}

.talk-edit-tool-btn.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.talk-edit-form-grid .form-row,
.talk-edit-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 14px;
}

.talk-edit-weather-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px var(--control-height);
    gap: 8px;
}

.talk-edit-location-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.talk-edit-location-panel[hidden],
.talk-edit-location-results[hidden] {
    display: none;
}

.talk-edit-location-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.talk-edit-location-search > i {
    width: 18px;
    color: var(--text-soft);
    text-align: center;
}

.talk-edit-location-search .btn {
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 12px;
}

.talk-edit-location-results {
    display: grid;
    gap: 8px;
}

.talk-edit-location-result,
.talk-edit-location-empty {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.talk-edit-location-result {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--text);
    cursor: pointer;
    background: #fff;
}

.talk-edit-location-result:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

.talk-edit-location-result i {
    color: var(--primary);
}

.talk-edit-location-empty,
.talk-edit-location-hint {
    color: var(--text-muted);
}

.talk-edit-location-empty {
    background: #fff;
}

.talk-edit-location-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
}

.talk-edit-public {
    display: inline-flex !important;
    gap: 8px !important;
    align-items: center;
    justify-content: start;
    font-weight: 600 !important;
}

@media (max-width: 680px) {
    .talk-edit-form-grid .form-row,
    .talk-edit-form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .talk-edit-weather-field {
        grid-template-columns: minmax(0, 1fr) 88px var(--control-height);
    }

    .talk-edit-location-search {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .talk-edit-location-search > i {
        display: none;
    }

    .talk-edit-location-search input {
        grid-column: 1 / -1;
    }

    .talk-edit-location-search .btn {
        width: 100%;
    }
}

.admin-dialog-backdrop.is-leaving {
    animation: dialog-backdrop-out 0.16s ease-in forwards;
}

.admin-dialog-backdrop.is-leaving .admin-dialog {
    animation: dialog-out 0.16s ease-in forwards;
}

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

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes dialog-backdrop-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes dialog-backdrop-out {
    to {
        opacity: 0;
    }
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dialog-out {
    to {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--control-height);
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-soft);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.pagination a:hover,
.pagination .active,
.pagination span.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-border);
}

/* --------------------------------------------------------------------------
   5. Responsive Overrides
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    :root {
        --admin-content-width: calc(100vw - 122px);
    }

    .mail-status-grid,
    .mail-provider-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-sidebar {
        width: 82px;
        padding: 0 10px 12px;
    }

    .admin-wrapper {
        margin-left: 82px;
    }

    .admin-wrapper::before {
        left: 82px;
    }

    .admin-wrapper::after {
        left: 82px;
    }

    .admin-content:has(.post-editor-form) {
        width: calc(100vw - 82px);
    }

    .admin-brand {
        height: var(--admin-header-height);
        padding: 0 4px;
    }

    .admin-brand-link {
        justify-content: center;
        padding: 0;
    }

    .admin-brand-text,
    .admin-sidebar-search,
    .menu-group,
    .admin-menu a span,
    .admin-sidebar-logout span {
        display: none;
    }

    .admin-menu {
        padding-top: 10px;
    }

    .admin-menu-branch-head {
        grid-template-columns: 1fr;
    }

    .admin-menu-branch-toggle {
        display: none;
    }

    .admin-menu-children {
        padding-left: 0;
    }

    .admin-menu-children a {
        justify-content: center;
        padding: 10px 6px;
    }

    .admin-brand-avatar,
    .admin-brand-logo {
        width: 38px;
        height: 38px;
    }

    .admin-menu a {
        justify-content: center;
        padding: 10px 6px;
    }

    .admin-sidebar-footer {
        padding: 10px 0 4px;
    }

    .admin-sidebar-logout {
        justify-content: center;
        padding: 10px 6px;
    }

    .admin-row,
    .editor-pane,
    .post-editor-layout {
        grid-template-columns: 1fr;
    }

    .post-editor-sidebar {
        border-top: 1px solid var(--border);
    }

    .post-editor-main .editor-toolbar,
    .post-editor-main .editor-pane {
        border-right: 0;
    }

    .editor-toolbar-spacer {
        display: none;
    }

    .editor-toolbar-meta {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
    }

    .editor-pane textarea {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .editor-preview {
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 820px) {
    :root {
        --admin-content-width: 100%;
    }

    body.admin-body {
        overflow-x: hidden;
    }

    .admin-sidebar {
        position: sticky;
        top: 0;
        display: block;
        width: 100%;
        height: auto;
        padding: 8px 10px;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: none;
    }

    .admin-brand {
        display: none;
    }

    .admin-menu {
        display: flex;
        gap: 6px;
        padding: 0;
        overflow-x: auto;
    }

    .admin-menu-branch {
        flex: 0 0 auto;
    }

    .admin-menu a {
        flex: 0 0 auto;
        min-width: 42px;
    }

    .admin-sidebar-footer {
        display: none;
    }

    .admin-wrapper {
        margin-left: 0;
    }

    .admin-wrapper::before {
        content: none;
    }

    .admin-wrapper::after {
        content: none;
    }

    .admin-header {
        position: relative;
        flex-direction: row;
        align-items: center;
        min-height: 48px;
        padding: 0 12px;
        margin: 0;
    }

    .admin-user {
        flex-wrap: wrap;
        justify-content: flex-end;
        width: auto;
    }

    .admin-page-title p,
    .admin-account-chip span {
        display: none;
    }

    .admin-content {
        padding: 14px 12px 28px;
        margin-top: 10px;
        border-top: 0;
        border-right: 0;
        border-left: 0;
        box-shadow: none;
    }

    .admin-content:has(.post-editor-form) {
        width: 100%;
        padding: 14px 12px 28px;
        margin-top: 10px;
    }

    .admin-col {
        overflow-x: auto;
    }

    .mail-status-grid,
    .mail-provider-grid,
    .mail-event-grid {
        grid-template-columns: 1fr;
    }

    .admin-toolbar,
    .admin-search {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .admin-search {
        margin-left: 0;
    }

    .resource-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .x-tweet-capture-row {
        flex-direction: column;
        align-items: stretch;
    }

    .x-tweet-url-field,
    .x-tweet-capture-submit {
        width: 100%;
    }

    .resource-card-grid {
        grid-template-columns: 1fr;
    }

    .plugin-card .resource-card-body {
        grid-template-columns: 1fr;
    }

    .plugin-main {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .plugin-card .plugin-toggle-form {
        justify-self: start;
    }

    .resource-actions {
        justify-content: flex-start;
    }

    .settings-subtabs {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .settings-page-shell {
        width: 100%;
        max-width: none;
    }

    .favicon-settings-body {
        flex-direction: column;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .admin-form {
        padding: 16px;
    }

    .profile-form,
    .profile-settings-section,
    .profile-section-title {
        width: 100%;
        max-width: none;
    }

    .profile-section-title-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-section-title-actions .btn {
        width: 100%;
    }

    .form-row,
    .profile-header {
        flex-direction: column;
        align-items: stretch;
    }

    .form-group {
        min-width: 0;
    }

    .form-actions {
        padding: 12px 16px;
        margin: 16px -16px -16px;
    }

    .admin-dialog-shell {
        align-items: flex-end;
        padding: 14px;
    }

    .admin-modal-backdrop {
        align-items: stretch;
        padding: 12px;
    }

    .admin-modal {
        max-height: calc(100vh - 24px);
        border-radius: 12px;
    }

    .admin-dialog-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .admin-dialog-actions {
        flex-direction: row-reverse;
        align-items: center;
        justify-content: flex-start;
    }

    .admin-dialog-actions .btn {
        width: auto;
    }

    .cover-upload {
        flex-direction: column;
        align-items: stretch;
    }

    .editor-pane,
    .editor-pane textarea {
        min-height: 420px;
    }

    .social-row-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin mobile baseline: keep every backend surface usable on narrow screens. */
@media (max-width: 820px) {
    html,
    body.admin-body {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .admin-sidebar {
        position: sticky;
        top: 0;
        z-index: 80;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        width: 100%;
        max-width: 100vw;
        padding: 8px 10px 10px;
        background: #fff;
    }

    .admin-sidebar-search {
        order: 1;
        min-height: 36px;
        margin: 0;
    }

    .admin-menu {
        order: 2;
        display: flex;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        padding-bottom: 2px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .admin-menu::-webkit-scrollbar {
        display: none;
    }

    .admin-menu .menu-group,
    .admin-menu-branch-toggle,
    .admin-menu-children {
        display: none !important;
    }

    .admin-menu a,
    .admin-menu-branch-head a,
    .admin-sidebar-logout {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 7px 10px;
        margin: 0;
        border-radius: var(--radius);
        white-space: nowrap;
    }

    .admin-menu a.active {
        border-radius: 0;
    }

    .admin-wrapper {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .admin-header {
        position: relative;
        top: auto;
        z-index: 70;
        min-height: 50px;
        padding: 0 12px;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .admin-page-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    .admin-page-title h2,
    .admin-header h2 {
        max-width: 100%;
        overflow: hidden;
        font-size: 14px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-page-title h2 i {
        flex: 0 0 18px;
    }

    .admin-user {
        flex: 0 0 auto;
        gap: 8px;
    }

    .admin-preview-link,
    .admin-account-chip {
        width: 34px;
        min-width: 34px;
        height: 34px;
        padding: 0;
    }

    .admin-content,
    .admin-content:has(.post-editor-form) {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        padding: 12px 10px 28px;
        margin: 0;
        overflow-x: hidden;
    }

    .admin-toolbar {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        align-items: stretch;
        padding: 10px;
        margin-bottom: 12px;
        overflow-x: auto;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
    }

    .admin-toolbar > .btn,
    .admin-toolbar > form,
    .admin-toolbar > button,
    .admin-toolbar > a {
        flex: 0 0 auto;
    }

    .admin-toolbar .admin-search,
    .admin-search {
        display: flex;
        flex: 1 1 100%;
        flex-direction: row;
        gap: 8px;
        min-width: 0;
    }

    .admin-search input,
    .admin-search select,
    .admin-search .btn,
    .admin-search button {
        min-width: 0;
    }

    .btn,
    .link-btn,
    .btn-icon {
        max-width: 100%;
        min-height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }

    .admin-form,
    .settings-section,
    .mail-provider-card,
    .admin-empty-card,
    .mail-log-panel,
    .activity-integration-card,
    .resource-card,
    .stat-card {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius);
    }

    .admin-form,
    .settings-section,
    .mail-provider-card {
        padding: 14px;
    }

    .admin-form-title,
    .admin-form-head,
    .resource-page-head,
    .profile-section-title,
    .settings-group-title {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .form-row,
    .form-actions,
    .compact-flags,
    .bulk-bar,
    .link-admin-toolbar,
    .music-admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        position: sticky;
        bottom: 0;
        z-index: 35;
        gap: 8px;
        padding: 12px 14px;
        margin: 14px -14px -14px;
    }

    .form-actions .btn,
    .form-actions button,
    .form-actions a,
    .admin-dialog-actions .btn,
    .admin-dialog-actions button,
    .admin-modal .btn,
    .admin-modal button {
        width: 100%;
    }

    .admin-form input[type="text"],
    .admin-form input[type="email"],
    .admin-form input[type="url"],
    .admin-form input[type="password"],
    .admin-form input[type="number"],
    .admin-form input[type="datetime-local"],
    .admin-form input[type="file"],
    .admin-form select,
    .admin-form textarea,
    .login-card input,
    .social-row-grid input {
        width: 100%;
        min-width: 0;
    }

    .admin-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius);
    }

    .admin-table th,
    .admin-table td {
        padding: 11px 12px;
        font-size: 12px;
    }

    .admin-action-table th:last-child,
    .admin-action-table td:last-child,
    .post-admin-table th:last-child,
    .post-admin-table td:last-child {
        position: static;
        width: auto;
        min-width: 150px;
        max-width: none;
        box-shadow: none;
    }

    .admin-action-table .admin-action-bar,
    .admin-action-table .post-action-bar,
    .talk-admin-table .admin-action-bar,
    .music-admin-card-actions {
        justify-content: flex-start;
        width: auto;
        margin-left: 0;
    }

    .admin-action-btn,
    .post-action-btn {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0;
    }

    .comment-toolbar,
    .settings-subtabs,
    .attachment-tabs,
    .resource-filter-tabs {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comment-toolbar > *,
    .settings-subtabs > *,
    .attachment-tabs > *,
    .resource-filter-tabs > * {
        flex: 0 0 auto;
    }

    .stat-grid,
    .dashboard-stat-grid,
    .mail-status-grid,
    .mail-provider-grid,
    .mail-event-grid,
    .activity-integration-grid,
    .resource-card-grid,
    .plugin-card-grid,
    .music-admin-grid,
    .attachment-grid,
    .settings-page-shell,
    .profile-settings-grid,
    .favicon-asset-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
    }

    .dashboard-grid,
    .music-editor-grid,
    .music-online-layout,
    .music-online-form,
    .post-editor-layout,
    .page-editor-form .post-editor-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .post-editor-form {
        border-radius: var(--radius);
        overflow: hidden;
    }

    .post-editor-title-row input[type="text"] {
        height: 48px;
        min-height: 48px;
        padding: 0 14px;
        font-size: 18px;
    }

    .post-editor-layout {
        min-height: 0;
    }

    .post-editor-main {
        order: 1;
    }

    .post-editor-sidebar {
        order: 2;
        border-bottom: 1px solid var(--border);
    }

    .post-editor-actions {
        position: sticky;
        bottom: 0;
        z-index: 30;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 8px;
        border-top: 1px solid var(--border);
    }

    .post-editor-actions .btn {
        min-width: 0;
        padding: 0 6px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .post-editor-panel {
        padding: 12px;
    }

    .post-editor-panel h3 {
        margin-bottom: 10px;
    }

    .post-option-check {
        margin-bottom: 8px;
    }

    .post-editor-sidebar {
        display: contents;
    }

    .post-editor-actions {
        order: 3;
        align-self: end;
        margin-top: auto;
    }

    .post-editor-panel {
        order: 2;
    }

    .post-editor-panel .cover-upload {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px;
        gap: 8px;
        align-items: center;
    }

    .post-editor-panel .cover-upload .admin-upload-field-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
    }

    .post-import-form {
        padding: 0;
        overflow: hidden;
    }

    .post-import-form .form-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        align-items: stretch;
    }

    .post-import-form .import-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
        margin: 0;
        background: #fff;
        border: 0;
        border-bottom: 1px solid var(--border);
        border-left: 0;
        border-radius: 0;
    }

    .post-import-form .import-panel h3 {
        display: flex;
        gap: 8px;
        align-items: center;
        margin: 0 0 6px;
        font-size: 16px;
    }

    .post-import-form .import-panel h3 i {
        color: var(--primary);
    }

    .post-import-form .import-panel p {
        display: none;
    }

    .post-import-form .import-panel .btn {
        width: 100%;
        justify-content: center;
    }

    .post-import-form > .form-row,
    .post-import-form > .compact-flags {
        padding: 0 14px;
        margin-top: 14px;
    }

    .post-import-form > .form-row:not(.post-import-flags) {
        padding-bottom: 2px;
        border-bottom: 1px solid var(--border);
    }

    .post-import-form .post-import-source-row {
        margin-top: 12px;
    }

    .post-import-form input[type="file"] {
        height: 42px;
        min-height: 42px;
        padding: 0 10px 0 0;
        overflow: hidden;
        font-size: 13px;
        line-height: 42px;
        color: var(--text-soft);
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }

    .post-import-form input[type="file"]::file-selector-button {
        height: 40px;
        min-height: 40px;
        padding: 0 14px;
        margin: 0 10px 0 0;
        font: inherit;
        font-weight: 700;
        color: var(--text);
        cursor: pointer;
        background: #fff;
        border: 0;
        border-right: 1px solid var(--border);
        border-radius: 0;
    }

    .post-import-form input[type="file"]::file-selector-button:hover {
        color: var(--primary);
        background: var(--primary-soft);
    }

    .post-import-form .post-import-meta-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .post-import-form .post-import-meta-row .form-group {
        min-width: 0;
    }

    .post-import-form .post-import-flags {
        padding-top: 0;
        font-size: 13px;
        color: var(--text-soft);
    }

    .post-import-form .post-import-flags label {
        display: flex;
        gap: 8px;
        align-items: center;
        width: 100%;
        margin: 0;
    }

    .post-import-form .form-group {
        min-width: 0;
        margin-bottom: 12px;
    }

    .post-import-form textarea {
        min-height: 88px;
    }

    .post-import-form .cover-upload {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px;
        gap: 8px;
        align-items: center;
    }

    .post-import-form .admin-upload-field-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
    }

    .post-import-form .form-actions {
        position: sticky;
        bottom: 0;
        z-index: 30;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 12px 14px;
        margin: 14px 0 0;
        background: #fff;
    }

    .post-import-form .form-actions .btn,
    .post-import-form .form-actions button,
    .post-import-form .form-actions a {
        width: 100%;
        justify-content: center;
    }

    .post-editor-main .editor-toolbar,
    .post-editor-main .editor-pane,
    .post-editor-main .editor-pane textarea,
    .post-editor-main .editor-preview {
        border-right: 0;
    }

    .editor-toolbar {
        gap: 4px;
        padding: 7px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .editor-toolbar > * {
        flex: 0 0 auto;
    }

    .editor-toolbar-spacer,
    .editor-toolbar-meta {
        display: none;
    }

    .editor-pane {
        grid-template-columns: minmax(0, 1fr);
        min-height: 520px;
    }

    .editor-pane textarea,
    .editor-preview,
    .post-editor-main .editor-pane,
    .post-editor-main .editor-pane textarea,
    .post-editor-main .editor-preview {
        min-height: 520px;
    }

    .editor-preview {
        border-top: 1px solid var(--border);
    }

    .page-system-empty {
        min-height: 360px;
        border-right: 0;
    }

    .music-editor-sidebar,
    .music-online-search,
    .music-online-pending,
    .attachment-settings-panel {
        position: static;
        width: 100%;
        max-width: none;
    }

    .music-admin-card {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
        align-items: center;
    }

    .music-admin-cover {
        width: 72px;
        height: 72px;
    }

    .music-admin-card-main {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        gap: 8px;
    }

    .music-admin-card-head {
        gap: 6px;
    }

    .music-admin-title-block {
        width: 100%;
        min-width: 0;
    }

    .music-admin-title-block strong,
    .music-admin-title-block span {
        display: block;
        max-width: 100%;
    }

    .music-admin-footer {
        display: inline-flex;
        width: fit-content;
        max-width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        justify-content: flex-start !important;
    }

    .music-admin-stats {
        flex: 0 1 auto;
        min-width: 0;
    }

    .music-admin-card-actions {
        flex: 0 0 auto;
        display: inline-flex;
        flex-wrap: nowrap;
        gap: 0;
        margin-left: 0;
    }

    .music-share-trigger.admin-action-btn {
        flex: 0 0 32px;
        width: 32px;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
        padding: 0;
    }

    .resource-card-body,
    .plugin-card .resource-card-body {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px;
    }

    .attachment-card,
    .resource-card,
    .music-admin-card {
        min-width: 0;
    }

    .attachment-card-head {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 9px;
    }

    .attachment-meta .attachment-actions {
        width: auto;
    }

    .attachment-meta .admin-action-btn {
        flex: 0 0 32px;
        width: 32px;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
        padding: 0;
    }

    .admin-dialog-backdrop,
    .admin-modal-backdrop {
        align-items: flex-end;
        padding: 10px;
    }

    .admin-dialog-shell {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .admin-dialog,
    .admin-modal,
    .music-share-dialog-panel,
    .talk-edit-dialog-panel {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 20px);
        overflow: auto;
        border-radius: 12px 12px 0 0;
    }

    .admin-category-dialog {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 20px);
        border-radius: var(--radius);
    }

    #category-dialog.admin-modal-backdrop {
        align-items: center;
        padding: 12px;
    }

    .admin-category-dialog-body {
        padding: 12px;
    }

    .category-dialog-toolbar {
        padding: 0;
        margin-bottom: 10px;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .category-dialog-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .category-dialog-form {
        padding: 12px;
        margin: 0 0 12px;
        border-radius: var(--radius);
    }

    .category-dialog-form .admin-form-title {
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
        margin-bottom: 12px;
        font-size: 16px;
    }

    .category-dialog-form .form-row {
        gap: 0;
    }

    .category-dialog-form .form-group {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        margin-bottom: 12px;
    }

    .category-dialog-form label {
        margin-bottom: 5px;
        font-size: 12px;
    }

    .category-dialog-form input[type="text"],
    .category-dialog-form input[type="number"] {
        height: 38px;
        min-height: 38px;
        font-size: 13px;
    }

    .category-dialog-form .icon-field {
        gap: 8px;
    }

    .category-dialog-form .icon-preview {
        width: 38px;
        height: 38px;
    }

    .category-dialog-form .icon-presets,
    .category-dialog-form .color-presets {
        gap: 7px;
        margin-top: 8px;
    }

    .category-dialog-form .icon-preset,
    .category-dialog-form .color-preset,
    .category-dialog-form .spell-color-option.color-preset {
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0;
    }

    .category-dialog-form .spell-color-option.color-preset {
        width: 24px;
        height: 24px;
        min-height: 24px;
    }

    .category-dialog-form .color-preset.color-auto {
        width: auto;
        min-width: 56px;
        padding: 0 10px;
    }

    .category-dialog-form .form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 12px 0;
        margin: 10px -12px 0;
        border-top: 1px solid var(--border);
    }

    .category-dialog-form .form-actions .btn,
    .category-dialog-form .form-actions button {
        width: 100%;
        justify-content: center;
    }

    .admin-dialog-body,
    .admin-modal-body {
        padding: 18px;
    }

    .admin-dialog-layout {
        gap: 14px;
        align-items: flex-start;
        text-align: left;
    }

    .admin-dialog-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .admin-dialog-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 18px 18px;
    }

    .admin-toast-stack {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 560px) {
    .admin-menu a span,
    .admin-menu-branch-head a span {
        display: none;
    }

    .admin-menu a,
    .admin-menu-branch-head a {
        justify-content: center;
        width: 38px;
        min-width: 38px;
        padding: 7px 0;
    }

    .admin-menu a i {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }

    .admin-sidebar-search button {
        display: none;
    }

    .admin-page-title h2 {
        font-size: 13px;
    }

    .admin-content,
    .admin-content:has(.post-editor-form) {
        padding: 10px 8px 24px;
    }

    .admin-toolbar {
        padding: 8px;
    }

    .btn,
    .link-btn,
    .btn-icon {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }

    .admin-form,
    .settings-section,
    .mail-provider-card {
        padding: 12px;
    }

    .form-actions {
        padding: 10px 12px;
        margin: 12px -12px -12px;
    }

    .post-editor-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .post-editor-actions .btn {
        width: 100%;
        padding: 0 4px;
        font-size: 12px;
    }

    .editor-pane,
    .editor-pane textarea,
    .editor-preview,
    .post-editor-main .editor-pane,
    .post-editor-main .editor-pane textarea,
    .post-editor-main .editor-preview {
        min-height: 460px;
    }

    .music-admin-card {
        grid-template-columns: 60px minmax(0, 1fr);
    }

    .stat-card,
    .mail-status-card {
        padding: 14px;
    }
}

@media (max-width: 820px) {
    .talk-admin-table,
    .comment-admin-table,
    .post-admin-table,
    .page-admin-table,
    .activity-admin-table,
    .link-admin-table,
    .activity-integration-table,
    .activity-sync-log-table,
    .category-dialog-table,
    .passkey-table,
    .dashboard-post-table,
    .mail-log-table,
    .telegram-env-table,
    .x-admin-tweets-table {
        display: block;
        overflow: visible;
        white-space: normal;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .talk-admin-table thead,
    .comment-admin-table thead,
    .post-admin-table thead,
    .page-admin-table thead,
    .activity-admin-table thead,
    .link-admin-table thead,
    .activity-integration-table thead,
    .activity-sync-log-table thead,
    .category-dialog-table thead,
    .passkey-table thead,
    .dashboard-post-table thead,
    .mail-log-table thead,
    .telegram-env-table thead,
    .x-admin-tweets-table thead,
    .x-admin-tweets-table colgroup,
    .post-admin-table colgroup {
        display: none;
    }

    .talk-admin-table tbody,
    .comment-admin-table tbody,
    .post-admin-table tbody,
    .page-admin-table tbody,
    .activity-admin-table tbody,
    .link-admin-table tbody,
    .activity-integration-table tbody,
    .activity-sync-log-table tbody,
    .category-dialog-table tbody,
    .passkey-table tbody,
    .dashboard-post-table tbody,
    .mail-log-table tbody,
    .telegram-env-table tbody,
    .x-admin-tweets-table tbody {
        display: grid;
        gap: 10px;
    }

    .talk-admin-table tr,
    .comment-admin-table tr,
    .post-admin-table tr,
    .page-admin-table tr,
    .activity-admin-table tr,
    .link-admin-table tr,
    .activity-integration-table tr,
    .activity-sync-log-table tr,
    .category-dialog-table tr,
    .passkey-table tr,
    .dashboard-post-table tr,
    .mail-log-table tr,
    .telegram-env-table tr,
    .x-admin-tweets-table tr {
        display: grid;
        gap: 9px;
        padding: 13px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
    }

    .talk-admin-table td,
    .comment-admin-table td,
    .post-admin-table td,
    .page-admin-table td,
    .activity-admin-table td,
    .link-admin-table td,
    .activity-integration-table td,
    .activity-sync-log-table td,
    .category-dialog-table td,
    .passkey-table td,
    .dashboard-post-table td,
    .mail-log-table td,
    .telegram-env-table td,
    .x-admin-tweets-table td,
    .talk-admin-table td:last-child,
    .comment-admin-table td:last-child,
    .post-admin-table td:last-child,
    .page-admin-table td:last-child,
    .activity-admin-table td:last-child,
    .link-admin-table td:last-child,
    .activity-integration-table td:last-child,
    .activity-sync-log-table td:last-child,
    .x-admin-tweets-table td:last-child,
    .category-dialog-table td:last-child {
        position: static;
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 0;
        overflow: visible;
        font-size: 13px;
        line-height: 1.55;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .talk-admin-table td::before,
    .comment-admin-table td::before,
    .post-admin-table td::before,
    .page-admin-table td::before,
    .activity-admin-table td::before,
    .link-admin-table td::before,
    .activity-integration-table td::before,
    .activity-sync-log-table td::before,
    .category-dialog-table td::before,
    .passkey-table td::before,
    .dashboard-post-table td::before,
    .mail-log-table td::before,
    .telegram-env-table td::before,
    .x-admin-tweets-table td::before {
        font-size: 12px;
        font-weight: 750;
        line-height: 1.55;
        color: var(--text-muted);
        content: "";
    }

    .talk-admin-table .comment-cell,
    .comment-admin-table .comment-cell,
    .post-admin-table td,
    .page-admin-table td,
    .activity-admin-table td,
    .link-admin-table td,
    .activity-integration-table td,
    .activity-sync-log-table td,
    .dashboard-post-table td,
    .mail-log-table td,
    .telegram-env-table td,
    .x-admin-tweets-table td {
        max-width: none;
        margin: 0;
        text-align: left;
    }

    .talk-admin-table .status,
    .comment-admin-table .status,
    .post-admin-table .status,
    .page-admin-table .status,
    .activity-admin-table .status,
    .link-admin-table .status,
    .activity-integration-table .status,
    .activity-sync-log-table .status,
    .dashboard-post-table .status,
    .mail-log-table .status,
    .telegram-env-table .status,
    .x-admin-tweets-table .status,
    .talk-admin-table .badge,
    .comment-admin-table .badge,
    .post-admin-table .badge,
    .page-admin-table .badge,
    .activity-admin-table .badge,
    .link-admin-table .badge,
    .activity-integration-table .badge,
    .activity-sync-log-table .badge,
    .dashboard-post-table .badge,
    .mail-log-table .badge,
    .telegram-env-table .badge,
    .x-admin-tweets-table .badge {
        justify-self: start;
        width: auto;
        max-width: 100%;
    }

    .talk-admin-table .admin-action-bar,
    .comment-admin-table .admin-action-bar,
    .post-admin-table .post-action-bar,
    .page-admin-table .admin-action-bar,
    .activity-admin-table .admin-action-bar,
    .link-admin-table .admin-action-bar,
    .activity-integration-table .admin-action-bar,
    .activity-sync-log-table .admin-action-bar,
    .x-admin-tweets-table .admin-action-bar,
    .category-dialog-table .admin-action-bar {
        justify-content: flex-start;
        width: auto;
        margin: 0;
    }

    .talk-admin-table td:nth-child(1)::before { content: "序号"; }
    .talk-admin-table td:nth-child(2)::before { content: "内容"; }
    .talk-admin-table td:nth-child(3)::before { content: "公开"; }
    .talk-admin-table td:nth-child(4)::before { content: "时间"; }
    .talk-admin-table td:nth-child(5)::before { content: "操作"; }

    .talk-admin-table tr {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px 12px;
    }

    .talk-admin-table {
        table-layout: auto;
    }

    .talk-admin-table td:nth-child(1),
    .talk-admin-table td:nth-child(4) {
        display: inline-flex;
        gap: 6px;
        align-items: center;
        width: auto;
        font-size: 12px;
        color: var(--text-muted);
    }

    .talk-admin-table td:nth-child(1) {
        grid-row: 1;
        grid-column: 1;
    }

    .talk-admin-table td:nth-child(4) {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
        text-align: right;
    }

    .talk-admin-table td:nth-child(4)::before,
    .talk-admin-table td:nth-child(2)::before,
    .talk-admin-table td:nth-child(5)::before {
        content: none;
    }

    .talk-admin-table td:nth-child(2) {
        grid-row: 2;
        grid-column: 1 / -1;
        display: block;
        font-size: 14px;
        line-height: 1.65;
        color: var(--text);
    }

    .talk-admin-table td:nth-child(3) {
        grid-row: 3;
        grid-column: 2;
        display: inline-flex;
        justify-self: end;
        align-self: end;
        width: auto;
    }

    .talk-admin-table td:nth-child(3)::before {
        content: none;
    }

    .talk-admin-table td:nth-child(5) {
        grid-row: 3;
        grid-column: 1;
        display: block;
        padding-top: 2px;
    }

    .talk-admin-table td:nth-child(5) .admin-action-bar {
        justify-content: flex-start;
    }

    .comment-admin-table td:nth-child(1)::before { content: "ID"; }
    .comment-admin-table td:nth-child(2)::before { content: "用户"; }
    .comment-admin-table td:nth-child(3)::before { content: "目标"; }
    .comment-admin-table td:nth-child(4)::before { content: "内容"; }
    .comment-admin-table td:nth-child(5)::before { content: "状态"; }
    .comment-admin-table td:nth-child(6)::before { content: "时间"; }
    .comment-admin-table td:nth-child(7)::before { content: "操作"; }

    .comment-admin-table tr {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 12px;
    }

    .comment-admin-table {
        table-layout: auto;
    }

    .comment-admin-table td:nth-child(1),
    .comment-admin-table td:nth-child(2),
    .comment-admin-table td:nth-child(3),
    .comment-admin-table td:nth-child(4),
    .comment-admin-table td:nth-child(5),
    .comment-admin-table td:nth-child(6),
    .comment-admin-table td:nth-child(7),
    .comment-admin-table td:last-child {
        display: inline-flex;
        grid-template-columns: none;
        gap: 0;
        align-items: center;
        width: auto;
        min-width: 0;
        padding: 0;
    }

    .comment-admin-table td:nth-child(1)::before,
    .comment-admin-table td:nth-child(5)::before,
    .comment-admin-table td:nth-child(6)::before,
    .comment-admin-table td:nth-child(7)::before {
        content: none;
    }

    .comment-admin-table td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 750;
    }

    .comment-admin-table td:nth-child(1)::after {
        content: "ID";
        order: -1;
        margin-right: 5px;
        color: var(--text-soft);
        font-weight: 700;
    }

    .comment-admin-table td:nth-child(6) {
        grid-column: 2 / 4;
        grid-row: 1;
        justify-self: end;
        color: var(--text-muted);
        font-size: 12px;
        white-space: nowrap;
    }

    .comment-admin-table td:nth-child(5) {
        grid-column: 3;
        grid-row: 5;
        justify-self: end;
        align-self: end;
    }

    .comment-admin-table td:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .comment-admin-table td:nth-child(2)::before,
    .comment-admin-table td:nth-child(3)::before,
    .comment-admin-table td:nth-child(4)::before {
        margin-right: 8px;
    }

    .comment-admin-table td:nth-child(3) {
        grid-column: 1 / -1;
        grid-row: 3;
        overflow: hidden;
    }

    .comment-admin-table td:nth-child(4) {
        grid-column: 1 / -1;
        grid-row: 4;
    }

    .comment-admin-table td:nth-child(7) {
        grid-column: 1 / 3;
        grid-row: 5;
    }

    .comment-admin-table .cmt-user-flag,
    .comment-admin-table .cmt-user-ip,
    .comment-admin-table .cmt-user-email,
    .comment-admin-table .avatar {
        display: none;
    }

    .comment-admin-table .cmt-user-name {
        font-weight: 650;
    }

    .post-admin-table td:nth-child(1)::before { content: "选择"; }
    .post-admin-table td:nth-child(2)::before { content: "ID"; }
    .post-admin-table td:nth-child(3)::before { content: "标题"; }
    .post-admin-table td:nth-child(4)::before { content: "分类"; }
    .post-admin-table td:nth-child(5)::before { content: "浏览"; }
    .post-admin-table td:nth-child(6)::before { content: "评论"; }
    .post-admin-table td:nth-child(7)::before { content: "状态"; }
    .post-admin-table td:nth-child(8)::before { content: "发布时间"; }
    .post-admin-table td:nth-child(9)::before { content: "操作"; }

    .post-admin-table tr {
        grid-template-columns: minmax(0, 1fr) auto auto auto;
        gap: 9px 12px;
        padding: 13px;
    }

    .post-admin-table td:nth-child(1),
    .post-admin-table td:nth-child(2) {
        display: none;
    }

    .post-admin-table td:nth-child(3),
    .post-admin-table td:nth-child(4),
    .post-admin-table td:nth-child(5),
    .post-admin-table td:nth-child(6),
    .post-admin-table td:nth-child(7),
    .post-admin-table td:nth-child(8),
    .post-admin-table td:nth-child(9),
    .post-admin-table td:last-child {
        display: inline-flex;
        grid-template-columns: none;
        gap: 0;
        align-items: center;
        width: auto;
        min-width: 0;
        padding: 0;
    }

    .post-admin-table td:nth-child(3)::before,
    .post-admin-table td:nth-child(7)::before,
    .post-admin-table td:nth-child(9)::before {
        content: none;
    }

    .post-admin-table td:nth-child(3) {
        grid-column: 1 / 4;
        grid-row: 1;
        align-self: center;
        overflow: hidden;
    }

    .post-admin-table td:nth-child(3) a {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: 15px;
        font-weight: 720;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .post-admin-table td:nth-child(7) {
        grid-column: 4;
        grid-row: 1;
        justify-self: end;
    }

    .post-admin-table td:nth-child(4),
    .post-admin-table td:nth-child(8),
    .post-admin-table td:nth-child(5),
    .post-admin-table td:nth-child(6) {
        color: var(--text-muted);
        font-size: 12px;
        line-height: 1.4;
        white-space: nowrap;
    }

    .post-admin-table td:nth-child(4)::before,
    .post-admin-table td:nth-child(8)::before,
    .post-admin-table td:nth-child(5)::before,
    .post-admin-table td:nth-child(6)::before {
        margin-right: 5px;
        font-size: 12px;
        font-weight: 700;
        color: var(--text-soft);
    }

    .post-admin-table td:nth-child(4) {
        grid-column: 1;
        grid-row: 2;
    }

    .post-admin-table td:nth-child(8) {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .post-admin-table td:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
        justify-self: center;
    }

    .post-admin-table td:nth-child(6) {
        grid-column: 3 / 5;
        grid-row: 2;
        justify-self: end;
    }

    .post-admin-table td:nth-child(9) {
        grid-column: 1 / -1;
        grid-row: 4;
        padding-top: 2px;
    }

    .post-admin-table .post-action-bar {
        display: grid;
        grid-template-columns: repeat(4, 38px);
        gap: 8px;
        width: auto;
    }

    .post-admin-table .post-action-btn {
        width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .page-admin-table td:nth-child(1)::before { content: "ID"; }
    .page-admin-table td:nth-child(2)::before { content: "标题"; }
    .page-admin-table td:nth-child(3)::before { content: "类型"; }
    .page-admin-table td:nth-child(4)::before { content: "Slug"; }
    .page-admin-table td:nth-child(5)::before { content: "菜单"; }
    .page-admin-table td:nth-child(6)::before { content: "排序"; }
    .page-admin-table td:nth-child(7)::before { content: "浏览"; }
    .page-admin-table td:nth-child(8)::before { content: "操作"; }

    .page-admin-table tr {
        grid-template-columns: auto auto minmax(0, 1fr);
        gap: 10px 12px;
    }

    .page-admin-table td:nth-child(1),
    .page-admin-table td:nth-child(3),
    .page-admin-table td:nth-child(5) {
        display: inline-flex;
        gap: 6px;
        align-items: center;
        width: auto;
    }

    .page-admin-table td:nth-child(1) {
        grid-row: 1;
        grid-column: 1;
        color: var(--text-muted);
    }

    .page-admin-table td:nth-child(3) {
        grid-row: 1;
        grid-column: 2;
    }

    .page-admin-table td:nth-child(5) {
        grid-row: 1;
        grid-column: 3;
        justify-self: end;
    }

    .page-admin-table td:nth-child(5) .cat-switch {
        width: 40px;
        height: 22px;
    }

    .page-admin-table td:nth-child(5) .cat-switch-slider {
        flex-basis: 40px;
        width: 40px;
        height: 22px;
    }

    .page-admin-table td:nth-child(5) .cat-switch-slider::before {
        width: 18px;
        height: 18px;
    }

    .page-admin-table td:nth-child(5) .cat-switch input:checked + .cat-switch-slider::before {
        transform: translateX(18px);
    }

    .page-admin-table td:nth-child(1)::before,
    .page-admin-table td:nth-child(3)::before,
    .page-admin-table td:nth-child(5)::before,
    .page-admin-table td:nth-child(2)::before,
    .page-admin-table td:nth-child(8)::before {
        content: none;
    }

    .page-admin-table td:nth-child(2) {
        grid-row: 2;
        grid-column: 1 / -1;
        display: block;
        font-size: 15px;
        font-weight: 720;
    }

    .page-admin-table td:nth-child(2) a {
        display: inline-flex;
        gap: 8px;
        align-items: center;
        max-width: 100%;
        text-decoration: none;
    }

    .page-admin-table td:nth-child(4),
    .page-admin-table td:nth-child(6),
    .page-admin-table td:nth-child(7) {
        grid-row: 3;
        display: inline-flex;
        gap: 5px;
        align-items: center;
        width: auto;
        font-size: 12px;
        color: var(--text-muted);
    }

    .page-admin-table td:nth-child(4) {
        grid-column: 1 / 2;
    }

    .page-admin-table td:nth-child(6) {
        grid-column: 2 / 3;
    }

    .page-admin-table td:nth-child(7) {
        grid-column: 3 / 4;
        justify-self: end;
    }

    .page-admin-table td:nth-child(4) code {
        max-width: 120px;
        padding: 0;
        overflow: hidden;
        font-size: 12px;
        color: var(--text-muted);
        text-overflow: ellipsis;
        white-space: nowrap;
        background: transparent;
    }

    .page-admin-table td:nth-child(8) {
        grid-row: 4;
        grid-column: 1 / -1;
        display: block;
        padding-top: 2px;
    }

    .page-admin-table tr {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 10px;
        align-items: center;
    }

    .page-admin-table td:nth-child(1),
    .page-admin-table td:nth-child(3),
    .page-admin-table td:nth-child(4),
    .page-admin-table td:nth-child(6),
    .page-admin-table td:nth-child(7) {
        display: none;
    }

    .page-admin-table td:nth-child(2) {
        grid-row: 1;
        grid-column: 1;
        min-width: 0;
        font-size: 15px;
        font-weight: 720;
    }

    .page-admin-table td:nth-child(2) a {
        display: inline-flex;
        gap: 8px;
        align-items: center;
        max-width: 100%;
    }

    .page-admin-table td:nth-child(2) a i {
        flex: 0 0 auto;
        color: var(--primary);
    }

    .page-admin-table td:nth-child(2) a {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .page-admin-table td:nth-child(5) {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
    }

    .page-admin-table td:nth-child(8) {
        grid-row: 1;
        grid-column: 3;
        display: block;
        padding: 0;
    }

    .page-admin-table td:nth-child(8) .admin-action-bar {
        justify-content: flex-end;
        gap: 0;
    }

    .page-admin-table td:nth-child(8) .admin-action-delete {
        display: none;
    }

    .activity-admin-table td:nth-child(1)::before { content: "ID"; }
    .activity-admin-table td:nth-child(2)::before { content: "动态"; }
    .activity-admin-table td:nth-child(3)::before { content: "类型"; }
    .activity-admin-table td:nth-child(4)::before { content: "来源"; }
    .activity-admin-table td:nth-child(5)::before { content: "可见性"; }
    .activity-admin-table td:nth-child(6)::before { content: "时间"; }
    .activity-admin-table td:nth-child(7)::before { content: "操作"; }

    .link-admin-table td:nth-child(1)::before { content: "选择"; }
    .link-admin-table td:nth-child(2)::before { content: "ID"; }
    .link-admin-table td:nth-child(3)::before { content: "名称"; }
    .link-admin-table td:nth-child(4)::before { content: "URL"; }
    .link-admin-table td:nth-child(5)::before { content: "RSS"; }
    .link-admin-table td:nth-child(6)::before { content: "排序"; }
    .link-admin-table td:nth-child(7)::before { content: "启用"; }
    .link-admin-table td:nth-child(8)::before { content: "操作"; }

    .activity-integration-table td:nth-child(1)::before { content: "平台"; }
    .activity-integration-table td:nth-child(2)::before { content: "状态"; }
    .activity-integration-table td:nth-child(3)::before { content: "API 信息"; }
    .activity-integration-table td:nth-child(4)::before { content: "频率"; }
    .activity-integration-table td:nth-child(5)::before { content: "最近同步"; }
    .activity-integration-table td:nth-child(6)::before { content: "说明"; }
    .activity-integration-table td:nth-child(7)::before { content: "操作"; }

    .category-dialog-table td:nth-child(1)::before { content: "ID"; }
    .category-dialog-table td:nth-child(2)::before { content: "图标"; }
    .category-dialog-table td:nth-child(3)::before { content: "名称"; }
    .category-dialog-table td:nth-child(4)::before { content: "Slug"; }
    .category-dialog-table td:nth-child(5)::before { content: "文章数"; }
    .category-dialog-table td:nth-child(6)::before { content: "排序"; }
    .category-dialog-table td:nth-child(7)::before { content: "菜单"; }
    .category-dialog-table td:nth-child(8)::before { content: "操作"; }

    .category-dialog-table tr {
        grid-template-columns: 24px minmax(0, 1fr) auto auto;
        gap: 10px;
        align-items: center;
        padding: 11px;
    }

    .category-dialog-table td:nth-child(1),
    .category-dialog-table td:nth-child(4),
    .category-dialog-table td:nth-child(5),
    .category-dialog-table td:nth-child(6) {
        display: none;
    }

    .category-dialog-table td:nth-child(2),
    .category-dialog-table td:nth-child(3),
    .category-dialog-table td:nth-child(7),
    .category-dialog-table td:nth-child(8) {
        display: inline-flex;
        align-items: center;
        width: auto;
        min-width: 0;
    }

    .category-dialog-table td:nth-child(2)::before,
    .category-dialog-table td:nth-child(3)::before,
    .category-dialog-table td:nth-child(7)::before,
    .category-dialog-table td:nth-child(8)::before {
        content: none;
    }

    .category-dialog-table td:nth-child(2) {
        grid-column: 1;
        justify-content: center;
        color: var(--primary);
        font-size: 16px;
    }

    .category-dialog-table td:nth-child(3) {
        grid-column: 2;
        overflow: hidden;
        font-size: 15px;
        font-weight: 720;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .category-dialog-table td:nth-child(7) {
        grid-column: 3;
        justify-self: end;
        align-self: center;
    }

    .category-dialog-table td:nth-child(7) .cat-switch {
        width: 40px;
        height: 22px;
    }

    .category-dialog-table td:nth-child(7) .cat-switch-slider {
        flex-basis: 40px;
        width: 40px;
        height: 22px;
    }

    .category-dialog-table td:nth-child(7) .cat-switch-slider::before {
        width: 18px;
        height: 18px;
    }

    .category-dialog-table td:nth-child(7) .cat-switch input:checked + .cat-switch-slider::before {
        transform: translateX(18px);
    }

    .category-dialog-table td:nth-child(8) {
        grid-column: 4;
        justify-self: end;
        align-self: center;
    }

    .category-dialog-table td:nth-child(8) .admin-action-bar {
        gap: 0;
        justify-content: flex-end;
    }

    .category-dialog-table td:nth-child(8) form {
        display: none;
    }

    .passkey-table td:nth-child(1)::before { content: "绑定时间"; }
    .passkey-table td:nth-child(2)::before { content: "最近使用"; }

    .dashboard-post-table td:nth-child(1)::before { content: "标题"; }
    .dashboard-post-table td:nth-child(2)::before { content: "状态"; }
    .dashboard-post-table td:nth-child(3)::before { content: "浏览"; }
    .dashboard-post-table td:nth-child(4)::before { content: "评论"; }
    .dashboard-post-table td:nth-child(5)::before { content: "时间"; }

    .dashboard-admin-page {
        display: grid;
        gap: 12px;
    }

    .dashboard-admin-page .dashboard-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px;
        margin-bottom: 0;
    }

    .dashboard-admin-page .stat-card {
        min-height: 86px;
        padding: 10px;
    }

    .dashboard-admin-page .stat-card-head {
        gap: 6px;
        align-items: flex-start;
    }

    .dashboard-admin-page .stat-icon {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .dashboard-admin-page .stat-label {
        max-width: 100%;
        overflow: hidden;
        font-size: 11px;
        line-height: 1.25;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-admin-page .stat-num {
        font-size: 22px;
    }

    .dashboard-admin-page .dashboard-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 0;
    }

    .dashboard-admin-page .dashboard-action {
        min-height: 46px;
        padding: 8px 10px;
    }

    .dashboard-admin-page .dashboard-action span {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
    }

    .dashboard-admin-page .admin-row {
        gap: 12px;
    }

    .dashboard-admin-page .admin-col {
        padding: 12px;
    }

    .dashboard-admin-page .admin-col-head {
        gap: 8px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .dashboard-admin-page .admin-col-head h3,
    .dashboard-admin-page .admin-col h3 {
        font-size: 14px;
    }

    .dashboard-admin-page .dashboard-more {
        flex: 0 0 auto;
        min-height: 32px;
        padding: 0 9px;
    }

    .dashboard-post-table tr {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 8px 10px;
        padding: 11px;
    }

    .dashboard-post-table td:nth-child(1),
    .dashboard-post-table td:nth-child(2),
    .dashboard-post-table td:nth-child(3),
    .dashboard-post-table td:nth-child(4),
    .dashboard-post-table td:nth-child(5) {
        display: inline-flex;
        grid-template-columns: none;
        gap: 0;
        align-items: center;
        width: auto;
        min-width: 0;
        padding: 0;
    }

    .dashboard-post-table td:nth-child(1)::before,
    .dashboard-post-table td:nth-child(2)::before {
        content: none;
    }

    .dashboard-post-table td:nth-child(1) {
        grid-column: 1 / 3;
        grid-row: 1;
        overflow: hidden;
    }

    .dashboard-post-table td:nth-child(2) {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .dashboard-post-table td:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
        justify-self: center;
    }

    .dashboard-post-table td:nth-child(4) {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }

    .dashboard-post-table td:nth-child(5) {
        grid-column: 1;
        grid-row: 2;
        color: var(--text-muted);
        font-size: 12px;
    }

    .dashboard-post-table td:nth-child(3)::before,
    .dashboard-post-table td:nth-child(4)::before,
    .dashboard-post-table td:nth-child(5)::before {
        margin-right: 5px;
    }

    .dashboard-admin-page .pending-comments li {
        padding: 10px 0;
    }

    .dashboard-admin-page .pending-comment-head {
        gap: 6px 10px;
    }

    .dashboard-admin-page .pending-comments p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .mail-log-table td:nth-child(1)::before { content: "时间"; }
    .mail-log-table td:nth-child(2)::before { content: "驱动"; }
    .mail-log-table td:nth-child(3)::before { content: "类型"; }
    .mail-log-table td:nth-child(4)::before { content: "收件人"; }
    .mail-log-table td:nth-child(5)::before { content: "主题"; }
    .mail-log-table td:nth-child(6)::before { content: "状态"; }
    .mail-log-table td:nth-child(7)::before { content: "错误"; }

    .telegram-env-table td:nth-child(1)::before { content: "环境变量"; }
    .telegram-env-table td:nth-child(2)::before { content: "是否必填"; }
    .telegram-env-table td:nth-child(3)::before { content: "使用位置"; }
    .telegram-env-table td:nth-child(4)::before { content: "说明"; }

    .activity-sync-log-table td:nth-child(1)::before { content: "平台"; }
    .activity-sync-log-table td:nth-child(2)::before { content: "状态"; }
    .activity-sync-log-table td:nth-child(3)::before { content: "信息"; }
    .activity-sync-log-table td:nth-child(4)::before { content: "开始时间"; }
    .activity-sync-log-table td:nth-child(5)::before { content: "结束时间"; }

    .x-admin-tweets-table td:nth-child(1)::before { content: "作者"; }
    .x-admin-tweets-table td:nth-child(2)::before { content: "内容"; }
    .x-admin-tweets-table td:nth-child(3)::before { content: "时间"; }
    .x-admin-tweets-table td:nth-child(4)::before { content: "互动"; }
    .x-admin-tweets-table td:nth-child(5)::before { content: "操作"; }

    .talk-admin-table td.table-empty,
    .comment-admin-table td.table-empty,
    .post-admin-table td.table-empty,
    .page-admin-table td.table-empty,
    .activity-admin-table td.table-empty,
    .link-admin-table td.table-empty,
    .activity-integration-table td.table-empty,
    .activity-sync-log-table td.table-empty,
    .category-dialog-table td.table-empty,
    .passkey-table td.table-empty,
    .dashboard-post-table td.table-empty,
    .mail-log-table td.table-empty,
    .telegram-env-table td.table-empty,
    .x-admin-tweets-table td.table-empty,
    .activity-sync-log-table td.empty {
        display: block;
        width: 100%;
        padding: 8px 0;
        text-align: center;
    }

    .talk-admin-table td.table-empty::before,
    .comment-admin-table td.table-empty::before,
    .post-admin-table td.table-empty::before,
    .page-admin-table td.table-empty::before,
    .activity-admin-table td.table-empty::before,
    .link-admin-table td.table-empty::before,
    .activity-integration-table td.table-empty::before,
    .activity-sync-log-table td.table-empty::before,
    .category-dialog-table td.table-empty::before,
    .passkey-table td.table-empty::before,
    .dashboard-post-table td.table-empty::before,
    .mail-log-table td.table-empty::before,
    .telegram-env-table td.table-empty::before,
    .x-admin-tweets-table td.table-empty::before,
    .activity-sync-log-table td.empty::before {
        content: none;
    }
}

@media (max-width: 820px) {
    .post-admin-toolbar {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        overflow: visible;
    }

    .post-admin-toolbar > .btn,
    .post-admin-toolbar > button,
    .post-admin-toolbar > a {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding-inline: 8px;
        overflow: hidden;
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .post-admin-toolbar .post-admin-search {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .post-admin-toolbar .post-admin-search input {
        grid-column: span 2;
    }

    .post-admin-toolbar .post-admin-search input,
    .post-admin-toolbar .post-admin-search select,
    .post-admin-toolbar .post-admin-search button {
        width: 100%;
        min-width: 0;
        height: 36px;
        min-height: 36px;
    }

    .post-admin-toolbar .post-admin-search select {
        padding-right: 28px;
        color: var(--text);
        appearance: none;
        background-color: #fff;
        background-image:
            linear-gradient(45deg, transparent 50%, #64748b 50%),
            linear-gradient(135deg, #64748b 50%, transparent 50%);
        background-repeat: no-repeat;
        background-position:
            calc(100% - 18px) 50%,
            calc(100% - 13px) 50%;
        background-size:
            5px 5px,
            5px 5px;
    }

    .post-admin-toolbar .post-admin-search button {
        padding-inline: 8px;
    }

    .activity-admin-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        overflow: visible;
    }

    .activity-admin-toolbar .btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding-inline: 10px;
    }

    .music-editor-form {
        padding: 14px;
    }

    .music-editor-form .form-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .music-editor-form .form-group {
        min-width: 0;
    }

    .music-editor-form .admin-upload-field {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px;
        gap: 8px;
        align-items: stretch;
    }

    .music-editor-form .admin-upload-field input[type="text"],
    .music-editor-form .admin-upload-field input[type="url"] {
        height: 38px;
        min-height: 38px;
    }

    .music-editor-form .admin-upload-field-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .music-editor-form textarea[name="lyrics"] {
        min-height: 132px;
        height: 132px;
    }

    .music-editor-form .form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 14px;
    }

    .music-editor-form .form-actions .btn,
    .music-editor-form .form-actions button,
    .music-editor-form .form-actions a {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .music-admin-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        width: 100%;
        overflow: visible;
    }

    .music-admin-toolbar > .admin-action-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .music-admin-toolbar > .admin-action-bar .btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding-inline: 10px;
    }

    .music-admin-toolbar .music-admin-search {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 36px;
        gap: 8px;
        width: 100%;
        max-width: none;
    }

    .music-admin-toolbar .music-admin-search input[type="search"] {
        width: 100%;
        min-width: 0;
        height: 36px;
        min-height: 36px;
    }

    .music-admin-toolbar .music-admin-search button,
    .music-admin-toolbar .music-admin-search .btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .music-admin-toolbar .music-admin-search button {
        height: 36px;
        padding: 0;
        aspect-ratio: 1 / 1;
    }

    .music-admin-toolbar .music-admin-search button span {
        display: none;
    }

    .music-admin-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px;
    }

    .music-admin-card {
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr) 30px;
        grid-template-rows: auto auto;
        gap: 6px 10px;
        align-items: stretch;
        padding: 10px;
        overflow: hidden;
    }

    .music-admin-cover {
        grid-row: 1 / 3;
        grid-column: 1;
        align-self: center;
        width: 52px;
        height: 52px;
    }

    .music-admin-card-main {
        display: contents;
        min-width: 0;
    }

    .music-admin-card-head {
        grid-row: 1;
        grid-column: 2;
        align-self: center;
        display: block;
        min-width: 0;
        padding-bottom: 0;
    }

    .music-admin-title-block {
        display: flex;
        gap: 6px;
        align-items: baseline;
        width: 100%;
        min-width: 0;
    }

    .music-admin-title-block strong {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: 15px;
        line-height: 1.25;
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .music-admin-title-block span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: 12px;
        line-height: 1.25;
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .music-admin-footer {
        display: contents !important;
        width: auto;
        max-width: 100%;
    }

    .music-admin-stats {
        grid-row: 2;
        grid-column: 2 / 4;
        justify-self: start;
        display: inline-flex;
        flex: 0 1 auto;
        flex-wrap: nowrap;
        gap: 8px;
        min-width: 0;
    }

    .music-admin-stats span {
        flex: 0 0 auto;
    }

    .music-admin-card-actions {
        grid-row: 1;
        grid-column: 3;
        justify-self: end;
        align-self: center;
        display: inline-flex;
        flex: 0 0 auto;
        margin: 0;
    }

    .music-share-trigger.admin-action-btn {
        flex: 0 0 30px;
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        padding: 0;
    }
}

@media (max-width: 420px) {
    .music-editor-form {
        padding: 12px;
    }

    .music-editor-form .admin-upload-field {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    .music-editor-form .admin-upload-field input[type="text"],
    .music-editor-form .admin-upload-field input[type="url"],
    .music-editor-form .admin-upload-field-btn {
        height: 34px;
        min-height: 34px;
    }

    .music-editor-form .admin-upload-field-btn {
        width: 34px;
        min-width: 34px;
    }

    .music-editor-form textarea[name="lyrics"] {
        min-height: 112px;
        height: 112px;
    }

    .music-admin-toolbar .music-admin-search {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    .music-admin-toolbar .music-admin-search input[type="search"],
    .music-admin-toolbar .music-admin-search button {
        height: 34px;
        min-height: 34px;
    }

    .music-admin-card {
        grid-template-columns: 48px minmax(0, 1fr) 28px;
        gap: 5px 9px;
        padding: 9px;
    }

    .music-admin-cover {
        width: 48px;
        height: 48px;
    }

    .music-admin-title-block strong {
        font-size: 13px;
    }

    .music-admin-title-block span {
        font-size: 11px;
    }

    .music-share-trigger.admin-action-btn {
        flex-basis: 28px;
        width: 28px;
        min-width: 28px;
        height: 28px;
        min-height: 28px;
    }
}

@media (max-width: 820px) {
    .admin-sidebar {
        position: sticky;
        top: 0;
        z-index: 100;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        width: 100%;
        height: auto;
        padding: 8px 10px 10px;
        overflow: hidden;
        background: #fff;
        border-bottom: 1px solid var(--border);
    }

    .admin-brand,
    .admin-sidebar-footer,
    .admin-menu .menu-group,
    .admin-menu-branch-toggle,
    .admin-menu-children {
        display: none !important;
    }

    .admin-sidebar-search {
        display: flex;
        order: 3;
        min-height: 34px;
        margin: 0;
        border-radius: var(--radius);
    }

    .admin-mobile-menu-toggle {
        display: inline-flex;
        order: 2;
        gap: 7px;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 34px;
        padding: 0 10px;
        font: inherit;
        font-size: 12px;
        font-weight: 650;
        color: var(--text-soft);
        cursor: pointer;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }

    .admin-mobile-menu-toggle i {
        color: var(--primary);
    }

    .admin-menu {
        display: flex;
        order: 1;
        gap: 6px;
        width: 100%;
        max-height: 40px;
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .admin-sidebar.is-mobile-menu-open .admin-menu {
        flex-wrap: wrap;
        max-height: none;
        overflow: visible;
    }

    .admin-menu::-webkit-scrollbar {
        display: none;
    }

    .admin-menu-branch {
        flex: 0 0 auto;
    }

    .admin-menu-branch-head {
        display: block;
    }

    .admin-menu a,
    .admin-menu-branch-head a {
        display: inline-flex;
        flex: 0 0 auto;
        gap: 0;
        align-items: center;
        justify-content: center;
        width: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0;
        margin: 0;
        border-radius: 0;
    }

    .admin-menu a span,
    .admin-menu-branch-head a span {
        display: none !important;
    }

    .admin-menu a i,
    .admin-menu-branch-head a i {
        width: 20px;
        height: 20px;
        font-size: 15px;
    }

    .admin-menu a.active,
    .admin-menu-branch-head a.active {
        color: #fff;
        background: var(--primary);
        border-color: var(--primary);
        border-radius: 0;
    }

    .admin-menu a.active i,
    .admin-menu-branch-head a.active i {
        color: #fff;
    }
}

@media (max-width: 480px) {
    .dashboard-admin-page .dashboard-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .dashboard-admin-page .stat-card {
        display: flex;
        gap: 8px;
        min-height: 0;
        padding: 9px 7px;
    }

    .dashboard-admin-page .stat-card-head {
        gap: 5px;
    }

    .dashboard-admin-page .stat-icon {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .dashboard-admin-page .stat-label {
        font-size: 10px;
    }

    .dashboard-admin-page .stat-num {
        font-size: 20px;
    }
}

@media (max-width: 820px) {
    .resource-page-shell .resource-page-head {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
    }

    .resource-page-shell .resource-page-head > div {
        min-width: 0;
        padding: 10px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }

    .resource-page-shell .resource-page-head code {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .plugin-card-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        width: 100%;
        padding: 0;
    }

    .plugin-card-form,
    .plugin-card {
        width: 100%;
        max-width: none;
    }

    .plugin-card .resource-card-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px 10px;
        padding: 12px;
    }

    .plugin-main {
        display: contents;
    }

    .plugin-name {
        grid-column: 1;
        grid-row: 1;
        align-items: start;
        min-width: 0;
    }

    .plugin-desc {
        display: block;
        grid-column: 1 / -1;
        grid-row: 2;
        overflow: visible;
        width: 100%;
        white-space: normal;
    }

    .plugin-meta {
        min-width: 0;
        font-size: 12px;
        line-height: 1.3;
        white-space: nowrap;
    }

    .plugin-key {
        display: none;
    }

    .plugin-meta-row {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        flex-wrap: nowrap;
        gap: 14px;
        align-self: center;
        justify-content: flex-end;
        min-width: 0;
    }

    .plugin-version::before {
        margin-right: 6px;
        font-weight: 700;
        color: var(--text-soft);
        content: "版本";
    }

}

@media (max-width: 420px) {
    .resource-page-shell .resource-page-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .plugin-meta-row {
        gap: 12px;
    }
}

@media (max-width: 820px) {
    .link-admin-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
    }

    .link-admin-toolbar .btn {
        justify-content: center;
        width: 100%;
        min-width: 0;
        padding: 0 10px;
    }

    .link-admin-toolbar #link-selected-count {
        display: block;
        grid-column: 1 / -1;
        text-align: center;
    }

    .link-rss-progress {
        padding: 12px;
        margin-bottom: 10px;
        border-radius: var(--radius);
    }

    .link-rss-progress-head,
    .link-rss-progress-meta {
        display: grid;
        gap: 4px;
        text-align: left;
    }

    #new-link-form {
        padding: 14px;
    }

    #new-link-form .form-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    #new-link-form .form-group {
        min-width: 0;
    }

    #new-link-form .form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #new-link-form .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .link-admin-table tr {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 12px;
    }

    .link-admin-table td:nth-child(2),
    .link-admin-table td:nth-child(7) {
        display: none;
    }

    .link-admin-table td:nth-child(1) {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        align-items: center;
        justify-content: center;
    }

    .link-admin-table td:nth-child(1)::before,
    .link-admin-table td:nth-child(3)::before,
    .link-admin-table td:nth-child(8)::before,
    .link-admin-table td:nth-child(9)::before {
        content: none;
    }

    .link-admin-table td:nth-child(3) {
        display: block;
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        min-width: 0;
        overflow: hidden;
        font-size: 15px;
        font-weight: 750;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-admin-table td:nth-child(8) {
        display: flex;
        grid-column: 3;
        grid-row: 1;
        align-items: center;
        justify-content: flex-end;
    }

    .link-admin-table td:nth-child(4),
    .link-admin-table td:nth-child(5),
    .link-admin-table td:nth-child(6),
    .link-admin-table td:nth-child(9) {
        grid-column: 1 / -1;
    }

    .link-admin-table td:nth-child(4),
    .link-admin-table td:nth-child(5),
    .link-admin-table td:nth-child(6) {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 8px;
        color: var(--text-soft);
    }

    .link-admin-table td:nth-child(5) a,
    .link-admin-table .rss-url {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-admin-table .link-rss-inline {
        display: grid;
        gap: 4px;
        min-width: 0;
    }

    .link-admin-table td:nth-child(9) {
        display: flex;
        justify-content: flex-start;
        padding-top: 2px;
    }

    .x-tweet-capture-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .x-tweet-url-field,
    .x-tweet-capture-submit {
        width: 100%;
        min-width: 0;
    }

    .x-tweet-capture-submit {
        justify-content: center;
    }

    .x-admin-tweets-table tr {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 12px;
    }

    .x-admin-tweets-table td:nth-child(1) {
        display: block;
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        min-width: 0;
        overflow: hidden;
        font-size: 14px;
        font-weight: 750;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .x-admin-tweets-table td:nth-child(3) {
        display: block;
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        color: var(--text-muted);
        font-size: 12px;
        white-space: nowrap;
    }

    .x-admin-tweets-table td:nth-child(2) {
        display: block;
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .x-admin-tweets-table td:nth-child(4) {
        display: flex;
        grid-column: 1;
        grid-row: 3;
        gap: 10px;
        align-items: center;
    }

    .x-admin-tweets-table td:nth-child(5) {
        display: flex;
        grid-column: 2;
        grid-row: 3;
        justify-content: flex-end;
    }

    .x-admin-tweets-table td:nth-child(1)::before,
    .x-admin-tweets-table td:nth-child(2)::before,
    .x-admin-tweets-table td:nth-child(3)::before,
    .x-admin-tweets-table td:nth-child(4)::before,
    .x-admin-tweets-table td:nth-child(5)::before {
        content: none;
    }

    .x-admin-tweet-content {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        align-items: start;
    }

    .x-admin-tweet-content > span {
        display: block;
        grid-column: 1;
        overflow: visible;
        text-align: left;
        white-space: normal;
        word-break: break-word;
    }

    .x-admin-tweet-thumbs {
        grid-column: 2;
        grid-template-columns: repeat(4, 44px);
        gap: 6px;
    }

    .x-admin-tweet-thumb {
        width: 44px;
        height: 44px;
    }

    .settings-page-shell {
        max-width: none;
    }

    .settings-page-shell > .admin-form,
    .settings-page-shell > .settings-section,
    .settings-page-shell > .settings-group-title,
    .settings-page-shell > .mail-status-grid,
    .settings-page-shell > .mail-log-panel,
    .settings-page-shell > .admin-toolbar,
    .settings-page-shell > .alert,
    .settings-page-shell > .stat-grid,
    .settings-page-shell > .admin-row,
    .settings-page-shell > .admin-col,
    .settings-page-shell > .resource-page-head,
    .settings-page-shell > .resource-card-grid,
    .settings-page-shell > .admin-empty-state {
        padding-right: 12px;
        padding-left: 12px;
    }

    .settings-page-shell .admin-form {
        padding: 14px;
    }

    .settings-page-shell .settings-section {
        padding: 14px;
    }

    .settings-page-shell .form-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .settings-page-shell .form-group {
        min-width: 0;
    }

    .settings-page-shell .form-group-toggle {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
    }

    .setting-upload-field,
    .favicon-upload-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .setting-upload-field .btn,
    .favicon-upload-row .btn {
        width: 42px;
        min-width: 42px;
        padding: 0;
        font-size: 0;
    }

    .setting-upload-field .btn i,
    .favicon-upload-row .btn i {
        margin: 0;
        font-size: 14px;
    }

    .favicon-upload-row #faviconUploadBtn,
    .avatar-upload-row #avatarUploadBtn {
        grid-column: 2;
        grid-row: 1;
    }

    .favicon-upload-row #faviconUploadStatus,
    .avatar-upload-row #avatarUploadStatus {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .favicon-settings-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .favicon-preview-box {
        justify-self: center;
    }

    .favicon-asset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-page-shell .form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .settings-page-shell .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .profile-header {
        display: grid;
        gap: 12px;
        justify-items: center;
        padding: 14px;
        text-align: center;
    }

    .profile-header .avatar-preview {
        width: 72px;
        height: 72px;
    }

    .profile-avatar-tools {
        width: 100%;
        min-width: 0;
    }

    .avatar-upload-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .avatar-upload-row .btn {
        width: 42px;
        min-width: 42px;
        padding: 0;
        font-size: 0;
    }

    .avatar-upload-row .btn i {
        margin: 0;
        font-size: 14px;
    }

    .profile-section-title-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 0 12px;
    }

    .profile-section-title-actions .btn {
        min-width: 0;
        padding: 0 12px;
        white-space: nowrap;
    }

    .socials-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .socials-toolbar .btn,
    .socials-toolbar .muted {
        width: 100%;
        justify-content: center;
    }

    .socials-presets {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .socials-presets .preset-chip {
        justify-content: center;
        width: 100%;
        min-width: 0;
    }

    .social-row {
        padding: 10px;
    }

    .social-row-grid {
        grid-template-columns: 34px minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .social-row-preview {
        grid-column: 1;
        grid-row: 1;
    }

    .social-row-grid .input-key {
        grid-column: 2;
        grid-row: 1;
    }

    .social-row-grid .btn-remove {
        grid-column: 3;
        grid-row: 1;
        width: 42px;
        height: var(--control-height);
    }

    .social-row-grid .input-url {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .social-row-grid .input-icon {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .social-row-grid .input-label {
        grid-column: 1 / -1;
        grid-row: 4;
    }

    .social-row-grid .social-row-qr {
        grid-column: 1 / -1;
        grid-row: 5;
    }

    .social-row.is-wechat-social .social-row-grid .input-icon {
        grid-row: 2;
    }

    .social-row.is-wechat-social .social-row-grid .social-row-qr {
        grid-row: 3;
    }

    .passkey-table tr {
        gap: 7px;
        padding: 12px;
    }

    .passkey-table td {
        grid-template-columns: 72px minmax(0, 1fr);
    }
}

@media (max-width: 420px) {
    .link-admin-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-page-shell > .admin-form,
    .settings-page-shell > .settings-section,
    .settings-page-shell > .settings-group-title,
    .settings-page-shell > .mail-status-grid,
    .settings-page-shell > .mail-log-panel,
    .settings-page-shell > .admin-toolbar,
    .settings-page-shell > .alert,
    .settings-page-shell > .stat-grid,
    .settings-page-shell > .admin-row,
    .settings-page-shell > .admin-col,
    .settings-page-shell > .resource-page-head,
    .settings-page-shell > .resource-card-grid,
    .settings-page-shell > .admin-empty-state {
        padding-right: 10px;
        padding-left: 10px;
    }

    .socials-presets {
        grid-template-columns: minmax(0, 1fr);
    }

    .favicon-asset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-section-title-actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .profile-section-title-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 820px) {
    .admin-dialog-backdrop {
        display: block;
        padding: 0;
    }

    .admin-dialog-shell {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 100dvh;
        padding: 16px;
    }

    .admin-dialog {
        width: min(100%, 420px);
        max-height: calc(100dvh - 32px);
        border-radius: 12px;
    }

    .admin-dialog-layout {
        align-items: flex-start;
        text-align: left;
    }

    .admin-dialog-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 18px 18px;
    }

    .admin-dialog-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 820px) {
    .settings-page-shell > .plugin-card-grid {
        padding-right: 0;
        padding-left: 0;
    }
}

@media (max-width: 820px) {
    .admin-header {
        box-sizing: border-box;
        width: calc(100% - 24px);
        margin-right: 12px;
        margin-left: 12px;
    }

    .admin-content {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }

    .link-admin-toolbar,
    .link-admin-table,
    .link-admin-table tbody,
    .link-admin-table tr {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }

    .link-admin-table {
        min-width: 0;
        overflow: visible;
    }
}

@media (max-width: 820px) {
    .link-admin-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        padding: 10px;
    }

    .link-admin-toolbar .btn {
        min-width: 0;
        min-height: 38px;
        padding: 0 8px;
        font-size: 13px;
    }

    .link-admin-toolbar #link-selected-count {
        grid-column: 1 / -1;
        padding-top: 2px;
        font-size: 12px;
    }

    #new-link-form {
        margin-top: 10px;
    }

    .link-admin-table tbody {
        gap: 10px;
    }

    .link-admin-table tr {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 9px 10px;
        width: 100%;
        padding: 12px;
    }

    .link-admin-table td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        justify-self: center;
    }

    .link-admin-table td:nth-child(3) {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        overflow: hidden;
        font-size: 15px;
        font-weight: 760;
        color: var(--text);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-admin-table td:nth-child(8) {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
        justify-self: end;
    }

    .link-admin-table td:nth-child(4) {
        grid-column: 1 / -1;
        grid-row: 3;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        min-width: 0;
        color: var(--text-muted);
    }

    .link-admin-table td:nth-child(5) {
        grid-column: 1 / -1;
        grid-row: 2;
        display: block;
        min-width: 0;
        font-size: 13px;
        line-height: 1.45;
    }

    .link-admin-table td:nth-child(6) {
        grid-column: 1 / -1;
        grid-row: 4;
        display: block;
        min-width: 0;
        color: var(--text-muted);
    }

    .link-admin-table td:nth-child(9) {
        grid-column: 1 / -1;
        grid-row: 5;
        display: flex;
        justify-content: flex-start;
        padding-top: 4px;
    }

    .link-admin-table td:nth-child(1)::before,
    .link-admin-table td:nth-child(3)::before,
    .link-admin-table td:nth-child(4)::before,
    .link-admin-table td:nth-child(5)::before,
    .link-admin-table td:nth-child(6)::before,
    .link-admin-table td:nth-child(8)::before,
    .link-admin-table td:nth-child(9)::before {
        content: none;
    }

    .link-admin-table td:nth-child(5) a {
        display: block;
        max-width: 100%;
        overflow: hidden;
        color: var(--primary);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-admin-table .link-rss-inline {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        min-width: 0;
    }

    .link-admin-table .rss-result {
        max-width: 100%;
        font-size: 12px;
    }

    .link-admin-table .rss-url {
        display: block;
        flex: 0 0 100%;
        max-width: 100%;
        margin: 0;
        overflow: hidden;
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-admin-table .admin-action-bar {
        gap: 8px;
        justify-content: flex-start;
    }

    .link-admin-table .admin-action-btn {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
    }
}

@media (max-width: 420px) {
    .link-admin-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .link-admin-table td:nth-child(2),
    .link-admin-table td:nth-child(5),
    .link-admin-table td:nth-child(6),
    .link-admin-table td:nth-child(7) {
        display: none;
    }

    .link-admin-table tr {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .link-admin-table td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .link-admin-table td:nth-child(3) {
        grid-column: 2 / -1;
        grid-row: 1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
    }

    .link-admin-table td:nth-child(4) {
        grid-column: 1 / -1;
        grid-row: 2;
        display: block;
        min-width: 0;
        font-size: 13px;
        line-height: 1.45;
    }

    .link-admin-table td:nth-child(8) {
        grid-column: 1 / -1;
        grid-row: 3;
        display: flex;
        justify-content: flex-start;
        padding-top: 4px;
    }

    .link-admin-table td:nth-child(1)::before,
    .link-admin-table td:nth-child(3)::before,
    .link-admin-table td:nth-child(4)::before,
    .link-admin-table td:nth-child(5)::before,
    .link-admin-table td:nth-child(8)::before {
        content: none;
    }

    .link-admin-table td:nth-child(4) a {
        display: block;
        max-width: 100%;
        overflow: hidden;
        color: var(--primary);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-admin-table .link-name-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .link-admin-table .link-mobile-rss-state {
        display: inline-flex;
        align-items: center;
        justify-self: end;
        margin-left: auto;
        min-width: 0;
    }

    .link-admin-table .link-mobile-rss-state .status {
        min-width: 0;
        padding-right: 7px;
        padding-left: 7px;
        font-size: 11px;
    }

    .link-admin-table .link-mobile-rss-state .rss-updated {
        font-size: 11px;
        line-height: 1;
    }
}

@media (max-width: 820px) {
    .admin-header {
        width: auto;
        max-width: none;
        margin-right: 10px;
        margin-left: 10px;
    }

    .admin-content {
        padding-right: 10px;
        padding-left: 10px;
    }

    .link-admin-toolbar,
    .link-admin-table {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
    }

    .link-admin-table {
        display: block;
        min-width: 0;
        overflow: visible;
        white-space: normal;
    }

    .link-admin-table tbody {
        display: grid;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .link-admin-table tr {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .link-admin-table td {
        min-width: 0;
    }

    .link-admin-table td:nth-child(3) {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 820px) {
    .admin-sidebar {
        gap: 0;
    }

    .admin-sidebar-search {
        display: none !important;
    }

    .admin-menu {
        position: relative;
        order: 1;
        padding-right: 0;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        grid-auto-rows: 40px;
        gap: 0;
        max-height: none;
        overflow: visible;
    }

    .admin-mobile-menu-toggle {
        display: none !important;
        flex: 0 0 40px;
        align-items: center;
        justify-content: center;
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
        margin: 0;
        font: inherit;
        color: var(--text-soft);
        cursor: pointer;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 0;
    }

    .admin-sidebar:not(.is-mobile-menu-open) .admin-menu > a,
    .admin-sidebar.is-mobile-menu-open .admin-menu > a,
    .admin-menu-branch {
        display: inline-flex;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .admin-menu-branch-head,
    .admin-menu-branch-head a {
        width: 100%;
        min-width: 0;
    }

    .admin-mobile-menu-toggle span {
        display: none !important;
    }

    .admin-mobile-menu-toggle i {
        width: 20px;
        height: 20px;
        font-size: 15px;
        color: var(--primary);
    }

    .admin-mobile-menu-toggle:hover,
    .admin-mobile-menu-toggle[aria-expanded="true"] {
        color: #fff;
        background: var(--primary);
        border-color: var(--primary);
    }

    .admin-mobile-menu-toggle:hover i,
    .admin-mobile-menu-toggle[aria-expanded="true"] i {
        color: #fff;
    }

    .admin-header {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
        border-radius: 0;
    }
}

@media (max-width: 820px) {
    .settings-page-shell {
        display: grid;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    .settings-subtabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        padding: 0;
        margin: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .settings-subtabs a {
        width: 100%;
        min-width: 0;
        height: 38px;
        min-height: 38px;
        padding: 0 8px;
        overflow: hidden;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }

    .settings-subtabs a span {
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .settings-page-shell > .admin-form,
    .settings-page-shell > .settings-section,
    .settings-page-shell > .alert,
    .settings-page-shell > .favicon-settings-panel {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        margin: 0;
    }

    .settings-page-shell .admin-form {
        display: grid;
        gap: 12px;
        padding-bottom: 0;
    }

    .settings-page-shell .settings-group-title {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 7px;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        text-align: left;
        padding: 0;
        margin: 4px 0 0;
        font-size: 14px;
        line-height: 1.25;
    }

    .settings-page-shell .settings-group-title::before {
        display: block;
        flex: 0 0 3px;
        width: 3px;
        height: 18px;
        content: "";
        background: var(--primary);
        border-radius: 0;
    }

    .settings-page-shell .settings-group-title i {
        width: 18px;
        min-width: 18px;
        height: 18px;
        font-size: 14px;
    }

    .settings-page-shell .admin-form > .settings-group-title,
    .settings-page-shell .favicon-settings-panel > .settings-group-title {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }

    .settings-page-shell .settings-section {
        display: grid;
        gap: 0;
        padding: 12px;
    }

    .settings-page-shell .form-group {
        display: grid;
        gap: 7px;
        min-width: 0;
        margin-bottom: 14px;
    }

    .settings-page-shell .form-group:last-child {
        margin-bottom: 0;
    }

    .settings-page-shell .form-group > label {
        margin: 0;
        font-size: 12px;
        line-height: 1.3;
    }

    .settings-page-shell .admin-form input[type="text"],
    .settings-page-shell .admin-form input[type="url"],
    .settings-page-shell .admin-form input[type="password"],
    .settings-page-shell .admin-form input[type="number"],
    .settings-page-shell .admin-form select,
    .settings-page-shell .admin-form textarea {
        width: 100%;
        min-width: 0;
        font-size: 13px;
    }

    .settings-page-shell .form-group-toggle {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
    }

    .settings-page-shell .form-group-toggle > label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .settings-page-shell .toggle-switch {
        justify-self: end;
    }

    .settings-page-shell .toggle-state {
        display: none;
    }

    .setting-upload-field {
        grid-template-columns: minmax(0, 1fr) 40px;
        gap: 8px;
    }

    .setting-upload-field .btn {
        display: inline-flex;
        gap: 0;
        align-items: center;
        justify-content: center;
        width: 40px;
        min-width: 40px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        font-size: 0;
    }

    .setting-upload-field .btn i {
        display: inline-grid;
        place-items: center;
        width: 16px;
        height: 16px;
        margin: 0;
        font-size: 14px;
        line-height: 1;
    }

    .field-hint {
        margin-top: 0;
        font-size: 11px;
        line-height: 1.45;
    }

    .favicon-settings-body {
        display: grid;
        grid-template-columns: 74px minmax(0, 1fr);
        gap: 10px 12px;
        align-items: start;
    }

    .favicon-preview-box {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        width: 74px;
        height: 74px;
    }

    .favicon-preview-box img {
        width: 52px;
        height: 52px;
    }

    .favicon-settings-main {
        display: contents;
    }

    .favicon-upload-row {
        display: grid;
        grid-column: 1 / -1;
        grid-row: 3;
        min-width: 0;
    }

    .favicon-upload-row:has(#faviconUploadStatus:empty) {
        display: none;
    }

    .favicon-preview-upload {
        right: 6px;
        bottom: 6px;
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
    }

    .favicon-preview-upload i {
        width: 14px;
        height: 14px;
        font-size: 13px;
        line-height: 14px;
    }

    .favicon-upload-row {
        align-items: start;
        min-width: 0;
    }

    .favicon-upload-row #faviconUploadStatus {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        min-width: 0;
        overflow: hidden;
        font-size: 12px;
        line-height: 1.4;
        text-overflow: ellipsis;
        white-space: normal;
    }

    .favicon-alert {
        grid-column: 1 / -1;
        grid-row: 4;
    }

    .favicon-asset-grid {
        display: grid;
        grid-column: 2;
        grid-row: 1;
        align-self: stretch;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        margin-top: 0;
    }

    .favicon-settings-main > .field-hint {
        grid-column: 1 / -1;
        grid-row: 5;
        margin-top: 0;
    }

    .favicon-asset {
        justify-content: center;
        min-height: 0;
        height: 34px;
        padding: 0 6px;
        overflow: hidden;
        font-size: 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .favicon-asset i {
        flex: 0 0 auto;
        font-size: 9px;
    }

    .settings-page-shell .form-actions {
        position: sticky;
        bottom: 0;
        z-index: 30;
        display: block;
        padding: 10px 12px;
        margin: 0 -12px;
        background: rgba(255, 255, 255, 0.94);
        border-top: 1px solid var(--border);
    }

    .settings-page-shell .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .settings-subtabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-subtabs a:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    #faviconUploadBtn.favicon-preview-upload {
        position: absolute;
        right: 6px;
        bottom: 6px;
        display: inline-grid;
        grid-column: auto;
        grid-row: auto;
        place-items: center;
        width: 30px;
        min-width: 30px;
        max-width: 30px;
        height: 30px;
        min-height: 30px;
        padding: 0;
        overflow: hidden;
        font-size: 0;
        line-height: 1;
        border-radius: 4px;
    }

    #faviconUploadBtn,
    #siteLogoUploadBtn {
        display: grid;
        place-items: center;
        gap: 0;
        line-height: 1;
    }

    #faviconUploadBtn i,
    #siteLogoUploadBtn i {
        display: inline-grid;
        place-items: center;
        width: 16px;
        height: 16px;
        margin: 0;
        font-size: 14px;
        line-height: 16px;
        text-align: center;
    }

    .settings-page-shell .favicon-asset-grid {
        display: grid;
        width: auto;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        gap: 6px;
    }

    .settings-page-shell .favicon-asset {
        grid-column: span 3;
        justify-content: center;
        height: 34px;
        min-height: 34px;
        padding: 0 5px;
        font-size: 10px;
        line-height: 1;
    }

    .settings-page-shell .favicon-asset i {
        font-size: 9px;
    }

    .settings-page-shell .favicon-asset:nth-child(n + 5) {
        grid-column: span 4;
    }
}

@media (max-width: 820px) {
    .profile-page-shell {
        display: grid;
        gap: 12px;
    }

    .profile-page-shell .profile-form,
    .profile-page-shell .profile-settings-section,
    .profile-page-shell .profile-section-title {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .profile-page-shell .profile-form {
        padding: 12px;
    }

    .profile-page-shell .profile-header {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        justify-items: stretch;
        padding: 12px;
        margin: 0 0 12px;
        text-align: left;
    }

    .profile-page-shell .profile-header .avatar-preview {
        width: 64px;
        height: 64px;
    }

    .profile-page-shell .profile-avatar-tools {
        display: grid;
        gap: 8px;
        width: 100%;
        min-width: 0;
    }

    .profile-page-shell .profile-avatar-tools > p {
        margin: 0;
        font-size: 11px;
        line-height: 1.45;
    }

    .profile-page-shell .avatar-upload-row {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        margin: 0;
    }

    .profile-page-shell #avatarUploadBtn {
        display: grid;
        place-items: center;
        grid-column: 1;
        grid-row: 1;
        width: 40px;
        min-width: 40px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        gap: 0;
        font-size: 0;
        line-height: 1;
    }

    .profile-page-shell #avatarUploadBtn i {
        width: 1em;
        height: 1em;
        margin: 0;
        font-size: 14px;
        line-height: 1;
    }

    .profile-page-shell #avatarUploadStatus {
        grid-column: 2;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-page-shell .form-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .profile-page-shell .form-group {
        min-width: 0;
        margin-bottom: 14px;
    }

    .profile-page-shell .settings-section {
        padding: 12px;
    }

    .profile-page-shell .settings-section > p {
        margin: 0 0 10px;
        line-height: 1.5;
    }

    .profile-page-shell .socials-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin-top: 10px;
    }

    .profile-page-shell .socials-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .profile-page-shell .socials-toolbar .muted {
        display: none;
    }

    .profile-page-shell .socials-presets {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .profile-page-shell .socials-presets .preset-chip {
        justify-content: center;
        min-width: 0;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .profile-page-shell #socials-list {
        gap: 8px;
        margin: 10px 0;
    }

    .profile-page-shell .social-row {
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .profile-page-shell .social-row-grid {
        grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 40px;
        gap: 8px;
    }

    .profile-page-shell .social-row-preview {
        grid-column: 1;
        grid-row: 1;
    }

    .profile-page-shell .social-row-grid .input-key {
        grid-column: 2;
        grid-row: 1;
    }

    .profile-page-shell .social-row-grid .input-label {
        grid-column: 2 / 4;
        grid-row: 1;
    }

    .profile-page-shell .social-row-grid .btn-remove {
        display: grid;
        grid-column: 4;
        grid-row: 1;
        place-items: center;
        width: 40px;
        min-width: 40px;
        height: var(--control-height);
        padding: 0;
    }

    .profile-page-shell .social-row-grid .input-url,
    .profile-page-shell .social-row-grid .input-icon {
        grid-column: 1 / -1;
    }

    .profile-page-shell .social-row-grid .input-url {
        grid-row: 2;
    }

    .profile-page-shell .social-row-grid .input-icon {
        grid-row: 3;
    }

    .profile-page-shell .social-row-grid .social-row-qr {
        grid-column: 1 / -1;
        grid-row: 4;
    }

    .profile-page-shell .social-row.is-wechat-social .social-row-grid .input-icon {
        grid-row: 2;
    }

    .profile-page-shell .social-row.is-wechat-social .social-row-grid .social-row-qr {
        grid-row: 3;
    }

    .profile-page-shell .profile-section-title-actions {
        display: grid;
        grid-template-columns: 3px minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        padding: 0;
    }

    .profile-page-shell .profile-section-title-actions::before {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    .profile-page-shell .profile-section-title-actions > span {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
        gap: 7px;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
        text-align: left;
    }

    .profile-page-shell .profile-section-title-actions .btn {
        grid-column: 1 / -1;
        grid-row: 2;
        width: auto;
        min-width: 0;
        padding: 0 10px;
        white-space: nowrap;
    }

    .profile-page-shell .passkey-table tr {
        gap: 7px;
        padding: 12px;
    }

    .profile-page-shell .passkey-table td {
        grid-template-columns: 72px minmax(0, 1fr);
    }
}

@media (max-width: 420px) {
    .profile-page-shell .socials-presets {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-page-shell .profile-section-title-actions {
        grid-template-columns: 3px minmax(0, 1fr);
    }

    .profile-page-shell .profile-section-title-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 820px) {
    .profile-page-shell .profile-section-title-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        justify-content: flex-start;
        padding: 0;
        line-height: 1;
    }

    .profile-page-shell .profile-section-title-actions::before {
        flex: 0 0 3px;
        width: 3px;
        height: 18px;
        align-self: center;
        margin: 0;
    }

    .profile-page-shell .profile-section-title-actions > span {
        display: inline-flex;
        flex: 1 1 calc(100% - 11px);
        gap: 7px;
        align-items: center;
        min-width: 0;
        height: 24px;
        line-height: 24px;
    }

    .profile-page-shell .profile-section-title-actions > span i {
        display: inline-grid;
        flex: 0 0 18px;
        place-items: center;
        width: 18px;
        height: 18px;
        margin: 0;
        font-size: 15px;
        line-height: 1;
    }

    .profile-page-shell .profile-section-title-actions .btn {
        flex: 0 0 100%;
        width: 100%;
        margin: 0;
        justify-content: center;
    }
}

@media (max-width: 820px) {
    .admin-page-title h2,
    .admin-form-title,
    .admin-modal-head h3,
    .admin-col h3,
    .settings-page-shell .settings-group-title,
    .profile-page-shell .profile-section-title {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        min-height: 24px;
        padding: 0;
        margin: 4px 0 0;
        font-size: 14px;
        line-height: 24px;
        text-align: left;
    }

    .admin-form-title::before,
    .admin-col h3::before,
    .settings-page-shell .settings-group-title::before,
    .profile-page-shell .profile-section-title::before {
        display: block;
        flex: 0 0 3px;
        width: 3px;
        height: 18px;
        margin: 0;
        content: "";
        background: var(--primary);
        border-radius: 0;
    }

    .admin-page-title h2 i,
    .admin-form-title > i,
    .admin-modal-head h3 > i,
    .admin-col h3 > i,
    .settings-page-shell .settings-group-title > i,
    .profile-page-shell .profile-section-title > i,
    .profile-page-shell .profile-section-title > span > i {
        display: inline-grid;
        flex: 0 0 18px;
        place-items: center;
        width: 18px;
        height: 18px;
        margin: 0;
        font-size: 15px;
        line-height: 1;
        color: var(--primary);
    }

    .admin-modal-head h3 {
        width: auto;
        min-height: 22px;
        margin: 0;
        line-height: 22px;
    }

    .admin-page-title h2::before,
    .admin-modal-head h3::before {
        content: none;
    }

    .profile-page-shell .profile-section-title > span {
        display: inline-flex;
        gap: 8px;
        align-items: center;
        min-width: 0;
        line-height: 24px;
        text-align: left;
    }

    .profile-page-shell .profile-section-title-actions {
        flex-wrap: wrap;
    }

    .profile-page-shell .profile-section-title-actions > span {
        flex: 1 1 calc(100% - 11px);
    }

    .profile-page-shell .profile-section-title-actions .btn {
        flex: 0 0 100%;
    }
}

@media (max-width: 820px) {
    .admin-header .admin-page-title {
        justify-content: flex-start;
        padding-right: 72px;
        padding-left: 0;
        text-align: left;
    }

    .admin-header .admin-page-title h2 {
        justify-content: flex-start;
        margin: 0;
        text-align: left;
    }

    .admin-header .admin-page-title p {
        display: none;
    }

    .admin-header .admin-user {
        right: 10px;
    }
}

/* Attachment settings final layout overrides. Keep this after the general
   responsive rules because the storage dialog needs its own desktop/mobile grid. */
.attachment-settings-panel {
    display: grid;
    gap: 16px;
}

.attachment-settings-panel .settings-group-title {
    margin-bottom: 0;
}

.attachment-settings-lead {
    max-width: 760px;
    margin: -4px 0 0;
    color: var(--text-muted);
}

.attachment-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.attachment-settings-section {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.attachment-settings-section:nth-child(n + 3) {
    grid-column: 1 / -1;
}

.attachment-settings-section-head {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.attachment-settings-section h4 {
    min-width: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 760;
    line-height: 1.3;
    color: var(--text);
}

.attachment-setting-toggle,
.attachment-settings-panel .admin-inline-check {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    min-width: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    color: var(--text-soft);
    white-space: nowrap;
}

.attachment-settings-panel input[type="checkbox"] {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.attachment-settings-grid .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.attachment-settings-section .form-group {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.attachment-settings-panel .form-group label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
}

.attachment-settings-section .hint,
.attachment-settings-section .field-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
}

.attachment-settings-section input[type="text"],
.attachment-settings-section input[type="url"],
.attachment-settings-section input[type="password"],
.attachment-settings-section input[type="number"],
.attachment-settings-section input[type="time"],
.attachment-settings-section select,
.attachment-settings-section textarea {
    width: 100%;
    min-width: 0;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 8px 11px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.3;
    color: var(--text);
    background: #fff;
    border: 1px solid #dfe3ea;
    border-radius: var(--radius);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.attachment-settings-section input[type="text"]:focus,
.attachment-settings-section input[type="url"]:focus,
.attachment-settings-section input[type="password"]:focus,
.attachment-settings-section input[type="number"]:focus,
.attachment-settings-section input[type="time"]:focus,
.attachment-settings-section select:focus,
.attachment-settings-section textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: var(--ring);
}

.attachment-s3-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.attachment-s3-tools .btn {
    min-width: 132px;
}

.attachment-s3-status {
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-soft);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.attachment-backup-toggle-field {
    justify-content: end;
}

.attachment-backup-head-toggles {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

@media (max-width: 820px) {
    .settings-page-shell > .attachment-settings-panel {
        padding: 12px;
    }

    .attachment-settings-panel {
        gap: 12px;
    }

    .attachment-settings-lead {
        margin: 0;
        font-size: 12px;
        line-height: 1.5;
    }

    .attachment-settings-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .attachment-settings-section,
    .attachment-settings-section:nth-child(n + 3) {
        grid-column: auto;
        gap: 12px;
        padding: 12px;
    }

    .attachment-settings-section-head {
        gap: 10px;
        align-items: flex-start;
        padding-bottom: 9px;
    }

    .attachment-settings-section h4 {
        padding-top: 1px;
        font-size: 13px;
    }

    .attachment-setting-toggle,
    .attachment-settings-panel .admin-inline-check {
        flex: 0 0 auto;
        max-width: 52%;
        font-size: 12px;
        white-space: normal;
    }

    .attachment-settings-grid .form-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .attachment-settings-section input[type="text"],
    .attachment-settings-section input[type="url"],
    .attachment-settings-section input[type="password"],
    .attachment-settings-section input[type="number"],
    .attachment-settings-section input[type="time"],
    .attachment-settings-section select,
    .attachment-settings-section textarea {
        font-size: 13px;
    }

    .attachment-backup-toggle-field {
        gap: 8px;
        justify-content: start;
    }

    .attachment-backup-head-toggles {
        gap: 10px;
        justify-content: flex-end;
        max-width: 62%;
    }

    .attachment-backup-head-toggles .attachment-setting-toggle {
        flex: 0 0 auto;
        max-width: none;
        white-space: nowrap;
    }

    .attachment-settings-section:has(.attachment-backup-head-toggles) .attachment-settings-section-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
    }

    .attachment-settings-section:has(.attachment-backup-head-toggles) h4 {
        white-space: nowrap;
    }

    .attachment-backup-head-toggles {
        flex-wrap: nowrap;
        gap: 8px;
        max-width: none;
        min-width: 0;
    }

    .attachment-backup-head-toggles .attachment-setting-toggle,
    .attachment-backup-head-toggles .admin-inline-check {
        flex: 0 0 auto;
        max-width: none;
        font-size: 11px;
        white-space: nowrap;
    }

    .attachment-s3-tools {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .attachment-s3-tools .btn {
        width: 100%;
        min-width: 0;
        padding: 0 8px;
        justify-content: center;
        font-size: 12px;
    }

    .attachment-settings-section:last-child .attachment-s3-tools {
        grid-template-columns: minmax(0, 1fr);
    }

    .attachment-settings-panel .form-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }
}

.attachment-settings-panel .attachment-backup-s3-toggle {
    display: inline-flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    max-width: 100%;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    white-space: normal;
}

.attachment-settings-panel .attachment-backup-s3-toggle input[type="checkbox"] {
    flex: 0 0 16px;
    align-self: center;
}

@media (max-width: 820px) {
    .attachment-settings-panel .attachment-backup-s3-toggle {
        max-width: 100%;
        min-height: 24px;
        font-size: 12px;
        line-height: 1.35;
    }

}

@media (max-width: 820px) {
    .settings-page-shell > .mail-status-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
        width: 100%;
        margin: 0;
    }

    .mail-status-card {
        min-height: 62px;
        gap: 9px;
        padding: 10px;
        border-radius: var(--radius);
        box-shadow: none;
    }

    .mail-status-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .mail-status-card strong {
        overflow: hidden;
        font-size: 13px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mail-status-card small,
    .mail-status-card .status {
        margin-top: 2px;
        font-size: 11px;
    }

    .mail-settings-form,
    .mail-test-form,
    .mail-log-panel {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        margin: 0;
    }

    .mail-settings-form {
        display: grid;
        gap: 12px;
    }

    .mail-settings-section .form-row,
    .mail-provider-card .form-row,
    .mail-test-form .form-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        margin: 0;
    }

    .settings-page-shell .mail-event-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 8px;
        padding: 0;
        background: transparent;
        border: 0;
    }

    .mail-event-grid .form-group-toggle {
        min-height: 58px;
        padding: 10px;
    }

    .mail-event-grid .form-group-toggle > label:first-child {
        min-width: 0;
        overflow: visible;
        font-size: 12px;
        line-height: 1.35;
        text-overflow: clip;
        white-space: normal;
    }

    .settings-page-shell .mail-provider-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px;
        padding: 0;
        background: transparent;
        border: 0;
    }

    .mail-provider-card {
        display: grid;
        gap: 10px;
        padding: 12px;
        border-radius: var(--radius);
    }

    .mail-provider-card h4 {
        margin: 0;
        font-size: 13px;
    }

    .mail-provider-actions {
        margin-top: 2px;
    }

    .mail-provider-actions .btn {
        width: 100%;
    }

    .mail-test-action {
        align-self: auto;
    }

    .mail-test-action .btn,
    .mail-test-form .btn {
        width: 100%;
        justify-content: center;
    }

    .mail-log-panel {
        display: grid;
        gap: 12px;
    }

    .mail-log-table tbody {
        gap: 8px;
    }

    .mail-log-table tr {
        gap: 7px;
        padding: 11px;
        box-shadow: none;
    }

    .mail-log-table td {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 8px;
        font-size: 12px;
        line-height: 1.45;
    }

    .mail-log-table .comment-cell {
        max-height: 60px;
        overflow: auto;
    }
}

.mail-settings-page .settings-subtabs {
    gap: 5px;
    padding: 5px;
}

.mail-settings-page .settings-subtabs a {
    height: 34px;
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
}

.mail-settings-page .form-group-toggle {
    min-height: 48px;
    padding: 9px 10px;
}

.mail-settings-page .mail-settings-section {
    gap: 16px;
}

.mail-settings-page .mail-settings-section .form-row {
    gap: 16px;
}

.mail-settings-page .mail-settings-section .form-group {
    gap: 9px;
    margin-bottom: 0;
}

.mail-settings-page .mail-settings-section .form-group > label:first-child {
    margin-bottom: 2px;
}

.mail-settings-page .cat-switch {
    width: 40px;
    height: 22px;
}

.mail-settings-page .cat-switch-slider {
    flex-basis: 40px;
    width: 40px;
    height: 22px;
    border-radius: 22px;
}

.mail-settings-page .cat-switch-slider::before {
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
}

.mail-settings-page .cat-switch input:checked + .cat-switch-slider::before {
    transform: translateX(18px);
}

@media (max-width: 820px) {
    .mail-settings-page .settings-subtabs {
        gap: 6px;
    }

    .mail-settings-page .settings-subtabs a {
        height: 34px;
        min-height: 34px;
        padding: 0 6px;
        font-size: 12px;
    }

    .mail-settings-page .mail-event-grid .form-group-toggle,
    .mail-settings-page .mail-settings-section .form-group-toggle {
        min-height: 48px;
        padding: 8px 10px;
    }

    .mail-settings-page .mail-settings-section {
        gap: 18px;
    }

    .mail-settings-page .mail-settings-section .form-row {
        gap: 18px;
    }
}

.telegram-settings-page .mail-status-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.telegram-settings-page .telegram-help-list {
    display: grid;
    gap: 10px;
    padding-left: 20px;
    margin: 0 0 16px;
    color: var(--text-soft);
}

.telegram-settings-page .telegram-help-list li {
    line-height: 1.7;
}

.telegram-settings-page code {
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 820px) {
    .telegram-settings-page {
        display: grid;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }

    .telegram-settings-page .settings-subtabs {
        gap: 6px;
    }

    .telegram-settings-page .settings-subtabs a {
        height: 34px;
        min-height: 34px;
        padding: 0 6px;
        font-size: 12px;
    }

    .telegram-settings-page > .mail-status-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
        width: 100%;
        margin: 0;
    }

    .telegram-settings-page > .mail-status-grid .mail-status-card:nth-child(3) {
        grid-column: 1 / -1;
    }

    .telegram-settings-page .mail-status-card {
        min-height: 62px;
        gap: 9px;
        padding: 10px;
        box-shadow: none;
    }

    .telegram-settings-page .mail-status-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .telegram-settings-page .mail-status-card strong {
        overflow: hidden;
        font-size: 13px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .telegram-settings-page .mail-status-card small {
        margin-top: 2px;
        font-size: 11px;
    }

    .telegram-settings-page .mail-settings-form,
    .telegram-settings-page .mail-log-panel {
        display: grid;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        padding: 12px;
        margin: 0;
    }

    .telegram-settings-page .mail-settings-section,
    .telegram-settings-page .mail-log-panel .settings-section {
        display: grid;
        gap: 14px;
        padding: 12px;
    }

    .telegram-settings-page .form-group {
        display: grid;
        gap: 8px;
        min-width: 0;
        margin-bottom: 0;
    }

    .telegram-settings-page .form-group > label:first-child {
        margin-bottom: 2px;
    }

    .telegram-settings-page .setting-key {
        display: block;
        width: fit-content;
        max-width: 100%;
        margin: 5px 0 0;
        overflow-wrap: anywhere;
    }

    .telegram-settings-page .field-hint,
    .telegram-settings-page .telegram-help-list {
        font-size: 12px;
        line-height: 1.7;
    }

    .telegram-settings-page .telegram-help-list {
        gap: 8px;
        padding-left: 18px;
        margin-bottom: 6px;
    }

    .telegram-settings-page input[readonly],
    .telegram-settings-page textarea[readonly] {
        font-size: 12px;
        line-height: 1.55;
    }

    .telegram-settings-page textarea[readonly] {
        min-height: 112px;
        resize: vertical;
    }

    .telegram-settings-page .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .telegram-settings-page .telegram-env-table tr {
        gap: 7px;
        padding: 11px;
        box-shadow: none;
    }

    .telegram-settings-page .telegram-env-table td {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 8px;
        font-size: 12px;
        line-height: 1.5;
    }
}
