* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
body { background: linear-gradient(145deg, #f6f9fc, #e9f2f9); min-height: 100vh; padding: 2rem 1rem; }
.container { max-width: 1200px; margin: 0 auto; }
h1 { color: #1a4d6e; margin-bottom: 1.5rem; font-size: 1.8rem; }
h1 .sub { font-size: 0.9rem; color: #5583a4; font-weight: normal; }

.upload-area {
    background: rgba(255,255,255,0.8); border: 2px dashed #b4d0e7;
    border-radius: 1.5rem; padding: 2rem; text-align: center;
    cursor: pointer; margin-bottom: 1.5rem; transition: all 0.2s;
}
.upload-area:hover, .upload-area.drag-over {
    border-color: #1e7eb0; background: #e3f0fa; transform: scale(1.005);
}
.upload-area input { display: none; }
.upload-area .icon { font-size: 3rem; margin-bottom: 0.5rem; }
.upload-area p { color: #1f4e6f; font-size: 1.1rem; font-weight: 500; }
.upload-area small { color: #5583a4; display: block; margin-top: 0.4rem; }

.warn-box {
    background: #fff4e0; border-left: 4px solid #e6a23c;
    padding: 0.8rem 1rem; border-radius: 0.6rem;
    margin-bottom: 1rem; font-size: 0.85rem; color: #7a5a1a;
}
.warn-box code { background: #fff; padding: 0.1rem 0.4rem; border-radius: 0.3rem; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.toolbar h2 { font-size: 1.2rem; color: #0e2e44; }
.toolbar .count { color: #5583a4; font-size: 0.9rem; font-weight: normal; }
.btn {
    padding: 0.55rem 1.3rem; border: none; border-radius: 2rem;
    background: #1a4d6e; color: white; cursor: pointer; font-size: 0.9rem;
    transition: all 0.2s; text-decoration: none;
}
.btn:hover { background: #0f3a54; transform: translateY(-1px); }

.progress-box {
    display: none; margin-bottom: 1rem; padding: 0.8rem 1rem;
    background: #e3f0fa; border-radius: 0.8rem; color: #1a4d6e; font-size: 0.9rem;
}
.progress-box.show { display: block; }

.filters { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-btn {
    padding: 0.35rem 1rem; border: 1px solid #c9def0; background: white;
    border-radius: 2rem; cursor: pointer; font-size: 0.85rem; color: #42789b;
    transition: all 0.15s;
}
.filter-btn:hover { background: #e3f0fa; }
.filter-btn.active { background: #1a4d6e; color: white; border-color: #1a4d6e; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.card {
    background: white; border-radius: 1rem; overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,30,60,0.08); transition: all 0.2s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(20,80,130,0.15); }
.card.hidden { display: none; }

.card .preview {
    aspect-ratio: 1; overflow: hidden; background: #f0f7fd;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.card .preview img,
.card .preview video {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.card .preview audio { width: 90%; margin: 0 auto; }
.card .preview .file-icon {
    font-size: 3rem; color: #8fb6d4;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.card .preview .file-icon .ext-badge {
    font-size: 0.7rem; background: #1a4d6e; color: white;
    padding: 0.15rem 0.5rem; border-radius: 0.4rem; text-transform: uppercase;
}

.card .type-badge {
    position: absolute; top: 0.5rem; left: 0.5rem;
    background: rgba(26,77,110,0.85); color: white;
    font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 0.6rem;
    backdrop-filter: blur(4px);
    z-index: 2;
}
.card .info { padding: 0.7rem; font-size: 0.72rem; color: #5583a4; display: flex; flex-direction: column; gap: 0.4rem; }
.card .name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: #1f4e6f; font-weight: 500;
}
.card .meta { display: flex; justify-content: space-between; color: #779bb4; }
.card .actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.card .actions button {
    flex: 1; padding: 0.35rem; border: none; border-radius: 0.5rem;
    background: #ecf3fa; color: #42789b; cursor: pointer;
    font-size: 0.75rem; transition: all 0.15s; white-space: nowrap;
}
.card .actions button:hover { background: #d2e3f2; }
.card .actions button.del:hover { background: #ffe2e0; color: #b33c2e; }
.card .actions button.convert { background: #e8f4ea; color: #2b7a4b; }
.card .actions button.convert:hover { background: #d3ead7; }

.empty {
    grid-column: 1 / -1; text-align: center; padding: 4rem 2rem;
    color: #779bb4; background: rgba(255,255,255,0.5);
    border-radius: 1rem; border: 1px dashed #c2d9ec;
}
.empty .icon { font-size: 3rem; display: block; margin-bottom: 0.5rem; opacity: 0.7; }

.toast {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0b2b44; color: white;
    padding: 0.7rem 1.8rem; border-radius: 2rem; opacity: 0;
    transition: all 0.3s; pointer-events: none; z-index: 999;
    box-shadow: 0 15px 30px -8px rgba(0,30,60,0.4);
    max-width: 90vw; text-align: center; word-break: break-all;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-mask {
    display: none; position: fixed; inset: 0; background: rgba(0,20,40,0.5);
    z-index: 1000; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-mask.show { display: flex; }
.modal {
    background: white; border-radius: 1.2rem; padding: 1.8rem;
    max-width: 420px; width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0,20,40,0.3);
}
.modal h3 { color: #1a4d6e; margin-bottom: 1rem; font-size: 1.1rem; }
.modal .src-name { font-size: 0.8rem; color: #779bb4; margin-bottom: 1rem; word-break: break-all; }
.modal .target-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1.2rem; }
.modal .target-list button {
    padding: 0.7rem; border: 1.5px solid #c9def0; background: white;
    border-radius: 0.7rem; cursor: pointer; font-size: 0.85rem;
    color: #42789b; transition: all 0.15s; font-weight: 500;
}
.modal .target-list button:hover { background: #e3f0fa; border-color: #1a4d6e; }
.modal .target-list button.selected { background: #1a4d6e; color: white; border-color: #1a4d6e; }
.modal .actions { display: flex; gap: 0.6rem; justify-content: flex-end; }
.modal .actions button {
    padding: 0.6rem 1.4rem; border-radius: 2rem; border: none;
    cursor: pointer; font-size: 0.9rem;
}
.modal .actions .cancel { background: #eef5fa; color: #5583a4; }
.modal .actions .cancel:hover { background: #ddeaf5; }
.modal .actions .ok { background: #1a4d6e; color: white; }
.modal .actions .ok:hover { background: #0f3a54; }
.modal .actions .ok:disabled { background: #99b3c4; cursor: not-allowed; }
.modal .progress { margin-top: 1rem; font-size: 0.85rem; color: #42789b; text-align: center; display: none; }
.modal .progress.show { display: block; }

.footer { text-align: center; color: #779bb4; font-size: 0.78rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #d5e5f0; }
/* ========== 批量上传面板 ========== */
.progress-box {
    padding: 1rem 1.2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.batch-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}
.batch-title { font-weight: 600; color: #1a4d6e; font-size: 1rem; }
.batch-stats { font-size: 0.82rem; color: #5583a4; flex: 1; }
.batch-actions { display: flex; gap: 0.4rem; }
.mini-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid #c9def0;
    background: white;
    border-radius: 1.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: #b33c2e;
    transition: all 0.15s;
}
.mini-btn:hover { background: #ffe9e6; border-color: #b33c2e; }

.batch-overall {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}
.batch-bar {
    flex: 1;
    height: 8px;
    background: #dbe9f5;
    border-radius: 10px;
    overflow: hidden;
}
.batch-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4ea1d3, #1a4d6e);
    border-radius: 10px;
    transition: width 0.25s ease;
}
.batch-percent {
    font-size: 0.82rem;
    color: #1a4d6e;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.batch-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.batch-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    background: white;
    border-radius: 0.7rem;
    border: 1px solid #eef5fa;
    transition: all 0.2s;
}
.batch-item.uploading { border-color: #4ea1d3; background: #f4faff; }
.batch-item.success { border-color: #a8ddb8; background: #f3fbf5; }
.batch-item.error { border-color: #f0b8b0; background: #fff6f4; }

.batch-item .item-icon {
    font-size: 1.1rem;
    line-height: 1.4;
    flex-shrink: 0;
    width: 1.4rem;
    text-align: center;
}
.batch-item .item-info { flex: 1; min-width: 0; }
.batch-item .item-name {
    font-size: 0.82rem;
    color: #1f4e6f;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}
.batch-item .item-bar {
    height: 4px;
    background: #e8f1f9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}
.batch-item .item-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6eb8e0, #1a4d6e);
    transition: width 0.2s ease;
}
.batch-item .item-status {
    font-size: 0.72rem;
    color: #779bb4;
}
.batch-item.success .item-status { color: #2b7a4b; }
.batch-item.error .item-status { color: #b33c2e; }