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

:root {
    --primary-color: #5e72e4;
    --primary-hover: #4c63d2;
    --secondary-color: #6c757d;
    --success-color: #2dce89;
    --error-color: #f5365c;
    --warning-color: #fb6340;
    --background: #f7f8fc;
    --surface: #ffffff;
    --text-primary: #32325d;
    --text-secondary: #8898aa;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --radius: 0.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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;
    color: var(--text-primary);
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.language-selector {
    position: absolute;
    top: 0;
    right: 0;
    background: white;
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.language-selector select {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    outline: none;
}

.main-content {
    display: grid;
    gap: 2rem;
}

.input-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

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

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

.url-input {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: var(--transition);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(94, 114, 228, 0.25);
}

.options-section {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.option-group {
    flex: 1;
    min-width: 200px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.custom-alias-section {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.custom-alias-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.alias-prefix-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

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

.alias-prefix-group input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    flex: 1;
    max-width: 300px;
}

.alias-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    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(-2px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.results-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

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

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

.result-actions {
    display: flex;
    gap: 1rem;
}

.results-list {
    display: grid;
    gap: 1rem;
}

.result-item {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
}

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

.result-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.url-info {
    flex: 1;
    min-width: 300px;
}

.original-url, .shortened-url {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.url-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
    font-size: 0.9rem;
}

.url-text {
    flex: 1;
    word-break: break-all;
    color: var(--text-primary);
}

.url-text.shortened {
    color: var(--primary-color);
    font-weight: 500;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

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

.qr-code {
    width: 150px;
    height: 150px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    background: white;
}

.click-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.click-count {
    font-weight: 600;
    color: var(--success-color);
    font-size: 1.1rem;
}

.statistics-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    color: white;
}

.statistics-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--success-color);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(100%);
    transition: var(--transition);
    font-weight: 500;
    z-index: 1000;
}

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

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

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .input-section, .results-section {
        padding: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-actions {
        width: 100%;
    }
    
    .result-actions button {
        flex: 1;
    }
    
    .language-selector {
        position: static;
        margin-top: 1rem;
        display: inline-block;
    }
}