/* --- 全局和基础样式 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
}

p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
}

/* --- 表单和按钮样式 --- */
#uploadForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-input-wrapper {
    position: relative;
    text-align: center;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.btn-select {
    background-color: #3498db;
    color: white;
}

.btn-select:hover {
    background-color: #2980b9;
}

#file-chosen {
    margin-left: 15px;
    color: #555;
    font-style: italic;
}

.btn-upload {
    background-color: #2ecc71;
    color: white;
}

.btn-upload:hover {
    background-color: #27ae60;
}

.btn-upload:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* --- 状态和列表区域 --- */
#status {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    min-height: 24px; /* 防止文字消失时页面跳动 */
}

.upload-sections {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.upload-section {
    flex: 1;
    background-color: #f8f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
}

.section-title {
    font-size: 16px;
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-clear {
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-clear:hover {
    background-color: #e74c3c;
    color: white;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px; /* 防止滚动条遮挡内容 */
}

/* --- 单个文件进度项样式 --- */
.progress-item {
    background-color: #fff;
    border-radius: 5px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.progress-item.uploading {
    border-color: #3498db; /* 正在上传时边框高亮 */
}

.progress-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.file-name {
    font-weight: 500;
    word-break: break-all;
    flex-grow: 1;
    padding-right: 15px;
}

.file-size, .file-status {
    flex-shrink: 0;
    color: #7f8c8d;
    white-space: nowrap;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar {
    width: 0;
    height: 100%;
    background-color: #3498db;
    transition: width 0.2s ease-in-out;
}

.progress-item-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #555;
}

.upload-speed {
    text-align: center;
    flex-basis: 100px; /* 给速度一个固定宽度 */
}

/* --- 状态颜色 --- */
.progress-item.complete .progress-bar {
    background-color: #2ecc71;
}
.progress-item.complete .file-name {
    color: #27ae60;
}

.progress-item.error .progress-bar {
    width: 100% !important; /* 失败时进度条也填满 */
    background-color: #e74c3c;
}
.progress-item.error .file-name {
    color: #c0392b;
}
