* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f3f7fd;
    --bg-soft: #eef4fb;
    --card: rgba(255, 255, 255, 0.88);
    --card-solid: #ffffff;
    --text: #0f172a;
    --text-soft: #64748b;
    --line: #e5edf7;

    --blue-1: #2563eb;
    --blue-2: #3b82f6;
    --blue-3: #60a5fa;
    --blue-soft: rgba(59, 130, 246, 0.10);

    --success: #16a34a;
    --success-bg: #ecfdf3;
    --success-border: #bbf7d0;

    --danger: #dc2626;
    --danger-bg: rgba(239, 68, 68, 0.10);
    --danger-border: rgba(239, 68, 68, 0.18);

    --sidebar-1: #0b1220;
    --sidebar-2: #111b30;
    --sidebar-3: #172554;

    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 55px rgba(15, 23, 42, 0.14);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 28px;
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(96,165,250,0.12), transparent 24%),
        radial-gradient(circle at bottom left, rgba(37,99,235,0.10), transparent 22%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    color: var(--text);
}

body {
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* 主布局 */
.admin-layout {
    min-height: 100vh;
    display: flex;
    position: relative;
}

/* 移动端遮罩 */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: all 0.28s ease;
    z-index: 80;
}

/* 左侧菜单 */
.sidebar {
    width: 280px;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(96,165,250,0.18), transparent 28%),
        radial-gradient(circle at bottom left, rgba(59,130,246,0.12), transparent 24%),
        linear-gradient(180deg, var(--sidebar-1) 0%, var(--sidebar-2) 45%, var(--sidebar-3) 100%);
    color: rgba(255,255,255,0.92);
    padding: 24px 18px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 30px rgba(2, 6, 23, 0.18);
    position: relative;
    z-index: 90;
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
}

.sidebar::after {
    content: "";
    position: absolute;
    left: -60px;
    bottom: -100px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,0.14), transparent 70%);
}

.sidebar > * {
    position: relative;
    z-index: 2;
}

.sidebar-top {
    margin-bottom: 20px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 10px;
    border-radius: 20px;
    transition: all 0.22s ease;
}

.brand-link:hover {
    background: rgba(255,255,255,0.06);
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 14px 26px rgba(59, 130, 246, 0.32);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.brand-logo::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: shineLogo 3s linear infinite;
}

@keyframes shineLogo {
    0% { left: -120%; }
    100% { left: 120%; }
}

.brand-text h2 {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
}

.brand-text p {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.62);
}

.sidebar-menu-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.46);
    padding: 10px 12px 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    min-height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    color: rgba(255,255,255,0.86);
    transition: all 0.24s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.nav-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
    opacity: 0;
    transition: opacity 0.24s ease;
}

.nav-item:hover {
    transform: translateX(4px);
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.12);
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(37,99,235,0.22), rgba(96,165,250,0.12));
    border-color: rgba(96,165,250,0.22);
    color: #fff;
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.18);
}

.nav-item.active::after {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    box-shadow: 0 0 14px rgba(96,165,250,0.6);
}

.nav-icon,
.nav-text,
.nav-arrow {
    position: relative;
    z-index: 2;
}

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
}

.nav-arrow {
    font-size: 18px;
    color: rgba(255,255,255,0.42);
    transition: transform 0.22s ease;
}

.nav-item:hover .nav-arrow,
.nav-item.active .nav-arrow {
    transform: translateX(2px);
    color: rgba(255,255,255,0.78);
}

.sidebar-bottom {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-mini-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}

.mini-card-title {
    font-size: 12px;
    color: rgba(255,255,255,0.56);
    margin-bottom: 8px;
    font-weight: 700;
}

.mini-card-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.16);
    animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.16); opacity: 0.72; }
    100% { transform: scale(1); opacity: 1; }
}

.logout-btn {
    min-height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--danger-bg);
    color: #fecaca;
    border: 1px solid var(--danger-border);
    font-size: 14px;
    font-weight: 800;
    transition: all 0.22s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    background: rgba(239, 68, 68, 0.16);
    color: #fff;
    box-shadow: 0 10px 22px rgba(239, 68, 68, 0.16);
}

.logout-icon {
    font-size: 16px;
}

/* 右侧主体 */
.main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 顶部栏 */
.topbar {
    min-height: 82px;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.70);
    border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-title-group {
    min-width: 0;
}

.topbar-title-group h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.topbar-title-group p {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-soft);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.86);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.menu-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-chip {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.88);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.10);
}

/* 内容区域 */
.content-area {
    padding: 24px 28px 30px;
}

.flash-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.flash {
    position: relative;
    padding: 15px 18px 15px 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf3);
    border: 1px solid var(--success-border);
    color: #166534;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    animation: slideFadeIn 0.28s ease;
}

.flash::before {
    content: "✓";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-card {
    min-height: calc(100vh - 150px);
    background: rgba(255, 255, 255, 0.44);
    border: 1px solid rgba(226, 232, 240, 0.65);
    border-radius: 28px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.page-card::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,0.10), transparent 70%);
    pointer-events: none;
}

.page-card > * {
    position: relative;
    z-index: 2;
}

/* 基础通用 */
.card {
    background: var(--card-solid);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

table th {
    color: #475569;
    background: #f8fbff;
    font-weight: 800;
}

table tr:hover td {
    background: #fafcff;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #dbe4f0;
    background: #f8fbff;
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: all 0.22s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue-3);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue-1), var(--blue-2), var(--blue-3));
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.22s ease;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

button:active,
.btn:active {
    transform: scale(0.98);
}

/* 响应式 */
@media (max-width: 980px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        width: 290px;
        max-width: 86vw;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .mobile-overlay {
        opacity: 1;
        visibility: visible;
    }

    .topbar {
        padding: 14px 18px;
    }

    .content-area {
        padding: 18px;
    }

    .page-card {
        padding: 16px;
        min-height: auto;
        border-radius: 22px;
    }
}

@media (max-width: 640px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-left,
    .topbar-right {
        width: 100%;
    }

    .topbar-right {
        justify-content: flex-start;
    }

    .topbar-title-group h1 {
        font-size: 21px;
    }

    .topbar-title-group p {
        font-size: 12px;
    }

    .sidebar {
        padding: 18px 14px 16px;
    }

    .brand-text h2 {
        font-size: 18px;
    }

    .nav-item {
        min-height: 50px;
        padding: 0 14px;
    }
}

/* =========================
   Login Page
========================= */
.login-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.20), transparent 25%),
        radial-gradient(circle at bottom right, rgba(37,99,235,0.18), transparent 22%),
        linear-gradient(135deg, #0b1220 0%, #111827 38%, #172554 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    overflow: hidden;
    position: relative;
}

.login-page::before {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    top: -120px;
    left: -100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,0.18), transparent 70%);
    pointer-events: none;
}

.login-page::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -120px;
    bottom: -160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.16), transparent 70%);
    pointer-events: none;
}

.login-shell {
    width: 100%;
    max-width: 1180px;
    min-height: 680px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    border-radius: 30px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 2;
}

.login-left {
    position: relative;
    padding: 56px 48px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at top right, rgba(96,165,250,0.20), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.login-left::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.02), transparent 45%);
    pointer-events: none;
}

.login-brand,
.login-intro,
.login-feature-list {
    position: relative;
    z-index: 2;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.login-brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 18px 35px rgba(59,130,246,0.30);
    position: relative;
    overflow: hidden;
}

.login-brand-logo::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: loginShine 3s linear infinite;
}

@keyframes loginShine {
    0% { left: -120%; }
    100% { left: 120%; }
}

.login-brand-text h1 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.login-brand-text p {
    margin: 8px 0 0;
    font-size: 14px;
    color: rgba(255,255,255,0.72);
}

.login-intro {
    margin-top: 40px;
}

.login-intro h2 {
    margin: 0 0 14px;
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
}

.login-intro p {
    max-width: 500px;
    font-size: 16px;
    line-height: 1.9;
    color: rgba(255,255,255,0.82);
}

.login-feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255,255,255,0.88);
}

.feature-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 0 6px rgba(96,165,250,0.14);
    flex-shrink: 0;
}

.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
}

.login-box {
    width: 100%;
    max-width: 430px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 28px;
    padding: 34px 30px 30px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -100px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,0.14), transparent 70%);
    pointer-events: none;
}

.login-box-top {
    position: relative;
    z-index: 2;
    margin-bottom: 22px;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 16px;
}

.login-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.10);
}

.login-box h2 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
}

.login-box p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.8;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    position: relative;
    z-index: 2;
}

.login-form-group label {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

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

.login-input-wrap input {
    width: 100%;
    height: 54px;
    border: 1px solid #dbe4f0;
    background: #f8fbff;
    border-radius: 16px;
    padding: 0 16px;
    font-size: 15px;
    color: #0f172a;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.login-input-wrap input:focus {
    border-color: #60a5fa;
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.12);
    transform: translateY(-1px);
}

.login-submit-btn {
    width: 100%;
    height: 52px;
    margin-top: 10px;
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 55%, #60a5fa 100%);
    box-shadow: 0 16px 30px rgba(37,99,235,0.24);
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.login-submit-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.26), transparent);
    transition: left 0.6s ease;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(37,99,235,0.30);
}

.login-submit-btn:hover::before {
    left: 120%;
}

.login-submit-btn:active {
    transform: scale(0.98);
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 540px;
        min-height: auto;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 20px;
        background: transparent;
    }

    .login-box {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .login-page {
        padding: 16px;
    }

    .login-right {
        padding: 12px;
    }

    .login-box {
        padding: 26px 20px 22px;
        border-radius: 22px;
    }

    .login-box h2 {
        font-size: 25px;
    }

    .login-input-wrap input,
    .login-submit-btn {
        height: 50px;
    }
}