:root {
    --primary-color: #4A90E2;
    --secondary-color: #F5A623;
    --success-color: #7ED321;
    --error-color: #D0021B;
    --bg-color: #F0F4F8;
    --card-bg: #FFFFFF;
    --text-color: #333333;
}

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#app {
    width: 90%;
    max-width: 500px;
    background: white;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
}

header h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.subtitle {
    color: #888;
    margin-top: 0.5rem;
}

#game-container {
    margin: 2rem 0;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card-bg);
    border: 3px solid #E1E8ED;
    border-radius: 16px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
}

.card.selected {
    border-color: var(--primary-color);
    background-color: #EBF4FF;
    transform: translateY(-5px);
}

.card .expr {
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
}

.operators-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.op-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    border-radius: 12px;
    background-color: #F0F4F8;
    color: var(--primary-color);
    border: 2px solid transparent;
    cursor: pointer;
}

.op-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.op-btn.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

#controls-area {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.secondary-btn {
    background: none;
    border: 2px solid #E1E8ED;
    color: #666;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    background: #F0F4F8;
    border-color: #CCC;
}

#feedback-area {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    background-color: #F9FAFB;
}

#game-message {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
}

.won #game-message {
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.lost #game-message {
    color: var(--error-color);
}

/* --- 情感反馈动画 --- */

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

@keyframes celebrate {
    0% { transform: scale(1) rotate(0); }
    25% { transform: scale(1.2) rotate(5deg); }
    50% { transform: scale(1) rotate(-5deg); }
    75% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.animate-bounce { animation: bounce 0.3s ease; }
.animate-shake { animation: shake 0.3s ease; }
.animate-celebrate { animation: celebrate 0.6s ease infinite; }

.feedback-toast {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    pointer-events: none;
    animation: floatUp 2s forwards;
}

.feedback-toast.success { background: var(--success-color); }
.feedback-toast.hint { background: var(--secondary-color); }
.feedback-toast.error { background: var(--error-color); }

#hint-btn.glow {
    box-shadow: 0 0 15px var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* --- 页脚与品牌标识 --- */

footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #E1E8ED;
}

.team-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    color: #AAA;
    font-size: 0.9rem;
    font-weight: 500;
}

.brand-icon {
    font-size: 1.1rem;
}

.copyright {
    margin: 0.3rem 0 0;
    font-size: 0.75rem;
    color: #CCC;
    letter-spacing: 1px;
}


