/* training.css - 训练模式 + 能力档案 共享样式 */
/* 独立于现有 style.css，不修改任何现有样式 */

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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== 布局 ===== */
.training-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
}

.profile-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
}

/* ===== 顶部栏 ===== */
.top-bar {
    background: #f0f2f5;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.top-bar .user-info {
    color: #666;
}

.top-bar .user-info strong {
    color: #333;
}

.top-bar .badge {
    display: inline-block;
    background: #9c27b0;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 6px;
}

/* ===== 标题 ===== */
.page-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
    line-height: 1.5;
}

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

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}

.form-group label .hint {
    font-weight: normal;
    color: #999;
    font-size: 12px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

/* ===== 卡片 ===== */
.card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #eef0f2;
}

.card-title {
    font-weight: bold;
    font-size: 15px;
    color: #333;
    margin-bottom: 10px;
}

.card-content {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ===== 按钮 ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #007bff;
    color: white;
    width: 100%;
    font-weight: bold;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-outline {
    background: white;
    color: #007bff;
    border: 1px solid #007bff;
}

.btn-outline:hover {
    background: #e7f3ff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ===== 按钮组 ===== */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-group .btn {
    flex: 1;
}

/* ===== 迭代计数器 ===== */
.iteration-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e7f3ff;
    color: #0056b3;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 12px;
}

.iteration-badge .round {
    font-weight: bold;
    font-size: 16px;
}

/* ===== 反馈区 ===== */
.feedback-section {
    background: #f0f8ff;
    border-left: 4px solid #007bff;
    border-radius: 0 10px 10px 0;
    padding: 16px;
    margin: 16px 0;
}

.feedback-section .feedback-label {
    font-size: 12px;
    color: #007bff;
    font-weight: bold;
    margin-bottom: 8px;
}

.feedback-section .feedback-content {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ===== 对比容器 ===== */
.compare-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0;
}

.compare-box {
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 8px;
    padding: 12px;
}

.compare-box .compare-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    font-weight: bold;
}

.compare-box .compare-text {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
}

.compare-box.original {
    border-left: 3px solid #ff9800;
}

.compare-box.final {
    border-left: 3px solid #4caf50;
}

/* ===== 档案列表 ===== */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: bold;
}

.stat-card .stat-label {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.stat-card.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #f2994a 0%, #f2c94f 100%);
}

/* 训练记录列表 */
.record-item {
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.record-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.record-item .record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-item .record-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.record-item .record-date {
    font-size: 12px;
    color: #999;
}

.record-item .record-meta {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.record-item .record-toggle {
    color: #007bff;
    font-size: 12px;
    margin-top: 8px;
}

.record-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
    display: none;
}

.record-detail.open {
    display: block;
}

/* ===== 趋势区域 ===== */
.trend-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin: 20px 0;
    border: 1px solid #eef0f2;
}

.trend-section .trend-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.trend-section .trend-text {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state .empty-text {
    font-size: 15px;
    margin-bottom: 8px;
}

.empty-state .empty-hint {
    font-size: 13px;
    color: #bbb;
}

/* ===== 分享区域 ===== */
.share-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.share-section .share-hint {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
}

/* ===== 加载状态 ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 15px;
}

.loading .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

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

/* ===== 错误提示 ===== */
.error-msg {
    background: #fff0f0;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .training-container,
    .profile-container {
        padding: 14px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .compare-container {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }
}

/* ===== 响应式：平板/桌面 ===== */

/* ≥768px：容器卡片化加宽，排版升级 */
@media (min-width: 768px) {
    .training-container,
    .profile-container {
        max-width: 1000px;
        min-height: auto;
        margin: 28px auto;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
        padding: 32px 40px;
    }
    .page-title { font-size: 26px; }
    .page-subtitle { font-size: 15px; }
    .top-bar { padding: 14px 20px; font-size: 15px; }
    .card-content { font-size: 15px; }
    .btn { padding: 13px 28px; }
}

/* ≥960px：核心区域双栏布局 */
@media (min-width: 960px) {
    /* 速达版：左侧 = 三档进阶 + 完整版入口，右侧 = 自己试试 */
    #stepResult {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 40px;
        align-items: start;
    }
    #questionCard,
    #shareCardPreview,
    #stepResult > .share-section { grid-column: 1 / -1; }
    #levelsContainer,
    .full-version-card { grid-column: 1; }
    #tryYourself {
        grid-column: 2;
        border-top: none !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* 训练模式：左侧 = 编写提示词 + 提交/修改，右侧 = 需求回顾 + 教练反馈 */
    #stepTraining {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 40px;
        align-items: start;
    }
    #stepTraining .iteration-badge { grid-column: 1 / -1; }
    #stepTraining > .card { grid-column: 2; }
    #stepTraining > .form-group { grid-column: 1; }
    #submitEvalBtn {
        grid-column: 1;
        width: auto;
        justify-self: start;
        padding: 12px 40px;
    }
    #feedbackArea { grid-column: 2; }
    #reviseArea { grid-column: 1; }
    #evalLoading { grid-column: 1 / -1; }

    /* 能力档案：训练记录居左，成长路径居右 */
    #mainContent {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 40px;
        align-items: start;
    }
    #mainContent > .profile-stats,
    #trendSection,
    .usage-section,
    #mainContent > .share-section { grid-column: 1 / -1; }
    .records-section { grid-column: 1; }
    .path-section { grid-column: 2; }
}
