:root {
    --primary-color: #0052CC;
    --primary-hover: #0747A6;
    --secondary-color: #6B778C;
    --success-color: #00875A;
    --danger-color: #DE350B;
    --bg-color: #FAFBFC;
    --card-bg: #FFFFFF;
    --text-primary: #172B4D;
    --text-secondary: #5E6C84;
    --border-color: #DFE1E6;
    --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;
}

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

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

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

header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 20px;
}

.lang-switcher {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

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

.input-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-group {
    display: flex;
    gap: 10px;
}

#urlInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#urlInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

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

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.results-section.hidden {
    display: none;
}

.tabs {
    display: flex;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.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: 3px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

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

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

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

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

.component-item {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.component-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.component-item label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.component-item .value {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    word-break: break-all;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.params-list {
    margin-bottom: 20px;
}

.param-item {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.param-key, .param-value {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.param-key:focus, .param-value:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.btn-remove {
    padding: 10px 16px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #BF2600;
    transform: translateY(-1px);
}

.no-params {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    background: var(--bg-color);
    border-radius: var(--radius);
    font-style: italic;
}

.rebuilt-url {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 20px;
}

.rebuilt-url label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.url-display {
    background: white;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.encode-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.encode-group {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius);
    position: relative;
}

.encode-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.encode-group .value {
    font-family: 'Courier New', monospace;
    word-break: break-all;
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.copy-btn {
    position: absolute;
    top: 20px;
    right: 20px;
}

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

.tool-card {
    background: var(--bg-color);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tool-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tool-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.expanded-url {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border: 2px solid var(--success-color);
    border-radius: var(--radius);
    word-break: break-all;
    color: var(--text-primary);
}

.expanded-url.hidden {
    display: none;
}

.qrcode-container {
    margin-top: 15px;
    text-align: center;
}

.qrcode-container canvas {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px;
    background: white;
}

.copy-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #urlInput {
        width: 100%;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 50%;
    }
    
    .param-item {
        grid-template-columns: 1fr;
    }
    
    .copy-btn {
        position: static;
        width: 100%;
        margin-top: 10px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
}