/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 游戏标题 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 问题展示区 */
.problem-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.detective-character {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.problem-text h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.problem-text p {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.highlight {
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: bold;
    color: #2d3748;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 游戏主界面 */
.game-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* 笼子区域 */
.cage-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.cage {
    background: linear-gradient(45deg, #f7fafc 0%, #edf2f7 100%);
    border: 4px solid #a0aec0;
    border-radius: 15px;
    min-height: 200px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.cage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        #a0aec0 0px,
        #a0aec0 10px,
        transparent 10px,
        transparent 20px
    );
}

.cage-animals {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

.animal {
    font-size: 2.5rem;
    animation: fadeIn 0.5s ease-in;
    transition: all 0.3s ease;
}

.animal:hover {
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cage-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.info-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e2e8f0;
}

.info-item span:last-child {
    font-weight: bold;
    color: #4a5568;
    font-size: 1.2rem;
}

/* 步骤区域 */
.steps-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.step-card h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.step-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.step-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

/* 计算显示 */
.calculation-display {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid #e2e8f0;
}

.calc-line {
    margin: 10px 0;
    font-size: 1.1rem;
}

.highlight-diff {
    background: #fed7d7;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #fc8181;
    font-weight: bold;
    color: #c53030;
}

.insight {
    background: #e6fffa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #38b2ac;
    margin: 15px 0;
    font-weight: bold;
    color: #234e52;
}

/* 动物比较 */
.comparison {
    margin: 20px 0;
}

.animal-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #f7fafc;
    padding: 20px;
    border-radius: 15px;
}

.animal-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.animal-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.feet-count {
    font-weight: bold;
    color: #4a5568;
}

.arrow {
    font-size: 2rem;
    color: #667eea;
    font-weight: bold;
}

.difference-note {
    background: #c6f6d5;
    color: #22543d;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    border: 2px solid #48bb78;
}

.key-insight {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    border: 2px solid #ed8936;
    text-align: center;
}

/* 替换控制 */
.replacement-controls {
    background: #f7fafc;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
}

/* 新增：网格布局替换控制 */
.replacement-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: #f7fafc;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
}

.input-method-section,
.interactive-method-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-method-section h4,
.interactive-method-section h4 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.input-method, .interactive-method {
    margin: 20px 0;
}

.input-method label, .interactive-method label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #4a5568;
}

.input-method input {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    margin-right: 10px;
    width: 150px;
}

.input-method button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.divider {
    text-align: center;
    margin: 20px 0;
    font-weight: bold;
    color: #a0aec0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: -1;
}

.divider {
    background: white;
    padding: 0 20px;
    display: inline-block;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.controls button {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.controls button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.current-state {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.state-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #cbd5e0;
}

.state-label {
    color: #4a5568;
    font-weight: 500;
}

.state-value {
    color: #2d3748;
    font-weight: bold;
    font-size: 1.1rem;
}

.state-item.feet-progress,
.state-item.feet-progress-rabbit {
    border-left-color: #667eea;
}

.state-item.feet-progress .state-value,
.state-item.feet-progress-rabbit .state-value {
    color: #667eea;
}

/* 最终答案 */
.final-answer {
    background: #f0fff4;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #48bb78;
    margin: 20px 0;
}

.answer-display {
    font-size: 1.2rem;
    line-height: 2;
}

.answer-line {
    margin: 15px 0;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.verification {
    background: #c6f6d5;
    padding: 15px;
    border-radius: 10px;
    font-weight: bold;
    color: #22543d;
}

.success {
    color: #38a169;
    font-size: 1.5rem;
}

.celebration {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    border-radius: 15px;
}

.fireworks {
    font-size: 2rem;
    margin-bottom: 15px;
    animation: sparkle 1s infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* 公式面板 */
/* 错误提示 */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid #fc8181;
    text-align: center;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .problem-section {
        padding: 25px;
    }
    
    .cage-info {
        grid-template-columns: 1fr;
    }
    
    .animal-compare {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .replacement-controls-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .number-pad.compact {
        max-width: 180px;
    }
    
    .number-pad.compact .num-btn {
        height: 40px;
        font-size: 1.2rem;
    }
    
    .controls {
        flex-direction: row;
        gap: 8px;
    }
    
    .controls button {
        flex: 1;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
.step-card {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 变身动画 */
.transforming {
    animation: transform 0.8s ease-in-out;
}

@keyframes transform {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        opacity: 0.7;
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

/* 难度选择 */
.difficulty-selection {
    margin: 20px 0;
    padding: 20px;
    background: #f7fafc;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.difficulty-selection label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #4a5568;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.difficulty-btn {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: #4a5568;
    border: 2px solid #a0aec0;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.difficulty-info {
    text-align: center;
    font-size: 1rem;
    color: #4a5568;
}

/* 成就显示 */
.achievement-display {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    border-radius: 10px;
    border: 2px solid #ed8936;
    text-align: center;
    font-weight: bold;
    color: #744210;
}

/* 解题方法选择 */
.method-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.method-btn {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.method-btn:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.method-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.method-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 8px;
}

.method-desc {
    font-size: 0.9rem;
    color: #718096;
    opacity: 0.8;
}

/* 兔子方法的特殊样式 */
.animal-compare-rabbit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #f7fafc;
    padding: 20px;
    border-radius: 15px;
}

.feet-progress-rabbit {
    font-weight: bold;
    color: #667eea;
}

/* 响应式设计更新 */
@media (max-width: 768px) {
    .difficulty-buttons {
        flex-direction: column;
    }
    
    .method-buttons {
        grid-template-columns: 1fr;
    }
    
    .method-btn {
        padding: 20px;
    }
    
    .method-icon {
        font-size: 2.5rem;
    }
}

/* 成就动画 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* 新增的震动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 新增：目标显示样式 */
.target-display {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border: 2px solid #38b2ac;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.target-display h4 {
    color: #234e52;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.target-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.target-item {
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.target-label {
    font-weight: bold;
    color: #4a5568;
}

.target-value {
    font-weight: bold;
    color: #38b2ac;
    font-size: 1.1rem;
}

.strategy-hint {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 4px solid #38b2ac;
    text-align: center;
}

.strategy-hint p {
    margin: 0;
    color: #234e52;
}

/* 响应式设计更新 */
@media (max-width: 768px) {
    .target-info {
        grid-template-columns: 1fr;
    }
    
    .target-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}

/* 新增：计算引导样式 */
.calculation-guide {
    background: #f7fafc;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    border: 2px solid #e2e8f0;
}

.calculation-formula {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid #cbd5e0;
}

.formula-part {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 1.2rem;
}

.formula-text {
    color: #4a5568;
    font-weight: 500;
}

.formula-value {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.3rem;
}

.formula-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.touch-input {
    width: 100px;
    height: 50px;
    font-size: 1.5rem;
    text-align: center;
    border: 3px solid #cbd5e0;
    border-radius: 10px;
    background: #fff;
    color: #2d3748;
    font-weight: bold;
    transition: all 0.3s ease;
}

.touch-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.touch-input::placeholder {
    color: #a0aec0;
    font-size: 2rem;
}

/* 大屏幕数字键盘 */
.number-pad {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.number-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.num-btn {
    height: 60px;
    font-size: 1.8rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.num-btn:hover {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.num-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.num-btn.wide {
    grid-column: span 2;
}

.num-btn.delete {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
}

.num-btn.delete:hover {
    background: linear-gradient(135deg, #feb2b2 0%, #fc8181 100%);
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .num-btn {
        height: 70px;
        font-size: 2rem;
    }
    
    .touch-input {
        height: 60px;
        font-size: 1.8rem;
    }
}

/* 响应式设计更新 */
@media (max-width: 768px) {
    .target-info {
        grid-template-columns: 1fr;
    }
    
    .target-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .formula-part {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .number-pad {
        max-width: 250px;
    }
    
    .num-btn {
        height: 55px;
        font-size: 1.6rem;
    }
}

/* 新增：答案输入容器样式 */
.answer-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.input-label {
    color: #4a5568;
    font-weight: 500;
    font-size: 1.2rem;
}

/* 响应式设计更新 */
@media (max-width: 768px) {
    .target-info {
        grid-template-columns: 1fr;
    }
    
    .target-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .formula-part {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .number-pad {
        max-width: 250px;
    }
    
    .num-btn {
        height: 55px;
        font-size: 1.6rem;
    }
    
    .answer-input-container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* 新增：紧凑型数字键盘 */
.number-pad.compact {
    max-width: 200px;
    margin: 15px auto;
    gap: 8px;
}

.number-pad.compact .num-btn {
    height: 45px;
    font-size: 1.4rem;
    border-radius: 8px;
}

.number-pad.compact .num-btn.confirm {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.number-pad.compact .num-btn.confirm:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

/* 新增：解题总结样式 */
.solution-summary {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border: 2px solid #38b2ac;
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
}

.solution-summary h4 {
    color: #234e52;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid #38b2ac;
    padding-bottom: 10px;
}

.summary-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.method-recap,
.key-insights {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.method-recap h5,
.key-insights h5 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.recap-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recap-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.step-number {
    background: #667eea;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-text {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.4;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    margin: 8px 0;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 3px solid #48bb78;
}

.insight-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.insight-text {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* 新增：公式推导样式 */
.formula-derivation {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    border: 2px solid #ed8936;
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
}

.formula-derivation h4 {
    color: #744210;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid #ed8936;
    padding-bottom: 10px;
}

.derivation-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.formula-method,
.formula-alternative {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.formula-method h5,
.formula-alternative h5 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.formula-steps-detailed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.formula-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 3px solid #ed8936;
}

.formula-label {
    background: #ed8936;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.formula-content {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.4;
    font-family: 'Courier New', monospace;
}

.formula-general {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #38b2ac;
}

.formula-general h5 {
    color: #234e52;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.general-formula-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.formula-title {
    color: #4a5568;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1rem;
}

.formula-equation {
    font-family: 'Courier New', monospace;
    color: #2d3748;
    font-size: 0.95rem;
    line-height: 1.6;
}

.formula-equation div {
    background: #f7fafc;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* 新增：操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.step-btn.secondary {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
}

.step-btn.secondary:hover {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(113, 128, 150, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .summary-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .method-recap,
    .key-insights,
    .formula-method,
    .formula-alternative {
        padding: 15px;
    }
    
    .recap-step,
    .insight-item,
    .formula-step-item {
        padding: 8px;
        gap: 10px;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .step-text,
    .insight-text,
    .formula-content {
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons .step-btn {
        width: 100%;
    }
}

/* 新增：弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: bold;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 160px);
}

.modal-footer {
    background: #f7fafc;
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-radius: 0 0 20px 20px;
}

/* 弹窗内的解题总结样式调整 */
.modal-body .solution-summary {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border: 2px solid #38b2ac;
    border-radius: 15px;
    padding: 25px;
    margin: 0 0 25px 0;
}

.modal-body .solution-summary h4 {
    color: #234e52;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid #38b2ac;
    padding-bottom: 10px;
}

.modal-body .summary-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.modal-body .method-recap,
.modal-body .key-insights {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* 弹窗内的公式推导样式调整 */
.modal-body .formula-derivation {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    border: 2px solid #ed8936;
    border-radius: 15px;
    padding: 25px;
    margin: 0;
}

.modal-body .formula-derivation h4 {
    color: #744210;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid #ed8936;
    padding-bottom: 10px;
}

/* 弹窗动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
}

/* 弹窗响应式设计 */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 15px 20px;
        border-radius: 15px 15px 0 0;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 20px;
        max-height: calc(95vh - 140px);
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        border-radius: 0 0 15px 15px;
    }
    
    .modal-footer .step-btn {
        width: 100%;
    }
    
    .modal-body .summary-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-body .method-recap,
    .modal-body .key-insights {
        padding: 15px;
    }
    
    .modal-body .solution-summary,
    .modal-body .formula-derivation {
        padding: 20px;
    }
}

/* 滚动条样式 */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 版权信息样式 */
.copyright-footer {
    margin-top: 20px;
    padding: 20px 0;
}

.copyright-info {
    text-align: center;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.copyright-line {
    font-size: 0.9rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    text-align: center;
}

.copyright-line strong {
    color: #fff;
    text-shadow: none;
}

.website-link {
    color: #74b9ff;
    text-decoration: none;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(116, 185, 255, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(116, 185, 255, 0.3);
}

.website-link:hover {
    color: #0984e3;
    background: rgba(116, 185, 255, 0.2);
    border-color: rgba(116, 185, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(116, 185, 255, 0.3);
}

.wechat-name {
    color: #00b894;
    text-shadow: none;
}

/* 版权信息移动端适配 */
@media (max-width: 768px) {
    .copyright-footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .copyright-info {
        padding: 15px;
        margin: 0 15px;
        max-width: none;
    }
    
    .copyright-line {
        font-size: 0.85rem;
        line-height: 1.8;
    }
    
    .website-link {
        padding: 3px 6px;
        font-size: 0.85rem;
    }
} 