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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

.tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-content {
    display: none;
}

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

.main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.form-section, .preview-section {
    padding: 30px;
}

.form-section {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}

.preview-section {
    background: #ffffff;
}

h2 {
    font-size: 18px;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

label .required {
    color: #ef4444;
    margin-left: 4px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

textarea {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
}

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

input.error, select.error, textarea.error {
    border-color: #ef4444;
}

.hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.5;
}

.error-message {
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
}

.format-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.format-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #64748b;
}

.format-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.format-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.preview-box {
    background: #1e293b;
    border-radius: 8px;
    padding: 20px;
    overflow: auto;
    max-height: 500px;
    margin-bottom: 15px;
}

.preview-box pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 120px;
}

.proxy-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
}

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

.proxy-header h3 {
    font-size: 16px;
    color: #1e293b;
}

.btn-remove {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove:hover {
    background: #ef4444;
    color: white;
}

.btn-add {
    width: 100%;
    padding: 14px;
    background: #f1f5f9;
    border: 2px dashed #94a3b8;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add:hover {
    background: #e2e8f0;
    border-color: #667eea;
    color: #667eea;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    transition: transform 0.3s;
    z-index: 1000;
    font-weight: 600;
}

.toast.show {
    transform: translateX(0);
}

.converter-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.converter-preview-box {
    background: #1e293b;
    border-radius: 8px;
    padding: 15px;
    overflow: auto;
    max-height: 250px;
}

.converter-preview-box pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.converter-preview-box h4 {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #475569;
}

.converter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.converter-actions .btn {
    flex: 1;
    min-width: 140px;
}

.command-box {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.command-box h4 {
    color: #d97706;
    font-size: 14px;
    margin-bottom: 10px;
}

.command-box code {
    display: block;
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    margin-bottom: 10px;
}

@media (max-width: 1200px) {
    .converter-preview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .main {
        grid-template-columns: 1fr;
    }

    .form-section {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .format-selector {
        flex-wrap: wrap;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 22px;
    }

    .form-section, .preview-section {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }
}
