:root {
    --caramel-900: #5f4538;
    --caramel-800: #705345;
    --caramel-700: #836353;
    --caramel-600: #987565;
    --caramel-300: #d8b59d;
    --caramel-100: #f2dfcf;
    --caramel-050: #fffaf4;
    --ink: #302a26;
    --muted: #7a6f68;
    --line: #e7ddd3;
    --surface: #ffffff;
    --background: #f7f2eb;
    --success: #287451;
    --danger: #9a4b43;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--background);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Microsoft YaHei", sans-serif;
}

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

button,
input,
select {
    font: inherit;
}

button {
    min-height: 44px;
    padding: 10px 22px;
    color: white;
    border: 0;
    border-radius: 8px;
    background: var(--caramel-700);
    cursor: pointer;
}

button:hover {
    background: var(--caramel-800);
}

.card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(95, 69, 56, .05);
}

/* 登录页 */

.login-wrap {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(
            circle at 20% 15%,
            rgba(216, 181, 157, .22),
            transparent 34%
        ),
        linear-gradient(145deg, #fffaf4, #f1e5d8);
    place-items: center;
}

.login-card {
    width: min(100%, 430px);
    padding: 34px;
    border: 1px solid #eadbcf;
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 20px 55px rgba(95, 69, 56, .13);
}

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

.login-brand h1 {
    margin: 0;
    font-size: 22px;
}

.login-brand p {
    margin: 5px 0 0;
    color: var(--muted);
}

.brand-mark {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--caramel-900);
    font-size: 19px;
    font-weight: 700;
    border-radius: 12px;
    background: var(--caramel-100);
    place-items: center;
}

.login-card label {
    display: block;
    margin-top: 18px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    min-height: 48px;
    margin-top: 7px;
    padding: 10px 12px;
    border: 1px solid #d0c1b5;
    border-radius: 8px;
    outline: none;
    background: white;
}

.login-card input:focus,
.setting-row input:focus,
.setting-row select:focus {
    border-color: var(--caramel-600);
    box-shadow: 0 0 0 3px rgba(130, 80, 107, .13);
}

.login-card button {
    width: 100%;
    margin-top: 26px;
}

/* 后台整体结构 */

.admin-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    color: var(--caramel-050);
    background:
        linear-gradient(
            180deg,
            var(--caramel-700) 0%,
            var(--caramel-900) 100%
        );
    box-shadow: 4px 0 18px rgba(95, 69, 56, .12);
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 84px;
    padding: 17px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-brand .brand-mark {
    color: white;
    background: rgba(255, 255, 255, .16);
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand strong {
    font-size: 15px;
    line-height: 1.5;
}

.sidebar-brand span {
    margin-top: 2px;
    color: rgba(255, 250, 244, .68);
    font-size: 12px;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 12px;
    overflow-y: auto;
}

.nav-home,
.nav-group summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin-bottom: 5px;
    padding: 11px 13px;
    color: rgba(255, 250, 244, .9);
    border-radius: 9px;
    cursor: pointer;
    user-select: none;
}

.nav-home {
    gap: 11px;
}

.nav-home:hover,
.nav-group summary:hover {
    color: white;
    background: rgba(255, 255, 255, .10);
}

.nav-home.active,
.nav-group summary.active {
    color: var(--caramel-900);
    font-weight: 700;
    background: var(--caramel-100);
}

.nav-icon {
    display: inline-grid;
    width: 22px;
    font-size: 18px;
    text-align: center;
    place-items: center;
}

.nav-group {
    margin: 0;
}

.nav-group summary {
    justify-content: space-between;
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.summary-label {
    display: flex;
    gap: 11px;
    align-items: center;
}

.nav-arrow {
    font-size: 22px;
    line-height: 1;
    transition: transform .18s ease;
}

.nav-group[open] .nav-arrow {
    transform: rotate(90deg);
}

.submenu {
    margin: 2px 0 8px 24px;
    padding: 4px 0 4px 15px;
    border-left: 1px solid rgba(255, 255, 255, .20);
}

.submenu a,
.disabled-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 39px;
    margin: 2px 0;
    padding: 8px 10px;
    color: rgba(255, 250, 244, .78);
    font-size: 14px;
    border-radius: 7px;
}

.submenu a:hover {
    color: white;
    background: rgba(255, 255, 255, .09);
}

.submenu a.active {
    color: var(--caramel-900);
    font-weight: 700;
    background: var(--caramel-100);
}

.disabled-link {
    color: rgba(255, 250, 244, .48);
    cursor: not-allowed;
}

.disabled-link small {
    font-size: 11px;
    font-weight: 400;
}

.sidebar-footer {
    padding: 17px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-footer span,
.sidebar-footer strong {
    display: block;
}

.sidebar-footer span {
    color: rgba(255, 250, 244, .60);
    font-size: 12px;
}

.sidebar-footer strong {
    margin-top: 5px;
    font-size: 14px;
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
    padding: 14px 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
}

.admin-topbar h1 {
    margin: 0;
    font-size: 21px;
}

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

.topbar-account {
    display: flex;
    gap: 14px;
    align-items: center;
}

.topbar-account > span {
    color: var(--muted);
    font-size: 14px;
}

.logout-button {
    min-height: 38px;
    padding: 7px 15px;
    color: var(--caramel-700);
    border: 1px solid #d8c6b7;
    background: white;
}

.logout-button:hover {
    color: white;
    border-color: var(--caramel-700);
    background: var(--caramel-700);
}

.admin-content {
    width: min(1240px, calc(100% - 48px));
    margin: 28px auto 70px;
}

/* 后台首页 */

.welcome-panel {
    position: relative;
    overflow: hidden;
    padding: 32px 34px;
    color: white;
    border-radius: 16px;
    background:
        linear-gradient(
            120deg,
            var(--caramel-700),
            var(--caramel-900)
        );
    box-shadow: 0 12px 28px rgba(95, 69, 56, .15);
}

.welcome-panel::after {
    position: absolute;
    top: -70px;
    right: -50px;
    width: 230px;
    height: 230px;
    content: "";
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}

.welcome-panel h2 {
    position: relative;
    margin: 7px 0 10px;
    font-size: 25px;
}

.welcome-panel p {
    position: relative;
    max-width: 700px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    line-height: 1.8;
}

.eyebrow {
    position: relative;
    color: var(--caramel-100);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.content-section {
    margin-top: 24px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: white;
}

.section-heading h2 {
    margin: 0;
    font-size: 19px;
}

.section-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.status-list {
    margin-top: 20px;
    border-top: 1px solid #eee5dc;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 14px 4px;
    color: inherit;
    border-bottom: 1px solid #eee5dc;
}

.status-row > div {
    display: grid;
    gap: 5px;
}

.status-row span {
    color: var(--muted);
    font-size: 13px;
}

.status-row.available:hover strong {
    color: var(--caramel-700);
}

.status-label {
    padding: 5px 11px;
    color: var(--success) !important;
    border-radius: 20px;
    background: #e7f5ed;
}

.status-label.pending {
    color: #7f756d !important;
    background: #f1ece6;
}

/* 系统设置 */

.settings-group {
    margin-bottom: 20px;
}

.settings-group h2 {
    margin: 0 0 4px;
    color: var(--caramel-800);
    font-size: 19px;
}

.setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid #eee5dc;
}

.setting-row:first-of-type {
    margin-top: 16px;
}

.setting-row p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.setting-row input[type="text"],
.setting-row input[type="number"],
.setting-row select {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #d2c5ba;
    border-radius: 8px;
    outline: none;
    background: white;
}

.switch-label {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
}

.switch-label input {
    width: 22px;
    height: 22px;
    accent-color: var(--caramel-700);
}

.notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 8px;
}

.notice.success {
    color: #145c36;
    background: #dff5e8;
}

.notice.error {
    color: #8a2020;
    background: #fde5e5;
}

.save-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 16px 0;
    text-align: right;
    background: rgba(247, 242, 235, .95);
}

/* 小屏幕适配 */

@media (max-width: 820px) {
    .admin-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .sidebar-brand {
        min-height: 72px;
    }

    .sidebar-nav {
        max-height: none;
    }

    .sidebar-footer {
        display: none;
    }

    .admin-topbar {
        position: relative;
        padding: 14px 18px;
    }

    .admin-content {
        width: min(100% - 28px, 1240px);
        margin-top: 18px;
    }

    .setting-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 560px) {
    .admin-topbar {
        align-items: flex-start;
    }

    .topbar-account > span {
        display: none;
    }

    .welcome-panel {
        padding: 25px 22px;
    }

    .content-section,
    .card {
        padding: 20px;
    }
}


/* 系统状态概览卡片 */

.status-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.overview-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 3px 14px rgba(95, 69, 56, .06);
}

.overview-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.overview-value,
.overview-number {
    display: flex;
    align-items: center;
    min-height: 38px;
    margin-top: 8px;
    color: var(--caramel-800);
    font-size: 24px;
    line-height: 1.3;
}

.overview-value {
    font-size: 20px;
}

.overview-value.normal {
    color: var(--success);
}

.overview-number.muted-number {
    color: var(--caramel-600);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 9px;
    border-radius: 50%;
    background: #3c9369;
    box-shadow: 0 0 0 5px rgba(60, 147, 105, .12);
}

.overview-card p {
    margin: 7px 0 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 1080px) {
    .status-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .status-overview-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
