/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 禁用状态样式 */
input:disabled,
textarea:disabled,
button:disabled {
    cursor: not-allowed;
}

/* 表单组交互增强 */
.form-group {
    transition: all 0.3s ease;
}

/* .form-group:focus-within {
    transform: translateX(5px);
} */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(136deg, #e8f6ff, #ebf2ff, #e8edff, #d5e7f8);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    background: white;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.2em;
}

h2 {
    color: #34495e;
    margin: 30px 0 15px 0;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

/* 表单样式 */
.form-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

input[type='text'],
textarea,
input[type='file'] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: 'Arial';
}

input[type='text']:focus,
textarea:focus,
input[type='file']:focus {
    outline: none;
    border-color: #3498db;
}

textarea {
    height: 100px;
    resize: vertical;
}

input[type='file'] {
    padding: 8px;
    background: white;
    font-size: 14px;
    font-family: 'Arial';
}

small {
    display: block;
    margin-top: 5px;
    color: #99aeb2;
    font-size: 0.9em;
}

.file-size-info {
    margin-left: 10px;
    font-weight: normal;
}

/* 按钮样式 */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

button {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#submitBtn {
    background: linear-gradient(136deg, #286aff, #4e6ef2, #7274f9, #9f66ff);
    color: white;
    flex: 2;
}

#submitBtn:hover:not(:disabled) {
    /* background: #219a52; */
    background-image: linear-gradient(rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0.09)), linear-gradient(136deg, #286aff, #4e6ef2, #7274f9, #9f66ff);
}

#submitBtn:disabled {
    background: #b2b3b8;
    cursor: not-allowed;
}

#resetBtn {
    background: #d0d2d8;
    color: white;
    flex: 1;
}

#resetBtn:hover {
    background: #b2b3b8;
}

.refresh-btn {
    background: #3498db;
    color: white;
    margin-bottom: 15px;
}

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

/* 消息样式 */
.message {
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 数据展示区域 */
.data-section {
    margin-top: 30px;
}

.agents-list {
    max-height: 400px;
    overflow-y: auto;
}

.agent-item {
    background: #ecf0f1;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.agent-item h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.agent-item p {
    margin-bottom: 8px;
    color: #34495e;
}

.file-links {
    margin-top: 10px;
}

.file-links a {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 5px 10px;
    margin-right: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
}

.file-links a:hover {
    background: #2980b9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }

    .form-actions {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    h1 {
        font-size: 1.8em;
    }
}

/* 办公地址组样式 */
.office-address-group {
    background: #f8f9fa;
    /* padding: 15px; */
    border-radius: 8px;
    margin-bottom: 20px;
    /* border: 2px solid #ddd; */
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 2px;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.group-header label {
    margin-bottom: 0;
    color: #336bfb;
    font-size: 18px;
    font-weight: 600;
}

.group-header h3 {
    margin: 0;
    color: #2c3e50;
}

.group-actions {
    display: flex;
    gap: 10px;
}

.toggle-group-btn {
    background: linear-gradient(136deg, #286aff, #4e6ef2, #7274f9, #9f66ff);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: normal;
    padding: 10px 20px;
    border-radius: 60px;
    line-height: 1;
    font-size: 14px;
}

.group-content {
    transition: all 0.3s ease;
    overflow: hidden;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 2px solid #336bfb;
}

.group-collapsed .group-content {
    display: none;
}

.group-collapsed {
    /* background: #fff; */
}

.add-office-btn {
    border-radius: 8px;
    border: 2px solid #336bfb;
    color: #336bfb;
    padding: 10px 15px;
    cursor: pointer;
    display: block;
    width: 100%;
    background: #fff;
}

.add-office-btn:hover {
    background: #ebf2ff;
}

.remove-office-btn {
    float: right;
    background: #d15d68;
    color: white;
    cursor: pointer;
    font-weight: normal;
    padding: 10px 20px;
    border-radius: 60px;
    line-height: 1;
    font-size: 14px;
}

.remove-office-btn:disabled {
    background: #d0d2d8;
    cursor: not-allowed;
}

/* 文件上传区域美化 */
input[type='file']::file-selector-button {
    background: #3498db;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
}

input[type='file']::file-selector-button:hover {
    background: #2980b9;
}

/* 滚动条样式 */
.agents-list::-webkit-scrollbar {
    width: 8px;
}

.agents-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.agents-list::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.agents-list::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 自定义弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-message {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    padding: 5px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn-confirm {
    background: linear-gradient(136deg, #286aff, #4e6ef2, #7274f9, #9f66ff);
    color: white;
}

.modal-btn-confirm:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0.09)), linear-gradient(136deg, #286aff, #4e6ef2, #7274f9, #9f66ff);
}

.modal-btn-cancel {
    background: #d15d68;
    color: white;
}

/* 导出按钮样式 */
.export-btn {
    background-color: #28a745;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.export-btn:hover {
    background-color: #218838;
}

.status-message {
    margin-top: 20px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.export-options {
    text-align: center;
    margin: 40px 0;
}

.back-link {
    text-align: center;
    margin-top: 30px;
}

.back-link a {
    color: #007bff;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.notice-box {
    background-color: #fff8e6;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.notice-box p {
    margin: 0;
}

.file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 5px;
}
.file-preview-container .file-preview-item {
    display: inline-flex;
    align-items: center;
}
.file-preview-container .file-preview-item span {
    max-width: 200px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    border: 1px dashed #c2c2c2;
    padding: 3px 10px;
    font-size: 13px;
    background: #ebf2ff;
    border-radius: 6px;
}
.file-preview-container .file-preview-item .delete-file-btn {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    margin-right: 5px;
    background: #d15d68;
    color: #fff;
    border-radius: 50%;
}

/* 进度显示弹窗样式 */
.progress-modal {
    z-index: 2000;
}

.progress-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.progress-modal-content .modal-title {
    background: linear-gradient(136deg, #286aff, #4e6ef2);
    color: white;
    padding: 15px 25px;
    margin: -25px -25px 20px -25px;
    border-radius: 8px 8px 0 0;
    text-align: center;
}

.progress-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.overall-progress {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.overall-progress .progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.overall-progress .progress {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.overall-progress .progress-text {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.file-list {
    max-height: 400px;
    overflow-y: auto;
}

.cancel-upload-btn {
    background: #dc3545;
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.cancel-upload-btn:hover {
    background: #c82333;
}

/* 滚动条样式 */
.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .progress-modal-content {
        width: 98%;
        margin: 10px;
    }

    .file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .file-name {
        min-width: auto;
    }

    .file-progress {
        flex-direction: column;
        gap: 8px;
    }

    .file-progress .progress-bar {
        width: 100%;
    }
}

.file-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.file-modal .file-modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.file-modal.active {
    opacity: 1;
    visibility: visible;
}

.file-modal.active .modal-content {
    transform: translateY(0);
}

.file-modal .file-modal-title {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.file-modal .file-modal-message {
    width: 100%;
    background: #f7f7f7;
    padding: 10px;
    border-radius: 5px;
    min-height: 200px;
    max-height: calc(100vh - 220px);
    overflow: auto;
}

.file-modal .file-modal-message .file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    border-bottom: 1px dashed #c9c8c8;
    padding: 5px 0;
}

.file-modal .file-modal-message .file-info {
    width: 50%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
.file-modal .file-modal-message .file-info .file-name {
    max-width: calc(100% - 60px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 10px;
}
.file-modal .file-modal-message .file-info .file-size {
    min-width: 80px;
    background: #ffe8d9;
    color: #cd8a68;
    border-radius: 3px;
    border: 1px solid #ffd3b7;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.file-modal .file-modal-message .file-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.file-modal .file-modal-message .file-progress .progress-bar {
    width: 100px;
    height: 15px;
    overflow: hidden;
    background-color: #b9b9b9;
    border-radius: 3px;
}
.file-modal .file-modal-message .file-progress .progress {
    background: #218838;
    width: 0%;
    height: 100%;
    transition: width 0.3s ease;
}

/* 文件项状态动画 */
.file-modal .file-modal-message .file-item.active .file-progress .progress {
    animation: uploading 60s ease-in-out infinite;
    width: 0%;
}

.file-modal .file-modal-message .file-item.done .file-progress .progress {
    width: 100% !important;
    background: #28a745;
    animation: none;
}
.file-modal .file-modal-message .file-item.done .progress-text {
    color: #218838;
}

/* 上传动画 */
@keyframes uploading {
    0% {
        width: 0%;
        opacity: 0.7;
    }
    50% {
        width: 70%;
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0.7;
    }
}
.file-modal .file-modal-message .file-progress .progress-text {
    text-align: right;
    margin-left: 10px;
}
