/* 14_miniapp/static/styles.css — 简洁单屏设计 */
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
:root{
  --primary:#176B63; --primary-d:#11544d;
  --bg:#f5f7f6; --card:#fff; --line:#e3e8e6;
  --text:#1d2b28; --muted:#6b7a76;
  --danger:#d64545; --warn:#e08a00; --ok:#2e9e5b; --info:#2b6cb0;
  --radius:12px; --shadow:0 2px 10px rgba(20,40,35,.08);
}
html,body{height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",Roboto,sans-serif;
  background:var(--bg); color:var(--text); font-size:16px; line-height:1.55;
}
.app{max-width:680px;margin:0 auto;min-height:100%;display:flex;flex-direction:column}

/* 顶栏 */
.topbar{
  position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;background:var(--primary);color:#fff;box-shadow:var(--shadow);
}
.topbar__title{font-size:18px;font-weight:700;letter-spacing:.5px}
.topbar__sub{font-size:11px;opacity:.85;font-weight:400}
.btn-ghost{
  background:rgba(255,255,255,.16);color:#fff;border:1px solid rgba(255,255,255,.35);
  padding:8px 14px;border-radius:999px;font-size:14px;cursor:pointer;
}
.btn-ghost:active{background:rgba(255,255,255,.3)}

.main{padding:16px;flex:1}
.card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;margin-bottom:16px}
.card__label{font-size:14px;font-weight:600;margin-bottom:10px;color:var(--text)}
.card__hint{font-size:12px;color:var(--muted);font-weight:400}

/* 上传 */
.drop{
  border:2px dashed #b9ccc8;border-radius:var(--radius);padding:26px 12px;text-align:center;
  color:var(--muted);cursor:pointer;background:#fafcfb;transition:border-color .2s;
}
.drop:active,.drop.drag{border-color:var(--primary);color:var(--primary)}
.drop b{color:var(--primary);font-size:15px}
.thumbs{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.thumb{position:relative;width:72px;height:72px;border-radius:8px;overflow:hidden;border:1px solid var(--line)}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb__rm{
  position:absolute;top:2px;right:2px;width:20px;height:20px;border:none;border-radius:50%;
  background:rgba(0,0,0,.55);color:#fff;font-size:12px;line-height:20px;cursor:pointer;
}

/* 描述 */
textarea{
  width:100%;min-height:96px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;
  font-size:15px;resize:vertical;font-family:inherit;color:var(--text);background:#fff;
}
textarea:focus{outline:none;border-color:var(--primary)}
.desc-foot{display:flex;justify-content:space-between;align-items:center;margin-top:8px}
.counter{font-size:12px;color:var(--muted)}

/* 按钮 */
.btn{
  display:block;width:100%;border:none;border-radius:10px;padding:14px;font-size:16px;font-weight:600;
  cursor:pointer;transition:background .15s;text-align:center;
}
.btn--primary{background:var(--primary);color:#fff}
.btn--primary:active{background:var(--primary-d)}
.btn--primary:disabled{background:#9fb8b4;cursor:not-allowed}
.btn--soft{
  display:inline-block;width:auto;background:#e8f3f1;color:var(--primary);
  border:1px solid #cfe5e1;padding:8px 14px;font-size:14px;border-radius:999px;
}
.btn--soft:disabled{opacity:.5;cursor:not-allowed}

/* 结果 */
.badge{display:inline-block;padding:4px 14px;border-radius:999px;font-weight:700;font-size:14px;color:#fff}
.badge[data-level="E0"]{background:#8a9a95}
.badge[data-level="E1"]{background:var(--info)}
.badge[data-level="E2"]{background:var(--warn)}
.badge[data-level="E3"]{background:#e2703a}
.badge[data-level="E4"]{background:var(--danger)}
.level-cn{font-size:13px;color:var(--muted);font-weight:400}
.res-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.res-hazards{margin-top:8px;font-size:14px;color:var(--muted)}
.res-hazards b{color:var(--text)}
.section{margin-top:14px}
.section h4{font-size:14px;color:var(--primary);margin-bottom:6px;font-weight:700}
.section ul{list-style:none}
.section li{font-size:14px;padding:6px 0 6px 2px;border-bottom:1px dashed var(--line)}
.section li:last-child{border-bottom:none}
.section li .idx{color:var(--muted);margin-right:6px}
.danger-list li{color:var(--danger)}
.muted-note{font-size:13px;color:var(--muted);margin-top:8px}
.summary{font-size:15px;background:#f2f8f6;border-left:3px solid var(--primary);padding:10px 12px;border-radius:6px;margin-top:12px}

/* 加载 */
.loading{display:flex;flex-direction:column;align-items:center;gap:12px;padding:30px 0;color:var(--muted)}
.loading__hint{font-size:12px;color:var(--muted);opacity:.8;margin-top:4px}
.spinner{width:36px;height:36px;border:4px solid #d7e5e2;border-top-color:var(--primary);border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* 历史抽屉 */
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:50;display:none}
.overlay.open{display:block}
.drawer{
  position:fixed;top:0;right:0;bottom:0;width:min(360px,92%);background:#fff;z-index:60;
  transform:translateX(100%);transition:transform .25s;display:flex;flex-direction:column;
}
.drawer.open{transform:translateX(0)}
.drawer__head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;background:var(--primary);color:#fff}
.drawer__body{flex:1;overflow-y:auto;padding:12px}
.hist-item{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:10px;cursor:pointer;background:#fcfefd}
.hist-item:active{background:#f0f6f4}
.hist-item__time{font-size:12px;color:var(--muted)}
.hist-item__desc{font-size:14px;margin-top:2px}
.hist-empty{color:var(--muted);text-align:center;padding:40px 0;font-size:14px}

/* toast */
.toast{
  position:fixed;left:50%;bottom:32px;transform:translateX(-50%);background:rgba(20,40,35,.9);color:#fff;
  padding:10px 18px;border-radius:999px;font-size:14px;z-index:100;opacity:0;transition:opacity .2s;pointer-events:none;max-width:88%;
}
.toast.show{opacity:1}

.err-box{background:#fdecea;border:1px solid #f5c2c0;color:#a23b3b;padding:12px 14px;border-radius:8px;font-size:14px}

/* 造价独立卡片（醒目） */
.cost-card{
  background:#fff7e6;border:1px solid #ffd591;border-left:4px solid #fa8c16;
  border-radius:10px;padding:14px;margin-top:14px;
}
.cost-card__head{font-size:15px;color:#874d00}
.cost-card__head b{color:#d46b08;font-size:16px}
.cost-card__lvl{font-size:13px;color:#a0683a;font-weight:400;margin-left:8px}
.cost-card__range{font-size:20px;font-weight:700;color:#d46b08;margin-top:6px}
.cost-card__row{font-size:14px;color:#874d00;margin-top:4px}
.cost-card__note{font-size:13px;color:#8c6e3a;margin-top:8px;line-height:1.6}
.cost-card__disclaimer{font-size:12px;color:#a08a6a;margin-top:8px;border-top:1px dashed #ffd591;padding-top:8px}

/* 造价三档 */
.cost-tier{background:#fff;border:1px solid #ffd591;border-radius:8px;padding:10px 12px;margin-top:10px}
.cost-tier__head{display:flex;align-items:center;gap:8px}
.cost-tier__head b{color:#874d00;font-size:15px}
.cost-tier__tag{font-size:11px;color:#fff;background:#fa8c16;border-radius:6px;padding:2px 8px}
.cost-tier__amt{font-size:19px;font-weight:700;color:#d46b08;margin-top:4px}
.cost-tier__content{font-size:13px;color:#8c6e3a;margin-top:3px;line-height:1.5}

/* 地质条件/成因 分行排版 */
.kv{font-size:14px;padding:6px 0;border-bottom:1px dashed var(--line);line-height:1.6}
.kv:last-child{border-bottom:none}
.kv b{color:var(--primary)}
.cause-list{list-style:none}
.cause-list li{font-size:14px;padding:6px 0 6px 2px;border-bottom:1px dashed var(--line);line-height:1.6}
.cause-list li:last-child{border-bottom:none}
.cause-list .idx{color:var(--muted);margin-right:6px}
.obs-summary{font-size:14px;line-height:1.7;color:var(--text);background:#f8faf9;padding:10px 12px;border-radius:8px}

/* 段落化展示（地质/成因等） */
.prose{font-size:14px;line-height:1.8;color:var(--text);background:#f8faf9;padding:12px 14px;border-radius:8px}

/* 来源/可信度标签 */
.src-tag{display:inline-block;font-size:11px;padding:2px 8px;border-radius:6px;margin-left:6px;font-weight:600}
.src-image{background:#e3f2fd;color:#1565c0}
.src-user{background:#e8f5e9;color:#2e7d32}
.src-inference{background:#fff3e0;color:#e65100}
.src-standard{background:#f3e5f5;color:#6a1b9a}
.src-unknown{background:#eceff1;color:#546e7a}
.conf-tag{display:inline-block;font-size:11px;padding:2px 8px;border-radius:6px;margin-left:4px;font-weight:600}
.conf-high{background:#c8e6c9;color:#1b5e20}
.conf-medium{background:#fff9c4;color:#827717}
.conf-low{background:#ffccbc;color:#bf360c}
.conf-unknown{background:#eceff1;color:#546e7a}

/* 键值行带头部 */
.kv__head{display:flex;align-items:center;flex-wrap:wrap;gap:2px}
.kv__head b{color:var(--primary);font-size:14px}
.kv__obs{font-size:14px;line-height:1.6;margin-top:2px}
.kv__interp{margin-top:2px}

/* 治理分段与方案 */
.treat-seg{margin-top:12px}
.treat-seg__title{font-size:14px;font-weight:700;color:var(--primary);margin-bottom:6px}
.treat-opt{background:#fcfefd;border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin-bottom:8px}
.treat-opt__head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.treat-opt__head b{font-size:14px}
.treat-opt__row{font-size:13px;color:var(--text);margin-top:4px;line-height:1.5}
.treat-opt__row.warn{color:#b5493a}
.rl-tag{font-size:11px;padding:2px 8px;border-radius:6px;font-weight:600}
.rl-yes{background:#c8e6c9;color:#1b5e20}
.rl-alt{background:#fff9c4;color:#827717}
.rl-no{background:#ffccbc;color:#bf360c}

/* 造价明细 */
.cost-row{font-size:14px;color:#874d00;margin-top:6px;line-height:1.5}
.cost-missing{margin-top:8px;background:#fff;border:1px dashed #ffd591;border-radius:8px;padding:10px 12px}
.cost-missing b{color:#874d00;font-size:13px}
.cost-missing ul{margin-top:4px;padding-left:18px}
.cost-missing li{font-size:13px;color:#8c6e3a;padding:2px 0}
.cost-table{width:100%;border-collapse:collapse;margin-top:8px;font-size:13px}
.cost-table th,.cost-table td{border:1px solid #ffd591;padding:6px 8px;text-align:left}
.cost-table th{background:#ffe9c7;color:#874d00}

/* 历史卡片删除按钮 */
.hist-item{position:relative}
.hist-del{
  position:absolute;top:8px;right:8px;width:24px;height:24px;border:none;border-radius:50%;
  background:rgba(0,0,0,.12);color:#a33;font-size:15px;line-height:24px;cursor:pointer;font-weight:700;
}
.hist-del:active{background:#e6b8b6}

/* 结果操作按钮 */
.res-actions{display:flex;gap:10px;margin-bottom:16px}
.res-actions .btn{flex:1}
.res-actions .btn--soft{background:#eef4f2;color:var(--primary);border:1px solid #cfe5e1;border-radius:10px;font-weight:600;padding:14px}

@media (max-width:360px){ .topbar__title{font-size:16px} }

/* 润色版本选择卡片 */
.opt-item{
  border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:8px;
  cursor:pointer;background:#fcfefd;transition:background .15s;
}
.opt-item:active{background:#e8f3f1}
.opt-tag{display:inline-block;font-size:12px;font-weight:700;color:var(--primary);
  background:#e8f3f1;border-radius:6px;padding:2px 8px;margin-bottom:4px}
.opt-text{font-size:14px;line-height:1.5;color:var(--text)}

/* ===== 本轮整改新增（v16）===== */
/* 上传区收缩 + 缩略图同网格 + 继续添加 */
.drop{transition:padding .2s}
.drop.collapsed,.thumbs:has(+ .drop) {}
.thumbs{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;align-items:stretch}
.thumbs__count{width:100%;font-size:12px;color:var(--muted)}
.thumb{position:relative;width:76px;height:76px;border-radius:8px;overflow:hidden;border:1px solid var(--line);background:#fff;flex:0 0 auto}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb__idx{position:absolute;top:2px;left:2px;background:rgba(0,0,0,.55);color:#fff;font-size:11px;padding:1px 5px;border-radius:4px}
.thumb__st{position:absolute;bottom:0;left:0;right:0;font-size:10px;text-align:center;color:#fff;padding:1px 0}
.thumb--ready .thumb__st{background:rgba(46,158,91,.85)}
.thumb--dup .thumb__st{background:rgba(224,138,0,.85)}
.thumb--error_format .thumb__st,.thumb--error_size .thumb__st,.thumb--error_read .thumb__st{background:rgba(214,69,69,.85)}
.thumb--dup img,.thumb--error_format img,.thumb--error_size img,.thumb--error_read img{opacity:.5;filter:grayscale(.6)}
.thumb__ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--muted);background:#f3f5f4}
/* 扩大删除按钮可点击区域 */
.thumb__rm{position:absolute;top:0;right:0;width:32px;height:32px;border:none;border-radius:0 8px 0 8px;background:rgba(0,0,0,.55);color:#fff;font-size:16px;line-height:32px;cursor:pointer}
.thumb__rm:hover,.thumb__rm:focus{background:var(--danger);outline:2px solid #fff}
.thumb--add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:#f3f5f4;border:1px dashed #b9ccc8;color:var(--muted);font-size:18px;cursor:pointer}
.thumb--add .thumb__addtxt{font-size:11px}
.thumb--add:hover,.thumb--add:focus{border-color:var(--primary);color:var(--primary);outline:2px solid var(--primary)}
.thumb--add:disabled{opacity:.5;cursor:not-allowed}
/* 规范适用性标签 */
.norm-tag{display:inline-block;font-size:11px;padding:1px 7px;border-radius:6px;margin-left:4px;font-weight:600}
.norm-major{background:#e8f5e9;color:#2e7d32}
.norm-cross{background:#e3f2fd;color:#1565c0}
.warn-note{color:#b5493a}
/* 首屏强调 */
.res-first{border-left:4px solid var(--primary)}
/* 润色操作行 */
.polish-actions{display:flex;gap:8px;margin-top:10px}
/* 按钮状态 */
.btn,.btn--soft,.btn--primary{transition:background .15s,box-shadow .15s}
.btn:focus,.btn--soft:focus,.btn--primary:focus{outline:2px solid var(--primary);outline-offset:2px}
.btn.is-loading{opacity:.7;cursor:progress}
.btn:disabled{opacity:.5;cursor:not-allowed}
.drop__hint{display:block;font-size:12px;color:var(--muted);margin-top:4px}
/* 响应式 */
@media (max-width:480px){
  .thumb{width:64px;height:64px}
  .res-hazards{font-size:13px}
}
/* 上传后大上传区收缩 */
.drop.collapsed{padding:8px 12px}
.drop.collapsed b{font-size:13px}
.drop.collapsed .drop__hint{display:none}

/* 阶段3：造价参数一致性复核标记（仅新增标记样式，不重排造价卡） */
.cost-warn{color:#c0392b;background:#fdecea;border:1px solid #f5c6c0;border-radius:6px;padding:6px 10px;margin:6px 0;font-size:13px}

/* 阶段4：L0 表达边界（假设声明 + 详细依据默认折叠） */
.cost-assume{color:#8a6d1a;background:#fffbea;border:1px dashed #e6c85c;border-radius:6px;padding:6px 10px;margin:6px 0;font-size:13px}
details.cost-detail{margin:6px 0;border:1px solid #e8e4dc;border-radius:6px;background:#faf9f6}
details.cost-detail summary{cursor:pointer;padding:12px 10px;font-size:13px;color:#555;outline:none;min-height:44px;display:flex;align-items:center}
details.cost-detail summary:focus-visible{box-shadow:0 0 0 2px var(--primary)}
details.cost-detail[open] summary{border-bottom:1px solid #eee}
.cost-detail__body{padding:8px 10px;font-size:13px;color:#444;line-height:1.7}

/* 阶段6：造价卡结构化排版（摘要区/标签/分组，保持橙色体系） */
.cost-card__summary{background:linear-gradient(135deg,#fff7e6,#fff);border:1px solid #ffd591;border-radius:10px;padding:10px 12px;margin:8px 0}
.cost-card__amount{font-size:20px;font-weight:700;color:#fa8c16}
.cost-card__amount b{font-size:26px}
.cost-card__tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.cost-tag{font-size:12px;color:#8c6a1f;background:#fff3d6;border:1px solid #ffd591;border-radius:20px;padding:2px 10px;white-space:nowrap}
.cost-sec{font-size:13px;font-weight:700;color:#5a4632;margin:10px 0 4px}
.cost-tags{display:flex;flex-wrap:wrap;gap:6px}
.cost-chip{font-size:12px;color:#3d5a46;background:#eef5f0;border:1px solid #cfe3d6;border-radius:6px;padding:3px 9px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.cost-list{margin:4px 0 8px;padding-left:18px;font-size:13px;color:#444;line-height:1.7}
.cost-list li{word-break:break-all}
.cost-row{font-size:13px;color:#555;margin:5px 0;line-height:1.6;word-break:break-all}
.cost-card__head .cost-card__lvl{float:right}
.cost-card__range{display:none}
.cost-missing{display:none}
.cost-card__note{font-size:12px;color:#8a6d1a;background:#fffbea;border-radius:6px;padding:6px 10px;margin:6px 0}
@media (max-width:480px){
  .cost-card__amount{font-size:17px}
  .cost-card__amount b{font-size:22px}
  .cost-tag,.cost-chip{white-space:normal;word-break:break-all}
}



/* ===== 分方案造价范围 & 费用组成按方案分组（阶段12） ===== */
.cost-opt { margin: 6px 0 10px; }
.cost-opt__table { margin-top: 4px; }
.cost-opt__table td:first-child { white-space: nowrap; }
.cost-optgroup { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.cost-optgroup__name {
  flex: 0 0 96px; font-size: 12px; font-weight: 700; color: var(--ink-2, #555);
  background: rgba(64, 128, 200, .08); border-radius: 6px; padding: 3px 8px; line-height: 1.6;
}
.cost-optgroup .cost-tags { flex: 1; }
