:root {
    --primary-red: #de2910;
    --primary-gold: #ffde00;
    --typ-blue: #1890ff;
    --typ-green: #52c41a;
    --typ-purple: #722ed1;
    --bg-color: #fdfbf7;
    --text-dark: #2c3e50;
    --text-light: #596b7e;
    --glass-bg: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --font-title: 'Ma Shan Zheng', cursive;
    --font-body: 'Outfit', sans-serif;
    --font-serif: 'Noto Serif SC', serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(222, 41, 16, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(24, 144, 255, 0.03) 0%, transparent 20%);
    color: var(--text-dark);
    font-family: var(--font-body);
    min-height: 100vh;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Header ===== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 35px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
}

.header-content h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.header-content .highlight {
    color: var(--primary-red);
    font-family: var(--font-title);
    font-size: 2rem;
    margin-left: 10px;
}

.subtitle {
    font-family: var(--font-body);
    color: var(--text-light);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ideology-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--typ-blue), var(--typ-purple));
    color: white;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.badge-icon {
    font-size: 1.3rem;
}

/* ===== Main Stage ===== */
.main-stage {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 20px;
    min-height: 600px;
}

.left-panel,
.right-panel,
.center-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ===== Panel Sections ===== */
.panel-section {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-gold);
}

.panel-icon {
    font-size: 1.4rem;
}

.panel-header h3 {
    font-size: 1.05rem;
    color: var(--primary-red);
    font-weight: 700;
}

/* ===== Navigation ===== */
.graph-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.nav-btn:hover {
    border-color: var(--typ-blue);
    transform: translateX(5px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #e6f7ff, #f9f0ff);
    border-color: var(--typ-blue);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.2);
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-info {
    display: flex;
    flex-direction: column;
}

.nav-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.nav-desc {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===== Canvas Area ===== */
.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.canvas-header h2 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--primary-red);
}

.canvas-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.control-input {
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    width: 60px;
}

.control-btn {
    padding: 6px 15px;
    background: var(--typ-blue);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.control-btn:hover {
    background: #40a9ff;
}

.canvas-container {
    flex: 1;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    min-height: 400px;
}

#graphCanvas {
    width: 100%;
    height: 100%;
}

/* ===== Ideology Box ===== */
.ideology-box {
    background: linear-gradient(135deg, #fff5f5, #ffffff);
    border: 2px solid var(--primary-red);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.ideology-title {
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ideology-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-dark);
    text-align: justify;
}

/* ===== Info Content ===== */
.info-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.math-formula {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-family: var(--font-mono);
    border-left: 3px solid var(--typ-blue);
    overflow-x: auto;
}

/* ===== Stats List ===== */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 700;
    color: var(--typ-purple);
    font-family: var(--font-mono);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .main-stage {
        grid-template-columns: 1fr;
    }

    .canvas-container {
        height: 400px;
    }
}