* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

header {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
}

nav {
    display: flex;
    gap: 4px;
}

.tab {
    background: transparent;
    color: #aaa;
    border: none;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.tab.active {
    color: #fff;
    background: #16213e;
}

main {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 24px;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

.card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.card .desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.preview {
    width: 100%;
    height: 120px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.placeholder {
    color: #bbb;
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4361ee;
    color: #fff;
}

.btn-primary:hover {
    background: #3a56d4;
}

.btn-primary:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}

.btn-danger {
    background: #e63946;
    color: #fff;
}

.btn-danger:hover {
    background: #c1121f;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
    width: 100%;
    margin-top: 8px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.form-group input:focus {
    border-color: #4361ee;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.file-list {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.file-list div {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.progress-area {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4361ee;
    width: 0%;
    transition: width 0.3s;
    border-radius: 4px;
}

#progress-text {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}

#results-area {
    margin-top: 20px;
}

#results-area h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-collapse: collapse;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.status-success {
    color: #2d6a4f;
    font-weight: 500;
}

.status-error {
    color: #e63946;
    font-weight: 500;
}

#settings-msg {
    font-size: 13px;
    color: #2d6a4f;
    margin-left: 12px;
}

@media (max-width: 640px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .card-row {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
