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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

header {
    margin-bottom: 20px;
}

h1 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #4a9eff;
}

.subtitle {
    color: #999;
    font-size: 0.9em;
}

.controls {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.control-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

label {
    font-weight: 500;
    min-width: 60px;
}

input[type="number"],
input[type="text"] {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 1em;
    width: 120px;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #4a9eff;
}

button {
    background: #4a9eff;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover {
    background: #3a8eef;
}

button:active {
    background: #2a7edf;
}

.main-area {
    display: flex;
    gap: 20px;
}

.canvas-container {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    flex: 1;
    overflow: auto;
}

canvas {
    display: block;
    border: 1px solid #444;
    cursor: crosshair;
}

.info-panel {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    width: 400px;
    max-height: 800px;
    overflow-y: auto;
}

.info-panel h2 {
    color: #4a9eff;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.info-panel h3 {
    color: #4ecdc4;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.info-panel h4 {
    color: #999;
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 1em;
}

.instruction {
    color: #999;
    font-style: italic;
    margin-bottom: 20px;
}

#point-info {
    border-bottom: 2px solid #444;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

#static-info {
    /* Static information section */
}

.controls-list {
    margin-left: 20px;
    line-height: 1.8;
    color: #ccc;
    font-size: 0.9em;
}

.controls-list li {
    margin-bottom: 5px;
}

.legend {
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #444;
}

.branch-a {
    background: #4a9eff;
}

.branch-b {
    background: #ff6b6b;
}

.endpoint {
    background: #4eff9e;
}

.gray {
    background: #555;
}

.formulas {
    font-size: 0.9em;
    line-height: 1.6;
}

.formulas p {
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 500;
}

.formulas ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.formulas li {
    color: #ccc;
    font-family: 'Courier New', monospace;
}

.about {
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.6;
    margin-top: 8px;
}

.trajectory {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #444;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.8;
    max-height: 300px;
    overflow-y: auto;
}

.trajectory .odd {
    color: #4a9eff;
    font-weight: 500;
}

.trajectory .even {
    color: #999;
}

.trajectory .endpoint {
    color: #4ecdc4;
    font-weight: bold;
}

/* Scrollbar styling */
.info-panel::-webkit-scrollbar,
.trajectory::-webkit-scrollbar {
    width: 8px;
}

.info-panel::-webkit-scrollbar-track,
.trajectory::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.info-panel::-webkit-scrollbar-thumb,
.trajectory::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.info-panel::-webkit-scrollbar-thumb:hover,
.trajectory::-webkit-scrollbar-thumb:hover {
    background: #555;
}
