:root {
    --bg: #121212; --surface: #1e1e1e; --primary: #8b5cf6; 
    --accent: #3b82f6; --text: #e5e5e5; --text-dim: #a0a0a0; --border: #333;
    --code-bg: #2d2d2d;
}

body { 
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; 
    background: var(--bg); color: var(--text); 
    margin: 0; padding: 20px; height: 100vh; 
    box-sizing: border-box; overflow: hidden; 
}

.main-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; height: 100%; }

.sidebar { 
    background: var(--surface); padding: 20px; border-radius: 12px; 
    border: 1px solid var(--border); overflow-y: auto; 
    display: flex; flex-direction: column; gap: 15px; 
}

.display-area {
    display: flex; flex-direction: column; gap: 20px; height: 100%; overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

h1 { margin: 0; font-size: 1.4rem; color: var(--primary); text-align: center; }
h2 { font-size: 0.9rem; border-bottom: 1px solid #333; padding-bottom: 5px; margin: 15px 0 8px 0; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
h3 { font-size: 1rem; color: #fff; margin: 15px 0 8px 0; display: flex; align-items: center; gap: 8px; }

.control-group { margin-bottom: 8px; }
label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 5px; }

input[type="number"], input[type="text"], select { 
    background: #2a2a2a; border: 1px solid #444; color: white; 
    padding: 8px; border-radius: 4px; width: 100%; box-sizing: border-box; 
    font-family: monospace; text-align: center;
}
input:focus { border-color: var(--primary); outline: none; }
input[type="range"] { width: 100%; cursor: pointer; accent-color: var(--primary); }

.input-row { display: flex; gap: 10px; align-items: center; }
.input-row input[type="number"] { width: 60px; }
.input-row input[type="range"] { flex: 1; }

#drop-zone { 
    border: 2px dashed #444; padding: 20px; text-align: center; border-radius: 8px; 
    cursor: pointer; transition: 0.2s; background: #252525; 
}
#drop-zone:hover { border-color: var(--primary); background: #2a2a2a; }
#drop-zone.active { border-color: #22c55e; background: #1a2e1a; }

.btn-small { background: #333; border: 1px solid #444; color: #ccc; padding: 6px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }
.btn-small:hover { background: #444; color: white; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }

.action-area { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.btn-main { 
    width: 100%; padding: 12px; background: var(--primary); color: white; border: none; 
    border-radius: 6px; cursor: pointer; font-weight: bold; 
    font-size: 1rem; transition: 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.btn-main:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary {
    width: 100%; padding: 10px; background: #2d3748; color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; cursor: pointer; font-size: 0.9rem; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-secondary:hover { background: #374151; border-color: var(--text-dim); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; text-decoration: line-through; }

.preview-container { 
    flex: 1; 
    background: #000; border-radius: 12px; overflow: hidden; position: relative; 
    border: 1px solid var(--border); min-height: 300px;
}
#canvas-container { width: 100%; height: 100%; }

.overlay-stats {
    position: absolute; top: 15px; left: 15px; 
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(4px);
    padding: 10px; border-radius: 6px; border: 1px solid #333;
    font-size: 0.85rem; color: #0f0; pointer-events: none; user-select: none;
    z-index: 10;
}

.guide-panel {
    height: 40%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 0 20px 20px 20px;
    overflow-y: auto; color: #ccc; font-size: 0.9rem;
    line-height: 1.6;
}

code {
    background: var(--code-bg); padding: 2px 6px; border-radius: 4px; 
    font-family: monospace; color: #ff9e64; border: 1px solid #444;
}
.step-list { margin: 0; padding-left: 20px; }
.step-list li { margin-bottom: 8px; }
.important { color: #f87171; font-weight: bold; }
.tip { color: #60a5fa; font-size: 0.85rem; border-left: 3px solid #60a5fa; padding-left: 10px; margin: 10px 0; }

#anim-controls { display: none; border-top: 1px solid #333; padding-top: 15px; margin-top: 10px; }
