:root {
    --bg: #0b1120;
    --bg-soft: #111a2f;
    --panel: rgba(15, 23, 42, 0.9);
    --panel-strong: #16213b;
    --border: rgba(148, 163, 184, 0.18);
    --text: #e5eefc;
    --muted: #9fb0d0;
    --primary: #4f8ef7;
    --primary-strong: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 18px 60px rgba(2, 8, 23, 0.45);
    --radius: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(79, 142, 247, 0.18), transparent 28%),
        radial-gradient(circle at top left, rgba(124, 92, 252, 0.16), transparent 25%),
        linear-gradient(180deg, #07101f 0%, #0b1324 100%);
    min-height: 100vh;
}

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

.page-shell {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.hero-card,
.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.hero-card {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 10px;
    color: #8db5ff;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
}

.subtitle {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.7;
    max-width: 680px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 20px;
    margin-bottom: 20px;
}

.panel {
    padding: 24px;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-title-row h2,
.list-header h2 {
    margin: 0;
    font-size: 22px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(79, 142, 247, 0.16);
    color: #cfe1ff;
    font-size: 13px;
}

.badge.success {
    background: rgba(34, 197, 94, 0.18);
    color: #c8f7d7;
}

.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 230px;
    padding: 30px;
    border: 2px dashed rgba(79, 142, 247, 0.34);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(19, 31, 56, 0.9), rgba(14, 23, 41, 0.95));
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    transform: translateY(-2px);
    border-color: rgba(79, 142, 247, 0.82);
    background: linear-gradient(180deg, rgba(27, 41, 73, 0.96), rgba(15, 26, 48, 0.98));
}

.drop-icon {
    font-size: 42px;
}

.drop-zone strong {
    font-size: 22px;
}

.drop-zone small,
.hint-text,
.muted,
.tips-list {
    color: var(--muted);
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.file-action {
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
    text-decoration: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
}

.secondary-btn {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.ghost-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.file-action:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.secondary-btn:disabled,
.primary-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.upload-queue {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.queue-name {
    font-weight: 600;
    word-break: break-all;
}

.queue-size {
    color: var(--muted);
    font-size: 13px;
}

.progress-card {
    margin-top: 18px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(19, 31, 56, 0.9);
    border: 1px solid rgba(79, 142, 247, 0.16);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.progress-bar {
    height: 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #4f8ef7);
}

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

.stat-item {
    padding: 16px;
    border-radius: 16px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.stat-item.wide {
    grid-column: 1 / -1;
}

.stat-label {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
    font-size: 13px;
}

.stat-item strong {
    font-size: 22px;
}

.tips-list {
    margin: 18px 0 0;
    padding-left: 18px;
    line-height: 1.8;
}

.list-panel {
    min-height: 280px;
}

.list-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input {
    width: min(320px, 100%);
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(8, 15, 30, 0.65);
    color: var(--text);
    outline: none;
}

.search-input:focus {
    border-color: rgba(79, 142, 247, 0.72);
}

.file-list {
    display: grid;
    gap: 14px;
}

.file-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(10, 18, 34, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.file-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(79, 142, 247, 0.14);
    font-size: 20px;
    flex: 0 0 auto;
}

.file-name {
    font-size: 18px;
    font-weight: 600;
    word-break: break-all;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

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

.file-action {
    background: rgba(79, 142, 247, 0.15);
    color: #dbeafe;
}

.file-action.secondary {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
}

.file-action.success {
    background: rgba(34, 197, 94, 0.18);
    color: #dbffe7;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 12px;
    min-height: 180px;
    border: 1px dashed rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    color: var(--muted);
}

.empty-icon {
    font-size: 40px;
}

.message-box {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.message-box.success {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.22);
    color: #d7ffe3;
}

.message-box.error {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.24);
    color: #ffd7d7;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.modal.hidden,
.hidden {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.82);
}

.modal-dialog {
    position: relative;
    width: min(1000px, calc(100vw - 24px));
    margin: 40px auto;
    border-radius: 20px;
    background: #09101f;
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 2;
}

.modal-body {
    min-height: 320px;
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 64px 20px 24px;
}

.modal-body img,
.modal-body video,
.modal-body iframe {
    display: block;
    width: 100%;
    max-height: calc(100vh - 180px);
    border: none;
    border-radius: 14px;
    background: #020617;
}

.modal-body audio {
    width: 100%;
}

.modal-body pre {
    margin: 0;
    padding: 18px;
    border-radius: 14px;
    background: #020617;
    color: #d6e6ff;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    overflow-x: auto;
}

@media (max-width: 920px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .hero-card,
    .file-card {
        grid-template-columns: 1fr;
    }

    .hero-card {
        padding: 22px;
    }

    .file-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100vw - 18px, 1180px);
        padding-top: 16px;
    }

    .panel,
    .hero-card {
        padding: 18px;
        border-radius: 18px;
    }

    .panel-title-row,
    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-input {
        width: 100%;
    }

    .action-row,
    .hero-actions,
    .file-actions {
        width: 100%;
    }

    .primary-btn,
    .secondary-btn,
    .ghost-btn,
    .file-action {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
