* {
    box-sizing: border-box;
}

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

body {
    font-family: Arial, "Microsoft YaHei", sans-serif;
    color: #f8fafc;
    background: #070816;
    overflow: hidden;
}

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

button,
input {
    font-family: inherit;
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(8px);
    opacity: .9;
    pointer-events: none;
}

.orb-a {
    width: 420px;
    height: 420px;
    left: -140px;
    top: -130px;
    background: radial-gradient(circle, rgba(139,92,246,.55), transparent 68%);
}

.orb-b {
    width: 520px;
    height: 520px;
    right: -170px;
    top: -160px;
    background: radial-gradient(circle, rgba(34,211,238,.38), transparent 68%);
}

.orb-c {
    width: 520px;
    height: 520px;
    left: 42%;
    bottom: -250px;
    background: radial-gradient(circle, rgba(236,72,153,.22), transparent 70%);
}

.app-shell {
    position: relative;
    z-index: 1;
    height: 100vh;
    padding: 18px;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
}

.sidebar,
.topbar,
.quick-create,
.content-card {
    background: rgba(15, 23, 42, .68);
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 24px 80px rgba(0,0,0,.34);
    backdrop-filter: blur(24px);
}

.sidebar {
    border-radius: 30px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 23px;
    font-weight: 900;
    margin-bottom: 28px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    display: inline-block;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.28), transparent),
        linear-gradient(135deg, #8b5cf6, #22d3ee);
    box-shadow: 0 0 36px rgba(139,92,246,.58);
}

.menu {
    display: grid;
    gap: 11px;
}

.menu-item {
    width: 100%;
    min-height: 52px;
    border: 0;
    cursor: pointer;
    border-radius: 18px;
    padding: 0 14px;
    color: #cbd5e1;
    background: rgba(255,255,255,.055);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 800;
    text-align: left;
    transition: .2s ease;
}

.menu-item:hover,
.menu-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(139,92,246,.5), rgba(34,211,238,.22));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 16px 36px rgba(139,92,246,.16);
}

.menu-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: rgba(255,255,255,.08);
}

.user-card {
    margin-top: auto;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.045));
    border: 1px solid rgba(255,255,255,.1);
}

.avatar {
    width: 46px;
    height: 46px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    margin-bottom: 12px;
}

.user-name {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 4px;
}

.user-balance {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 12px;
}

.user-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.user-actions a {
    color: #bae6fd;
    font-weight: 800;
    font-size: 14px;
}

.main {
    min-width: 0;
    height: calc(100vh - 36px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
}

.topbar {
    min-height: 86px;
    border-radius: 28px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.mobile-brand {
    display: none;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -1px;
}

.topbar p {
    margin: 7px 0 0;
    color: #94a3b8;
    line-height: 1.5;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.balance-pill,
.top-btn {
    min-height: 42px;
    padding: 0 15px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-weight: 800;
    font-size: 14px;
}

.balance-pill {
    color: #dbeafe;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
}

.top-btn {
    border: 0;
    cursor: pointer;
}

.top-btn.ghost,
.top-btn.refresh {
    color: #e2e8f0;
    background: rgba(255,255,255,.075);
    border: 1px solid rgba(255,255,255,.1);
}

.top-btn.primary {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
}

.quick-create {
    border-radius: 26px;
    padding: 14px;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.quick-left strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.quick-left span {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.5;
}

.quick-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 10px;
}

.quick-input input {
    width: 100%;
    height: 46px;
    border: 1px solid rgba(255,255,255,.1);
    outline: none;
    border-radius: 16px;
    padding: 0 15px;
    color: #f8fafc;
    background: rgba(2,6,23,.62);
}

.quick-input input::placeholder {
    color: #64748b;
}

.quick-input button {
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
}

.content-card {
    position: relative;
    min-height: 0;
    border-radius: 30px;
    overflow: hidden;
}

.content-card iframe {
    width: 100%;
    height: 100%;
    display: block;
    background: #fff;
}

.loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: #e2e8f0;
    background: rgba(2,6,23,.64);
    backdrop-filter: blur(10px);
}

.loading.show {
    display: grid;
}

.loader {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 3px solid rgba(255,255,255,.18);
    border-top-color: #22d3ee;
    animation: spin 1s linear infinite;
}

.mobile-nav {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    body {
        overflow: auto;
    }

    .app-shell {
        min-height: 100vh;
        height: auto;
        padding: 12px;
        grid-template-columns: 1fr;
        padding-bottom: 82px;
    }

    .sidebar {
        display: none;
    }

    .main {
        height: calc(100vh - 106px);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .quick-create {
        grid-template-columns: 1fr;
    }

    .mobile-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 20;
        height: 58px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 8px;
        border-radius: 22px;
        background: rgba(15,23,42,.88);
        border: 1px solid rgba(255,255,255,.12);
        backdrop-filter: blur(18px);
        box-shadow: 0 20px 60px rgba(0,0,0,.38);
    }

    .mobile-nav button {
        border: 0;
        border-radius: 16px;
        color: #cbd5e1;
        background: transparent;
        font-weight: 900;
    }

    .mobile-nav button.active {
        color: #fff;
        background: linear-gradient(135deg, rgba(139,92,246,.65), rgba(34,211,238,.28));
    }
}

@media (max-width: 620px) {
    .top-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .balance-pill,
    .top-btn {
        min-height: 38px;
        font-size: 13px;
    }

    .quick-input {
        grid-template-columns: 1fr;
    }

    .quick-input button {
        height: 44px;
    }
}
