/**
 * Py Pro - Professional Python IDE
 * Refined, minimalist luxury design language.
 * Smooth cubic-bezier transitions, subtle gold accents, layered depth.
 */

/* ============================================
   Variables
   ============================================ */
:root {
    --primary: #c9a84c;
    --primary-dark: #a88a3a;
    --primary-light: #d4bc6e;
    --primary-dim: rgba(201, 168, 76, 0.12);
    --primary-glow: rgba(201, 168, 76, 0.08);

    --success: #4caf50;
    --warning: #e6a817;
    --danger: #d94535;
    --info: #5b9bd5;

    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #161616;
    --bg-hover: #1e1e1e;
    --bg-active: rgba(201, 168, 76, 0.10);

    --text-primary: #e0e0e0;
    --text-secondary: #7a7a7a;
    --text-tertiary: #4a4a4a;
    --text-highlight: #f0f0f0;

    --border-color: rgba(255, 255, 255, 0.04);
    --border-subtle: rgba(255, 255, 255, 0.025);
    --border-focus: var(--primary);

    --console-bg: #0a0a0a;
    --console-output: #c8c8c8;
    --console-error: #f06050;
    --console-warning: #e6a817;
    --console-info: #5b9bd5;
    --console-success: #6ecc71;

    --menu-height: 40px;
    --status-height: 26px;
    --sidebar-width: 220px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 13px;
    --font-size-lg: 14px;
    --font-size-xl: 16px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 0.18s var(--ease-out);
    --transition-normal: 0.32s var(--ease-out);
    --transition-slow: 0.5s var(--ease-out);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.02);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.02);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
    --shadow-glow: 0 0 20px rgba(201, 168, 76, 0.06);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.5;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Refined scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover { background: rgba(201, 168, 76, 0.2); }
::-webkit-scrollbar-corner { background: transparent; }

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed; inset: 0;
    background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s var(--ease-out), visibility 0.8s var(--ease-out);
}
.loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loading-content { text-align: center; max-width: 400px; }

.loading-logo {
    font-size: 60px;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--primary);
    margin-bottom: 24px;
    letter-spacing: -2px;
    animation: logoPulse 3s var(--ease-in-out) infinite;
    text-shadow: 0 0 40px rgba(201, 168, 76, 0.15);
}

@keyframes logoPulse {
    0%, 100% { opacity: 0.8; text-shadow: 0 0 40px rgba(201, 168, 76, 0.1); }
    50% { opacity: 1; text-shadow: 0 0 60px rgba(201, 168, 76, 0.2); }
}

.loading-title {
    font-size: 22px;
    font-weight: 400;
    color: var(--text-highlight);
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--font-serif);
}

.loading-status {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    margin-bottom: 24px;
    letter-spacing: 0.3px;
}

.loading-progress {
    width: 200px;
    height: 1px;
    background: rgba(255,255,255,0.04);
    border-radius: 1px;
    margin: 0 auto 18px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-light));
    border-radius: 1px;
    transition: width 0.6s var(--ease-out);
}

.loading-hint {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
}

/* ============================================
   IDE Layout
   ============================================ */
.python-ide {
    display: flex; flex-direction: column;
    height: 100vh;
}

/* ============================================
   Menu Bar
   ============================================ */
.menu-bar {
    height: var(--menu-height);
    background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    will-change: transform;
    position: relative;
    z-index: 1000;
}

.menu-left { display: flex; align-items: center; gap: 20px; }

/* Logo */
.logo {
    display: flex; align-items: center; gap: 8px;
    padding-right: 16px;
    border-right: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--primary);
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-dim);
    border-radius: 6px;
    letter-spacing: -1px;
    transition: all var(--transition-normal);
    box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.1);
}

.logo-icon:hover {
    box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.25), var(--shadow-glow);
}

.logo-text {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-highlight);
    letter-spacing: -0.3px;
}

.logo-version {
    font-size: 10px;
    color: var(--primary-dark);
    background: rgba(201, 168, 76, 0.06);
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid rgba(201, 168, 76, 0.08);
}

/* Main Menu */
.main-menu { display: flex; height: 100%; }

.menu-item {
    position: relative;
    padding: 0 12px;
    display: flex; align-items: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.menu-item:hover { background: var(--bg-hover); }

.menu-label {
    font-size: var(--font-size-sm);
    display: flex; align-items: center; gap: 5px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.menu-item:hover .menu-label { color: var(--text-primary); }
.menu-label i { font-size: 12px; }

/* Dropdown */
.dropdown-menu {
    position: absolute; top: calc(100% + 2px); left: 0;
    min-width: 220px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 5px 0;
    opacity: 0; visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0.25s;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.menu-item.dropdown:hover .dropdown-menu,
.menu-item.dropdown.open .dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}

.dropdown-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 18px;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background: var(--bg-active);
    color: var(--text-highlight);
}

.dropdown-item i { width: 16px; text-align: center; margin-right: 8px; color: var(--text-tertiary); transition: color var(--transition-fast); }
.dropdown-item:hover i { color: var(--primary); }

.dropdown-item .shortcut {
    font-size: 10px;
    color: var(--text-tertiary);
    background: rgba(255,255,255,0.03);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 12px;
}

/* Menu Right */
.menu-right { display: flex; align-items: center; gap: 14px; }

.file-name input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    padding: 3px 8px;
    border-radius: 4px;
    width: 120px;
    transition: all var(--transition-normal);
}

.file-name input:hover { border-color: var(--border-color); }
.file-name input:focus {
    outline: none;
    border-color: rgba(201, 168, 76, 0.3);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.05);
}

.status-indicators { display: flex; gap: 12px; }

.indicator {
    display: flex; align-items: center; gap: 5px;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.indicator i { font-size: 7px; color: var(--success); }

.menu-actions { display: flex; gap: 6px; }

.language-selector select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}
.language-selector select:hover { border-color: rgba(255,255,255,0.08); }
.language-selector select option { background: var(--bg-tertiary); }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px;
    padding: 5px 14px;
    border: none;
    border-radius: 5px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.1px;
    position: relative;
    overflow: hidden;
}

.btn-icon { padding: 5px; width: 28px; height: 28px; }
.btn-sm { padding: 2px 7px; font-size: var(--font-size-xs); }
.btn-sm.btn-icon { width: 24px; height: 24px; }

.btn-primary {
    background: var(--primary);
    color: #0a0a0a;
    box-shadow: 0 1px 4px rgba(201, 168, 76, 0.15);
}
.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 2px 12px rgba(201, 168, 76, 0.2);
    transform: translateY(-0.5px);
}
.btn-primary:active { transform: translateY(0); }

.btn-success {
    background: var(--primary);
    color: #0a0a0a;
    box-shadow: 0 1px 4px rgba(201, 168, 76, 0.15);
}
.btn-success:hover {
    background: var(--primary-light);
    box-shadow: 0 2px 12px rgba(201, 168, 76, 0.2);
    transform: translateY(-0.5px);
}
.btn-success:active { transform: translateY(0); }

.btn-danger {
    background: transparent;
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
}
.btn-danger:hover {
    background: rgba(217, 69, 53, 0.08);
    color: var(--danger);
    border-color: rgba(217, 69, 53, 0.2);
}

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ============================================
   Main Content
   ============================================ */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    transition: width var(--transition-normal);
}

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

.sidebar-tab {
    flex: 1; padding: 9px;
    background: transparent; border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
    position: relative;
}

.sidebar-tab:hover { color: var(--text-secondary); }
.sidebar-tab.active {
    color: var(--primary);
}
.sidebar-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 20%; right: 20%;
    height: 2px;
    background: var(--primary);
    border-radius: 1px 1px 0 0;
}

.sidebar-content { flex: 1; overflow: hidden; }

.sidebar-panel { display: none; height: 100%; overflow-y: auto; }
.sidebar-panel.active { display: block; }

.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.panel-actions { display: flex; gap: 2px; }

/* File Tree */
.file-tree { padding: 4px; }

.file-item {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.file-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.file-item.active {
    background: var(--bg-active);
    color: var(--primary);
}

.file-item i { font-size: 14px; transition: color var(--transition-fast); }
.file-item .fa-python { color: var(--primary); }

/* ============================================
   Editor
   ============================================ */
.editor-container { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.editor-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.editor-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 16px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.editor-tab:hover { background: var(--bg-hover); color: var(--text-secondary); }
.editor-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.editor-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: var(--primary);
}

.editor-tab .close-tab {
    display: none;
    background: transparent; border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0; width: 16px; height: 16px;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.editor-tab:hover .close-tab { display: flex; align-items: center; justify-content: center; }
.editor-tab .close-tab:hover { background: var(--bg-hover); color: var(--text-primary); }

.editor-wrapper { flex: 1; position: relative; overflow: hidden; }
.monaco-editor { width: 100%; height: 100%; }

.line-indicator {
    padding: 4px 14px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* ============================================
   Output Panel
   ============================================ */
.output-panel {
    width: 350px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    position: relative;
}

.panel-resizer {
    width: 3px; cursor: col-resize;
    background: transparent;
    position: absolute; left: 0; top: 0; bottom: 0;
    z-index: 10;
    transition: background var(--transition-fast);
}

.panel-resizer:hover,
.panel-resizer.resizing {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.15);
}

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

.output-tab {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 14px;
    background: transparent; border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.output-tab:hover { color: var(--text-secondary); }
.output-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.output-tab .badge {
    background: var(--danger);
    color: #fff;
    padding: 1px 5px;
    border-radius: 10px;
    font-size: 10px;
    min-width: 16px;
    text-align: center;
    transition: transform var(--transition-fast);
}

.output-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.output-view { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.output-view.active { display: flex; }

/* ============================================
   Problems Panel
   ============================================ */
.problems-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.problems-mode-toggle { display: flex; align-items: center; gap: 6px; }

.mode-label {
    font-size: 10px; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.8px;
}

.mode-btn {
    font-size: 11px; padding: 3px 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.mode-btn.active {
    background: var(--primary);
    color: #0a0a0a;
    border-color: var(--primary);
    box-shadow: 0 1px 6px rgba(201, 168, 76, 0.15);
}

.problems-container {
    position: relative; flex: 1; overflow: hidden;
    display: flex; flex-direction: column;
}

.problems-list {
    position: relative; z-index: 1;
    flex: 1; overflow-y: auto;
}

/* LogiX Footer */
.logix-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    background: linear-gradient(180deg, transparent, rgba(201, 168, 76, 0.02));
    border-top: 1px solid rgba(201, 168, 76, 0.08);
    font-size: 11px;
    flex-shrink: 0;
}

.logix-brand {
    color: var(--primary);
    font-weight: 500;
    display: flex; align-items: center; gap: 7px;
}

.logix-brand__chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    border-radius: 4px;
    background: var(--primary);
    color: #0a0a0a;
    font-size: 9px;
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.15);
}

.logix-brand__text { color: var(--text-secondary); }
.logix-brand__text strong { color: var(--primary); font-weight: 600; }

.logix-stats {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(201, 168, 76, 0.04);
    border: 1px solid rgba(201, 168, 76, 0.08);
}

.logix-stats__dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--success);
    animation: statusBlink 2.5s var(--ease-in-out) infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(76, 175, 80, 0.3); }
    50% { opacity: 0.35; box-shadow: none; }
}

.logix-stats--loading .logix-stats__dot { background: var(--warning); animation: statusBlink 0.6s var(--ease-in-out) infinite; }
.logix-stats--error .logix-stats__dot { background: var(--danger); animation: none; }

/* LogiX Loading */
.logix-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 24px 20px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.logix-loading__icon {
    width: 20px; height: 20px;
    border-radius: 4px;
    background: var(--primary);
    color: #0a0a0a;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px;
    animation: logoPulse 2s var(--ease-in-out) infinite;
}

.logix-loading__title {
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
}

.logix-loading__sub {
    color: var(--text-tertiary);
    font-size: 10px;
    font-family: var(--font-mono);
}

/* Problem Items */
.problem-item {
    transition: background var(--transition-fast);
}

.problem-badge {
    font-size: 9px; padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.problem-badge--root {
    background: rgba(217, 69, 53, 0.10);
    color: var(--danger);
    border: 1px solid rgba(217, 69, 53, 0.2);
}

.problem-badge--downstream {
    background: rgba(230, 168, 23, 0.10);
    color: var(--warning);
    border: 1px solid rgba(230, 168, 23, 0.2);
}

.cause-chain {
    color: var(--text-tertiary);
    font-size: 10px;
    margin-top: 3px;
    padding-left: 2px;
    border-left: 2px solid rgba(230, 168, 23, 0.2);
    padding: 2px 0 2px 6px;
    border-radius: 0 2px 2px 0;
}

.cause-chain i { color: var(--warning); font-size: 9px; margin-right: 2px; }
.cause-chain strong { color: var(--warning); font-weight: 600; }

/* ============================================
   Console
   ============================================ */
.console-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.console-filter { display: flex; gap: 4px; margin-left: auto; }

.filter-btn {
    padding: 2px 8px;
    background: transparent; border: none;
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.filter-btn:hover { color: var(--text-secondary); }
.filter-btn.active { background: var(--bg-hover); color: var(--text-primary); }

.console-output {
    flex: 1; overflow-y: auto;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

.console-welcome {
    display: flex; flex-direction: column; gap: 5px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.python-logo {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--primary);
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.1);
}

.welcome-text { color: var(--text-secondary); font-weight: 500; }

.python-version { color: var(--text-tertiary); font-size: var(--font-size-xs); }

.console-line { display: flex; margin-bottom: 4px; line-height: 1.5; }

.console-line .prompt { color: var(--text-tertiary); margin-right: 8px; user-select: none; }
.console-line .code { color: var(--console-output); }

.console-line.output { padding-left: 20px; }

/* ---- 内联输入 — 模拟原生 Python input() 体验 ---- */
.console-inline-input {
    display: flex; align-items: center;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.5;
    min-height: 20px;
}

.console-inline-input .inline-text {
    color: #D4D4D4;
}

.console-inline-input .inline-cursor {
    color: var(--primary);
    font-weight: 400;
    animation: inlineBlink 1s var(--ease-in-out) infinite;
    margin-left: 1px;
}

@keyframes inlineBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.inline-hidden-input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.console-line.error {
    color: var(--console-error);
    background: rgba(240, 96, 80, 0.06);
    padding: 4px 8px; border-radius: 4px;
    margin: 4px 0;
}

.console-line.warning {
    color: var(--console-warning);
    background: rgba(230, 168, 23, 0.06);
    padding: 4px 8px; border-radius: 4px;
    margin: 4px 0;
}

.console-line.info { color: var(--console-info); }
.console-line.success { color: var(--console-success); }

.console-input-wrapper {
    display: flex; align-items: center;
    padding: 7px 12px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    transition: border-color var(--transition-fast);
}

.console-input-wrapper:focus-within {
    border-top-color: rgba(201, 168, 76, 0.15);
}

.console-prompt {
    color: var(--primary);
    font-family: var(--font-mono);
    margin-right: 8px;
    opacity: 0.7;
}

.console-input {
    flex: 1;
    background: transparent; border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    outline: none;
}

.console-status-line {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--font-size-xs);
}

.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.4s var(--ease-out);
}

.status-dot.idle { background-color: var(--text-tertiary); }
.status-dot.compiling { background-color: var(--warning); animation: pulse 1s var(--ease-in-out) infinite; }
.status-dot.outputting { background-color: var(--info); animation: pulse 0.8s var(--ease-in-out) infinite; }
.status-dot.awaiting-input { background-color: var(--danger); animation: breathe 1.2s var(--ease-in-out) infinite; }

.status-dot-text { color: var(--text-tertiary); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 96, 80, 0.35); }
    50% { box-shadow: 0 0 0 5px rgba(240, 96, 80, 0); }
}

/* ============================================
   Status Bar
   ============================================ */
.status-bar {
    height: var(--status-height);
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    font-size: var(--font-size-xs);
    border-top: 1px solid var(--border-color);
}

.status-left, .status-center, .status-right {
    display: flex; align-items: center; gap: 16px;
}

.status-item {
    display: flex; align-items: center; gap: 4px;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

/* ============================================
   Toast
   ============================================ */
#toast-container {
    position: fixed; bottom: 40px; right: 24px;
    z-index: 10000;
}

.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: toastIn 0.4s var(--ease-spring);
    font-size: var(--font-size-sm);
}

@keyframes toastIn {
    from { transform: translateX(30px) scale(0.95); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast-success { border-left: 2px solid var(--success); }
.toast-error { border-left: 2px solid var(--danger); }
.toast-warning { border-left: 2px solid var(--warning); }
.toast-info { border-left: 2px solid var(--primary); }

/* ============================================
   Modal
   ============================================ */
#modal-container .modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.25s var(--ease-out);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    max-width: 500px; width: 90%;
    max-height: 80vh; overflow: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.35s var(--ease-spring);
}

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

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title { font-size: var(--font-size-lg); font-weight: 600; }

.modal-body { padding: 22px; }

.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Context Menu
   ============================================ */
.context-menu {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 4px 0;
    animation: ctxIn 0.18s var(--ease-out);
}

@keyframes ctxIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    :root { --sidebar-width: 180px; }
    .output-panel { width: 280px; }
}

@media (max-width: 1100px) {
    :root { --sidebar-width: 160px; }
    .output-panel { width: 260px; }
    .menu-bar { padding: 0 8px; }
    .main-menu .menu-item { padding: 0 7px; }
    .menu-label { font-size: 11px; }
}

@media (max-width: 992px) {
    .sidebar { display: none; }
    .sidebar.visible {
        display: flex; position: absolute;
        top: var(--menu-height); left: 0; bottom: var(--status-height);
        z-index: 500;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }
    .editor-container { margin-left: 0; }
    .output-panel { width: 250px; }
    .main-content { flex-direction: column; }
    .editor-container { flex: 1 1 auto; min-height: 200px; }
    .output-panel {
        width: 100%; height: 35vh; min-height: 180px;
        border-left: none; border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    :root { --menu-height: 34px; }
    .logo-text { font-size: 13px; }
    .logo-version { display: none; }
    .main-menu .menu-label span { display: none; }
    .main-menu .menu-label i { font-size: 14px; }
    .file-name input { width: 70px; font-size: 11px; }
    .status-indicators { display: none; }
    .menu-actions .btn span { display: none; }
}

@media (max-width: 480px) {
    .main-menu .menu-item { padding: 0 4px; }
    .menu-right { gap: 4px; }
    .language-selector select { font-size: 10px; padding: 2px 4px; }
}

[data-i18n] { transition: opacity 0.15s ease; }
.language-switching [data-i18n] { opacity: 0.5; }
