/* ==================== shared.css ==================== */
/* 三页（方案/决策/计划）共享的基础样式 */
/* 各页独有样式在各 HTML 的 <style> 块中定义 */

:root {
  --primary: #134e4a; --primary-dark: #0f766e; --primary-light: #0d9488;
  --accent: #0d9488; --green: #059669; --red: #dc2626;
  --orange: #ea580c; --yellow: #f59e0b; --blue: #2563eb;
  --bg: #f0fdfa; --card: #ffffff; --text: #1e293b;
  --gray: #6b7280; --light: #ccfbf1; --border: #99f6e4;
  --radius: 12px; --shadow: 0 2px 8px rgba(0,0,0,0.04);
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.7; }
.container { max-width: 720px; margin: 0 auto; padding: 32px 16px; }

/* Nav */
.nav-top { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.nav-top .home-link { color: var(--gray); text-decoration: none; font-size: 14px; padding: 4px 12px; border: 1px solid var(--light); border-radius: 6px; transition: all .15s; }
.nav-top .home-link:hover { border-color: var(--accent); color: var(--text); }
.nav-top .stage-title { font-size: 18px; font-weight: 700; color: var(--text); }
.nav-top .upstream-badge { font-size: 14px; background: #f0fdf4; color: var(--text); padding: 3px 8px; border-radius: 10px; }
.nav-top .optional-badge { font-size: 14px; background: #fff7ed; color: var(--text); padding: 3px 8px; border-radius: 10px; }
/* L3-8：进度导出/导入工具按钮 */
.nav-tools { margin-left: auto; display: flex; gap: 6px; }
.nav-tool { font-size: 12px; color: var(--gray); padding: 4px 10px; border: 1px solid var(--light); border-radius: 6px; background: #fff; cursor: pointer; transition: all .15s; }
.nav-tool:hover { border-color: var(--accent); color: var(--accent); }

/* Progress */
.step-progress { display: flex; align-items: flex-start; margin-bottom: 24px; padding: 0 4px; }
.step-progress-item { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step-progress-item .sp-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; background: var(--light); color: var(--gray); z-index: 2; transition: all .3s; }
.step-progress-item.done .sp-dot { background: var(--green); color: #fff; }
.step-progress-item.current .sp-dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(13,148,136,.12); }
.step-progress-item .sp-label { font-size: 14px; color: var(--gray); margin-top: 6px; text-align: center; white-space: nowrap; }
.step-progress-item.current .sp-label, .step-progress-item.done .sp-label { color: var(--text); font-weight: 500; }
.step-progress-line { position: absolute; top: 15px; left: calc(50% + 15px); width: calc(100% - 30px); height: 2px; background: var(--light); z-index: 1; }
.step-progress-item.done .step-progress-line { background: var(--green); }
.step-progress-item:last-child .step-progress-line { display: none; }

/* Step card */
.step-card { background: var(--card); border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow); margin-bottom: 20px; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.step-card h2 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.step-card .step-desc { font-size: 14px; color: var(--gray); margin-bottom: 24px; line-height: 1.6; }
.step-card .step-desc .highlight { color: var(--text); font-weight: 500; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group .hint { font-size: 14px; color: var(--gray); margin-top: 4px; }
textarea, input[type="text"], input[type="number"], input[type="date"] { width: 100%; padding: 12px 14px; border: 2px solid var(--light); border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; transition: border-color .15s; line-height: 1.5; background: #faf9ff; }
textarea:focus, input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 70px; }

/* Choice buttons */
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice-btn { padding: 10px 20px; border: 2px solid var(--light); border-radius: 8px; cursor: pointer; font-size: 14px; transition: all .15s; background: var(--card); }
.choice-btn:hover { border-color: #5eead4; }
.choice-btn.selected { border-color: var(--accent); background: #f0fdfa; font-weight: 600; color: var(--text); }

/* Radio cards */
.radio-cards { display: flex; gap: 12px; }
.radio-card { flex: 1; border: 2px solid var(--light); border-radius: var(--radius); padding: 20px 16px; cursor: pointer; transition: all .15s; text-align: center; }
.radio-card:hover { border-color: #5eead4; }
.radio-card.selected { border-color: var(--accent); background: #f0fdfa; }
.radio-card .rc-icon { font-size: 18px; margin-bottom: 8px; }
.radio-card .rc-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.radio-card .rc-desc { font-size: 14px; color: var(--gray); line-height: 1.5; }

/* Case toggle */
.case-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text); cursor: pointer; margin-top: 8px; background: none; border: none; padding: 0; }
.case-toggle:hover { text-decoration: underline; }
.case-content { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 8px; padding: 14px 16px; margin-top: 10px; font-size: 14px; color: var(--text); line-height: 1.7; display: none; }
.case-content.show { display: block; }

/* Buttons */
.btn-row { display: flex; gap: 10px; justify-content: space-between; margin-top: 24px; }
.btn { padding: 12px 28px; border-radius: 8px; font-size: 16px; cursor: pointer; border: none; font-weight: 500; transition: all .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0f766e; }
.btn-primary:disabled { background: var(--light); color: var(--gray); cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text); border: 1.5px solid var(--light); }
.btn-secondary:hover { border-color: var(--accent); color: var(--text); }
.btn-ghost { background: none; border: none; color: var(--gray); font-size: 14px; cursor: pointer; padding: 8px 12px; }
.btn-add { background: none; border: 2px dashed var(--light); color: var(--text); font-size: 14px; padding: 10px 16px; border-radius: 8px; cursor: pointer; width: 100%; transition: all .15s; }
.btn-add:hover { border-color: var(--accent); background: #f0fdfa; }
.btn-danger { background: none; border: 1px solid var(--red); color: var(--red); padding: 4px 10px; border-radius: 4px; font-size: 14px; cursor: pointer; }
.btn-danger:hover { background: #fef2f2; }

/* Context banner */
.ctx-banner { background: linear-gradient(135deg, #f0fdfa, #ccfbf1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; font-size: 14px; }
.ctx-banner .ctx-row { margin-bottom: 4px; }
.ctx-banner .ctx-label { font-weight: 600; color: var(--text); }
.ctx-banner .ctx-empty { color: var(--gray); font-style: italic; }

/* Report */
.report-card { background: var(--card); border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow); }
.report-card h2 { font-size: 18px; color: var(--text); margin-bottom: 16px; text-align: center; }
.report-section { margin-bottom: 20px; }
.report-section h3 { font-size: 16px; color: var(--text); margin-bottom: 8px; border-bottom: 1px solid var(--light); padding-bottom: 6px; }
.report-section .r-item { font-size: 14px; line-height: 1.8; padding: 2px 0; }
.report-section .r-label { color: var(--gray); }
.report-section .r-value { font-weight: 500; }
.r-highlight { color: var(--red); font-weight: 600; }

/* Case Panel */
.case-panel { background: var(--card); border: 2px solid #fef3c7; border-radius: 12px; margin-bottom: 20px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.case-header { padding: 12px 18px; cursor: pointer; display: flex; align-items: center; gap: 10px; background: #fffbeb; user-select: none; }
.case-header .ch-icon { font-size: 18px; }
.case-header .ch-title { font-size: 16px; font-weight: 600; color: var(--text); flex: 1; }
.case-header .ch-toggle { font-size: 14px; color: var(--text); transition: transform .2s; }
.case-header.open .ch-toggle { transform: rotate(180deg); }
.case-body { display: none; padding: 14px 18px; border-top: 1px solid #fef3c7; font-size: 16px; }
.case-body.show { display: block; }
.case-body .cb-label { font-size: 14px; color: var(--text); font-weight: 600; margin-top: 10px; }
.case-body .cb-label:first-child { margin-top: 0; }
.case-body .cb-value { font-size: 16px; color: var(--text); margin-bottom: 4px; line-height: 1.7; }
.case-body .cb-tag { display: inline-block; background: #fef3c7; color: var(--text); padding: 1px 8px; border-radius: 10px; font-size: 14px; margin-right: 6px; margin-bottom: 4px; }
.case-body .cb-idea { background: #fffbeb; border-radius: 8px; padding: 10px 14px; margin-bottom: 6px; font-size: 16px; }
.case-body .cb-idea b { color: var(--text); }
.case-body .cb-action { border-left: 3px solid #f59e0b; padding-left: 12px; margin-bottom: 8px; }
.case-body .cb-action .cb-act-title { font-weight: 600; color: var(--text); margin-bottom: 2px; font-size: 16px; }
.case-body .cb-action .cb-act-detail { font-size: 16px; color: var(--text); }

/* Progressive case panel — 决策回顾卡 */
.cs-card { background: #fff; border-radius: 10px; margin-bottom: 12px; padding: 0; overflow: hidden; border: 1px solid #f1f5f9; box-shadow: 0 1px 3px rgba(0,0,0,0.03); position: relative; }
.cs-card:last-child { margin-bottom: 0; }
.cs-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.cs-card.stripe-blue::before { background: #2563eb; }
.cs-card.stripe-teal::before { background: #2563eb; }
.cs-card.stripe-purple::before { background: #be123c; }
.cs-card.stripe-amber::before { background: #ea580c; }
.cs-card.stripe-coral::before { background: #dc2626; }
.cs-card.stripe-pink::before { background: #db2777; }

.cs-card-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px 8px 18px; background: #fafbfc; border-bottom: 1px solid #f1f5f9; }
.cs-card-step { font-size: 12px; font-weight: 700; color: #94a3b8; letter-spacing: 0.5px; text-transform: uppercase; }
.cs-card-name { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.cs-card-tag { font-size: 12px; font-weight: 600; color: #059669; background: #d1fae5; padding: 2px 8px; border-radius: 10px; }

.cs-conclusion { padding: 10px 14px 8px 18px; background: linear-gradient(180deg, #eff6ff 0%, transparent 100%); }
.cs-conclusion-label { font-size: 12px; font-weight: 700; color: #2563eb; letter-spacing: 0.3px; margin-bottom: 2px; }
.cs-conclusion-text { font-size: 14px; line-height: 1.6; color: var(--text); font-weight: 500; }

.cs-detail { padding: 8px 14px 8px 18px; }
.cs-section-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 6px; margin: 6px 0 4px 0; }
.cs-section-tag.cs-section-urgent { color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; }
.cs-section-tag.cs-section-root { color: #059669; background: #f0fdf4; border: 1px solid #bbf7d0; }
.cs-section-tag.cs-section-neutral { color: var(--text); background: #f1f5f9; }

.cs-list { margin: 4px 0 4px 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--text); }
.cs-list li { margin-bottom: 2px; }
.cs-p { font-size: 14px; line-height: 1.7; color: var(--text); margin: 4px 0; }

.cs-kv-key { color: #94a3b8; font-weight: 500; margin-right: 4px; }
.cs-kv-val { color: var(--text); font-weight: 500; }

.cs-principle { font-size: 12px; color: var(--text); margin: 8px 14px 8px 18px; line-height: 1.6; background: #eff6ff; padding: 8px 12px; border-radius: 6px; border-left: 3px solid #3b82f6; }
.cs-tip { font-size: 12px; color: var(--text); margin: 8px 14px 12px 18px; line-height: 1.6; background: #fefce8; padding: 8px 12px; border-radius: 6px; border-left: 3px solid #eab308; }

/* 方案阶段任务详情卡片（可展开） */
.cs-tasks-section { margin: 12px 14px 8px 18px; }
.cs-tasks-title { font-size: 12px; color: #94a3b8; font-weight: 600; margin-bottom: 8px; letter-spacing: 0.3px; }
.cs-task-item { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 6px; overflow: hidden; background: #fafbfc; }
.cs-task-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; user-select: none; transition: background .15s; }
.cs-task-header:hover { background: #f1f5f9; }
.cs-task-num { width: 24px; height: 24px; border-radius: 50%; background: #dbeafe; color: #1e40af; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-task-item.expanded .cs-task-num { background: #2563eb; color: #fff; }
.cs-task-name { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; line-height: 1.5; }
.cs-task-arrow { font-size: 12px; color: #94a3b8; transition: transform .2s; flex-shrink: 0; }
.cs-task-item.expanded .cs-task-arrow { transform: rotate(180deg); color: #2563eb; }
.cs-task-detail { display: none; padding: 0 14px 10px 48px; }
.cs-task-item.expanded .cs-task-detail { display: block; }
.cs-task-row { display: flex; font-size: 12px; line-height: 1.8; padding: 3px 0; }
.cs-task-k { color: #94a3b8; font-weight: 500; min-width: 56px; flex-shrink: 0; }
.cs-task-v { color: var(--text); }
.cs-task-v.cs-red { color: #dc2626; font-weight: 600; }

/* V2.0 双方案对比框（CASE_B 最后一卡追加） */
.cs-compare-box { margin: 12px 14px 8px 18px; border: 1.5px dashed #bfdbfe; background: #eff6ff; border-radius: 8px; padding: 12px 14px; }
.cs-compare-title { font-size: 14px; font-weight: 700; color: #1e40af; margin-bottom: 6px; }
.cs-compare-idea { font-size: 12px; color: var(--text); line-height: 1.7; }

/* 旧样式兼容保留 */
.cs-step-section { padding: 10px 0; border-bottom: 1px dashed #fef3c7; }
.cs-step-section:last-child { border-bottom: none; }
.cs-step-num { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.cs-principle { font-size: 12px; color: var(--text); margin-bottom: 8px; line-height: 1.6; background: #fffbeb; padding: 6px 10px; border-radius: 6px; }
.cb-tip { font-size: 12px; color: var(--text); margin-top: 6px; line-height: 1.6; background: #fffbeb; padding: 6px 10px; border-radius: 6px; }

/* Responsive */
@media (max-width: 600px) {
  .step-card { padding: 20px 16px; }
  .radio-cards { flex-direction: column; }
}

/* Demo banner */
.demo-banner { background: linear-gradient(135deg, #fef3c7, #fffbeb); border: 2px solid #f59e0b; border-radius: 8px; padding: 10px 18px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #92400e; }
.demo-banner .db-text { display: flex; align-items: center; gap: 8px; }
.btn-exit-demo { background: #fff; border: 1px solid #f59e0b; color: #92400e; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all .15s; }
.btn-exit-demo:hover { background: #fef3c7; }
/* 页面内确认浮层（替代原生 confirm——预览环境禁用时无反应） */
.ui-confirm-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ui-confirm-card { background: #fff; border-radius: 12px; padding: 20px 22px; max-width: 380px; width: 100%; box-shadow: 0 12px 32px rgba(15,23,42,.22); }
.ui-confirm-title { font-size: 16px; font-weight: 600; color: #1e3a5f; margin-bottom: 10px; }
.ui-confirm-msg { font-size: 14px; line-height: 1.65; color: #475569; }
.ui-confirm-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.ui-confirm-btn { font-size: 14px; padding: 7px 16px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.ui-confirm-btn.cancel { background: #fff; border-color: #cbd5e1; color: #475569; }
.ui-confirm-btn.ok { background: #2563eb; color: #fff; }
.ui-confirm-btn.ok:hover { background: #1d4ed8; }

/* ==================== 案例管理卡片（统一标准 2026-09-01） ==================== */
.case-manage-card { background: var(--card); border: 2px solid var(--light); border-radius: var(--radius); padding: 20px 22px; margin: 24px 0 40px; box-shadow: var(--shadow); }
.case-manage-card .cm-header { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
/* 折叠头部（2026-09-02 统一：案例管理卡默认收起，点击头部展开/收起） */
.case-manage-card .cm-head { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; padding: 2px 4px; margin: -4px -4px 0; border-radius: 8px; }
.case-manage-card .cm-head:hover { background: #f8fafc; }
.case-manage-card .cm-title { font-size: 17px; font-weight: 700; color: var(--text); flex: 1; }
.case-manage-card .cm-badge { font-size: 12px; color: #0d9488; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 10px; padding: 1px 10px; white-space: nowrap; }
.case-manage-card .cm-toggle { font-size: 13px; color: var(--gray); transition: transform .2s; }
.case-manage-card:not(.cm-collapsed) .cm-toggle { transform: rotate(180deg); }
.case-manage-card.cm-collapsed { padding-top: 12px; padding-bottom: 12px; }
.case-manage-card.cm-collapsed .cm-body { display: none; }
.case-manage-card .cm-desc { font-size: 14px; color: var(--gray); margin-bottom: 14px; line-height: 1.6; }
.case-manage-card .cm-row { display: flex; gap: 8px; flex-wrap: wrap; }
.case-manage-card .cm-row input { flex: 1; min-width: 180px; padding: 10px 12px; border: 2px solid var(--light); border-radius: 8px; font-size: 14px; font-family: inherit; }
.case-manage-card .cm-row input:focus { outline: none; border-color: var(--accent); }
.btn-sm { padding: 9px 16px; font-size: 14px; white-space: nowrap; }
.case-manage-card .cm-context { display: none; margin-top: 12px; font-size: 14px; color: var(--text); background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 8px; padding: 10px 14px; line-height: 1.6; }
.case-manage-card .cm-context.show { display: block; }
.case-list-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 16px 0 8px; }
.case-empty { font-size: 14px; color: var(--gray); font-style: italic; }
.case-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #eef2f7; border-radius: 8px; margin-bottom: 8px; background: #fafbff; flex-wrap: wrap; }
.case-row.current { border-color: var(--accent); background: #f0fdfa; }
.case-row .cr-name { font-size: 14px; font-weight: 500; color: var(--text); flex: 1; min-width: 120px; }
.case-row .cr-builtin { display: inline-block; margin-left: 6px; font-size: 12px; color: #1e40af; background: #dbeafe; border-radius: 8px; padding: 1px 8px; vertical-align: 1px; }
.case-row .cr-time { font-size: 12px; color: var(--gray); }
.case-row .cr-btns { display: flex; gap: 6px; }
.case-row .cr-btn { font-size: 13px; padding: 5px 12px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.case-row .cr-fill { background: #fff; border-color: var(--accent); color: var(--accent); }
.case-row .cr-fill:hover { background: #f0fdfa; }
.case-row .cr-load { background: var(--accent); color: #fff; }
.case-row .cr-load:hover { background: #0f766e; }
.case-row .cr-del { background: #fff; border-color: #fca5a5; color: var(--red); }
.case-row .cr-del:hover { background: #fef2f2; }
@media (max-width: 600px) { .case-row { flex-direction: column; align-items: flex-start; } }

/* 填写项统一标签（全工具统一标准：14px / 主文字色 / 600） */
.fill-label { display: block; font-size: 14px; color: var(--text); font-weight: 600; margin-bottom: 4px; }
