* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
}

body {
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.title-section {
    flex: 1;
    min-width: 300px;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.converter-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 1.1rem;
}

.file-input-wrapper {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9fafb;
}

.file-input-wrapper:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.file-input {
    display: none;
}

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

.file-preview {
    margin-top: 15px;
}

.preview-img {
    max-width: 100px;
    max-height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: none;
}

select, input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-item input {
    width: 18px;
    height: 18px;
}

.btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 25px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.output-section {
    margin-top: 40px;
    display: none;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.output-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #444;
}

.copy-btn, .download-btn {
    padding: 10px 20px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
    margin-left: 10px;
}

.copy-btn:hover {
    background: #0da271;
}

.download-btn {
    background: #3b82f6;
}

.download-btn:hover {
    background: #2563eb;
}

.output-content {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.code-line {
    margin-bottom: 5px;
}

.code-comment {
    color: #6c757d;
}

.code-keyword {
    color: #569cd6;
}

.code-type {
    color: #4ec9b0;
}

.code-number {
    color: #b5cea8;
}

.code-string {
    color: #ce9178;
}

.info-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.info-card h3 {
    color: #444;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.info-card p {
    color: #666;
    margin-bottom: 10px;
}

.info-card code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #d63384;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.toast.error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }
    
    .converter-card {
        max-width: 100%;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .output-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .copy-btn, .download-btn {
        margin-left: 0;
        margin-top: 5px;
    }
}