:root {
    color-scheme: light;
    --bg: #f7f9fc;
    --surface: #ffffff;
    --text: #0b1b3c;
    --muted: #758198;
    --border: #dce3ed;
    --border-strong: #c9d4e2;
    --blue: #1265f3;
    --blue-dark: #0752d9;
    --blue-soft: #f3f7ff;
    --danger: #d92d20;
    --success: #16803c;
    --shadow: 0 20px 55px rgba(22, 38, 68, .08), 0 2px 8px rgba(22, 38, 68, .05);
    --radius: 14px;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }

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

.login-page {
    background: #f8fafc;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.login-card {
    width: min(100%, 480px);
    padding: 54px 44px 45px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.brand-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    color: var(--blue);
}

.brand-icon svg,
.app-header svg,
.drop-zone svg,
.section-heading svg,
.empty-state svg,
.upload-row svg,
.download-action svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-icon svg path:first-child { fill: rgba(18, 101, 243, .07); }

.login-card h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.2;
    letter-spacing: -.02em;
    font-weight: 750;
}

.login-subtitle {
    margin: 12px 0 27px;
    color: #31415d;
    font-size: 18px;
}

.login-form {
    display: grid;
    gap: 14px;
    text-align: left;
}

.field-group { min-width: 0; }

.field-label {
    display: block;
    margin: 0 0 7px 2px;
    color: #31415d;
    font-size: 15px;
    font-weight: 650;
}

.login-field {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field input {
    width: 100%;
    height: 54px;
    padding: 0 18px 0 48px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.login-field input[type="password"] { padding-right: 54px; }
.login-field input::placeholder { color: #9aa5b7; }

.login-field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(18, 101, 243, .12);
}

.captcha-control {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(138px, 1fr);
    gap: 10px;
}

.captcha-decoy {
    min-width: 0;
    height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 0 13px 0 16px;
    color: #2459b5;
    background: #f7f9fd;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.captcha-decoy:hover {
    color: var(--blue);
    background: var(--blue-soft);
    border-color: #9dbbf0;
}

.captcha-decoy:focus-visible {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(18, 101, 243, .12);
}

.captcha-decoy-code {
    overflow: hidden;
    font-family: Consolas, "Courier New", monospace;
    font-size: 21px;
    font-style: italic;
    font-weight: 750;
    line-height: 1;
    letter-spacing: .13em;
    white-space: nowrap;
}

.captcha-decoy-refresh {
    color: #74829a;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.field-icon {
    position: absolute;
    left: 17px;
    width: 21px;
    height: 21px;
    color: #8b97aa;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.icon-button {
    position: absolute;
    right: 10px;
    width: 40px;
    height: 40px;
    padding: 9px;
    color: #7f8ba0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.icon-button:hover { background: #f2f5f9; color: #526078; }
.icon-button:focus-visible { outline: 3px solid rgba(18, 101, 243, .22); }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.form-error {
    min-height: 23px;
    margin: -3px 2px -2px;
    color: var(--danger);
    font-size: 13px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 25px;
    color: #fff;
    font-weight: 650;
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 10px;
    box-shadow: 0 5px 12px rgba(18, 101, 243, .16);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .12s ease;
}

.primary-button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.primary-button:active { transform: translateY(1px); }
.primary-button:focus-visible { outline: 3px solid rgba(18, 101, 243, .25); outline-offset: 2px; }
.primary-button:disabled { opacity: .65; cursor: wait; }
.login-form > .primary-button { width: 100%; }

.cleanup-note {
    margin: 23px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.app-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 23px;
    padding: 0 32px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.header-brand {
    padding-right: 23px;
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -.02em;
    border-right: 1px solid var(--border);
}

.header-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.header-note svg, .header-action svg, .text-action svg { width: 20px; height: 20px; }

.header-action, .text-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    color: var(--blue);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.header-action { margin-left: auto; }
.header-action:hover, .text-action:hover { background: var(--blue-soft); }
.header-action:focus-visible, .text-action:focus-visible { outline: 3px solid rgba(18, 101, 243, .2); }
.text-action:disabled { opacity: .6; cursor: wait; }
.text-action.is-loading svg { animation: refresh-spin .8s linear infinite; }

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

.app-shell {
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px 40px;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.upload-surface { padding: 20px; }
.files-surface { margin-top: 18px; padding: 20px; }

.surface h1, .surface h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.35;
    font-weight: 720;
    letter-spacing: -.01em;
}

.drop-zone {
    min-height: 264px;
    margin-top: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: #fbfdff;
    border: 1.5px dashed #5a91fa;
    border-radius: 11px;
    cursor: pointer;
    outline: none;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.drop-zone:hover, .drop-zone.is-dragging {
    background: var(--blue-soft);
    border-color: var(--blue);
}

.drop-zone:focus-visible { box-shadow: 0 0 0 4px rgba(18, 101, 243, .12); }
.drop-zone input { display: none; }
.upload-icon { width: 52px !important; height: 52px !important; color: var(--blue); }
.drop-title { margin: 12px 0 3px; font-size: 23px; font-weight: 650; }
.drop-help { margin: 0; color: var(--muted); font-size: 16px; }

.choose-button {
    min-height: 42px;
    margin-top: 18px;
    padding-inline: 22px;
    font-size: 16px;
    box-shadow: none;
    pointer-events: none;
}

.choose-button svg { width: 19px; height: 19px; margin-right: 8px; }

.upload-queue:empty { display: none; }

.upload-queue {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.upload-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 330px) 64px 72px;
    align-items: center;
    gap: 18px;
    min-height: 68px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.upload-name { min-width: 0; }
.upload-name strong, .upload-name span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.upload-name strong { font-size: 14px; font-weight: 650; }
.upload-name span { margin-top: 2px; color: var(--muted); font-size: 12px; }

.progress-track {
    --progress-color: var(--blue);
    width: 100%;
    height: 7px;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    background: #e7ebf1;
    border: 0;
    border-radius: 10px;
}
.progress-track::-webkit-progress-bar { background: #e7ebf1; border-radius: 10px; }
.progress-track::-webkit-progress-value { background: var(--progress-color); border-radius: 10px; transition: width .12s linear; }
.progress-track::-moz-progress-bar { background: var(--progress-color); border-radius: 10px; }
.progress-value { color: var(--muted); font-size: 13px; text-align: right; }
.cancel-upload { padding: 7px 9px; color: var(--blue); background: #fff; border: 1px solid #8eb4fb; border-radius: 7px; cursor: pointer; }
.cancel-upload:hover { background: var(--blue-soft); }
.upload-row.is-success .progress-track { --progress-color: var(--success); accent-color: var(--success); }
.upload-row.is-error .progress-track { --progress-color: var(--danger); accent-color: var(--danger); }

.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.file-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-table th { padding: 12px 18px; color: var(--muted); background: #f9fbfd; font-size: 15px; font-weight: 550; text-align: left; border-bottom: 1px solid var(--border); }
.file-table td { height: 64px; padding: 10px 18px; border-bottom: 1px solid #e8edf3; vertical-align: middle; }
.file-table tr:last-child td { border-bottom: 0; }
.file-table tbody tr:hover { background: #fbfdff; }
.file-table th:nth-child(1) { width: 44%; }
.file-table th:nth-child(2) { width: 16%; }
.file-table th:nth-child(3) { width: 25%; }
.file-table th:nth-child(4) { width: 15%; }

.file-name-cell { display: flex; align-items: center; min-width: 0; }
.file-type {
    flex: 0 0 38px;
    height: 42px;
    display: grid;
    place-items: end center;
    padding-bottom: 4px;
    margin-right: 14px;
    color: #fff;
    background: #66758d;
    border-radius: 5px 5px 7px 7px;
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
}

.file-type[data-kind="pdf"] { background: #e5484d; }
.file-type[data-kind="doc"], .file-type[data-kind="docx"] { background: #2c67c7; }
.file-type[data-kind="xls"], .file-type[data-kind="xlsx"] { background: #2f9e5b; }
.file-type[data-kind="zip"], .file-type[data-kind="rar"], .file-type[data-kind="7z"] { background: #8a63d2; }
.file-type[data-kind="jpg"], .file-type[data-kind="jpeg"], .file-type[data-kind="png"] { background: #d97726; }
.file-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 540; }
.size-cell, .date-cell { color: #34435d; font-variant-numeric: tabular-nums; }

.download-action { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; color: var(--blue); text-decoration: none; border-radius: 7px; }
.download-action:hover { background: var(--blue-soft); }
.download-action:focus-visible { outline: 3px solid rgba(18, 101, 243, .2); }
.download-action svg { width: 20px; height: 20px; }

.loading-state, .empty-state, .list-error {
    min-height: 116px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.empty-state { flex-direction: column; gap: 8px; }
.empty-state svg { width: 38px; height: 38px; }
.empty-state p { margin: 0; }
.list-error { color: var(--danger); }

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    max-width: min(380px, calc(100vw - 32px));
    padding: 12px 16px;
    color: #fff;
    background: #17233a;
    border-radius: 9px;
    box-shadow: 0 12px 32px rgba(10, 25, 50, .22);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible { opacity: 1; transform: none; }

[hidden] { display: none !important; }

@media (min-width: 1100px) and (min-height: 850px) {
    .login-card { width: min(100%, 640px); padding: 44px 52px 38px; }
    .brand-icon { width: 84px; height: 84px; margin-bottom: 14px; }
    .login-card h1 { font-size: 42px; }
    .login-subtitle { margin: 10px 0 24px; font-size: 20px; }
    .login-form { gap: 15px; }
    .field-label { margin-bottom: 8px; font-size: 17px; }
    .login-field input { height: 62px; padding-left: 58px; font-size: 18px; }
    .login-field input[type="password"] { padding-right: 62px; }
    .captcha-decoy { height: 62px; padding-inline: 18px 15px; }
    .captcha-decoy-code { font-size: 24px; }
    .captcha-decoy-refresh { font-size: 12px; }
    .field-icon { left: 19px; width: 27px; height: 27px; }
    .icon-button { right: 11px; width: 46px; height: 46px; padding: 10px; }
    .form-error { min-height: 24px; font-size: 14px; }
    .login-form > .primary-button { min-height: 62px; font-size: 20px; }
    .cleanup-note { margin-top: 22px; font-size: 17px; }
}

@media (max-width: 760px) {
    .app-header { min-height: 62px; padding: 0 16px; gap: 12px; }
    .header-brand { padding-right: 12px; font-size: 20px; }
    .header-note { font-size: 12px; }
    .header-note svg { display: none; }
    .header-action { padding-inline: 7px; }
    .app-shell { padding: 14px 12px 28px; }
    .upload-surface, .files-surface { padding: 14px; }
    .drop-zone { min-height: 210px; padding: 22px 14px; text-align: center; }
    .drop-title { font-size: 17px; }
    .upload-row { grid-template-columns: 1fr 50px; gap: 8px 12px; }
    .upload-name { grid-column: 1 / -1; }
    .progress-track { grid-column: 1; }
    .progress-value { grid-column: 2; }
    .cancel-upload { grid-column: 1 / -1; justify-self: end; }
    .table-wrap { overflow: visible; border: 0; }
    .file-table, .file-table tbody { display: block; }
    .file-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .file-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 14px;
        padding: 13px;
        margin-bottom: 9px;
        border: 1px solid var(--border);
        border-radius: 10px;
    }
    .file-table td { display: block; height: auto; padding: 0; border: 0 !important; }
    .file-table td:first-child { grid-column: 1 / -1; }
    .file-table .size-cell, .file-table .date-cell { color: var(--muted); font-size: 12px; }
    .file-table .size-cell::before, .file-table .date-cell::before { content: attr(data-label) "："; }
    .file-table td:last-child { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
    .file-table tbody tr:hover { background: #fff; }
    .login-card { padding: 34px 24px 28px; }
    .brand-icon { width: 62px; height: 62px; margin-bottom: 14px; }
    .login-card h1 { font-size: 30px; }
    .login-subtitle { margin: 8px 0 20px; font-size: 16px; }
}

@media (max-width: 440px) {
    .header-note { display: none; }
    .header-brand { border-right: 0; }
    .surface h1, .surface h2 { font-size: 20px; }
    .captcha-control { grid-template-columns: minmax(0, 1fr) 138px; gap: 8px; }
    .captcha-decoy { padding-inline: 11px; gap: 5px; }
    .captcha-decoy-code { font-size: 18px; }
    .captcha-decoy-refresh { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
