@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

:root {
    --ui-bg: #f4f7f2;
    --ui-bg-deep: #ebf1ea;
    --ui-surface: rgba(255, 255, 255, 0.82);
    --ui-surface-strong: rgba(255, 255, 255, 0.94);
    --ui-panel: #ffffff;
    --ui-border: rgba(15, 23, 42, 0.08);
    --ui-border-strong: rgba(15, 23, 42, 0.14);
    --ui-ink: #16202e;
    --ui-muted: #617085;
    --ui-soft: #8d9aae;
    --ui-accent: #0f766e;
    --ui-accent-strong: #115e59;
    --ui-accent-soft: rgba(15, 118, 110, 0.1);
    --ui-warm: #d97706;
    --ui-warm-soft: rgba(217, 119, 6, 0.12);
    --ui-danger: #dc2626;
    --ui-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    --ui-shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.05);
    --ui-shadow-strong: 0 28px 80px rgba(15, 23, 42, 0.12);
    --ui-radius-xl: 1.6rem;
    --ui-radius-lg: 1.1rem;
    --ui-radius-md: 0.9rem;
}

html {
    scroll-behavior: smooth;
}

body.app-ui,
body.admin-ui {
    font-family: "Manrope", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--ui-ink);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 28rem),
        radial-gradient(circle at top right, rgba(217, 119, 6, 0.08), transparent 24rem),
        linear-gradient(180deg, var(--ui-bg), var(--ui-bg-deep));
}

body.app-ui::before,
body.admin-ui::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 75%);
    opacity: 0.35;
}

body.admin-ui {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.08), transparent 22rem),
        linear-gradient(180deg, #eef3ef, #e8eeea);
}

body.admin-ui::before {
    opacity: 0.2;
}

body :where(.card, .stats, .alert, .modal-box, .navbar, aside, .table, .hero, .tabs-box, .join-item, .menu, .input, .textarea, .select, .file-input) {
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

body :where(.card, .stats, .hero, .modal-box) {
    border: 1px solid var(--ui-border);
    background: var(--ui-surface-strong);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(16px);
}

body .card {
    border-radius: var(--ui-radius-xl);
    overflow: hidden;
}

body .card-body {
    gap: 1rem;
}

body .card-title {
    color: var(--ui-ink);
    font-weight: 800;
    letter-spacing: -0.01em;
}

body .hero {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--ui-radius-xl) + 0.1rem);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.3), transparent 18rem),
        linear-gradient(135deg, #0f766e, #15803d 58%, #d97706);
    box-shadow: var(--ui-shadow-strong);
}

body .hero::after {
    content: "";
    position: absolute;
    inset: auto -6rem -7rem auto;
    width: 18rem;
    height: 18rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    filter: blur(14px);
}

body .stats {
    border-radius: var(--ui-radius-xl);
    background: var(--ui-surface-strong);
    overflow: hidden;
}

body .stat {
    min-width: 0;
    padding: 1.2rem 1.25rem;
}

body .stat-title {
    color: var(--ui-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body .stat-value {
    color: var(--ui-ink);
    font-weight: 800;
    letter-spacing: -0.03em;
}

body .alert {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--ui-shadow-soft);
}

body .alert-success {
    border-color: rgba(22, 163, 74, 0.22);
    background: rgba(240, 253, 244, 0.94);
}

body .alert-error,
body .alert-danger {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(254, 242, 242, 0.96);
}

body .alert-warning {
    border-color: rgba(217, 119, 6, 0.22);
    background: rgba(255, 251, 235, 0.96);
}

body .badge {
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    padding-inline: 0.72rem;
    min-height: 1.7rem;
    gap: 0.35rem;
}

body .badge-outline,
body .badge-ghost {
    border-color: var(--ui-border-strong);
    background: rgba(255, 255, 255, 0.65);
    color: var(--ui-muted);
}

body .btn {
    min-height: 2.9rem;
    border-radius: 1rem;
    border-color: transparent;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: none;
}

body .btn:hover {
    transform: translateY(-1px);
}

body .btn:active {
    transform: translateY(0);
}

body .btn-primary {
    background: linear-gradient(135deg, var(--ui-accent), #128276);
    color: #fff;
    box-shadow: 0 16px 28px rgba(15, 118, 110, 0.18);
}

body .btn-primary:hover {
    background: linear-gradient(135deg, var(--ui-accent-strong), #12796f);
}

body .btn-outline {
    border-color: var(--ui-border-strong);
    background: rgba(255, 255, 255, 0.72);
}

body .btn-ghost {
    background: rgba(15, 23, 42, 0.04);
    color: var(--ui-ink);
}

body .btn-error,
body .btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    box-shadow: 0 14px 26px rgba(220, 38, 38, 0.18);
}

body .btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 14px 26px rgba(217, 119, 6, 0.18);
}

body .btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    box-shadow: 0 14px 26px rgba(22, 163, 74, 0.16);
}

body .btn-outline.btn-error,
body .btn-outline.btn-danger {
    background: rgba(254, 242, 242, 0.82);
    border-color: rgba(220, 38, 38, 0.22);
    color: #b91c1c;
    box-shadow: none;
}

body .btn-outline.btn-warning {
    background: rgba(255, 251, 235, 0.82);
    border-color: rgba(217, 119, 6, 0.22);
    color: #b45309;
    box-shadow: none;
}

body .btn-outline.btn-success {
    background: rgba(240, 253, 244, 0.84);
    border-color: rgba(22, 163, 74, 0.2);
    color: #15803d;
    box-shadow: none;
}

body .input,
body .textarea,
body .select,
body .file-input {
    min-height: 3rem;
    border-radius: 1rem;
    border: 1px solid var(--ui-border-strong);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body .textarea {
    min-height: 7rem;
    line-height: 1.6;
}

body .input::placeholder,
body .textarea::placeholder {
    color: #97a2b3;
}

body .input:focus,
body .textarea:focus,
body .select:focus,
body .file-input:focus {
    outline: none;
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow:
        0 0 0 4px rgba(15, 118, 110, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body .toggle {
    border-color: rgba(15, 118, 110, 0.14);
}

body .table {
    border-collapse: separate;
    border-spacing: 0;
}

body .card > .card-body > .overflow-x-auto,
body .card > .card-body > .table-shell {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body .table thead th {
    background: rgba(15, 23, 42, 0.04);
    color: var(--ui-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body .table :where(th, td) {
    vertical-align: middle;
}

body .table tbody tr {
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

body .table tbody tr:hover {
    background: rgba(15, 118, 110, 0.045);
}

body pre {
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body .table code,
body .kbd,
body pre code,
body code {
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

body code:not(pre code):not(.kbd) {
    padding: 0.12rem 0.36rem;
    border-radius: 0.45rem;
    background: rgba(15, 23, 42, 0.06);
}

body .modal-box {
    border-radius: 1.8rem;
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-strong);
    background: rgba(255, 255, 255, 0.96);
}

body .divider {
    color: var(--ui-soft);
}

body .footer {
    background: transparent;
}

body .avatar > div,
body .mask {
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

body .tabs-box,
body .join-item {
    border-color: var(--ui-border);
}

body :where(.btn, .badge, .alert, .card-title, .label, .navbar, .menu a, .sidebar-nav-link, .link) > svg:not([class*="w-"]):not([class*="h-"]) {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

body .btn svg,
body .badge svg,
body .alert svg,
body .card-title svg,
body .navbar svg,
body .menu svg,
body .sidebar-nav-link svg,
body .label svg {
    flex-shrink: 0;
}

body :where(main, .card-body, .hero-content, .stats, .table, .join, .drawer-content, .modal-action) {
    min-width: 0;
}

.app-topbar-shell,
.admin-topbar-shell {
    position: sticky;
    top: 0;
    z-index: 60;
    padding-inline: 0.75rem;
    padding-top: 0.75rem;
}

.app-topbar,
.admin-topbar {
    max-width: 78rem;
    margin: 0 auto;
    border-radius: 1.55rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
}

.admin-topbar {
    max-width: 88rem;
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.8rem;
    padding-inline: 1rem;
    border-radius: 0.95rem;
    color: var(--ui-muted);
    text-decoration: none;
    font-weight: 700;
}

.app-nav-link:hover {
    background: rgba(15, 23, 42, 0.05);
    color: var(--ui-ink);
}

.app-nav-link-active {
    background: rgba(15, 118, 110, 0.1);
    color: var(--ui-accent-strong);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.app-menu-panel {
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(16px);
}

.app-mobile-sidebar {
    position: fixed;
    inset: 0;
    z-index: 78;
    pointer-events: none;
    visibility: hidden;
}

.app-mobile-sidebar.is-open {
    pointer-events: auto;
    visibility: visible;
}

.app-mobile-sidebar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.app-mobile-sidebar-panel {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(19rem, 84vw);
    max-width: 19rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 14rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 248, 0.96));
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
    box-shadow: 24px 0 48px rgba(15, 23, 42, 0.16);
    transform: translateX(calc(-100% - 1.5rem));
    transition: transform 0.24s ease;
    will-change: transform;
}

.app-mobile-sidebar.is-open .app-mobile-sidebar-backdrop {
    opacity: 1;
}

.app-mobile-sidebar.is-open .app-mobile-sidebar-panel {
    transform: translateX(0);
}

.app-mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 248, 0.95));
    backdrop-filter: blur(16px);
}

.app-mobile-sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background:
        linear-gradient(180deg, rgba(248, 250, 248, 0.94), rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(14px);
}

.app-mobile-nav {
    padding: 0.75rem 1rem 1rem;
}

.app-mobile-nav .menu {
    gap: 0.25rem;
}

.app-mobile-nav .menu-title {
    padding-inline: 0.5rem;
    color: var(--ui-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.app-mobile-nav-link {
    display: flex;
    align-items: center;
    min-height: 3rem;
    border-radius: 1rem;
    font-weight: 700;
}

.app-mobile-nav-link-active {
    background: rgba(15, 118, 110, 0.1);
    color: var(--ui-accent-strong);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

body .menu :where(li > a) {
    border-radius: 0.95rem;
    text-decoration: none;
}

body .menu :where(li > a:hover) {
    background: rgba(15, 23, 42, 0.05);
}

.admin-topbar-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ui-ink);
}

.app-topbar .navbar-start,
.app-topbar .navbar-center,
.app-topbar .navbar-end,
.admin-topbar .flex-1,
.admin-topbar .flex-none {
    min-width: 0;
}

.app-brand,
.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ui-ink);
    text-decoration: none;
}

.app-brand-mark,
.admin-brand-mark {
    display: inline-flex;
    width: 2.3rem;
    height: 2.3rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, var(--ui-accent), var(--ui-warm));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 14px 22px rgba(15, 118, 110, 0.22);
}

.app-page-shell {
    position: relative;
    z-index: 1;
    max-width: 78rem;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.admin-page-shell {
    max-width: 88rem;
    width: 100%;
    margin: 0 auto;
}

.app-footer-shell {
    max-width: 78rem;
    width: 100%;
    margin: 0 auto 1rem;
    padding-inline: 1rem;
}

.app-footer-shell .footer {
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 1.45rem;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--ui-shadow-soft);
    backdrop-filter: blur(12px);
}

body.admin-ui .drawer {
    min-height: 100vh;
}

.admin-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
}

.admin-sidebar-desktop,
.admin-mobile-sidebar-panel {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 15rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 248, 0.96));
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
}

.admin-sidebar-desktop {
    position: sticky;
    top: 0;
    width: 19rem;
    height: 100vh;
    flex-shrink: 0;
    min-height: 100vh;
    box-shadow: 22px 0 44px rgba(15, 23, 42, 0.08);
}

.admin-content-shell {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-mobile-sidebar {
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
}

.admin-mobile-sidebar.is-open {
    pointer-events: auto;
}

.admin-mobile-sidebar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.44);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.admin-mobile-sidebar-panel {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(20rem, 86vw);
    max-width: 20rem;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 24px 0 50px rgba(15, 23, 42, 0.18);
}

.admin-mobile-sidebar.is-open .admin-mobile-sidebar-backdrop {
    opacity: 1;
}

.admin-mobile-sidebar.is-open .admin-mobile-sidebar-panel {
    transform: translateX(0);
}

.sidebar-nav-link {
    min-height: 3rem;
    gap: 0.15rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-nav-link.active {
    box-shadow: 0 14px 26px rgba(15, 118, 110, 0.15);
}

.admin-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--ui-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.admin-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 248, 0.95));
    backdrop-filter: blur(16px);
}

.admin-sidebar-footer {
    margin-top: auto;
    background:
        linear-gradient(180deg, rgba(248, 250, 248, 0.94), rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(14px);
}

.auth-shell {
    min-height: calc(100vh - 10rem);
    display: grid;
    place-items: center;
}

.auth-panel {
    position: relative;
    overflow: hidden;
    max-width: 30rem;
    width: 100%;
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto auto;
    width: 10rem;
    height: 10rem;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.16), transparent 68%);
    pointer-events: none;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--ui-accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.surface-note {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: rgba(255, 255, 255, 0.68);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: clamp(1.35rem, 1.1rem + 0.8vw, 2rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.section-copy {
    color: var(--ui-muted);
    line-height: 1.7;
}

.table-shell {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-xl);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--ui-shadow-soft);
}

.table-shell .overflow-x-auto {
    border-radius: inherit;
}

body .toast .alert {
    border-radius: 1rem;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

@media (max-width: 1023px) {
    .app-topbar-shell,
    .admin-topbar-shell {
        padding-top: 0.6rem;
        padding-inline: 0.65rem;
    }

    .app-topbar,
    .admin-topbar {
        border-radius: 1.2rem;
    }

    .app-page-shell {
        padding-top: 1.2rem;
        padding-bottom: 2rem;
    }

    .admin-sidebar-desktop {
        display: none;
    }
}

@media (max-width: 767px) {
    body .card,
    body .stats,
    body .hero,
    body .modal-box {
        border-radius: 1.25rem;
    }

    body .card-body {
        padding: 1rem;
    }

    body .btn {
        min-height: 2.7rem;
        padding-inline: 0.95rem;
    }

    body .table td {
        max-width: 12rem;
    }

    .app-brand-mark,
    .admin-brand-mark {
        width: 2rem;
        height: 2rem;
        border-radius: 0.75rem;
    }

    .auth-shell {
        min-height: auto;
    }
}
