﻿:root {
    --bg: #F5F5F7;
    --text: #1D1D1F;
    --muted: #6E6E73;
    --weak: #9A9A9F;
    --primary: #4F6EF7;
    --primary-soft: #EEF1FF;
    --sidebar: #003f35;
    --danger: #FF3B30;
    --success: #00B894;
    --glass: rgba(255, 255, 255, 0.78);
    --border: rgba(0, 0, 0, 0.06);
    --shadow: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 8% 6%, rgba(102, 126, 234, 0.12), transparent 32%),
        radial-gradient(circle at 88% 10%, rgba(240, 147, 251, 0.12), transparent 30%),
        radial-gradient(circle at 12% 88%, rgba(132, 250, 176, 0.11), transparent 34%),
        var(--bg);
}

h1 {
    margin: 0 0 18px;
    font-size: 28px;
    font-weight: 700;
}

h2 {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 700;
}

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

.shell {
    max-width: none;
    margin: 0 auto;
    min-height: 100vh;
    padding: 22px 24px 32px 314px;
    box-sizing: border-box;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.subtitle {
    color: var(--muted);
    font-size: 14px;
}

.admin-sidebar {
    position: fixed;
    left: 22px;
    top: 22px;
    bottom: 22px;
    width: 272px;
    overflow: auto;
    padding: 20px 16px 18px;
    color: #ecfff8;
    background: linear-gradient(180deg, #003f35 0%, #00352d 55%, #002821 100%);
    border-radius: 24px;
    box-shadow: 0 22px 58px rgba(0, 57, 48, 0.18);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 4px 6px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(145deg, #16e5ae, #0a9f7c);
    box-shadow: 0 14px 34px rgba(18, 201, 154, 0.28);
    font-size: 22px;
    font-weight: 800;
}

.admin-brand-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.admin-brand-subtitle {
    margin-top: 4px;
    color: rgba(232, 255, 248, 0.68);
    font-size: 12px;
}

.admin-nav {
    display: grid;
    gap: 8px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    color: rgba(232, 255, 248, 0.82);
    text-decoration: none;
    font-size: 15px;
    font-weight: 650;
}

.admin-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.admin-nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, #12c99a, #0ab989);
    box-shadow: 0 12px 28px rgba(18, 201, 154, 0.26);
}

.admin-nav-section,
.sub-section {
    margin: 0;
}

.admin-nav-section > summary,
.sub-section > summary {
    list-style: none;
}

.admin-nav-section > summary::-webkit-details-marker,
.sub-section > summary::-webkit-details-marker {
    display: none;
}

.admin-nav-parent,
.sub-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    border: 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.admin-nav-parent {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
}

.admin-nav-parent > span:first-child,
.sub-parent > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-nav-icon {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.admin-nav-label {
    min-width: 0;
}

.admin-nav-arrow {
    transition: transform 160ms ease;
}

.admin-nav-section[open] > .admin-nav-parent .admin-nav-arrow,
.sub-section[open] > .sub-parent .admin-nav-arrow {
    transform: rotate(180deg);
}

.sub-menu {
    display: grid;
    gap: 4px;
    margin: 6px 0 0;
    padding: 6px 0 2px 10px;
}

.sub-item,
.sub-sub-item {
    align-items: center;
    text-decoration: none;
}

.sub-item {
    display: flex;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    color: rgba(232, 255, 248, 0.74);
    font-size: 14px;
    font-weight: 700;
}

.sub-item:hover,
.sub-sub-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sub-item.active-sub,
.sub-sub-item.active-sub {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.sub-section {
    margin-top: 4px;
}

.sub-parent {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(232, 255, 248, 0.82);
    font-size: 14px;
    font-weight: 750;
}

.sub-sub-menu {
    display: grid;
    gap: 4px;
    margin-top: 4px;
    padding: 2px 0 0 22px;
}

.sub-sub-item {
    display: flex;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    color: rgba(232, 255, 248, 0.70);
    font-size: 13px;
    font-weight: 700;
}

.admin-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 14px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
}

.admin-topbar {
    position: sticky;
    top: 22px;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    margin-bottom: 22px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.admin-topbar-kicker {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-topbar-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;
}

.admin-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    padding: 8px 14px 8px 9px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.admin-user-pill small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-avatar {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: var(--sidebar);
    color: #ffffff;
    font-size: 13px;
}

.admin-nav-item.active {
    color: #fff;
}

.glass-panel {
    padding: 20px;
    border-radius: 22px;
    background: var(--glass);
    border: 1px solid rgba(255,255,255,0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.message {
    margin: 14px 0;
    padding: 12px 14px;
    color: #087f5b;
    font-size: 14px;
    font-weight: 600;
    border-radius: 14px;
    background: rgba(132, 250, 176, 0.22);
    border: 1px solid rgba(0, 184, 148, 0.16);
}

button,
.btn {
    min-height: 34px;
    padding: 6px 14px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 18px rgba(79, 110, 247, 0.2);
}

button:active,
.btn:active,
.admin-nav a:active {
    transform: scale(0.97);
}

.delete-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 18px rgba(245, 87, 108, 0.18);
}

.update-btn,
.add-btn {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #14505b;
}

input,
select,
textarea {
    min-height: 34px;
    padding: 7px 10px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: rgba(255,255,255,0.82);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(79, 110, 247, 0.45);
    box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.09);
}

table {
    width: 100%;
    margin-top: 16px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

th,
td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    background: rgba(238,241,255,0.8);
}

td {
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

.form-row,
.search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.small {
    color: var(--muted);
    font-size: 12px;
    max-width: 240px;
    word-break: break-all;
    text-align: left;
}

.empty {
    color: var(--weak);
}

@media (max-width: 980px) {
    .shell {
        padding: 18px;
    }

    .admin-sidebar {
        position: relative;
        left: auto;
        top: auto;
        bottom: auto;
        width: auto;
        margin-bottom: 18px;
    }

    .admin-topbar {
        position: static;
    }
}

@media (max-width: 620px) {
    .shell {
        padding: 14px;
    }

    .admin-topbar,
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-user-pill {
        flex-wrap: wrap;
    }
}

