:root {
    --bg: #f3f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --ink: #152236;
    --muted: #64748b;
    --line: #d7e3f0;
    --primary: #1f5fa7;
    --primary-strong: #16477e;
    --accent: #f39c12;
    --danger: #d94841;
    --success: #1e8e5a;
    --shadow: 0 18px 44px rgba(17, 49, 85, 0.08);
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(31, 95, 167, 0.08), transparent 38%),
        linear-gradient(180deg, #eef4fb 0%, #f8fbff 24%, #f3f7fb 100%);
    transition: background 0.24s ease, color 0.24s ease;
}

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

button {
    cursor: pointer;
}

.hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(8, 25, 46, 0.48), rgba(8, 25, 46, 0.62)),
        url("../data/bg.jpg") center / cover no-repeat;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 209, 102, 0.22), transparent 28%),
        radial-gradient(circle at 80% 30%, rgba(64, 145, 255, 0.18), transparent 30%);
}

.hero__inner {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100vw - 48px));
    text-align: center;
    color: #fff;
}

.hero__eyebrow {
    margin: 0 0 18px;
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.hero__title {
    margin: 0;
    font-size: clamp(2.6rem, 5vw, 4.7rem);
    line-height: 1.18;
    font-weight: 800;
    text-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.hero__desc {
    margin: 24px auto 0;
    max-width: 780px;
    font-size: clamp(1.02rem, 2vw, 1.28rem);
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.96);
}

.hero__cta {
    margin-top: 34px;
    border: 0;
    border-radius: 999px;
    padding: 15px 28px;
    background: linear-gradient(135deg, #ffffff, #e8f1fb);
    color: var(--primary-strong);
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(6, 24, 42, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(6, 24, 42, 0.22);
}

.workspace {
    width: min(1260px, calc(100vw - 32px));
    margin: -78px auto 52px;
    position: relative;
    z-index: 2;
}

.app-shell {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(215, 227, 240, 0.8);
    border-radius: 32px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tabbar {
    display: flex;
    gap: 10px;
    padding: 18px;
    background: linear-gradient(135deg, #1f5fa7, #2e77b8);
    flex-wrap: wrap;
}

.tabbar__button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-weight: 700;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

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

.tabbar__button.is-active {
    background: #ffffff;
    color: var(--primary-strong);
}

.panel {
    padding: 30px;
}

.section-head {
    margin-bottom: 24px;
}

.section-head__title {
    margin: 0;
    font-size: clamp(1.75rem, 2.4vw, 2.2rem);
    color: var(--primary);
}

.section-head__desc {
    margin: 12px 0 0;
    max-width: 920px;
    line-height: 1.9;
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 18px;
}

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

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

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: 0 10px 24px rgba(17, 49, 85, 0.04);
}

.card--soft {
    background: linear-gradient(180deg, #fcfdff 0%, #f7fbff 100%);
}

.card__title {
    margin: 0 0 10px;
    font-size: 1.06rem;
    color: #24384f;
}

.card__text {
    margin: 0;
    color: var(--muted);
    line-height: 1.86;
}

.field-group {
    display: grid;
    gap: 16px;
}

.config-flow {
    gap: 20px;
}

.label {
    display: block;
    margin: 0 0 8px;
    color: #2f4157;
    font-weight: 700;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid #c9d8e7;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: #ffffff;
    color: var(--ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: #6aa6e8;
    box-shadow: 0 0 0 4px rgba(80, 145, 214, 0.14);
}

.input:disabled,
.select:disabled {
    background: #eef3f8;
    color: #8b98a8;
    cursor: not-allowed;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.upload-dropzone {
    display: grid;
    gap: 10px;
    align-content: center;
    min-height: 152px;
    padding: 18px 18px 16px;
    border: 1.5px dashed #c5d7ea;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 100%);
    color: #42546b;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.upload-dropzone:hover {
    border-color: #8eb8e6;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(241, 248, 255, 1) 100%);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(31, 95, 167, 0.08);
}

.upload-dropzone.is-disabled {
    cursor: not-allowed;
    border-color: #d7e1ec;
    background: #f5f8fb;
    color: #8a99a9;
    box-shadow: none;
    transform: none;
}

.upload-dropzone__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 58px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eaf3fd;
    color: var(--primary-strong);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.upload-dropzone.is-disabled .upload-dropzone__badge {
    background: #e7edf4;
    color: #8292a4;
}

.upload-dropzone__title {
    font-size: 1rem;
    font-weight: 800;
    color: #28415d;
    line-height: 1.5;
    word-break: break-all;
}

.upload-dropzone.is-disabled .upload-dropzone__title {
    color: #6c7f94;
}

.upload-dropzone__desc {
    color: #627489;
    line-height: 1.7;
}

.upload-dropzone__meta {
    color: #7c90a6;
    font-size: 0.9rem;
}

.segmented {
    display: inline-flex;
    gap: 8px;
    padding: 8px;
    background: #eff5fb;
    border-radius: 999px;
    border: 1px solid #d7e3f0;
    flex-wrap: wrap;
}

.segmented__button {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 10px 18px;
    color: #4a627d;
    font-weight: 700;
}

.segmented__button.is-active {
    background: #ffffff;
    color: var(--primary-strong);
    box-shadow: 0 8px 16px rgba(24, 62, 99, 0.08);
}

.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    border: 0;
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--primary), #2d73bb);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(31, 95, 167, 0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(31, 95, 167, 0.18);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn--ghost {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid #c9d8e7;
    box-shadow: none;
}

.btn--wide {
    width: 100%;
    justify-content: center;
}

.status {
    border-radius: var(--radius-md);
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    line-height: 1.8;
}

.status--info {
    background: #f4f8fd;
    border-color: #d8e5f5;
}

.status--warn {
    background: #fff7ec;
    border-color: #f6ddb7;
}

.status strong {
    color: var(--ink);
}

.metric {
    padding: 18px 16px;
    text-align: center;
}

.metric__label {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.metric__value {
    margin: 10px 0 0;
    color: var(--primary);
    font-size: clamp(1.72rem, 3vw, 2.3rem);
    font-weight: 800;
}

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

.subtabs__button {
    border: 1px solid #d4e0ee;
    background: #ffffff;
    color: #44617c;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
}

.subtabs__button.is-active {
    background: #eaf3fd;
    color: var(--primary-strong);
    border-color: #b7d1ef;
}

.chart-card {
    display: grid;
    gap: 14px;
}

.chart-card__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    flex-wrap: wrap;
}

.chart-card__title {
    margin: 0;
    font-size: 1.08rem;
    color: #24384f;
}

.chart-card__desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.chart-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e1ebf5;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.chart-wrap svg {
    display: block;
    width: 100%;
    min-width: 760px;
    height: auto;
}

.legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.92rem;
}

.legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend__swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.table-frame {
    display: grid;
    gap: 10px;
}

.table-scroll-note {
    color: #6f8195;
    font-size: 0.92rem;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    border: 1px solid #dbe6f2;
    border-radius: 16px;
    background: #ffffff;
    scrollbar-gutter: stable both-edges;
    -webkit-overflow-scrolling: touch;
}

.table-wrap:focus {
    outline: 2px solid rgba(80, 145, 214, 0.22);
    outline-offset: 2px;
}

.table-wrap::-webkit-scrollbar,
.chart-wrap::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-wrap::-webkit-scrollbar-track,
.chart-wrap::-webkit-scrollbar-track {
    background: #edf4fb;
    border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb,
.chart-wrap::-webkit-scrollbar-thumb {
    background: #bfd3e8;
    border: 2px solid #edf4fb;
    border-radius: 999px;
}

.table-wrap__inner {
    width: max-content;
    min-width: 100%;
}

.table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

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

.table th {
    position: sticky;
    top: 0;
    background: #f7fbff;
    color: #324a63;
    font-weight: 800;
    z-index: 1;
}

.table tr:last-child td {
    border-bottom: 0;
}

.meta-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    line-height: 1.7;
}

.meta-row strong {
    color: var(--ink);
}

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 20;
    padding: 13px 16px;
    border-radius: 14px;
    background: rgba(20, 35, 54, 0.95);
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(8, 25, 46, 0.22);
    transform: translateY(-14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--success {
    background: rgba(30, 142, 90, 0.95);
}

.toast--error {
    background: rgba(217, 72, 65, 0.96);
}

.muted {
    color: var(--muted);
}

@media (max-width: 980px) {
    .workspace {
        width: min(100vw - 18px, 100%);
        margin-top: -44px;
    }

    .panel {
        padding: 22px 16px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .hero__inner {
        width: min(100vw - 28px, 100%);
    }
}
