:root {
    --bg: #eef3fb;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-soft: #f7f9fc;
    --line: rgba(34, 62, 94, 0.1);
    --text: #10233d;
    --muted: #60738c;
    --brand: #2f67f6;
    --brand-deep: #1746bf;
    --teal: #0d7b85;
    --gold: #f2ddb8;
    --danger: #e25b54;
    --success: #1e8b6f;
    --warning: #c47c18;
    --shadow-xl: 0 26px 70px rgba(41, 73, 113, 0.12);
    --shadow-lg: 0 16px 46px rgba(41, 73, 113, 0.08);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --max-width: 1360px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(50, 116, 255, 0.12), transparent 26%),
        radial-gradient(circle at right 20%, rgba(18, 140, 153, 0.11), transparent 24%),
        linear-gradient(180deg, #f9fbff 0%, #eef3fb 52%, #edf2f7 100%);
    font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 88%);
}

.hidden {
    display: none !important;
}

.login-shell,
.console-shell {
    min-height: 100vh;
}

.login-shell {
    position: relative;
    display: grid;
    place-items: center;
    padding: 32px;
    overflow: hidden;
}

.login-aurora {
    position: absolute;
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.95;
    animation: floatBlob 12s ease-in-out infinite;
}

.login-aurora--blue {
    width: 420px;
    height: 420px;
    top: 6%;
    left: 8%;
    background: radial-gradient(circle, rgba(60, 110, 255, 0.28), rgba(60, 110, 255, 0));
}

.login-aurora--gold {
    width: 360px;
    height: 360px;
    right: 10%;
    bottom: 6%;
    background: radial-gradient(circle, rgba(242, 221, 184, 0.62), rgba(242, 221, 184, 0));
    animation-delay: -6s;
}

.login-card,
.glass-panel,
.record-card,
.stat-card,
.queue-card,
.result-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    padding: 36px;
    border-radius: 30px;
    animation: revealUp 0.7s ease-out both;
}

.login-card__eyebrow,
.hero__eyebrow,
.mini-label,
.upload-dropzone__badge {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--teal);
}

.login-card h1,
.hero h1,
.section-header h2,
.panel-head h2,
.panel-head h3,
.upload-dropzone__title {
    margin: 0;
    font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
}

.login-card h1 {
    margin-top: 14px;
    font-size: clamp(32px, 5vw, 44px);
    line-height: 1.06;
}

.login-card p,
.hero p,
.section-header p,
.panel-head p,
.record-meta,
.brand-subtitle,
.upload-dropzone__desc,
.selection-meta,
.queue-card__meta,
.result-card__meta {
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
}

label span {
    font-size: 13px;
    font-weight: 600;
    color: #41536a;
}

input,
select,
button,
a {
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus {
    border-color: rgba(47, 103, 246, 0.4);
    box-shadow: 0 0 0 4px rgba(47, 103, 246, 0.12);
}

button {
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover,
.ghost-link:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.primary-btn,
.secondary-btn,
.round-btn {
    border-radius: 999px;
    padding: 13px 22px;
    font-weight: 700;
}

.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--teal) 0%, var(--brand) 100%);
    box-shadow: 0 16px 28px rgba(30, 93, 192, 0.2);
}

.primary-btn:disabled,
.secondary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.primary-btn--full {
    width: 100%;
}

.secondary-btn,
.round-btn,
.ghost-link {
    color: var(--text);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(17, 35, 61, 0.09);
    box-shadow: 0 8px 18px rgba(30, 56, 90, 0.06);
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
}

.message {
    min-height: 20px;
    color: var(--danger);
    font-size: 13px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(19, 37, 62, 0.06);
    box-shadow: 0 10px 30px rgba(38, 65, 100, 0.05);
}

.topbar__inner,
.page-shell {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
}

.topbar__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 28px;
    align-items: center;
    min-height: 82px;
}

.brand-block {
    display: grid;
    gap: 4px;
}

.brand-mark {
    color: var(--brand);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.topnav::-webkit-scrollbar {
    display: none;
}

.topnav button {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-radius: 999px;
    background: transparent;
    color: #20334c;
    font-weight: 700;
}

.topnav button.active {
    background: rgba(47, 103, 246, 0.1);
    color: var(--brand-deep);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    min-width: 140px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(47, 103, 246, 0.08);
    text-align: center;
    font-weight: 700;
}

.page-shell {
    padding: 34px 0 54px;
}

.hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 14% 20%, rgba(14, 163, 180, 0.16), transparent 24%),
        radial-gradient(circle at 92% 12%, rgba(242, 221, 184, 0.7), transparent 26%),
        linear-gradient(96deg, rgba(233, 246, 247, 0.96), rgba(255, 250, 240, 0.9));
    box-shadow: var(--shadow-xl);
}

.hero__inner {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 34px 36px;
}

.hero h1 {
    margin-top: 10px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.05;
}

.hero p {
    max-width: 820px;
    margin: 14px 0 0;
    font-size: 17px;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.view {
    display: none;
    gap: 22px;
    animation: revealUp 0.45s ease;
}

.view.active {
    display: grid;
}

.section-header,
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.section-header h2,
.panel-head h2,
.panel-head h3 {
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.1;
}

.section-header p,
.panel-head p {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.7;
}

.glass-panel {
    border-radius: var(--radius-xl);
    padding: 28px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    border-radius: 28px;
    padding: 22px;
    animation: revealUp 0.55s ease both;
}

.stat-card__label {
    font-size: 14px;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 18px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-card small {
    display: block;
    margin-top: 8px;
    color: #4b6585;
    font-size: 12px;
}

.dashboard-grid,
.dual-grid {
    display: grid;
    gap: 20px;
}

.dashboard-grid {
    grid-template-columns: 1.15fr 0.85fr;
}

.dual-grid {
    grid-template-columns: minmax(320px, 480px) 1fr;
}

.dual-grid--wide {
    grid-template-columns: minmax(320px, 420px) 1fr;
}

.dual-grid--upload {
    grid-template-columns: minmax(360px, 520px) 1fr;
}

.quick-actions,
.record-list,
.upload-queue,
.result-list {
    display: grid;
    gap: 14px;
}

.file-table-shell {
    padding: 0;
    overflow: hidden;
}

.file-table-scroll {
    overflow-x: auto;
}

.file-table {
    width: 100%;
    min-width: 1160px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.file-table__col--name {
    width: 15%;
}

.file-table__col--key {
    width: 11%;
}

.file-table__col--scope {
    width: 6%;
}

.file-table__col--status {
    width: 13%;
}

.file-table__col--size {
    width: 6%;
}

.file-table__col--type {
    width: 8%;
}

.file-table__col--uploaded {
    width: 10%;
}

.file-table__col--access {
    width: 7%;
}

.file-table__col--url {
    width: 8%;
}

.file-table__col--actions {
    width: 16%;
}

.file-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 16px 18px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #41536a;
    background: rgba(244, 248, 255, 0.96);
    border-bottom: 1px solid rgba(17, 35, 61, 0.08);
    white-space: nowrap;
}

.file-table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(17, 35, 61, 0.06);
    font-size: 14px;
    line-height: 1.55;
    overflow: hidden;
}

.file-table tbody tr:last-child td {
    border-bottom: none;
}

.file-table tbody tr:hover {
    background: rgba(248, 250, 255, 0.72);
}

.file-table__name {
    font-size: 16px;
    font-weight: 700;
}

.file-table__secondary,
.file-table__empty {
    color: var(--muted);
    font-size: 13px;
}

.file-table__code {
    display: -webkit-box;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(17, 35, 61, 0.08);
    color: #314962;
    font-family: "Consolas", "SFMono-Regular", monospace;
    font-size: 13px;
}

.file-table__chips {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 6px;
    justify-content: start;
    align-content: center;
}

.file-table__url-cell {
    color: var(--brand-deep);
}

.file-table__url {
    display: -webkit-box;
    color: var(--brand-deep);
    text-decoration: none;
}

.file-table__actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
    align-content: center;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    width: 100%;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid rgba(17, 35, 61, 0.08);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.table-action--danger {
    color: var(--danger);
}

.file-table__clamp-2 {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.file-table__single-line {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-table__nowrap {
    white-space: nowrap;
}

.file-table__name-cell,
.file-table__key-cell,
.file-table__url-cell {
    vertical-align: top;
}

.file-table__status-cell,
.file-table__actions-cell {
    vertical-align: middle;
}

.file-table__chips .chip {
    padding: 6px 10px;
    white-space: nowrap;
}

.quick-action {
    display: grid;
    gap: 6px;
    text-align: left;
    padding: 18px 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 255, 0.96));
    border: 1px solid rgba(34, 62, 94, 0.08);
}

.quick-action strong {
    font-size: 16px;
}

.quick-action span {
    color: var(--muted);
    line-height: 1.7;
}

.filter-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, minmax(140px, 1fr)) auto;
    gap: 14px;
    margin-top: 22px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.record-card {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 22px;
    padding: 22px;
    border-radius: 28px;
}

.record-card__aside {
    display: grid;
    align-content: start;
    gap: 12px;
}

.record-card__aside strong {
    font-size: 28px;
}

.record-meta,
.queue-card__meta,
.result-card__meta {
    font-size: 13px;
    line-height: 1.6;
}

.record-card__body,
.queue-card__body,
.result-card__body {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.record-card__header,
.queue-card__header,
.result-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.record-card__header h3,
.queue-card__header h3,
.result-card__header h3 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.record-card__subline {
    display: grid;
    gap: 6px;
}

.record-card__path,
.result-card__url {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    word-break: break-all;
}

.result-card__url {
    color: var(--brand-deep);
    text-decoration: none;
}

.chip-row,
.detail-grid,
.card-actions,
.pagination-shell,
.upload-dropzone__actions,
.queue-card__actions,
.result-card__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(47, 103, 246, 0.1);
    color: var(--brand-deep);
}

.chip--success {
    background: rgba(30, 139, 111, 0.12);
    color: var(--success);
}

.chip--warning {
    background: rgba(196, 124, 24, 0.12);
    color: var(--warning);
}

.chip--danger {
    background: rgba(226, 91, 84, 0.12);
    color: var(--danger);
}

.chip--neutral {
    background: rgba(96, 115, 140, 0.12);
    color: #41536a;
}

.detail-grid {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.detail-grid span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(17, 35, 61, 0.06);
}

.card-actions a,
.card-actions button,
.queue-card__actions button,
.result-card__actions a,
.result-card__actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(17, 35, 61, 0.08);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.card-actions .danger-action,
.queue-card__actions .danger-action {
    color: var(--danger);
}

.pagination-shell {
    justify-content: center;
}

.page-state {
    min-width: 180px;
    text-align: center;
    font-weight: 700;
    color: #34475f;
}

.code-block {
    margin: 18px 0 0;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(248, 250, 254, 0.95), rgba(239, 245, 251, 0.95));
    border: 1px solid rgba(17, 35, 61, 0.06);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.7;
    overflow: auto;
}

.upload-dropzone {
    display: grid;
    gap: 12px;
    padding: 22px;
    border-radius: 26px;
    border: 1px dashed rgba(47, 103, 246, 0.28);
    background:
        linear-gradient(135deg, rgba(236, 247, 248, 0.98), rgba(250, 251, 255, 0.96));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus {
    border-color: rgba(47, 103, 246, 0.45);
    box-shadow: 0 0 0 6px rgba(47, 103, 246, 0.08);
}

.upload-dropzone.is-dragover {
    transform: translateY(-1px);
    border-color: rgba(13, 123, 133, 0.45);
    box-shadow: 0 0 0 8px rgba(13, 123, 133, 0.08);
}

.upload-dropzone__title {
    font-size: 22px;
    line-height: 1.25;
}

.upload-dropzone__desc {
    font-size: 14px;
    line-height: 1.7;
}

.selection-meta {
    min-height: 20px;
    font-size: 14px;
    line-height: 1.7;
}

.upload-progress-panel {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(248, 250, 254, 0.96), rgba(238, 245, 252, 0.98));
    border: 1px solid rgba(17, 35, 61, 0.07);
}

.upload-progress-panel__head,
.progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.upload-progress-panel__head strong {
    font-size: 16px;
}

.upload-progress-panel__head span {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-deep);
}

.upload-progress-panel__hint,
.progress-meta {
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

.progress-track {
    position: relative;
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: rgba(47, 103, 246, 0.1);
}

.progress-track--large {
    height: 12px;
}

.progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--teal) 0%, var(--brand) 100%);
    transition: width 0.18s ease;
}

.progress-fill.is-success {
    background: linear-gradient(135deg, rgba(30, 139, 111, 0.92), rgba(23, 176, 118, 0.9));
}

.progress-fill.is-danger {
    background: linear-gradient(135deg, rgba(228, 75, 57, 0.92), rgba(248, 121, 95, 0.9));
}

.queue-card,
.result-card {
    padding: 18px;
    border-radius: 22px;
}

.queue-card__header strong,
.result-card__header strong {
    font-size: 18px;
}

.queue-card__name,
.result-card__name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-all;
}

.queue-card__progress {
    display: grid;
    gap: 8px;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 20px;
    text-align: center;
    color: var(--muted);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px dashed rgba(17, 35, 61, 0.1);
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatBlob {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, -18px, 0) scale(1.04);
    }
}

@media (max-width: 1200px) {
    .topbar__inner {
        grid-template-columns: 1fr;
        padding: 16px 0;
    }

    .topbar__actions {
        justify-content: space-between;
    }

    .dashboard-grid,
    .dual-grid,
    .dual-grid--wide,
    .dual-grid--upload {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 860px) {
    .page-shell,
    .topbar__inner {
        width: min(var(--max-width), calc(100% - 24px));
    }

    .hero__inner,
    .record-card,
    .section-header,
    .panel-head,
    .queue-card__header,
    .result-card__header {
        flex-direction: column;
    }

    .hero__inner {
        align-items: flex-start;
        padding: 28px 22px;
    }

    .glass-panel,
    .record-card,
    .login-card {
        border-radius: 24px;
        padding: 22px;
    }

    .record-card {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .file-table {
        min-width: 1040px;
    }

    .topbar__actions {
        flex-wrap: wrap;
    }

    .user-pill {
        min-width: 0;
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero h1,
    .record-card__header h3,
    .record-card__aside strong {
        font-size: 24px;
    }

    .hero__actions,
    .filter-actions,
    .card-actions,
    .file-table__actions,
    .upload-dropzone__actions,
    .queue-card__actions,
    .result-card__actions {
        width: 100%;
    }

    .hero__actions button,
    .filter-actions button,
    .card-actions button,
    .card-actions a,
    .file-table__actions .table-action,
    .upload-dropzone__actions button,
    .queue-card__actions button,
    .result-card__actions button,
    .result-card__actions a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
