:root {
    --panel: #ffffff;
    --brand: #2f6bff;
    --brand-deep: #1547c9;
    --brand-soft: #eef4ff;
    --ink: #1f2b46;
    --muted: #7b88a8;
    --line: rgba(47, 107, 255, 0.12);
    --shadow: 0 18px 60px rgba(40, 86, 190, 0.12);
    --green: #2fbf71;
    --orange: #ff8a1f;
    --purple: #835bff;
    --danger: #e35b5b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #fbfdff 0%, #f2f6ff 100%);
    overflow-x: hidden;
}

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

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

.test-shell {
    min-height: 100vh;
}

.page {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
}

.page-main {
    padding: 18px 0 40px;
}

.page-main-home {
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.page-main-workspace {
    width: 100%;
    max-width: none;
    padding: 18px 28px 40px;
}

.page-main-records {
    width: 100%;
    max-width: none;
    padding: 18px 28px 40px;
}

.topbar-full {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(47, 107, 255, 0.08);
    backdrop-filter: blur(14px);
}

.topbar-inner {
    height: 72px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    width: 100%;
    max-width: none;
    padding: 0 28px;
}

.brand,
.nav-links,
.user-side,
.user-trigger,
.summary-header,
.toolbar,
.store-actions,
.workspace-stat,
.user-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand strong {
    font-size: 20px;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), #5ab5ff);
    position: relative;
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
    top: 6px;
    width: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.92);
}

.brand-mark::before {
    left: 9px;
    height: 16px;
}

.brand-mark::after {
    left: 15px;
    height: 10px;
}

.nav-left {
    justify-content: flex-start;
}

.nav-links a,
.nav-links button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-links a.active,
.nav-links button.active {
    color: var(--brand);
    background: var(--brand-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #fff;
    background: var(--brand);
}

.btn.secondary {
    color: var(--brand);
    background: var(--brand-soft);
}

.btn.ghost {
    color: var(--ink);
    background: rgba(47, 107, 255, 0.08);
}

.btn.danger {
    background: var(--danger);
}

.user-dropdown {
    position: relative;
}

.user-trigger {
    height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    cursor: pointer;
    background: rgba(47, 107, 255, 0.06);
}

.caret {
    color: var(--muted);
    font-size: 12px;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 152px;
    padding: 8px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(47, 107, 255, 0.1);
    box-shadow: var(--shadow);
    display: none;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
}

.dropdown-menu a:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #dce8ff, #c9dcff);
}

.avatar-fallback {
    display: grid;
    place-items: center;
    color: var(--brand);
    font-weight: 700;
}

.avatar-large {
    width: 56px;
    height: 56px;
}

.home-hero {
    position: relative;
    margin-top: 0;
    width: 100%;
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.home-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    display: block;
}

.home-copy {
    position: absolute;
    left: 140px;
    top: 50%;
    transform: translateY(-50%);
    max-width: 560px;
}

.home-copy h1 {
    margin: 0;
    font-size: 54px;
    line-height: 1.12;
}

.home-copy p {
    margin: 18px 0 26px;
    color: var(--muted);
    line-height: 1.8;
    white-space: nowrap;
}

.content {
    margin-top: 18px;
}

.subnav,
.card,
.store-card,
.record-item,
.table,
.login-card,
.workspace-summary,
.workspace-panel {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow);
}

.subnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-radius: 20px;
}

.section-title {
    margin: 0 0 6px;
    font-size: 30px;
}

.section-subtitle,
.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.workspace-grid {
    margin-top: 18px;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.card {
    padding: 24px;
    border-radius: 24px;
}

.card-title {
    margin: 0;
    font-size: 18px;
}

.workspace-stat strong {
    display: block;
    margin-top: 4px;
    font-size: 30px;
}

.mini-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f2f6ff, #e4edff);
    color: var(--brand);
    font-size: 24px;
}

.workspace-panel {
    padding: 20px 22px 16px;
    border-radius: 22px;
}

.workspace-form {
    display: grid;
    gap: 12px;
}

.workspace-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.workspace-actions {
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.workspace-action-buttons,
.workspace-inline-stats {
    display: flex;
    align-items: center;
    gap: 14px;
}

.workspace-inline-stats {
    margin-left: auto;
}

.workspace-status {
    min-width: 200px;
    color: var(--muted);
}

.workspace-inline-stats .workspace-stat {
    min-width: 220px;
    padding: 10px 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff, #f5f8ff);
    border: 1px solid var(--line);
}

.workspace-inline-stats .workspace-stat strong {
    font-size: 22px;
}

.field,
.textarea {
    width: 100%;
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fbfdff;
    color: var(--ink);
}

.textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.75;
}

.stream-box,
.summary-box {
    min-height: 280px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fbfdff, #f5f8ff);
    white-space: pre-wrap;
    line-height: 1.75;
}

.workspace-stream {
    min-height: 240px;
}

.profile-form-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-top: 18px;
}

.profile-form-label {
    color: var(--muted);
    font-weight: 700;
}

.profile-form-field {
    margin-top: 0;
}

.profile-avatar-row {
    align-items: flex-start;
}

.profile-avatar-upload {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fbfdff, #f5f8ff);
}

.profile-avatar-preview {
    flex-shrink: 0;
}

.profile-upload-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: rgba(47, 107, 255, 0.1);
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.profile-file-input {
    display: none;
}

.record-list {
    display: grid;
    gap: 12px;
}

.record-item {
    padding: 16px;
    border-radius: 18px;
    cursor: pointer;
}

.record-item strong,
.record-item span,
.record-item small {
    display: block;
}

.record-item span,
.record-item small {
    margin-top: 8px;
    color: var(--muted);
}

.audio-player {
    width: 100%;
    margin-top: 16px;
}

.page-main-records .grid {
    grid-template-columns: 320px minmax(0, 1fr);
}

.page-main-records .span-4,
.page-main-records .span-8 {
    grid-column: auto;
}

.page-main-records .summary-header {
    justify-content: space-between;
}

.table {
    border-radius: 20px;
    overflow: hidden;
}

.table-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid rgba(47, 107, 255, 0.08);
}

.table-row:first-child {
    border-top: none;
}

.table-row.head {
    background: #f5f8ff;
    font-weight: 700;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.store-card {
    padding: 26px 22px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.store-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, var(--accent-color), rgba(255,255,255,0));
}

.store-card .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
}

.store-card h4 {
    margin: 18px 0 12px;
    font-size: 22px;
}

.store-card .duration {
    margin: 18px 0 8px;
    font-size: 42px;
    font-weight: 700;
}

.store-card .duration small {
    font-size: 18px;
    font-weight: 500;
}

.store-card .price {
    color: var(--muted);
}

.store-empty {
    margin-top: 24px;
    padding: 28px 30px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(47, 107, 255, 0.08);
    box-shadow: var(--shadow);
}

.store-empty h3 {
    margin: 0 0 10px;
    font-size: 26px;
}

.store-empty p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(22, 32, 48, 0.32);
}

.purchase-modal {
    width: min(620px, 100%);
    padding: 26px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 28px 80px rgba(22, 56, 124, 0.18);
}

.purchase-head,
.purchase-actions,
.purchase-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.purchase-head {
    align-items: flex-start;
}

.purchase-head h3 {
    margin: 0 0 6px;
    font-size: 28px;
}

.purchase-summary {
    margin-top: 22px;
    padding: 18px 20px;
    border-radius: 18px;
    background: #f7f9ff;
}

.purchase-summary-item {
    display: grid;
    gap: 6px;
}

.purchase-summary-item strong {
    font-size: 20px;
}

.purchase-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.purchase-channel {
    min-height: 56px;
    border: 1px solid rgba(47, 107, 255, 0.12);
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.purchase-channel.active {
    border-color: rgba(47, 107, 255, 0.45);
    background: #eef4ff;
    color: var(--brand);
    font-weight: 700;
}

.purchase-actions {
    margin-top: 22px;
    justify-content: flex-end;
}

.store-card.blue { --accent-color: var(--brand); }
.store-card.green { --accent-color: var(--green); }
.store-card.orange { --accent-color: var(--orange); }
.store-card.purple { --accent-color: var(--purple); }

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(47, 107, 255, 0.12), transparent 30%),
        linear-gradient(135deg, #f7fbff 0%, #eef4ff 100%);
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(940px, 100%);
    margin-top: 28px;
    border-radius: 28px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
}

.login-hero {
    padding: 42px;
    background: linear-gradient(145deg, #edf4ff, #ffffff);
}

.login-form {
    padding: 42px;
}

.login-form .muted {
    margin-bottom: 16px;
}

.login-form .field,
.login-form .inline-form {
    margin-top: 12px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.tab {
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: none;
    background: #eef4ff;
    color: var(--muted);
    cursor: pointer;
}

.tab.active {
    background: var(--brand);
    color: #fff;
}

.inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.notice {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--brand-deep);
    background: #eef4ff;
}

.ops {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .store-grid,
    .grid,
    .login-card {
        grid-template-columns: 1fr;
    }

    .purchase-summary,
    .purchase-methods {
        grid-template-columns: 1fr;
        display: grid;
    }

    .span-3,
    .span-4,
    .span-6,
    .span-8,
    .span-12 {
        grid-column: span 12;
    }

    .workspace-actions,
    .workspace-inline-stats {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 760px) {
    .page {
        width: calc(100% - 20px);
    }

    .topbar-inner {
        height: auto;
        grid-template-columns: 1fr;
        padding: 12px 0;
    }

    .page-main-home {
        width: 100%;
    }

    .page-main-workspace {
        width: 100%;
        padding: 18px 10px 30px;
    }

    .page-main-records {
        width: 100%;
        padding: 18px 10px 30px;
    }

    .page-main-records .grid {
        grid-template-columns: 1fr;
    }

    .nav-left {
        flex-wrap: wrap;
    }

    .home-copy {
        left: 24px;
        right: 28px;
        max-width: 280px;
    }

    .home-copy h1 {
        font-size: 38px;
    }

    .workspace-form-row,
    .inline-form,
    .table-row {
        grid-template-columns: 1fr;
    }
}
