/* 通用样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

h1, h2 {
    color: #007bff;
    text-align: center;
    margin-bottom: 25px;
}

/* 各个功能区的基础样式 */
.section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fcfcfc;
}

/* 二维码部分样式 */
.qr-code-section {
    text-align: center;
}

#qrcode {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background-color: white;
}
#qrcode img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 文件上传部分样式 (现在合并到 index.html 中) */
.upload-section {
    text-align: center; /* 居中上传元素 */
}

.upload-section input[type="file"] {
    display: block;
    width: calc(100% - 20px); /* 适应容器宽度，留出边距 */
    margin: 20px auto; /* 垂直居中 */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    background-color: #fff;
    cursor: pointer;
}

.upload-section button {
    background-color: #28a745; /* 绿色上传按钮 */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.2s ease;
    margin-top: 15px;
}

.upload-section button:hover {
    background-color: #218838; /* 鼠标悬停时变深 */
}

#uploadStatus {
    margin-top: 20px;
    font-weight: bold;
    min-height: 20px; /* 确保占位，防止内容变化引起布局跳动 */
}

/* 进度条样式 */
#progressBar {
    margin-top: 20px;
    height: 25px;
    appearance: none; /* 移除默认样式 */
    -webkit-appearance: none; /* 移除 Safari/Chrome 的默认样式 */
    width: 100%;
    border: 1px solid #ddd; /* 添加边框 */
    border-radius: 5px; /* 圆角 */
    overflow: hidden; /* 隐藏进度条超出部分 */
}

#progressBar::-webkit-progress-bar {
    background-color: #f0f0f0; /* 进度条背景色 */
    border-radius: 5px;
}

#progressBar::-webkit-progress-value {
    background-color: #28a745; /* 进度条填充色 (绿色) */
    border-radius: 5px;
    transition: width 0.3s ease; /* 进度条平滑过渡 */
}

#progressBar::-moz-progress-bar { /* Firefox 兼容性 */
    background-color: #28a745;
    border-radius: 5px;
}


/* 文件列表部分样式 */
.file-list-section ul {
    list-style: none; /* 移除默认列表点 */
    padding: 0;
}

.file-list-section li {
    display: flex; /* 使用 Flexbox 布局 */
    justify-content: space-between; /* 元素两端对齐 */
    align-items: center; /* 垂直居中对齐 */
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    transition: background-color 0.2s ease; /* 悬停效果 */
    word-break: break-word; /* 防止长文件名溢出 */
}

.file-list-section li:hover {
    background-color: #f0f8ff; /* 鼠标悬停背景色 */
}

.file-list-section li span {
    flex-grow: 1; /* 文件名占据大部分空间 */
    margin-right: 10px;
    font-weight: 500;
    color: #333;
}

.file-list-section li a {
    color: #007bff; /* 蓝色链接 */
    text-decoration: none;
    margin-right: 15px;
    font-weight: 500;
    white-space: nowrap; /* 确保链接不换行 */
}

.file-list-section li a:hover {
    text-decoration: underline; /* 鼠标悬停下划线 */
}

.file-list-section li button {
    background-color: #dc3545; /* 红色删除按钮 */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
    white-space: nowrap; /* 确保按钮不换行 */
}

.file-list-section li button:hover {
    background-color: #c82333; /* 鼠标悬停时变深 */
}

.file-list-section .placeholder {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background-color: #ffffff;
    border: none; /* 占位符不需要边框 */
    box-shadow: none; /* 占位符不需要阴影 */
}

/* 响应式调整 (可选，但推荐) */
@media (max-width: 600px) {
    .container {
        margin: 20px auto;
        padding: 20px;
    }
    .file-list-section li {
        flex-direction: column; /* 小屏幕下垂直堆叠 */
        align-items: flex-start;
    }
    .file-list-section li span {
        margin-bottom: 5px;
    }
    .file-list-section li a,
    .file-list-section li button {
        margin-top: 5px;
        margin-right: 0;
        width: 100%; /* 按钮和链接占据整行 */
        text-align: center;
    }
}