:root {
    --primary-red: #de2910;
    --primary-gold: #ffde00;
    --bg-gradient: linear-gradient(135deg, #fff1f0 0%, #ffe4e1 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #f5b7b1;
    --success-green: #27ae60;
    --error-red: #c0392b;
    --shadow: 0 4px 12px rgba(222, 41, 16, 0.15);

    --font-main: "Noto Serif SC", serif;
    --font-sans: "Outfit", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
    --font-title: "Ma Shan Zheng", cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 96vw;
    height: 92vh;
    max-width: 1900px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

/* Header */
.main-header {
    padding: 1.2rem 2.5rem;
    background: linear-gradient(90deg, #de2910 0%, #b01f0c 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.highlight {
    font-family: var(--font-title);
    color: var(--primary-gold);
    font-weight: normal;
    margin-left: 10px;
}

.subtitle {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

.header-tabs {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: white;
    color: var(--primary-red);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Main Layout */
.main-stage {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    overflow: hidden;
}

.tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 30px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary-red);
    font-family: var(--font-title);
    margin-bottom: 10px;
}

.section-desc {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Comparator Styles (Equivalence & Implication) */
.comparator-container {
    max-width: 900px;
    margin: 0 auto;
}

.formula-input-area {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.input-card {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.input-card h3 {
    color: var(--primary-red);
    margin-bottom: 12px;
    font-size: 1rem;
}

.input-card input {
    width: 100%;
    padding: 12px;
    font-size: 1.2rem;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: var(--font-mono);
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.input-card input:focus {
    border-color: var(--primary-red);
    outline: none;
}

.desc-tag {
    font-size: 0.85rem;
    color: var(--text-light);
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
}

.comparison-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--primary-gold);
    border-radius: 50%;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.icon-symbol {
    font-size: 2rem;
    color: var(--primary-red);
    font-weight: bold;
}

.action-area {
    text-align: center;
    margin-bottom: 30px;
}

.action-btn {
    padding: 12px 40px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(222, 41, 16, 0.3);
    transition: transform 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.result-panel {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.placeholder-text {
    color: #ccc;
    font-size: 1.2rem;
}

.result-content {
    width: 100%;
    text-align: center;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.result-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.result-desc {
    color: var(--text-light);
    margin-bottom: 20px;
}

.counter-example {
    background: #fff5f5;
    border: 1px solid #ffccc7;
    padding: 15px;
    border-radius: 8px;
    color: var(--error-red);
    text-align: left;
    display: inline-block;
}

/* Challenge Tab */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 40px;
    text-align: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-red);
}

.question-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 2px solid #eee;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.question-formula {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--text-dark);
    margin: 20px 0;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.option-btn {
    padding: 20px;
    background: white;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    font-family: var(--font-mono);
}

.option-btn:hover {
    border-color: var(--primary-red);
    background: #fff5f5;
}

.option-btn.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.option-btn.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.feedback-area {
    margin-top: 20px;
    min-height: 60px;
    font-size: 1.1rem;
}

.next-btn {
    margin-top: 20px;
    padding: 10px 30px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1rem;
}

.next-btn.hidden {
    display: none;
}

/* Sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.8);
    padding: 30px;
    overflow-y: auto;
}

.panel-section {
    margin-bottom: 40px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-gold);
}

.panel-icon {
    font-size: 1.5rem;
}

.panel-header h3 {
    font-size: 1.2rem;
    color: var(--primary-red);
}

.concept-content h4,
.insight-content h4 {
    color: var(--text-dark);
    margin: 16px 0 8px 0;
    font-size: 1rem;
}

.concept-content p,
.insight-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
}