:root {
    color-scheme: dark;
    --bg-base: #08111f;
    --bg-secondary: #0d1830;
    --surface: rgba(12, 23, 42, 0.54);
    --surface-strong: rgba(13, 25, 47, 0.82);
    --surface-soft: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text-primary: #f8fbff;
    --text-secondary: rgba(232, 241, 255, 0.76);
    --text-muted: rgba(194, 208, 230, 0.58);
    --primary: #7cc7ff;
    --primary-strong: #4aa4ff;
    --danger: #ff6b8a;
    --danger-strong: #ff4d73;
    --success: #59e6b4;
    --warning: #ffd36b;
    --shadow-xl: 0 30px 80px -38px rgba(0, 0, 0, 0.72);
    --shadow-card: 0 24px 70px -30px rgba(16, 24, 40, 0.78);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--text-primary);
    overflow-x: hidden;
    font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(122, 195, 255, 0.22), transparent 26%),
        radial-gradient(circle at top right, rgba(167, 139, 250, 0.18), transparent 28%),
        radial-gradient(circle at bottom, rgba(45, 212, 191, 0.12), transparent 26%),
        linear-gradient(180deg, #08111f 0%, #091526 35%, #07111e 100%);
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}

body::before {
    background:
        radial-gradient(circle at 12% 20%, rgba(125, 211, 252, 0.18), transparent 0 18%),
        radial-gradient(circle at 82% 16%, rgba(196, 181, 253, 0.16), transparent 0 16%),
        radial-gradient(circle at 50% 84%, rgba(45, 212, 191, 0.14), transparent 0 20%);
    filter: blur(12px);
}

body::after {
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.5), transparent 78%);
    opacity: 0.22;
}

main { position: relative; z-index: 1; }

a { text-decoration: none; }

.app-shell {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.glass {
    background: linear-gradient(180deg, rgba(16, 27, 48, 0.7), rgba(10, 20, 36, 0.52));
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-card);
}

.glass-nav {
    position: sticky;
    top: 16px;
    z-index: 40;
    width: min(1180px, calc(100% - 24px));
    margin: 18px auto 0;
    border-radius: 999px;
    padding: 0 10px;
}

.glass-panel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(17, 27, 48, 0.7), rgba(8, 16, 31, 0.6));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(28px) saturate(145%);
    -webkit-backdrop-filter: blur(28px) saturate(145%);
}

.glass-panel::before,
.glass-modal::before,
.glass-nav::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 30%, transparent 100%);
    pointer-events: none;
}

.glass-soft {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.glass-modal {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(17, 27, 48, 0.9), rgba(9, 17, 32, 0.82));
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(32px) saturate(150%);
    -webkit-backdrop-filter: blur(32px) saturate(150%);
}

.hero-wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 16px 44px;
}

.hero-copy {
    max-width: 760px;
    margin: 0 auto 22px;
    text-align: center;
}

.hero-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-title {
    margin: 14px 0 10px;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.8;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--text-secondary);
    transition: 180ms ease;
}

.nav-link:hover,
.drawer-link:hover { color: #fff; }

.nav-active-desktop {
    color: #fff !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 35px -22px rgba(96, 165, 250, 0.95);
}

.nav-active-desktop i { color: var(--primary) !important; }

#drawer-overlay {
    background: rgba(3, 8, 18, 0.48);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#drawer {
    background: linear-gradient(180deg, rgba(8, 16, 31, 0.96), rgba(10, 19, 35, 0.88));
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 12px;
    padding: 16px 18px;
    border-radius: 18px;
    color: var(--text-secondary);
    transition: 180ms ease;
}

.nav-active-mobile {
    color: #fff !important;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.18), rgba(59, 130, 246, 0.12)) !important;
    border: 1px solid rgba(125, 211, 252, 0.16);
}

.surface-grid {
    display: grid;
    gap: 20px;
}

.page-card {
    padding: 22px;
    border-radius: var(--radius-xl);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
}

.panel-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.glass-field,
.glass-select,
.glass-input {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
    color: #fff;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: 180ms ease;
}

.glass-field::placeholder,
.glass-input::placeholder { color: rgba(203, 213, 225, 0.46); }

.glass-field:focus,
.glass-input:focus,
.glass-select:focus,
.input-group:focus-within {
    border-color: rgba(124, 199, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(74, 164, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 0 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: 180ms ease;
}

.input-group input,
.input-group select {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: none;
    color: #fff;
}

.input-group input::placeholder { color: rgba(203, 213, 225, 0.46); }

.glass-button,
.glass-button-danger,
.glass-button-soft,
.glass-button-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 800;
    transition: transform 140ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.glass-button:hover,
.glass-button-danger:hover,
.glass-button-soft:hover,
.glass-button-ghost:hover { transform: translateY(-1px); }
.glass-button:active,
.glass-button-danger:active,
.glass-button-soft:active,
.glass-button-ghost:active { transform: scale(0.98); }

.glass-button {
    color: #07111f;
    background: linear-gradient(180deg, #c9ebff 0%, #85d2ff 100%);
    box-shadow: 0 18px 40px -22px rgba(74, 164, 255, 0.95);
}

.glass-button-danger {
    color: #fff;
    background: linear-gradient(180deg, #ff7a98 0%, #ff557b 100%);
    box-shadow: 0 18px 38px -22px rgba(255, 85, 123, 0.9);
}

.glass-button-soft {
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.07));
    border-color: rgba(255, 255, 255, 0.08);
}

.glass-button-ghost {
    color: var(--text-secondary);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
}

.glass-button:disabled,
.glass-button-danger:disabled,
.glass-button-soft:disabled,
.glass-button-ghost:disabled,
button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none !important;
}

.segmented {
    display: inline-flex;
    gap: 8px;
    padding: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.segmented button,
.segmented a,
.segmented .segment-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    color: var(--text-secondary);
    transition: 180ms ease;
}

.tab-active,
.segmented .is-active {
    color: #fff !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 18px 35px -26px rgba(124, 199, 255, 0.9);
}

.glass-table-wrap {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(4, 10, 20, 0.22);
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
}

.glass-table thead {
    background: rgba(255, 255, 255, 0.04);
}

.glass-table th,
.glass-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.glass-table td { color: var(--text-secondary); }
.glass-table tbody tr:last-child td { border-bottom: 0; }
.glass-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
}

.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 0 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-card {
    width: min(100%, 460px);
    padding: 28px;
    margin: 28px auto;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tabs button {
    min-height: 46px;
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 800;
    transition: 180ms ease;
}

.hero-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(16px);
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}

.custom-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.45); border-radius: 999px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }

.swal2-popup { backdrop-filter: blur(18px); }

@media (max-width: 767px) {
    .glass-nav {
        top: 10px;
        width: calc(100% - 18px);
        margin-top: 10px;
        border-radius: 28px;
    }

    .hero-wrap { padding: 18px 14px 34px; }
    .page-card { padding: 18px; }
    .panel-header { align-items: flex-start; flex-direction: column; }
    .pagination-bar { flex-wrap: wrap; }
    .auth-card { padding: 22px; }
}
