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

:root {
    --primary-color: #0052CC;
    --primary-hover: #0747A6;
    --secondary-color: #6B778C;
    --success-color: #00875A;
    --error-color: #DE350B;
    --background: #FAFBFC;
    --surface: #FFFFFF;
    --border: #DFE1E6;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --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);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    padding: 48px 0 32px;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), #0065FF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 24px;
}

.language-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.lang-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

main {
    padding-bottom: 64px;
}

.upload-area {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 32px;
}

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

.upload-area.dragover {
    background: #F4F5F7;
    border-color: var(--primary-color);
    transform: scale(1.02);
}

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

.upload-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.preview-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

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

.preview-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.clear-btn {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--error-color);
    color: var(--error-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: var(--error-color);
    color: white;
}

.preview-container {
    display: flex;
    gap: 24px;
    align-items: center;
}

#previewImage {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.image-info {
    flex: 1;
    color: var(--text-secondary);
    line-height: 1.8;
}

.image-info span:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

.output-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 48px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9375rem;
    position: relative;
    transition: all 0.2s;
}

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

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.output-label {
    font-weight: 500;
    color: var(--text-primary);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary-hover);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    resize: vertical;
    background: #F4F5F7;
}

.features {
    margin-top: 64px;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 32px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

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

.feature-card svg {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer {
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    margin-top: 64px;
    color: var(--text-secondary);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    background: var(--success-color);
    color: white;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: var(--error-color);
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .upload-area {
        padding: 32px 20px;
    }
    
    .preview-container {
        flex-direction: column;
        text-align: center;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 140px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .toast {
        left: 24px;
        right: 24px;
    }
}