:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --bg-color: #f8f9fa;
    --text-color: #2b2d42;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 1200px;
    padding: 1rem;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-color);
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.progress {
    height: 1.5rem;
    border-radius: 10px;
    background-color: #e9ecef;
    margin: 2rem 0;
}

.progress-bar {
    background-color: var(--accent-color);
    transition: width 0.5s ease;
}

#status {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.results-table {
    margin-top: 2rem;
}

.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
}

.table tbody td {
    vertical-align: middle;
    padding: 1rem;
}

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.loader {
    width: 25px;
    height: 25px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 自定义 FilePond 容器样式 */
#images.filepond--root {
    margin-top: 1rem;
}

/* FilePond 容器美化 */
.filepond--root {
    margin-bottom: 2rem;
    font-family: inherit;
    max-height: 500px;
    overflow-y: auto;
}

.filepond--panel-root {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
}

.filepond--drop-label {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    transition: background-color 0.3s ease, border-radius 0.3s ease, border 0.3s ease;
}

.filepond--drop-label:hover {
    background-color: #e9ecef;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
}

.filepond--label-action {
    color: var(--primary-color);
    text-decoration-color: var(--primary-color);
}

.filepond--item-panel {
    background-color: var(--primary-color);
}

/* 隐藏进度条和状态区域 */
.progress-container,
.status-container {
    display: none;
}

.progress-container.show,
.status-container.show {
    display: block;
}

.filepond--drip {
    background-color: var(--primary-color);
    opacity: 0.1;
}

.filepond--item {
    transition: transform 0.3s ease;
    width: 200px;
    height: 200px;
}

.filepond--item:hover {
    transform: translateY(-2px);
}

/* 调整 Image Preview 的样式 */
.filepond--image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

#resultsTable {
    table-layout: auto;
    width: 100%;
}

/* 移除第一列的 max-width 限制 */
#resultsTable th:first-child,
#resultsTable td:first-child {
    white-space: normal;
    overflow-wrap: break-word;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .form-control,
    .form-select {
        padding: 0.5rem 0.75rem;
    }

    .btn-primary {
        padding: 0.5rem 1rem;
    }

    .table tbody td {
        padding: 0.5rem;
    }

    #status {
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    .progress {
        margin: 1rem 0;
    }

    /* 堆叠式表格布局 */
    .table-responsive {
        overflow-x: unset;
    }

    #resultsTable,
    #resultsTable thead,
    #resultsTable tbody,
    #resultsTable th,
    #resultsTable td,
    #resultsTable tr {
        display: block;
    }

    #resultsTable thead tr {
        display: none;
    }

    #resultsTable tr {
        margin-bottom: 1rem;
        border-bottom: 1px solid #dee2e6;
    }

    #resultsTable td {
        text-align: left;
        padding: 0.5rem;
        position: relative;
    }

    #resultsTable td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 0.5rem;
        color: var(--text-color);
    }
}
