/* ===========================================
   Cortex: AI Parameter Lab - Stylesheet
   Based on Gumroad Design Style
   =========================================== */

/* Global style reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Font and basic styles */
body {
    font-family: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background-color: #19A488;
    background-image: 
        radial-gradient(circle at 25% 75%, #FFD1E6 0%, transparent 50%),
        radial-gradient(circle at 75% 25%, #FECB2E 0%, transparent 50%);
    min-height: 100vh;
    padding: 20px;
}

/* Main game container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   卡片基础样式 (Gumroad风格)
   =========================================== */
.card-base {
    background: #FFFFFF;
    border-radius: 12px;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-base:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000000;
}

/* ===========================================
   标题区域
   =========================================== */
.game-header {
    text-align: center;
}

.title-card {
    /* Base card styles */
    background: #FFFFFF;
    border-radius: 12px;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    
    /* Title card specific styles */
    background: linear-gradient(135deg, #FFD1E6 0%, #FECB2E 100%);
    position: relative;
    overflow: hidden;
}

.game-title {
    font-size: 3rem;
    font-weight: 900;
    color: #000000;
    margin-bottom: 8px;
    text-shadow: 2px 2px 0px #FFFFFF;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 16px;
}

.level-badge {
    display: inline-block;
    background: rgba(25, 164, 136, 0.15); /* Semi-transparent teal background */
    color: #19A488; /* Teal text color to match our design system */
    font-weight: 600; /* Reduced from 800 to look less button-like */
    font-size: 0.9rem; /* Slightly smaller */
    padding: 6px 12px; /* Reduced padding */
    border: 1px solid rgba(25, 164, 136, 0.3); /* Subtle border */
    border-radius: 8px; /* Less rounded, more tag-like */
    transform: none; /* Remove rotation to look more like a status indicator */
    box-shadow: none; /* Remove shadow to reduce button appearance */
    letter-spacing: 0.5px; /* Add letter spacing for better readability */
    text-transform: uppercase; /* Make it look more like a status label */
}

/* ===========================================
   问题区域
   =========================================== */
.problem-section {
    display: grid;
    gap: 16px;
}

.problem-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 24px;
    position: relative;
}

.example-hints {
    margin-top: 20px;
    text-align: left;
}

.hints-label {
    font-size: 1rem;
    font-weight: 600;
    color: #19A488;
    margin-bottom: 10px;
}

.hint-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hint-chip {
    background: #FFD1E6;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.hint-chip:hover {
    background: #FECB2E;
    transform: translateY(-1px);
    box-shadow: 2px 2px 0px #000000;
}

.hint-chip:active {
    transform: translateY(0px);
    box-shadow: 1px 1px 0px #000000;
}

.problem-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.problem-text {
    font-size: 1.1rem;
    color: #000000;
    line-height: 1.8;
    background: #FFD1E6;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #000000;
    font-weight: 500;
}

/* ===========================================
   控制面板
   =========================================== */
.control-panel {
    display: grid;
    gap: 20px;
}

.input-card, .parameters-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 24px;
}

.input-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 12px;
}

.prompt-input {
    width: 100%;
    font-size: 1.1rem;
    padding: 16px;
    border: 2px solid #000000;
    border-radius: 8px;
    background: #FFFFFF;
    font-family: inherit;
    transition: box-shadow 0.2s ease;
}

.prompt-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px #FFD1E6;
}

/* 参数控制 */
.parameters-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 20px;
    text-align: center;
}

.slider-group {
    margin-bottom: 24px;
}

.style-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #000000;
    border-radius: 8px;
    background: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
    color: #000000;
    cursor: pointer;
    margin-bottom: 8px;
}

.style-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 164, 136, 0.3);
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 8px;
}

.slider-value {
    background: #FECB2E;
    color: #000000;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid #000000;
    font-weight: 800;
}

.slider-container {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.parameter-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #FFD1E6;
    outline: none;
    border: 1px solid #000000;
}

.target-indicator {
    position: absolute;
    top: -8px;
    width: 4px;
    height: 24px;
    background: #ff4757;
    border: 2px solid #000000;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
    opacity: 0.8;
    animation: pulse-target 2s infinite;
}

@keyframes pulse-target {
    0%, 100% { 
        opacity: 0.8;
        transform: translateY(0);
    }
    50% { 
        opacity: 1;
        transform: translateY(-2px);
    }
}

.parameter-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FECB2E;
    border: 2px solid #000000;
    cursor: pointer;
    box-shadow: 2px 2px 0px #000000;
}

.slider-hint {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* 生成按钮 */
.generate-btn {
    background: linear-gradient(135deg, #FECB2E 0%, #FFD1E6 100%);
    color: #000000;
    font-size: 1.3rem;
    font-weight: 800;
    padding: 18px 36px;
    border: 3px solid #000000;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 0px #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
}

.generate-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000000;
}

.generate-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000000;
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 4px 4px 0px #000000;
}

/* ===========================================
   结果区域
   =========================================== */
.result-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 24px;
}

.result-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 20px;
    text-align: center;
}

.image-container {
    width: 100%;
    height: 400px;
    border: 2px solid #000000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: #F8F8F8;
    overflow: hidden;
}

.placeholder-image {
    text-align: center;
    color: #666;
}

.placeholder-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.generated-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* 为什么按钮 */
.explanation-controls {
    text-align: center;
    margin-top: 16px;
}

.why-button {
    background: #19A488;
    color: #FFFFFF;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 24px;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0px #000000;
}

.why-button:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px #000000;
}

/* ===========================================
   解释面板
   =========================================== */
.explanation-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.explanation-content {
    background: #FFFFFF;
    border: 3px solid #000000;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 8px 8px 0px #000000;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.explanation-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 16px;
    text-align: center;
}

.explanation-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #000000;
    margin-bottom: 24px;
}

.explanation-text p {
    margin-bottom: 12px;
    padding: 12px;
    background: #FFD1E6;
    border-radius: 6px;
    border: 1px solid #000000;
}

.close-explanation {
    background: #FECB2E;
    color: #000000;
    font-weight: 600;
    padding: 12px 24px;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    box-shadow: 3px 3px 0px #000000;
}

.close-explanation:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px #000000;
}

/* ===========================================
   加载状态
   =========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(25, 164, 136, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-spinner {
    text-align: center;
    color: #FFFFFF;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #FFFFFF;
    border-top: 4px solid #FECB2E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
}

/* ===========================================
   成功模态框
   =========================================== */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.success-content {
    background: linear-gradient(135deg, #FECB2E 0%, #FFD1E6 100%);
    border: 3px solid #000000;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 8px 8px 0px #000000;
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.success-title {
    font-size: 2rem;
    font-weight: 900;
    color: #000000;
    margin-bottom: 16px;
}

.success-text {
    font-size: 1.2rem;
    color: #000000;
    margin-bottom: 24px;
}

.next-level-btn {
    background: #19A488;
    color: #FFFFFF;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 12px 32px;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 4px 4px 0px #000000;
    transition: all 0.2s ease;
}

.next-level-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000000;
}

/* ===========================================
   响应式设计
   =========================================== */
@media (max-width: 768px) {
    .game-container {
        padding: 16px;
        gap: 16px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .card-base {
        padding: 16px;
    }
    
    .image-container {
        height: 300px;
    }
    
    .explanation-content {
        padding: 24px;
        margin: 10px;
    }
}

/* ===========================================
   特殊效果和动画
   =========================================== */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* ========== Level Selection Screen Styles ========== */

/* Project Description */
.project-description {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 30px;
    padding: 0 20px;
}

.description-card {
    background: #FFFFFF;
    border: 3px solid #000000;
    border-radius: 16px;
    box-shadow: 6px 6px 0px #000000;
    padding: 30px;
    max-width: 600px;
    text-align: center;
}

.description-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 16px;
}

.description-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #000000;
    line-height: 1.6;
    margin-bottom: 20px;
}

.feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.feature-chip {
    background: #FECB2E;
    color: #000000;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #000000;
    box-shadow: 2px 2px 0px #000000;
}

/* Responsive for description */
@media (max-width: 768px) {
    .description-card {
        padding: 20px;
        max-width: 500px;
    }

    .description-title {
        font-size: 1.3rem;
    }

    .description-text {
        font-size: 1rem;
    }

    .feature-chip {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .project-description {
        padding: 0 15px;
    }

    .description-card {
        padding: 16px;
    }

    .feature-chips {
        gap: 8px;
    }

    .feature-chip {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

.level-select-screen {
    min-height: 100vh;
    padding: 20px;
    background-color: #19A488;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.level-select-header {
    text-align: center;
    margin-bottom: 40px;
}

.level-select-header .main-title {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 3px 3px 0px #000000;
}

.level-select-header .subtitle {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 20px;
    font-weight: 600;
}

.progress-info {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #000000;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 4px 4px 0px #000000;
    font-weight: 600;
    color: #000000;
}

.level-grid-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 30px;
}

.level-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    justify-content: center;
    max-width: 900px;
}

.level-card {
    width: 200px;
    height: 160px;
    border: 3px solid #000000;
    border-radius: 16px;
    box-shadow: 6px 6px 0px #000000;
    background: #FFFFFF; /* 添加默认背景色 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-weight: 600;
    padding: 16px;
    text-align: center;
    opacity: 0;
    animation: slideInUp 0.6s ease forwards;
}

.level-card:nth-child(1) { animation-delay: 0.1s; }
.level-card:nth-child(2) { animation-delay: 0.2s; }
.level-card:nth-child(3) { animation-delay: 0.3s; }
.level-card:nth-child(4) { animation-delay: 0.4s; }
.level-card:nth-child(5) { animation-delay: 0.5s; }
.level-card:nth-child(6) { animation-delay: 0.6s; }
.level-card:nth-child(7) { animation-delay: 0.7s; }
.level-card:nth-child(8) { animation-delay: 0.8s; }
.level-card:nth-child(9) { animation-delay: 0.9s; }
.level-card:nth-child(10) { animation-delay: 1.0s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.level-card:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 0px #000000;
}

.level-card.completed {
    background: linear-gradient(135deg, #2ed573 0%, #17c0eb 100%);
    color: #000000;
}

.level-card.unlocked {
    background: linear-gradient(135deg, #feca57 0%, #ff6b6b 100%);
    color: #000000;
    /* 同时执行入场动画与呼吸动画，避免覆盖导致opacity保持为0 */
    animation: slideInUp 0.6s ease forwards, pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 6px 6px 0px #000000; }
    50% { box-shadow: 8px 8px 0px #000000, 0 0 20px rgba(254, 202, 87, 0.6); }
    100% { box-shadow: 6px 6px 0px #000000; }
}

.level-card.locked {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #000000;
    opacity: 0.7;
    cursor: not-allowed;
}

.level-card.locked:hover {
    transform: none;
    box-shadow: 6px 6px 0px #000000;
}

.level-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.level-number {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.level-title {
    font-size: 0.9rem;
    line-height: 1.2;
    font-weight: 500;
}

.level-select-footer {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.reset-btn {
    background: linear-gradient(135deg, #ff4757 0%, #c44569 100%);
    color: #000000;
    border: 3px solid #000000;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 4px 4px 0px #000000;
    transition: transform 0.2s ease;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000000;
}

.audio-toggle-btn {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #000000;
    border: 3px solid #000000;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 4px 4px 0px #000000;
    transition: transform 0.2s ease;
}

.audio-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000000;
}

.audio-toggle-btn.disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.back-button-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-to-levels-btn {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: #000000;
    border: 3px solid #000000;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 4px 4px 0px #000000;
    transition: transform 0.2s ease;
    font-size: 1rem;
}

.back-to-levels-btn:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000000;
}

.game-screen {
    display: none;
}

/* ========== Responsive Design for Level Selection ========== */

@media (max-width: 768px) {
    .level-select-header .main-title {
        font-size: 2rem;
    }
    
    .level-grid {
        gap: 15px;
        padding: 15px;
        max-width: 600px;
    }
    
    .level-card {
        width: 160px;
        height: 140px;
        font-size: 0.9rem;
    }
    
    .level-icon {
        font-size: 2rem;
    }
    
    .level-number {
        font-size: 1rem;
    }
    
    .level-title {
        font-size: 0.8rem;
    }
    
    .back-to-levels-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .level-select-screen {
        padding: 15px;
    }
    
    .level-select-header .main-title {
        font-size: 1.8rem;
    }
    
    .level-select-header .subtitle {
        font-size: 1rem;
    }
    
    .level-grid {
        gap: 12px;
        padding: 10px;
        max-width: 320px;
    }
    
    .level-card {
        width: 140px;
        height: 120px;
    }
    
    .level-icon {
        font-size: 1.8rem;
    }
    
    .progress-info {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* ========== 玩家判断区域样式 ========== */
.judgment-controls {
    background: linear-gradient(135deg, #FFD1E6 0%, #FECB2E 100%);
    border: 3px solid #000000;
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    text-align: center;
    box-shadow: 6px 6px 0px #000000;
}

.judgment-question {
    font-size: 1.4rem;
    font-weight: 800;
    color: #000000;
    margin: 0 0 12px 0;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8);
}

.judgment-hint {
    font-size: 1rem;
    color: #000000;
    margin: 0 0 24px 0;
    opacity: 0.8;
}

.judgment-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.judgment-btn {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 16px 32px;
    border: 3px solid #000000;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 0px #000000;
    min-width: 160px;
    text-transform: uppercase;
}

.solved-btn {
    background: linear-gradient(135deg, #2ed573 0%, #19A488 100%);
    color: #000000;
}

.solved-btn:hover {
    background: linear-gradient(135deg, #19A488 0%, #2ed573 100%);
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000000;
}

.not-solved-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #000000;
}

.not-solved-btn:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%);
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000000;
}

.judgment-btn:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0px #000000;
}

/* ===========================================
   Parameter Visualization Styles
   =========================================== */

.parameter-visualization {
    margin: 20px 0;
    padding: 20px;
    background: rgba(25, 164, 136, 0.1);
    border: 2px solid #19A488;
    border-radius: 12px;
    animation: slideInUp 0.3s ease;
}

.viz-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 15px;
    text-align: center;
}

.parameter-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.param-bar-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.param-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333333;
}

.param-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.param-bar {
    flex: 1;
    height: 20px;
    border: 2px solid #000000;
    border-radius: 10px;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.param-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--fill-percentage, 50%);
    transition: width 0.5s ease;
    border-radius: 8px;
}

.creativity-bar::after {
    background: linear-gradient(90deg, #FFD1E6 0%, #FF6B9D 100%);
}

.style-bar::after {
    background: linear-gradient(90deg, #FECB2E 0%, #FF8F00 100%);
}

.randomness-bar::after {
    background: linear-gradient(90deg, #19A488 0%, #0F7B6C 100%);
}

.param-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #000000;
    min-width: 50px;
    text-align: right;
}

.param-bar.updating {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Enhanced explanation text formatting */
.explanation-text {
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.explanation-item {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid #000000;
    box-shadow: 2px 2px 0px #000000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.explanation-item:last-child {
    margin-bottom: 0;
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 1.2rem;
}

.category-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #333333;
}

.explanation-content-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444444;
}

.explanation-content-text strong {
    color: #19A488;
    font-weight: 700;
}

/* Category-specific styling */
.explanation-creativity {
    border-left: 4px solid #FFD1E6;
}

.explanation-style {
    border-left: 4px solid #FECB2E;
}

.explanation-combination {
    border-left: 4px solid #19A488;
}

.explanation-warning {
    border-left: 4px solid #ff4757;
    background: rgba(255, 71, 87, 0.05);
}

.explanation-education {
    border-left: 4px solid #5352ed;
    background: rgba(83, 82, 237, 0.05);
}

.explanation-technical {
    border-left: 4px solid #747d8c;
}

.explanation-prediction {
    border-left: 4px solid #2ed573;
}

.explanation-general {
    border-left: 4px solid #a4b0be;
}

/* Scrollbar styling */
.explanation-text::-webkit-scrollbar {
    width: 6px;
}

.explanation-text::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.explanation-text::-webkit-scrollbar-thumb {
    background: #19A488;
    border-radius: 3px;
}

.explanation-text::-webkit-scrollbar-thumb:hover {
    background: #0F7B6C;
}

/* Parameter History Styles */
.parameter-history {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed rgba(25, 164, 136, 0.3);
}

.history-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 10px;
}

.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.history-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #19A488;
    color: white;
    border: 2px solid #000000;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-btn:hover {
    background: #0F7B6C;
    transform: translateY(-1px);
}

.history-timeline {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}

.history-entry {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.history-entry.current {
    border: 2px solid #19A488;
    background: rgba(25, 164, 136, 0.1);
}

.history-entry:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-time {
    font-size: 0.7rem;
    color: #666666;
    font-weight: 600;
}

.history-prompt {
    font-size: 0.8rem;
    color: #333333;
    font-style: italic;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.history-params {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.param-chip {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.param-chip.creativity.very-high { background: #ff6b6b; color: white; }
.param-chip.creativity.high { background: #feca57; color: #333; }
.param-chip.creativity.medium { background: #48dbfb; color: #333; }
.param-chip.creativity.low { background: #a4b0be; color: #333; }
.param-chip.creativity.very-low { background: #ddd; color: #333; }

.param-chip.style.active { background: #FECB2E; color: #333; }
.param-chip.style.inactive { background: #f1f2f6; color: #666; }

.current-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #19A488;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    border: 2px solid #000000;
}

.comparison-insights {
    margin-top: 15px;
    padding: 12px;
    background: rgba(25, 164, 136, 0.05);
    border: 1px solid rgba(25, 164, 136, 0.2);
    border-radius: 8px;
}

.comparison-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #19A488;
    margin-bottom: 8px;
}

.comparison-insights p {
    font-size: 0.8rem;
    color: #333333;
    margin-bottom: 5px;
    line-height: 1.4;
}

.comparison-insights p:last-child {
    margin-bottom: 0;
}

.no-history {
    text-align: center;
    color: #666666;
    font-style: italic;
    font-size: 0.9rem;
    padding: 20px;
}

/* ===========================================
   Input Mode Toggle & Safe Prompt Builder
   =========================================== */

.input-mode-toggle {
    margin-bottom: 15px;
}

.toggle-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.mode-btn {
    padding: 8px 16px;
    border: 2px solid #000000;
    border-radius: 6px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    transform: translateY(-1px);
    box-shadow: 2px 2px 0px #000000;
}

.mode-btn.active {
    background: #19A488;
    color: #FFFFFF;
}

.input-mode {
    margin-top: 15px;
}

.prompt-builder {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.keyword-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.keyword-category {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333333;
}

.keyword-select {
    padding: 10px 12px;
    border: 2px solid #000000;
    border-radius: 8px;
    background: #FFFFFF;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.keyword-select:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.keyword-select:focus {
    outline: none;
    border-color: #19A488;
    box-shadow: 0 0 0 2px rgba(25, 164, 136, 0.2);
}

.prompt-preview {
    margin-top: 10px;
    padding: 15px;
    background: rgba(25, 164, 136, 0.1);
    border: 2px dashed #19A488;
    border-radius: 8px;
}

.preview-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #19A488;
    display: block;
    margin-bottom: 8px;
}

.prompt-display {
    padding: 10px;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    color: #333333;
    min-height: 20px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.prompt-display.has-content {
    background: rgba(255, 209, 230, 0.2);
    border-color: #FFD1E6;
    color: #000000;
}

.prompt-display.empty {
    color: #666666;
    font-style: italic;
}

@media (min-width: 768px) {
    .keyword-categories {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}