* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #ddd;
}

header {
    background: #2c3e50;
    color: #fff;
    padding: 25px 30px;
    border-bottom: 3px solid #1a252f;
}

h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.info-box {
    background: #34495e;
    padding: 12px 18px;
    display: inline-block;
    border-left: 3px solid #8e44ad;
}

.info-box p {
    margin: 3px 0;
    font-size: 0.95rem;
    color: #ecf0f1;
}

.info-box strong {
    color: #fff;
    font-weight: 600;
}

main {
    padding: 30px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Home Link */
.home-link {
    display: inline-block;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 15px;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-weight: 500;
}

.home-link:hover {
    opacity: 1;
    color: #fff;
}

/* Upload Section */
.upload-section {
    text-align: center;
}

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    background: #fafafa;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: #8e44ad;
    background: #faf5fc;
}

.drop-zone.dragover {
    border-color: #8e44ad;
    background: #f3e8f9;
    border-style: solid;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-zone-content svg {
    color: #999;
}

.drop-text {
    color: #666;
    font-size: 1rem;
}

.file-label {
    display: inline-block;
    padding: 10px 24px;
    background: #8e44ad;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
}

.file-label:hover {
    background: #7d3c98;
}

.file-hint {
    color: #999;
    font-size: 0.85rem;
}

/* Settings Section */
.settings-section {
    padding: 0 30px 20px;
}

.setting-group {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.setting-group > label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.setting-hint {
    display: block;
    font-size: 0.8rem;
    color: #999;
    margin-top: 6px;
}

/* Compression Slider */
.compression-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compression-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.compression-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #8e44ad;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.compression-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #8e44ad;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.compression-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    text-align: center;
}

/* Output Format */
.setting-group select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    color: #333;
}

/* Resize Controls */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.resize-options {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-inputs label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
}

.size-inputs input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.size-separator {
    color: #999;
    font-weight: 600;
}

/* Resize Presets */
.resize-presets {
    width: 100%;
    margin-bottom: 12px;
}

.preset-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preset-btn {
    padding: 6px 14px;
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: #8e44ad;
    color: #8e44ad;
}

.preset-btn.active {
    background: #8e44ad;
    color: #fff;
    border-color: #8e44ad;
}

.resize-custom {
    width: 100%;
    margin-bottom: 8px;
}

.aspect-label {
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #555 !important;
}

/* Result Section */
.result-section {
    padding: 0 30px 20px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.clear-btn {
    padding: 6px 14px;
    background: none;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #e74c3c;
    color: #fff;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* File Card */
.file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    position: relative;
    transition: all 0.2s;
}

.file-card:hover {
    border-color: #8e44ad;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.file-card.status-done {
    border-left: 3px solid #27ae60;
}

.file-card.status-compressing {
    border-left: 3px solid #f39c12;
    background: #fffef5;
}

.file-card.status-error {
    border-left: 3px solid #e74c3c;
    background: #fef5f5;
}

.file-thumb {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eee;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

.file-result {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.result-arrow {
    color: #999;
    font-size: 0.9rem;
}

.result-size {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.result-saved.saved-positive {
    color: #27ae60;
    font-size: 0.8rem;
    font-weight: 600;
}

.result-saved.saved-negative {
    color: #e74c3c;
    font-size: 0.8rem;
    font-weight: 600;
}

.download-btn {
    padding: 4px 10px;
    background: #8e44ad;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.download-btn:hover {
    background: #7d3c98;
}

.compressing-text {
    color: #f39c12;
    font-size: 0.85rem;
    font-weight: 500;
}

.error-text {
    color: #e74c3c;
    font-size: 0.85rem;
    font-weight: 500;
}

.file-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(231, 76, 60, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.file-card:hover .file-remove {
    display: flex;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.compress-btn {
    padding: 12px 28px;
    background: #8e44ad;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.compress-btn:hover:not(:disabled) {
    background: #7d3c98;
}

.compress-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.zip-btn {
    padding: 12px 28px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.zip-btn:hover:not(:disabled) {
    background: #34495e;
}

.zip-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Notice Section */
.notice-section {
    background: #fffbe6;
    border: 1px solid #e6d8a8;
    border-left: 4px solid #d4a017;
    padding: 20px;
    margin: 0 30px 25px 30px;
}

.notice-section h2 {
    color: #5d4e00;
    margin-bottom: 12px;
    font-size: 1.1rem;
    border-bottom: none;
    padding-bottom: 0;
}

.notice-content p {
    color: #665500;
    margin: 8px 0;
    line-height: 1.6;
    font-size: 0.9rem;
}

.notice-content strong {
    color: #4a4000;
}

/* Footer */
footer {
    background: #f8f9fa;
    text-align: center;
    padding: 15px 20px;
    color: #777;
    font-size: 0.85rem;
    border-top: 1px solid #ddd;
}

.footer-links {
    margin-top: 8px;
}

.lang-select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #fff;
    color: #333;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2c3e50;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.3rem;
    }

    header {
        padding: 20px;
    }

    main {
        padding: 20px;
    }

    .settings-section {
        padding: 0 20px 20px;
    }

    .result-section {
        padding: 0 20px 20px;
    }

    .notice-section {
        margin: 0 20px 20px 20px;
    }

    .drop-zone {
        padding: 30px 15px;
    }
}

@media (max-width: 480px) {
    .compression-control {
        flex-direction: column;
        gap: 8px;
    }

    .resize-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .size-inputs {
        flex-wrap: wrap;
    }

    .result-actions {
        flex-direction: column;
    }

    .compress-btn,
    .zip-btn {
        width: 100%;
    }

    .file-card {
        flex-wrap: wrap;
    }

    .file-result {
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }
}
