
:root {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-focus: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
    
      
    --gradient-primary: linear-gradient(135deg, #2563eb, #7c3aed);
    --gradient-accent: linear-gradient(135deg, #06b6d4, #3b82f6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    
      
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
    background-size: 50px 50px;
}


header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tabs-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    padding: 10px 20px;
    gap: 8px;
}

  
.tabs-nav::-webkit-scrollbar {
    height: 4px;
}
.tabs-nav::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
    color: #ffffff;
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}


.content-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

  
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

  
.intro-brief {
    background: #ffffff;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    max-width: 800px;
    margin: 40px auto;
    text-align: center;
}

.intro-brief h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-brief p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 16px;
}


.tab-header {
    margin-bottom: 25px;
    text-align: center;
}

.tab-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.equation {
    font-size: 20px;
    padding: 10px;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
    display: inline-block;
    border-radius: var(--radius-md);
}

  
.simulation-area {
    display: flex;
    gap: 24px;
    align-items: stretch;
    position: relative;
    margin-bottom: 35px;
}

  
.canvas-wrapper {
    flex: 1;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    min-height: 480px;
    position: relative;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

  
.control-shelf {
    width: 300px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.control-shelf:hover {
    box-shadow: var(--shadow-focus);
}

.control-shelf h3 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

  
.drawer-toggle {
    display: none;
}


.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

  
.btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

  
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-canvas-slider-thumb,
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    transition: transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

  
input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #4f46e5;
    transform: scale(1.1);
    vertical-align: middle;
}

  
.status-display {
    background: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.status-display h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.status-display p {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}


.theory-section {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.theory-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    padding-left: 12px;
}

  
.theory-section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.theory-section p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}


@media (max-width: 920px) {
    .content-container {
        margin: 15px auto;
    }
    
    .simulation-area {
        flex-direction: column;
    }

    .canvas-wrapper {
        min-height: 400px;
    }

      
    .control-shelf {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        z-index: 150;
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
        transform: translateX(100%);   
        background: rgba(255, 255, 255, 0.95);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        border-left: 1px solid var(--border-color);
    }

      
    .control-shelf.open {
        transform: translateX(0);
    }

      
    .drawer-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 50px;
        background: var(--gradient-primary);
        color: #ffffff;
        border: none;
        border-radius: 10px 0 0 10px;
        cursor: pointer;
        z-index: 160;
        font-size: 18px;
        font-weight: bold;
        box-shadow: -2px 4px 12px rgba(0,0,0,0.15);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

      
    .drawer-toggle.shelf-open {
        right: 280px;
        background: #ef4444;   
        border-radius: 10px 0 0 10px;
    }
}