:root {
    --bg-color: #1a1b26;
    --card-bg: rgba(30, 32, 48, 0.8);
    --accent-color: #ff6b6b;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --highlight: #ffd43b;
    --font-main: 'Outfit', sans-serif;
    --font-zh: 'Noto Sans TC', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main), var(--font-zh);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(45deg, #ff6b6b, #fcc419);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
}

.description {
    color: var(--text-secondary);
    font-size: 1rem;
}

main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }
    .controls-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.visualization-container {
    background: #13141f;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
    /* Ensure it takes full width of its grid cell */
    width: 100%;
}

svg {
    width: 100%;
    height: auto;
    display: block;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stage-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
}

.stage-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-main), var(--font-zh);
    font-size: 1rem;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stage-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.stage-btn.active {
    background: linear-gradient(90deg, rgba(255,107,107,0.2), transparent);
    border-left: 4px solid var(--accent-color);
    color: #fff;
}

.info-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
}

.info-card h2 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.info-card p {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.mechanism-box {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--highlight);
}

.mechanism-box h3 {
    color: var(--highlight);
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mechanism-box p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: #e0e0e0;
}
