/* ===== 文件中转站样式 ===== */
:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(17, 24, 39, .06), 0 8px 24px rgba(17, 24, 39, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- 按钮 ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 18px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    text-decoration: none; transition: all .15s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f9fafb; color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-dl { background: #eef2ff; color: var(--primary); }
.btn-dl:hover { background: #e0e7ff; }
.btn-del { background: #fef2f2; color: var(--danger); }
.btn-del:hover { background: #fee2e2; }

/* ---- 登录页 ---- */
body.gate {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    padding: 20px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
    background: var(--card); border-radius: 16px; padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2); text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-sub { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.field { position: relative; margin-bottom: 16px; }
.field input {
    width: 100%; padding: 12px 44px 12px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 15px; transition: border-color .15s;
}
.field input:focus { outline: none; border-color: var(--primary); }
.toggle-pw {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 16px; padding: 6px;
    opacity: .6;
}
.toggle-pw:hover { opacity: 1; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--muted); }
.alert {
    padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px;
    text-align: left;
}
.alert.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* ---- 顶栏 ---- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--card); padding: 14px 24px; box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 18px; font-weight: 700; }

/* ---- 容器 & 卡片 ---- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.card {
    background: var(--card); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); margin-bottom: 24px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 17px; font-weight: 600; }
.card > .card-title { margin-bottom: 16px; }

/* ---- 拖拽上传区 ---- */
.dropzone {
    border: 2px dashed #c7d2fe; border-radius: var(--radius);
    background: #f8faff; padding: 40px 20px; text-align: center;
    transition: all .2s ease; cursor: pointer;
}
.dropzone.dragover { border-color: var(--primary); background: #eef2ff; transform: scale(1.01); }
.dz-icon { font-size: 40px; margin-bottom: 8px; }
.dz-text { color: var(--muted); margin-bottom: 12px; }
.dz-hint { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* ---- 上传队列 ---- */
.upload-queue { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.up-item {
    border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
    background: #fff;
}
.up-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.up-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.up-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.up-status.done { color: var(--success); }
.up-status.fail { color: var(--danger); }
.progress { height: 6px; background: #eef2ff; border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .2s ease; border-radius: 4px; }
.progress-bar.done { background: var(--success); }
.progress-bar.fail { background: var(--danger); }

/* ---- 文件表格 ---- */
.table-wrap { overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.file-table th, .file-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.file-table th { color: var(--muted); font-weight: 600; font-size: 13px; background: #fafbfc; }
.file-table tbody tr:hover { background: #f9fafb; }
.fname { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.col-ext, .col-size, .col-time, .col-dl { color: var(--muted); }
.col-act { white-space: nowrap; }
.col-act .btn { margin-right: 6px; }
.empty-row td { text-align: center; color: var(--muted); padding: 40px; }

/* ---- Toast ---- */
.toast-box { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: #111827; color: #fff; padding: 12px 18px; border-radius: 8px;
    font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
    animation: slideIn .25s ease; max-width: 320px;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ---- 确认弹窗 ---- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 90;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
    background: #fff; border-radius: var(--radius); padding: 24px;
    max-width: 380px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 20px; word-break: break-all; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- 响应式 ---- */
@media (max-width: 640px) {
    .container { padding: 16px 12px 40px; }
    .card { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .brand { font-size: 16px; }
    .dropzone { padding: 28px 12px; }
    .file-table th, .file-table td { padding: 10px 8px; }
    .col-ext, .col-dl { display: none; }
    .fname { max-width: 140px; }
    .col-act .btn { margin-right: 4px; padding: 5px 10px; }
    .login-card { padding: 32px 24px; }
}
