:root {
    --shell-bg: linear-gradient(180deg, #f3f6fb 0%, #eef3f8 100%);
    --panel-bg: rgba(255, 255, 255, 0.92);
    --panel-border: rgba(148, 163, 184, 0.22);
    --panel-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    --text-strong: #10233f;
    --text-main: #355070;
    --text-muted: #728197;
    --brand: #1f6feb;
    --brand-soft: rgba(31, 111, 235, 0.12);
    --brand-deep: #164fb0;
    --success-bg: #1f9d67;
    --danger: #dc4c64;
    --danger-soft: rgba(220, 76, 100, 0.12);
    --warning: #b7791f;
    --warning-soft: rgba(183, 121, 31, 0.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

html {
    scrollbar-gutter: stable;
}

html {
    box-sizing: border-box;
}

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

body.settings-shell-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
    background: var(--shell-bg);
    color: var(--text-main);
}

body.settings-shell-body,
body.settings-shell-body button,
body.settings-shell-body input,
body.settings-shell-body select,
body.settings-shell-body textarea {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

.settings-shell {
    display: flex;
    gap: 24px;
    min-height: 100vh;
    padding: 24px;
}

.admin-sidebar {
    width: 260px;
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px 20px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 253, 0.94));
    box-shadow: var(--panel-shadow);
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
}

.admin-sidebar__brand h2 {
    margin: 8px 0 8px;
    font-size: 22px;
    color: var(--text-strong);
}

.admin-sidebar__brand p {
    margin: 0;
    line-height: 1.6;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-sidebar__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-sidebar__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    transition: 0.2s ease;
    cursor: pointer;
}

.admin-sidebar__item:hover {
    border-color: rgba(31, 111, 235, 0.12);
    background: rgba(255, 255, 255, 0.82);
    color: var(--brand-deep);
    transform: translateX(2px);
}

.admin-sidebar__item.is-active {
    background: linear-gradient(135deg, #1f6feb, #2f80ed);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 24px rgba(31, 111, 235, 0.24);
}

.admin-sidebar__item--button {
    font: inherit;
}

.admin-sidebar__icon {
    width: 22px;
    text-align: center;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.admin-sidebar__footer {
    margin-top: auto;
}

.admin-sidebar__preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1f9d67, #2db980);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 12px 22px rgba(31, 157, 103, 0.22);
}

.admin-sidebar__preview:hover {
    filter: brightness(1.03);
}

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

.settings-page {
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 28px;
    padding: 28px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.settings-page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.settings-page__header h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 30px;
}

.settings-page__header p {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
}

.settings-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.settings-grid {
    display: grid;
    gap: 20px;
}

.settings-grid--2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.settings-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    padding: 22px;
    min-width: 0;
}

.settings-card h2,
.settings-card h3 {
    margin: 0 0 14px;
    color: var(--text-strong);
}

.settings-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.settings-card__header p,
.settings-card__hint,
.settings-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
}

.settings-stat {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-stat__label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-stat__value {
    font-size: 34px;
    line-height: 1;
    color: var(--text-strong);
    font-weight: 700;
}

.settings-form {
    display: grid;
    gap: 16px;
}

.settings-form__row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.settings-field label {
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 600;
}

.settings-input,
.settings-select,
.settings-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    font: inherit;
    color: var(--text-strong);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.settings-textarea {
    min-height: 100px;
    resize: vertical;
}

.settings-input:focus,
.settings-select:focus,
.settings-textarea:focus {
    outline: none;
    border-color: rgba(31, 111, 235, 0.4);
    box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.12);
}

.settings-btn,
.settings-btn--secondary,
.settings-btn--ghost,
.settings-btn--danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
}

.settings-btn {
    background: linear-gradient(135deg, #1f6feb, #2f80ed);
    color: #fff;
    box-shadow: 0 12px 24px rgba(31, 111, 235, 0.2);
}

.settings-btn:hover,
.settings-btn--secondary:hover,
.settings-btn--ghost:hover,
.settings-btn--danger:hover {
    transform: translateY(-1px);
}

.settings-btn--secondary {
    background: linear-gradient(135deg, #1f9d67, #2db980);
    color: #fff;
    box-shadow: 0 12px 22px rgba(31, 157, 103, 0.18);
}

.settings-btn--ghost {
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-main);
    border-color: rgba(148, 163, 184, 0.26);
}

.settings-btn--danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(220, 76, 100, 0.18);
}

.settings-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 12px;
    font-weight: 700;
}

.settings-alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    margin-bottom: 20px;
    font-size: 14px;
}

.settings-alert--success {
    background: rgba(31, 157, 103, 0.1);
    border-color: rgba(31, 157, 103, 0.18);
    color: #166b47;
}

.settings-alert--warning {
    background: var(--warning-soft);
    border-color: rgba(183, 121, 31, 0.2);
    color: #8c5e14;
}

.settings-table-wrap {
    overflow-x: auto;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.settings-table th,
.settings-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    vertical-align: middle;
}

.settings-table th {
    background: rgba(241, 245, 249, 0.8);
    color: var(--text-main);
    font-weight: 700;
    white-space: nowrap;
}

.settings-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.9);
}

.settings-table__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
}

.settings-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 960px) {
    .settings-shell {
        flex-direction: column;
        padding: 16px;
    }

    .admin-sidebar {
        width: 100%;
        max-height: none;
        position: static;
    }

    .settings-page {
        padding: 20px;
        border-radius: 22px;
    }

    .settings-page__header {
        flex-direction: column;
    }

    .settings-grid--2,
    .settings-grid--3,
    .settings-form__row {
        grid-template-columns: 1fr;
    }
}
