/* ==================== 教学模块样式 ==================== */

/* 模式切换栏 */
.mode-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 4px;
}

.mode-bar button {
    padding: 6px 18px;
    border: 1px solid #b8860b;
    border-radius: 6px;
    background: #f5e6c8;
    color: #5a3e1b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-bar button.active {
    background: #b8860b;
    color: #fff;
}

/* 教学面板(默认隐藏) */
.teaching-panel {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    width: 360px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fffbeb;
    border: 2px solid #b8860b;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 100;
    font-size: 14px;
    line-height: 1.6;
    color: #3a2a10;
}

.teaching-panel.visible {
    display: block;
}

/* 章节列表 */
.tp-title {
    font-size: 17px;
    font-weight: bold;
    color: #8b4513;
    border-bottom: 1px solid #d4a017;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.tp-chapter {
    margin-bottom: 6px;
    border-radius: 6px;
    overflow: hidden;
}

.tp-chapter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f0d896;
    cursor: pointer;
    font-weight: bold;
}

.tp-chapter.locked .tp-chapter-head {
    color: #999;
    cursor: not-allowed;
    background: #e8e8e8;
}

.tp-chapter-body {
    display: none;
    padding: 6px 10px;
    background: #fffdf5;
}

.tp-chapter.expanded .tp-chapter-body {
    display: block;
}

.tp-section {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    margin: 3px 0;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #5a3e1b;
}

.tp-section:hover {
    background: #f5e6c8;
}

/* 步骤教学区 */
.tp-step-progress {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.tp-step-title {
    font-size: 15px;
    font-weight: bold;
    color: #8b4513;
    margin: 10px 0 6px;
}

.tp-instruction {
    white-space: pre-wrap;
    background: #fff8e0;
    border-left: 3px solid #d4a017;
    padding: 8px 10px;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.7;
}

.tp-task {
    background: #e8f5e9;
    border: 1px solid #81c784;
    border-radius: 4px;
    padding: 8px 10px;
    margin: 8px 0;
    color: #2e7d32;
    font-size: 13px;
    font-weight: 500;
}

.tp-step-nav {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tp-actions {
    display: flex;
    gap: 6px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.tp-btn {
    padding: 5px 12px;
    border: 1px solid #b8860b;
    border-radius: 5px;
    background: #fff;
    color: #8b4513;
    cursor: pointer;
    font-size: 13px;
}

.tp-btn:hover {
    background: #f5e6c8;
}

.tp-btn.primary {
    background: #b8860b;
    color: #fff;
}

.tp-feedback {
    margin-top: 8px;
    padding: 8px;
    border-radius: 4px;
    display: none;
}

.tp-feedback.show {
    display: block;
}

.tp-feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tp-feedback.wrong {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 教学模式下的棋盘提示高亮 */
.piece.teach-highlight {
    box-shadow: 0 0 0 3px #ff6600, 0 0 12px rgba(255, 102, 0, 0.6);
    animation: tp-pulse 1s infinite;
}

@keyframes tp-pulse {
    0%, 100% { box-shadow: 0 0 0 3px #ff6600, 0 0 12px rgba(255, 102, 0, 0.6); }
    50% { box-shadow: 0 0 0 3px #ff9900, 0 0 18px rgba(255, 153, 0, 0.8); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .teaching-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 50vh;
        border-radius: 10px 10px 0 0;
    }
}
