:root {
    --bg-main: #0F172A;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --border: rgba(51, 65, 85, 0.8);
    
    --text-primary: #F8FAFC;
    --text-muted: #94A3B8;
    
    --primary: #14B8A6;
    --primary-hover: #0D9488;
    --secondary: #2DD4BF;
    --accent: #5EEAD4;
    
    --grade-aplus: #10B981;
    --grade-a: #34D399;
    --grade-b: #FBBF24;
    --grade-c: #F87171;
    
    --radius: 12px;
    --transition: all 0.25s ease;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Background Glow Effect */
.gradient-bg {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 30%, rgba(20, 184, 166, 0.15), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* Header */
.header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.grade-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--grade-aplus);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.grade-badge strong {
    font-size: 1rem;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    flex: 1;
}

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

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.panel h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 2rem;
}

.form-group > label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#serverTypeGroup {
    flex-direction: row;
}

.radio-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(15, 23, 42, 0.5);
    flex: 1;
    text-align: center;
}

#configLevelGroup .radio-card {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card span {
    font-size: 0.875rem;
    font-weight: 500;
}

.radio-card em {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: normal;
}

.radio-card:hover {
    border-color: var(--text-muted);
    background: rgba(30, 41, 59, 0.8);
}

.radio-card.active {
    border-color: var(--primary);
    background: rgba(20, 184, 166, 0.1);
    box-shadow: 0 0 0 1px var(--primary);
}

.radio-card.active span {
    color: var(--accent);
}

/* Toggle Switch */
.switch-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.switch-label label {
    font-size: 0.875rem;
    font-weight: 500;
}

.switch-label .help-text {
    margin-bottom: 0;
    margin-top: 0.25rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Preview Panel */
.preview-panel {
    overflow: hidden;
}

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

.preview-header h2 {
    margin-bottom: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #0F172A;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.code-wrapper {
    flex: 1;
    background: #0B1120;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: auto;
    position: relative;
}

pre {
    margin: 0;
    padding: 1.5rem;
}

code {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Syntax Highlighting Fake */
.kw { color: #F472B6; } /* Keywords pink */
.val { color: var(--secondary); } /* values teal */
.str { color: #A78BFA; } /* string purple */
.cmt { color: var(--text-muted); font-style: italic; }

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-main);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    box-shadow: var(--shadow);
}

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