/*
 * 星火AI家教 — tutor-tools.css
 * tutor 页面内嵌工具面板（暗色主题）
 */

/* ==================== 工具区 header ==================== */
.tut-tools-section {
    padding: 2rem 0 4rem;
}

.tut-tools-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tut-tools-header h2 {
    font-size: 1.5rem;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.tut-tools-header p {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* ==================== 工具面板 ==================== */
.tut-tool-panel {
    display: none;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    scroll-margin-top: 80px;
}

.tut-tool-panel.active {
    display: block;
    animation: tutFadeIn 0.3s ease;
}

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

.tut-panel-title {
    font-size: 1.3rem;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.tut-panel-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.tut-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 20px;
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ==================== 模式切换 ==================== */
.tut-mode-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tut-mode-btn {
    padding: 8px 18px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.05);
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    font-weight: 500;
}

.tut-mode-btn:hover {
    border-color: #3b82f6;
    color: #93c5fd;
}

.tut-mode-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    font-weight: 600;
}

/* ==================== 表单 ==================== */
.tut-form-group {
    margin-bottom: 14px;
}

.tut-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: #cbd5e1;
}

.tut-form-group input,
.tut-form-group select,
.tut-form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    font-size: 0.95rem;
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    transition: border-color 0.3s;
}

.tut-form-group input:focus,
.tut-form-group select:focus,
.tut-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
}

.tut-form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.tut-form-group select option {
    background: #1e293b;
    color: #e2e8f0;
}

.tut-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ==================== 按钮 ==================== */
.tut-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    color: white;
    border: none;
    padding: 13px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 4px;
}

.tut-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.tut-btn-secondary {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

/* ==================== Loading ==================== */
.tut-loading {
    display: none;
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.tut-loading.show {
    display: block;
}

.tut-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: tutSpin 0.8s linear infinite;
    margin-bottom: 8px;
}

@keyframes tutSpin {
    to { transform: rotate(360deg); }
}

/* ==================== 结果框 ==================== */
.tut-result-box {
    margin-top: 20px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    color: #cbd5e1;
    line-height: 1.8;
}

.tut-result-box h3 {
    font-size: 1.05rem;
    color: #e2e8f0;
    margin-bottom: 12px;
}

/* 讲解结果子元素 */
.tut-r-concept {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    font-size: 1rem;
    font-weight: 600;
    color: #93c5fd;
}

.tut-r-explain {
    margin: 12px 0;
    line-height: 1.9;
    white-space: pre-wrap;
    color: #cbd5e1;
}

.tut-r-formula {
    margin: 12px 0;
    padding: 14px;
    background: rgba(124, 58, 237, 0.08);
    border-radius: 10px;
    text-align: center;
}

.tut-r-formula-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #a78bfa;
    margin-bottom: 6px;
}

.tut-r-formula-note {
    font-size: 0.85rem;
    color: #94a3b8;
}

.tut-r-practice {
    margin: 12px 0;
    padding: 14px;
    background: rgba(16, 185, 129, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.tut-r-practice strong {
    color: #34d399;
}

.tut-r-encourage {
    margin-top: 12px;
    padding: 10px;
    background: rgba(251, 191, 36, 0.06);
    border-radius: 8px;
    text-align: center;
    color: #fbbf24;
    font-style: italic;
}

/* ==================== 复制按钮 ==================== */
.tut-copy-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.3s;
}

.tut-copy-btn:hover {
    background: #059669;
}

/* ==================== 积分信息 ==================== */
.tut-credits-info {
    margin-top: 14px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.06);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #34d399;
}

.tut-credits-free {
    background: rgba(59, 130, 246, 0.06);
    color: #93c5fd;
}

.tut-credits-info a {
    color: #60a5fa;
    font-weight: 600;
    text-decoration: underline;
}

/* ==================== 错误/提示 ==================== */
.tut-error-msg {
    color: #f87171;
    padding: 10px;
}

.tut-error-banner {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #f87171;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    margin-top: 8px;
}

.tut-error-banner a {
    color: #60a5fa;
    text-decoration: underline;
}

.tut-error-warn {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.06);
    border-color: rgba(251, 191, 36, 0.2);
}

.tut-error-red {
    color: #f87171;
}

/* ==================== 登录提示 ==================== */
.tut-login-prompt {
    padding: 24px;
    text-align: center;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    margin-top: 12px;
}

.tut-login-prompt h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 8px;
}

.tut-login-prompt p {
    font-size: 0.88rem;
    color: #94a3b8;
    margin-bottom: 14px;
}

.tut-login-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tut-login-btn {
    display: inline-block;
    padding: 10px 22px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.25s;
}

.tut-login-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
}

.tut-login-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent;
    color: white;
}

.tut-login-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ==================== 练习模式 ==================== */
.tut-practice-area {
    border: 1px dashed rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    background: rgba(59, 130, 246, 0.02);
    transition: opacity 0.3s;
}

.tut-question-box {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #cbd5e1;
}

.tut-q-label {
    font-size: 0.8rem;
    color: #60a5fa;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tut-q-type {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tut-q-kp {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.tut-practice-hint {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(251, 191, 36, 0.06);
    border-left: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    font-size: 0.88rem;
    color: #fbbf24;
}

/* 批改结果 */
.tut-grade-result {
    margin-top: 12px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    background: rgba(30, 41, 59, 0.5);
}

.tut-grade-result.correct {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.04);
}

.tut-grade-result.incorrect {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.04);
}

.tut-grade-score {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tut-grade-result.correct .tut-grade-score { color: #34d399; }
.tut-grade-result.incorrect .tut-grade-score { color: #f87171; }

.tut-grade-explain {
    padding: 10px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    margin-bottom: 10px;
    line-height: 1.7;
    color: #cbd5e1;
}

.tut-grade-correct {
    padding: 10px;
    background: rgba(16, 185, 129, 0.06);
    border-radius: 8px;
    margin-bottom: 10px;
    color: #a7f3d0;
    line-height: 1.7;
}

.tut-grade-takeaway {
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.06);
    border-radius: 8px;
    margin-bottom: 8px;
    color: #93c5fd;
    font-size: 0.9rem;
}

.tut-grade-cheer {
    text-align: center;
    color: #fbbf24;
    font-style: italic;
    padding: 8px;
    font-size: 0.9rem;
}

.tut-notebook-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.82rem;
}

.tut-notebook-hint a {
    color: #f87171;
    text-decoration: underline;
    margin-left: 4px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
    .tut-tool-panel {
        padding: 20px 16px;
    }
    .tut-form-row-2col {
        grid-template-columns: 1fr;
    }
    .tut-mode-switch {
        flex-wrap: wrap;
    }
    .tut-btn-primary {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}
