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

:root {
    --primary-color: #0052CC;
    --primary-hover: #0065FF;
    --secondary-color: #42526E;
    --background: #FAFBFC;
    --surface: #FFFFFF;
    --border: #DFE1E6;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --success: #00875A;
    --warning: #FF991F;
    --error: #DE350B;
    --shadow-sm: 0 1px 2px rgba(9, 30, 66, 0.08);
    --shadow-md: 0 4px 8px rgba(9, 30, 66, 0.08);
    --shadow-lg: 0 8px 16px rgba(9, 30, 66, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    padding: 32px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.language-switcher {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--background);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

main {
    flex: 1;
}

.drop-zone {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.drop-zone:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: #F4F5F7;
    box-shadow: var(--shadow-lg);
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.drop-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.drop-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}

.results-container {
    margin-top: 48px;
}

.results-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--text-secondary);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.result-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.result-card.error {
    border: 1px solid var(--error);
    color: var(--error);
}

.file-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    word-break: break-all;
}

.size-info {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.size-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label {
    font-size: 14px;
    color: var(--text-secondary);
}

.value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.compression-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.compression-method {
    padding: 12px 16px;
    background: var(--background);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.compression-method.best {
    background: #E3FCEF;
    border: 1px solid #ABF5D1;
}

.method-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.method-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.compression-rate {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
}

.method-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compressed-size {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.best-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.best-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.best-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
}

footer {
    margin-top: 80px;
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .title {
        font-size: 24px;
    }
    
    .drop-zone {
        padding: 40px 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .result-card {
        padding: 16px;
    }
}