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

body {
    font-family: "Yu Gothic", "Hiragino Sans", "Meiryo", sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1a1a2e;
}

/* Form */
.form-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.flex-grow {
    flex: 1;
    min-width: 300px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
}

.radio-label:has(input:checked) {
    border-color: #4472c4;
    background: #f0f4ff;
}

.radio-label input {
    cursor: pointer;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="password"] {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

input[type="password"]:focus {
    outline: none;
    border-color: #4472c4;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    cursor: pointer;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #c0c0c0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 16px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #4472c4;
    background: #f8faff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.upload-zone p {
    color: #555;
    font-size: 15px;
}

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

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0f4ff;
    border-radius: 8px;
    margin-bottom: 16px;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
}

.file-size {
    color: #666;
    font-size: 12px;
}

.btn-remove {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #999;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-remove:hover {
    background: #fee;
    color: #e00;
}

/* Buttons */
.btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    background: #4472c4;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #3461b3;
}

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

.btn-secondary {
    padding: 10px 20px;
    background: #fff;
    color: #4472c4;
    border: 2px solid #4472c4;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f0f4ff;
}

.results-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.results-actions .btn-primary {
    width: auto;
    flex: 0 0 auto;
    padding: 10px 24px;
}

/* Progress */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4472c4, #5b9bd5);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    margin-bottom: 12px;
}

.progress-text {
    font-size: 13px;
    color: #666;
}

.progress-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-pause {
    padding: 6px 16px;
    background: #fff;
    color: #d97706;
    border: 1.5px solid #d97706;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-pause:hover:not(:disabled) {
    background: #fffbeb;
}

.btn-pause:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-stop-proc {
    padding: 6px 16px;
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #dc2626;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-stop-proc:hover:not(:disabled) {
    background: #fff1f1;
}

.btn-stop-proc:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-resume {
    padding: 6px 16px;
    background: #fff;
    color: #2563eb;
    border: 1.5px solid #2563eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-top: 8px;
}

.btn-resume:hover {
    background: #eff6ff;
}

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

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.file-item:last-child {
    border-bottom: none;
}

.file-status {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.file-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-error {
    color: #e53935;
    font-size: 12px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #4472c4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Results Table */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

thead th {
    background: #4472c4;
    color: #fff;
    padding: 10px 12px;
    font-weight: 600;
    position: sticky;
    top: 0;
    text-align: left;
}

tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

tbody tr:hover {
    background: #f8faff;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

tbody tr:nth-child(even):hover {
    background: #f0f4ff;
}

td.editable {
    cursor: text;
    position: relative;
}

td.editable:hover {
    background: #e8edf5;
}

td.editable:focus {
    outline: 2px solid #4472c4;
    outline-offset: -2px;
    background: #fff;
}

td.warning {
    background: #fff9c4 !important;
}

td.error-cell {
    background: #ffebee !important;
    color: #c62828;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

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

    .radio-group {
        flex-direction: column;
    }

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