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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f0f8ff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.container {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 95%;
}

.main-content {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.game-section {
    flex: 1;
}

.teaching-section {
    flex: 1;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid #ff6b00;
}

h1 {
    color: #ff6b00;
    text-align: center;
    margin-bottom: 2rem;
}

h2 {
    color: #333;
    margin-bottom: 1.5rem;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

label {
    font-size: 1.2rem;
    color: #333;
    min-width: 100px;
}

input {
    padding: 0.5rem;
    border: 2px solid #ff6b00;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    width: 100px;
}

button {
    background-color: #ff6b00;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 1rem;
}

button:hover {
    background-color: #ff8533;
}

.game-area {
    margin: 2rem 0;
    border: 2px solid #ff6b00;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

canvas {
    display: block;
    width: 100%;
    height: 400px;
    background-color: #fff;
}

.remainder-area {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid #ff6b00;
    text-align: center;
    min-width: 120px;
}

.remainder-area h3 {
    color: #ff6b00;
    margin-bottom: 0.5rem;
}

#remainderCount {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

#remainderOranges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    min-height: 40px;
}

.remainder-orange {
    width: 20px;
    height: 20px;
    background-color: #ff6b00;
    border-radius: 50%;
    position: relative;
}

.remainder-orange::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50% 50% 0 0;
}

.result-section {
    text-align: center;
    font-size: 1.2rem;
    color: #333;
    margin-top: 1rem;
    min-height: 2rem;
}

.teaching-steps {
    margin-bottom: 1.5rem;
}

.step {
    display: none;
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
}

.step.active {
    display: block;
    border-color: #ff6b00;
}

.step h3 {
    color: #ff6b00;
    margin-bottom: 1rem;
}

.step p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.step ul {
    list-style-position: inside;
    margin-left: 1rem;
}

.step li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.next-step-btn {
    width: 100%;
    margin-top: 1rem;
}

.calculation-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.calculation-section h3 {
    color: #ff6b00;
    margin-bottom: 1rem;
}

.calculation-step {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: 0.5rem;
}

.calculation-step p {
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: bold;
}

.calculation-step div {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.3rem;
    white-space: pre;
}

.publisher {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 1.1rem;
}

.publisher p {
    font-weight: bold;
}

.question-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.question-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    width: 400px;
    text-align: center;
}

.question-content p {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
}

.choice-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.choice-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 120px;
}

#knowAnswer {
    background-color: #4CAF50;
    color: white;
}

#needHelp {
    background-color: #2196F3;
    color: white;
}

#skipAnswer {
    background-color: #FF9800;
    color: white;
}

.choice-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.analysis-content {
    text-align: left;
    max-width: 600px;
}

.analysis-content h3 {
    color: #2196F3;
    margin-bottom: 15px;
    text-align: center;
}

.analysis-steps {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.analysis-steps p {
    margin: 8px 0;
    line-height: 1.5;
    color: #333;
}

.analysis-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.analysis-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

#continueAfterAnalysis {
    background-color: #4CAF50;
    color: white;
}

#tryAnswer {
    background-color: #2196F3;
    color: white;
}

.analysis-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.summary-content {
    text-align: left;
    max-width: 700px;
}

.summary-content h3 {
    color: #2196F3;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.summary-steps {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.summary-steps p {
    margin: 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.summary-steps ul {
    margin: 10px 0;
    padding-left: 20px;
}

.summary-steps li {
    margin: 8px 0;
    line-height: 1.5;
    color: #555;
}

.summary-steps li:last-child {
    color: #2196F3;
    font-style: italic;
}

#continueAfterSummary {
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto 0;
}

#continueAfterSummary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
} 