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

:root {
    --primary-color: #0052CC;
    --primary-hover: #0747A6;
    --secondary-color: #6B778C;
    --danger-color: #DE350B;
    --success-color: #00875A;
    --background: #FFFFFF;
    --surface: #F4F5F7;
    --border: #DFE1E6;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

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

header {
    background: var(--background);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.lang-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

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

.lang-btn:hover {
    background: var(--surface);
}

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

main {
    background: var(--background);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.input-section {
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

input[type="url"],
input[type="text"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

input[type="url"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.params-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #BF2600;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.params-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.param-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.param-key,
.param-value {
    padding: 0.5rem;
}

.remove-param {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    padding: 0;
}

.actions-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.result-section {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.result-container {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.result-url {
    flex: 1;
    padding: 1rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.preview-section {
    margin-top: 1.5rem;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.preview-params {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.preview-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--surface);
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-key {
    color: var(--primary-color);
    font-weight: 600;
    margin-right: 0.5rem;
}

.preview-equals {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.preview-value {
    color: var(--text-primary);
    word-break: break-all;
}

.no-params {
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
}

.tools-section {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.tool-card {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.tool-card h3 {
    margin-bottom: 1rem;
}

.tool-buttons {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tool-output {
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    min-height: 50px;
    color: var(--text-primary);
}

footer {
    text-align: center;
    padding: 2rem;
    color: white;
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header,
    main {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .param-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .actions-section {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .result-container {
        flex-direction: column;
    }
    
    .lang-selector {
        flex-wrap: wrap;
    }
}