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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 2rem;
}

header {
    color: white;
    padding: 30px;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.hero-section {
    padding: 60px 20px 40px;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h2 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

.usp-section {
    padding: 40px 20px 60px;
    color: white;
}

.usp-content {
    max-width: 1000px;
    margin: 0 auto;
}

.usp-section h2 {
    color: white;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 600;
}

.usp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.usp-item {
    text-align: center;
    padding: 25px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.usp-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.usp-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    opacity: 0.9;
}

.usp-icon svg {
    width: 100%;
    height: 100%;
    stroke: rgba(255, 255, 255, 0.9);
}

.usp-item h3 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.usp-item p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    line-height: 1.6;
    margin: 0;
}

main {
    padding: 30px;
    min-height: auto;
}

/* レスポンシブ改行制御 */
.sp-only {
    display: none;
}

.pc-only {
    display: inline;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafafa;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.disabled {
    border-color: #28a745;
    background: #f8fff8;
    cursor: default;
}

.upload-area.disabled .upload-icon {
    color: #28a745;
}

.upload-area.disabled p {
    color: #155724;
}

.upload-area.uploading {
    border-color: #ffc107;
    background: #fff8e1;
    cursor: wait;
}

.upload-area.uploading .upload-icon {
    color: #ffc107;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.file-input-hidden {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-label {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin: 10px 0;
    font-size: 1rem;
    font-family: inherit;
}

.file-label:hover {
    background: #5a67d8;
}

.upload-info {
    color: #666;
    font-size: 0.9rem;
    margin-top: 15px;
}

.file-list {
    margin-top: 30px;
}

.file-list h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.file-item {
    background: #dde6ea;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.file-meta {
    font-size: 0.85rem;
    color: #666;
}

.encoding-info {

}

.encoding-info strong {
    color: #333;
    font-size: 0.9rem;
}

.encoding-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 5px;
}

.encoding-badge.encoding-main {
    background: #667eea;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 4px 10px;
}

.file-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.file-delete-btn:hover {
    background: #c82333;
    opacity: 1;
    transform: scale(1.1);
}

.convert-options {
    margin-top: 30px;
    padding: 20px;
    background: #dde6ea;
    border-radius: 8px;
}

.convert-options h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

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

.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

.advanced-options {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
}

.advanced-options summary {
    cursor: pointer;
    font-weight: 500;
    color: #667eea;
}

.convert-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: 20px;
}

.convert-btn:hover {
    transform: translateY(-2px);
}

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

.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 20px;
}

.reset-btn:hover {
    background: #5a6268;
}

.reset-btn svg {
    flex-shrink: 0;
}

.progress-area {
    margin-top: 30px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
}

#progressText {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

.result-area {
    margin-top: 30px;
}

.result-area h2 {
    color: #4caf50;
    margin-bottom: 20px;
}

.download-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 30px;
    background: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    margin: 10px 10px 10px 0;
    transition: background 0.3s ease;
}

.download-link:hover {
    background: #45a049;
}

.download-link svg {
    flex-shrink: 0;
}

.file-size {
    font-size: 0.85rem;
    color: #666;
    margin-left: 10px;
}

footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

footer a,
footer .footer__link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover,
footer .footer__link:hover {
    color: white;
    text-decoration: underline;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .usp-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    .hero-section {
        padding: 40px 20px 30px;
    }
    
    .usp-section {
        padding: 30px 20px 50px;
    }
    
    .usp-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 15px;
    }
    
    main {
        padding: 20px;
    }
    
    /* タブレット時の改行制御 */
    .sp-only {
        display: none;
    }
    
    .pc-only {
        display: inline;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    
    .container {
        border-radius: 0;
    }
    
    body {
        padding: 0;
    }
    
    .hero-section h2,
    .usp-section h2 {
        font-size: 1.5rem;
    }
    
    .hero-section p {
        font-size: 0.85rem;
    }
    
    .usp-item {
        padding: 20px 15px;
    }
    
    .usp-item h3 {
        font-size: 0.95rem;
    }
    
    .usp-item p {
        font-size: 0.75rem;
    }
    
    /* スマホ時の改行制御 */
    .sp-only {
        display: inline;
    }
    
    .pc-only {
        display: none;
    }
}