/* ═══ 后训练页面样式 ═══ */

/* SFT */
.sft-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.sft-panel { background: var(--code-bg); border-radius: 10px; padding: 16px; }
.sft-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.sft-demo { display: flex; flex-direction: column; gap: 8px; }
.sft-input { font-size: 12px; color: var(--accent-light); padding: 8px; background: rgba(99,102,241,0.1); border-radius: 6px; }
.sft-output { font-size: 12px; color: var(--text); padding: 8px; background: rgba(255,255,255,0.03); border-radius: 6px; line-height: 1.6; }
.sft-tag { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.sft-tag.bad { background: rgba(239,68,68,0.15); color: var(--red); }
.sft-tag.good { background: rgba(34,197,94,0.15); color: var(--green); }
.sft-note { font-size: 13px; color: var(--text-dim); margin-top: 12px; padding: 12px; background: rgba(234,179,8,0.08); border-radius: 8px; line-height: 1.7; }

/* RLHF */
.rlhf-flow { display: flex; align-items: flex-start; gap: 16px; margin: 16px 0; }
.rlhf-step { flex: 1; background: var(--code-bg); border-radius: 10px; padding: 16px; }
.rlhf-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.rlhf-step-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.rlhf-step-desc { font-size: 12px; color: var(--text-dim); line-height: 1.6; margin-bottom: 10px; }
.rlhf-arrow { font-size: 24px; color: var(--yellow); padding-top: 40px; }
.rlhf-example { background: rgba(255,255,255,0.03); border-radius: 8px; padding: 10px; }
.rlhf-pair { display: flex; flex-direction: column; gap: 6px; }
.rlhf-response { font-size: 11px; padding: 6px 10px; border-radius: 6px; line-height: 1.5; }
.rlhf-response.good { background: rgba(34,197,94,0.1); border-left: 3px solid var(--green); color: var(--green); }
.rlhf-response.bad { background: rgba(239,68,68,0.1); border-left: 3px solid var(--red); color: var(--text-dim); }
.rlhf-score { font-size: 11px; color: var(--text-dim); margin-top: 6px; text-align: center; }
.ppo-cycle { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ppo-box { font-size: 11px; padding: 6px 12px; border-radius: 6px; background: rgba(99,102,241,0.15); color: var(--accent-light); }
.ppo-box.rm { background: rgba(234,179,8,0.15); color: var(--yellow); }
.ppo-arrow-down { font-size: 14px; color: var(--text-dim); }
.ppo-arrow-up { font-size: 14px; color: var(--green); }

/* 4 models */
.model-count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.model-item { text-align: center; }
.model-box { padding: 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.model-box.actor { background: rgba(99,102,241,0.2); color: var(--accent-light); }
.model-box.critic { background: rgba(239,68,68,0.2); color: var(--red); }
.model-box.reward { background: rgba(234,179,8,0.2); color: var(--yellow); }
.model-box.ref { background: rgba(34,197,94,0.2); color: var(--green); }
.model-role { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* DPO */
.dpo-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.dpo-panel { background: var(--code-bg); border-radius: 10px; padding: 16px; }
.dpo-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 12px; text-align: center; }
.dpo-flow { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.dpo-node { font-size: 11px; padding: 6px 12px; border-radius: 6px; background: rgba(99,102,241,0.15); color: var(--accent-light); }
.dpo-node.highlight { background: rgba(239,68,68,0.15); color: var(--red); border: 1px dashed var(--red); }
.dpo-node.big-highlight { background: rgba(34,197,94,0.2); color: var(--green); font-weight: 700; font-size: 13px; padding: 10px 16px; }
.dpo-arrow { font-size: 16px; color: var(--text-dim); }
.dpo-cost { font-size: 12px; color: var(--red); text-align: center; margin-top: 10px; }
.dpo-cheap { color: var(--green); }
.dpo-intuition { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.dpo-pair { background: var(--code-bg); border-radius: 8px; padding: 10px; }
.dpo-label { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 4px; }
.dpo-label.good { background: rgba(34,197,94,0.15); color: var(--green); }
.dpo-label.bad { background: rgba(239,68,68,0.15); color: var(--red); }
.dpo-text { font-size: 12px; color: var(--text-dim); margin: 4px 0; }
.dpo-action { font-size: 11px; font-weight: 600; }
.dpo-math { background: rgba(99,102,241,0.08); padding: 12px; border-radius: 8px; font-size: 13px; margin-top: 12px; line-height: 1.8; }
.formula-hint { font-size: 11px; color: var(--text-dim); display: block; margin-top: 4px; }

/* GRPO */
.grpo-demo { margin: 16px 0; }
.grpo-prompt { font-size: 14px; font-weight: 700; color: var(--yellow); padding: 10px; background: rgba(234,179,8,0.1); border-radius: 8px; margin-bottom: 12px; }
.grpo-samples { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.grpo-sample { background: var(--code-bg); border-radius: 8px; padding: 10px; }
.grpo-sample-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.grpo-label { font-size: 11px; font-weight: 700; color: var(--accent-light); }
.grpo-score { font-size: 11px; color: var(--yellow); font-weight: 600; }
.grpo-text { font-size: 11px; color: var(--text-dim); line-height: 1.5; }
.grpo-tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.grpo-tag.good { background: rgba(34,197,94,0.15); color: var(--green); }
.grpo-tag.bad { background: rgba(239,68,68,0.15); color: var(--red); }
.grpo-tag.mid { background: rgba(234,179,8,0.15); color: var(--yellow); }
.grpo-advantage { background: rgba(34,197,94,0.08); padding: 12px; border-radius: 8px; font-size: 13px; line-height: 1.8; }
.grpo-pos { color: var(--green); font-weight: 700; }
.grpo-neg { color: var(--red); font-weight: 700; }
.grpo-variants { display: flex; flex-direction: column; gap: 10px; }
.grpo-variant { background: var(--code-bg); border-radius: 8px; padding: 12px; border-left: 3px solid var(--accent); }
.gv-name { font-size: 13px; font-weight: 700; color: var(--accent-light); margin-bottom: 4px; }
.gv-desc { font-size: 12px; color: var(--text-dim); line-height: 1.6; }

/* RLVR */
.rlvr-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.rlvr-panel { background: var(--code-bg); border-radius: 10px; padding: 16px; }
.rlvr-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 10px; text-align: center; }
.rlvr-source { display: flex; gap: 10px; align-items: flex-start; }
.rlvr-icon { font-size: 28px; }
.rlvr-text { font-size: 12px; color: var(--text); line-height: 1.7; }
.rlvr-note { display: block; font-size: 11px; color: var(--red); margin-top: 4px; }
.rlvr-note.good-note { color: var(--green); }
.r1-emergence { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.r1-before, .r1-after { background: var(--code-bg); border-radius: 8px; padding: 12px; }
.r1-label { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.r1-output { font-size: 12px; color: var(--text); line-height: 1.7; font-family: 'Consolas', monospace; }
.r1-tag { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.r1-tag.bad { background: rgba(239,68,68,0.15); color: var(--red); }
.r1-tag.good { background: rgba(34,197,94,0.15); color: var(--green); }
.r1-arrow-down { text-align: center; font-size: 13px; color: var(--green); padding: 4px; }
.r1-insight { background: rgba(234,179,8,0.1); padding: 12px; border-radius: 8px; font-size: 13px; color: var(--text); line-height: 1.7; margin-top: 12px; }
.rlvr-scenarios { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rlvr-scenario { background: var(--code-bg); border-radius: 8px; padding: 12px; text-align: center; }
.rlvr-sc-icon { font-size: 24px; margin-bottom: 6px; }
.rlvr-sc-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.rlvr-sc-desc { font-size: 11px; color: var(--text-dim); line-height: 1.5; }

/* Pipeline */
.pipeline-flow { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px 0; }
.pipe-stage { background: var(--code-bg); border-radius: 12px; padding: 16px; text-align: center; min-width: 140px; }
.pipe-stage.highlight { border: 2px solid var(--green); background: rgba(34,197,94,0.08); }
.pipe-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; margin: 0 auto 8px; }
.pipe-stage.highlight .pipe-num { background: var(--green); }
.pipe-name { font-size: 16px; font-weight: 700; color: #fff; }
.pipe-desc { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.pipe-data { font-size: 10px; color: var(--accent-light); margin-top: 6px; }
.pipe-arrow { font-size: 20px; color: var(--yellow); }
.pipe-summary { font-size: 13px; color: var(--text); text-align: center; margin-top: 16px; padding: 12px; background: rgba(234,179,8,0.08); border-radius: 8px; line-height: 1.8; }
.final-summary { display: flex; flex-direction: column; gap: 8px; }
.fs-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--code-bg); border-radius: 8px; }
.fs-year { font-size: 14px; font-weight: 700; color: var(--accent-light); min-width: 50px; }
.fs-text { font-size: 13px; color: var(--text); }

@media (max-width: 900px) {
    .sft-compare, .dpo-compare, .rlvr-compare { grid-template-columns: 1fr; }
    .rlhf-flow { flex-direction: column; }
    .model-count { grid-template-columns: 1fr 1fr; }
    .grpo-samples { grid-template-columns: 1fr; }
    .rlvr-scenarios { grid-template-columns: 1fr 1fr; }
    .pipeline-flow { flex-direction: column; }
}
