/* ===========================================================================
 * 私域破冰话术（#sub-icebreak）· 独立样式表
 * ---------------------------------------------------------------------------
 * 为什么单开文件：全站铁律 —— 不往 style.css 里加（体量大、多会话并发在改）。
 * 本文件在 index.html 里排在 style.css 与其它板块 css 之后加载。
 *
 * 🔴 四条硬约束（都是本项目踩过的坑）
 *   ① 所有选择器必须带 `#sub-icebreak` 作用域 —— 裸类名会误伤别的板块。
 *   ② 带 absolute 装饰的容器必须 position:relative —— 否则装饰按 right 撑宽
 *      document，手机端整页缩成 77%（桌面完全看不出来）。
 *   ③ `[hidden]` 会被 display:flex/grid 盖掉，必须显式压掉。
 *   ④ 底部留白 ≥96px —— fixed TabBar 实测高 74px，不留会挡住按钮。
 *
 * 视觉基调：暖白底 + 品牌橙（#f95901 不许换）+ **微信气泡绿**做特色点缀。
 *   特色落在「首发开场白」上：话术不排成普通段落，而是**渲染成微信气泡的样子**
 *   —— 用户一眼看到"这条发出去长什么样"，而不是读一段排版好的文字。
 * =========================================================================== */

#sub-icebreak {
  --ib-paper: #fffdf9;
  --ib-line: rgba(150, 100, 50, .13);
  --ib-ink: #3a2a1e;
  --ib-ink2: #8b7a68;
  --ib-ink3: #b3a394;
  --ib-brand: #f95901;
  --ib-brand2: #ff7a2e;
  --ib-wx: #95ec69;          /* 微信己方气泡绿（特色） */
  --ib-wx-ink: #10320a;
  --ib-wx-bg: #ededed;       /* 微信聊天窗底色 */
  --ib-shadow: 0 2px 10px rgba(122, 58, 18, .07);
  --ib-shadow2: 0 6px 22px rgba(122, 58, 18, .11);
  padding-bottom: 96px;
}

/* ③ hidden 必须显式压掉 */
#sub-icebreak [hidden] { display: none !important; }

/* ===================== 顶部条 ===================== */
#sub-icebreak .sub-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 6px;
}
#sub-icebreak .sub-back {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; box-shadow: var(--ib-shadow);
  font-size: 20px; color: var(--ib-brand); line-height: 1;
  cursor: pointer;
}
#sub-icebreak .sub-title { font-size: 16px; font-weight: 700; letter-spacing: .3px; }

/* ===================== 头部 ===================== */
#sub-icebreak .ib-head {
  position: relative;               /* ② 装饰物定位基准 */
  margin: 8px 14px 12px;
  padding: 17px 16px 15px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff6ee 0%, #fffdfb 62%);
  border: 1px solid var(--ib-line);
  box-shadow: var(--ib-shadow);
  overflow: hidden;
}
#sub-icebreak .ib-head::after {      /* 右上角柔光 */
  content: ''; position: absolute; right: -34px; top: -34px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 89, 1, .13) 0%, rgba(249, 89, 1, 0) 70%);
  pointer-events: none;
}
#sub-icebreak .ib-head-t { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
#sub-icebreak .ib-head-d {
  margin-top: 7px; font-size: 13.5px; line-height: 1.65; color: var(--ib-ink2);
}
#sub-icebreak .ib-gains { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
#sub-icebreak .ib-gain {
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px;
  background: #fff; border: 1px solid var(--ib-line); color: var(--ib-ink2);
}

/* ===================== 卡片 ===================== */
#sub-icebreak .ib-card {
  position: relative;               /* ② */
  margin: 0 14px 13px;
  padding: 15px 14px;
  border-radius: 20px;
  background: var(--ib-paper);
  border: 1px solid var(--ib-line);
  box-shadow: var(--ib-shadow);
}
#sub-icebreak .ib-card-h {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 11px;
}
#sub-icebreak .ib-step {
  flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ib-brand); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transform: translateY(1px);
}
#sub-icebreak .ib-card-t { font-size: 14.5px; font-weight: 700; }
#sub-icebreak .ib-card-sub { font-size: 11.5px; color: var(--ib-ink3); }
#sub-icebreak .ib-req {
  font-size: 10.5px; font-weight: 600; color: #fff; background: var(--ib-brand);
  padding: 1px 6px; border-radius: 6px; margin-left: 2px;
}
#sub-icebreak .ib-opt {
  font-size: 10.5px; font-weight: 600; color: var(--ib-ink3);
  border: 1px solid var(--ib-line); padding: 1px 6px; border-radius: 6px; margin-left: 2px;
}

/* ===================== ① 来源选择（2 列卡） ===================== */
#sub-icebreak .ib-srcs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#sub-icebreak .ib-src {
  display: flex; align-items: flex-start; gap: 8px; text-align: left;
  padding: 10px 10px 10px 9px; border-radius: 14px;
  background: #fff; border: 1.5px solid var(--ib-line);
  cursor: pointer; transition: border-color .14s, background .14s, transform .1s;
  font-family: inherit;
}
#sub-icebreak .ib-src:active { transform: scale(.975); }
#sub-icebreak .ib-src.on {
  border-color: var(--ib-brand);
  background: linear-gradient(135deg, #fff6ee 0%, #fff 100%);
  box-shadow: 0 3px 12px rgba(249, 89, 1, .14);
}
#sub-icebreak .ib-src-ico { font-size: 17px; line-height: 1.25; flex: 0 0 auto; }
#sub-icebreak .ib-src-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#sub-icebreak .ib-src-body b { font-size: 12.5px; font-weight: 700; line-height: 1.35; }
#sub-icebreak .ib-src-body i {
  font-style: normal; font-size: 10.5px; color: var(--ib-ink3); line-height: 1.45;
}
#sub-icebreak .ib-src.on .ib-src-ico,
#sub-icebreak .ib-src.on .ib-src-body b { color: var(--ib-brand); }
#sub-icebreak .ib-src.on .ib-src-body b { color: #b83f00; }

/* ===================== 输入框 ===================== */
#sub-icebreak .ib-input, #sub-icebreak .ib-area {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; border-radius: 13px;
  border: 1.5px solid var(--ib-line); background: #fff;
  font-size: 14px; color: var(--ib-ink); font-family: inherit; line-height: 1.5;
  transition: border-color .14s, box-shadow .14s;
}
#sub-icebreak .ib-input:focus, #sub-icebreak .ib-area:focus {
  outline: none; border-color: var(--ib-brand);
  box-shadow: 0 0 0 3px rgba(249, 89, 1, .1);
}
#sub-icebreak .ib-area { resize: vertical; min-height: 62px; }
#sub-icebreak .ib-ph { font-size: 11.5px; color: var(--ib-ink3); margin: 7px 2px 0; line-height: 1.55; }

/* ===================== 通用 chip ===================== */
#sub-icebreak .ib-chips { display: flex; flex-wrap: wrap; gap: 7px; }
#sub-icebreak .ib-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 13px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--ib-line);
  font-size: 12.5px; color: var(--ib-ink); cursor: pointer;
  font-family: inherit; transition: border-color .14s, background .14s, transform .1s;
}
#sub-icebreak .ib-chip:active { transform: scale(.96); }
#sub-icebreak .ib-chip.on {
  border-color: var(--ib-brand); color: #b83f00; font-weight: 700;
  background: linear-gradient(135deg, #fff2e6 0%, #fff 100%);
}
#sub-icebreak .ib-chip-ico { font-size: 13px; }

/* ===================== 选填折叠 ===================== */
#sub-icebreak .ib-adv-btn {
  width: 100%; text-align: left; margin-top: 11px;
  padding: 9px 12px; border-radius: 12px;
  background: #fff; border: 1.5px dashed var(--ib-line);
  font-size: 12.5px; color: var(--ib-ink2); cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: space-between;
}
#sub-icebreak .ib-adv-btn .ib-caret { transition: transform .18s; font-size: 11px; }
#sub-icebreak .ib-adv-btn.on .ib-caret { transform: rotate(180deg); }
#sub-icebreak .ib-adv { margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--ib-line); }
#sub-icebreak .ib-adv-row { margin-bottom: 11px; }
#sub-icebreak .ib-adv-row:last-child { margin-bottom: 0; }
#sub-icebreak .ib-adv-l { font-size: 12px; font-weight: 600; color: var(--ib-ink2); margin-bottom: 6px; }

/* ===================== 生成按钮 ===================== */
#sub-icebreak .ib-gen {
  width: 100%; margin-top: 14px;
  padding: 14px 16px; border: none; border-radius: 15px;
  background: linear-gradient(135deg, var(--ib-brand2) 0%, #f94400 100%);
  color: #fff; font-size: 15.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; letter-spacing: .5px;
  box-shadow: 0 6px 18px rgba(249, 89, 1, .3);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
#sub-icebreak .ib-gen:active { transform: scale(.985); }
#sub-icebreak .ib-gen:disabled {
  opacity: .62; box-shadow: none; cursor: default; transform: none;
}

/* ===================== 结果区 ===================== */
#sub-icebreak .ib-result-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 10px;
}
#sub-icebreak .ib-mood {
  font-size: 11.5px; color: var(--ib-ink2);
  background: #fff; border: 1px solid var(--ib-line);
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%;
}
#sub-icebreak .ib-sec-h {
  margin: 16px 0 10px; padding-top: 2px;
}
#sub-icebreak .ib-sec-h:first-child { margin-top: 0; }
#sub-icebreak .ib-sec-h .ib-sec-ico { font-size: 14px; margin-right: 5px; }
#sub-icebreak .ib-sec-h b { font-size: 14.5px; font-weight: 800; }
#sub-icebreak .ib-sec-h i {
  display: block; font-style: normal; font-size: 11.5px;
  color: var(--ib-ink3); margin-top: 4px; line-height: 1.5;
}

/* ---- 主推（视觉重心） ---- */
#sub-icebreak .ib-main {
  position: relative;               /* ② */
  border-radius: 18px; padding: 12px 12px 4px;
  background: linear-gradient(160deg, #fff4e9 0%, #fffdfb 70%);
  border: 1.5px solid rgba(249, 89, 1, .22);
}
#sub-icebreak .ib-main-tag {
  position: absolute; left: 12px; top: -9px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--ib-brand); padding: 2px 9px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(249, 89, 1, .3);
}
#sub-icebreak .ib-alts-t {
  font-size: 11.5px; color: var(--ib-ink3); margin: 15px 2px 8px;
}
#sub-icebreak .ib-alt {
  border-radius: 15px; padding: 11px 11px 3px;
  background: #fff; border: 1px solid var(--ib-line); margin-bottom: 9px;
}
#sub-icebreak .ib-alt-h {
  font-size: 12px; font-weight: 700; color: var(--ib-ink2); margin-bottom: 8px;
}

/* ---- 微信气泡（本功能的视觉特色） ---- */
#sub-icebreak .ib-bub-wrap {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px; padding: 9px 10px; border-radius: 14px;
  background: var(--ib-wx-bg);
  margin-bottom: 9px;
}
#sub-icebreak .ib-bub {
  position: relative;               /* ② 小三角定位基准 */
  max-width: 88%;
  background: var(--ib-wx);
  color: var(--ib-wx-ink);
  padding: 10px 13px;
  border-radius: 11px 3px 11px 11px;   /* 右上角收成尖角 = 微信己方气泡 */
  font-size: 13.8px; line-height: 1.62;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
#sub-icebreak .ib-bub::after {     /* 气泡尖角 */
  content: ''; position: absolute; right: -5px; top: 0;
  width: 0; height: 0;
  border-top: 7px solid var(--ib-wx);
  border-right: 6px solid transparent;
}
#sub-icebreak .ib-copy {
  font-size: 11.5px; font-family: inherit; cursor: pointer;
  padding: 5px 13px; border-radius: 999px;
  background: #fff; border: 1px solid rgba(0, 0, 0, .1);
  color: var(--ib-ink2); transition: all .14s;
}
#sub-icebreak .ib-copy:active { transform: scale(.95); }
#sub-icebreak .ib-copy.ok {
  background: #e8f8df; border-color: #b6e39a; color: #2f6b18; font-weight: 700;
}
#sub-icebreak .ib-why {
  font-size: 11.8px; line-height: 1.6; color: var(--ib-ink2);
  background: rgba(249, 89, 1, .055);
  border-left: 2.5px solid rgba(249, 89, 1, .35);
  padding: 7px 10px; border-radius: 0 9px 9px 0;
  margin: 0 0 9px;
}

/* ---- 跟进 / 回复卡 ---- */
#sub-icebreak .ib-fol, #sub-icebreak .ib-rep {
  border-radius: 16px; padding: 11px 11px 3px;
  background: #fff; border: 1px solid var(--ib-line); margin-bottom: 10px;
}
#sub-icebreak .ib-fol-h {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  color: #b83f00; background: #fff3e8;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 9px;
}
#sub-icebreak .ib-rep-q {
  font-size: 12.5px; font-weight: 700; color: var(--ib-ink2);
  margin-bottom: 9px; line-height: 1.5;
  padding-left: 9px; border-left: 2.5px solid rgba(249, 89, 1, .3);
}
#sub-icebreak .ib-meta {
  display: flex; flex-direction: column; gap: 4px;
  margin: 2px 0 9px; padding: 8px 10px;
  background: #fdfaf6; border-radius: 10px;
}
#sub-icebreak .ib-meta span { font-size: 11.3px; color: var(--ib-ink2); line-height: 1.55; }

/* ---- 避坑对照 ---- */
#sub-icebreak .ib-avoid { display: flex; flex-direction: column; gap: 9px; }
#sub-icebreak .ib-av {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--ib-line); background: #fff;
}
#sub-icebreak .ib-av-bad, #sub-icebreak .ib-av-good {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.6;
}
#sub-icebreak .ib-av-bad { background: #fdf3f3; color: #96302e; }
#sub-icebreak .ib-av-good { background: #f2faf0; color: #2f6b18; border-top: 1px solid var(--ib-line); }
#sub-icebreak .ib-av-bad span, #sub-icebreak .ib-av-good span {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 800;
  padding: 2px 7px; border-radius: 6px; transform: translateY(1px);
}
#sub-icebreak .ib-av-bad span { background: #f6dcdc; color: #8c2422; }
#sub-icebreak .ib-av-good span { background: #d8efd0; color: #2f6b18; }

/* ---- 7 天节奏时间轴 ---- */
#sub-icebreak .ib-plan {
  position: relative; padding-left: 18px;
}
#sub-icebreak .ib-plan::before {
  content: ''; position: absolute; left: 5px; top: 7px; bottom: 7px;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(249, 89, 1, .45), rgba(249, 89, 1, .12));
}
#sub-icebreak .ib-plan-row {
  position: relative; display: flex; gap: 10px;
  padding: 7px 0; align-items: flex-start;
}
#sub-icebreak .ib-plan-row::before {
  content: ''; position: absolute; left: -16px; top: 13px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ib-brand);
}
#sub-icebreak .ib-plan-k {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 800; color: #b83f00;
  background: #fff3e8; padding: 3px 8px; border-radius: 8px;
  white-space: nowrap; min-width: 44px; text-align: center;
}
#sub-icebreak .ib-plan-v { font-size: 12.8px; line-height: 1.62; color: var(--ib-ink); }

/* ---- 降级原始渲染 ---- */
#sub-icebreak .ib-raw p {
  font-size: 13px; line-height: 1.72; margin: 0 0 8px; color: var(--ib-ink);
}
#sub-icebreak .ib-meta-line { font-size: 11.5px; color: var(--ib-ink2); }

/* ---- 发出前自检（代码护栏，只在有问题时出现） ---- */
#sub-icebreak .ib-lint {
  margin: 0 0 14px; padding: 11px 13px 12px;
  border-radius: 13px;
  background: #fff8ec;
  border: 1px solid rgba(219, 146, 32, .3);
  border-left: 3px solid #e8a33d;
}
#sub-icebreak .ib-lint-h {
  font-size: 12.3px; font-weight: 800; color: #9a6412; margin-bottom: 7px;
}
#sub-icebreak .ib-lint-i {
  position: relative; padding-left: 13px;
  font-size: 12.2px; line-height: 1.62; color: #7d5410; margin-top: 5px;
}
#sub-icebreak .ib-lint-i::before {
  content: '·'; position: absolute; left: 3px; top: -1px;
  font-weight: 800; color: #d99a3a;
}

/* ---- 加载 / 错误 ---- */
#sub-icebreak .ib-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 4px; font-size: 13.5px; color: var(--ib-ink2);
}
#sub-icebreak .ib-spin {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2.2px solid rgba(249, 89, 1, .22); border-top-color: var(--ib-brand);
  animation: ib-spin .75s linear infinite;
}
@keyframes ib-spin { to { transform: rotate(360deg); } }
#sub-icebreak .ib-err {
  border-radius: 16px; padding: 15px 14px;
  background: #fdf6f5; border: 1px solid rgba(239, 68, 68, .2);
}
#sub-icebreak .ib-err-t { font-size: 14px; font-weight: 700; color: #96302e; }
#sub-icebreak .ib-err-d { font-size: 13px; color: #7a3a37; margin-top: 6px; line-height: 1.6; }
#sub-icebreak .ib-err-x {
  font-size: 11.8px; color: var(--ib-ink3); margin-top: 9px; line-height: 1.6;
  padding-top: 9px; border-top: 1px dashed rgba(150, 100, 50, .16);
}

/* ---- 空态 ---- */
#sub-icebreak .ib-empty {
  text-align: center; padding: 22px 16px 26px; color: var(--ib-ink3);
}
#sub-icebreak .ib-empty-ico { font-size: 30px; margin-bottom: 9px; }
#sub-icebreak .ib-empty-t { font-size: 13.5px; font-weight: 600; color: var(--ib-ink2); }
#sub-icebreak .ib-empty-d { font-size: 11.8px; margin-top: 6px; line-height: 1.65; }

/* ---- 历史 ---- */
#sub-icebreak .ib-hs { display: flex; flex-direction: column; gap: 7px; }
#sub-icebreak .ib-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: 12px;
  background: #fff; border: 1px solid var(--ib-line);
  font-family: inherit; cursor: pointer; text-align: left;
  transition: border-color .14s, transform .1s;
}
#sub-icebreak .ib-h:active { transform: scale(.99); }
#sub-icebreak .ib-h:hover { border-color: rgba(249, 89, 1, .35); }
#sub-icebreak .ib-h-m {
  font-size: 12.5px; color: var(--ib-ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#sub-icebreak .ib-h-t { flex: 0 0 auto; font-size: 11px; color: var(--ib-ink3); }

/* ===================== 提示条 ===================== */
#sub-icebreak .ib-toast {
  position: fixed; left: 50%; bottom: 96px;
  transform: translate(-50%, 14px);
  background: rgba(58, 42, 30, .93); color: #fff;
  font-size: 13px; padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 60; max-width: 84vw; text-align: center;
}
#sub-icebreak .ib-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 小屏：来源卡单列，避免描述被挤成两行半 */
@media (max-width: 359.98px) {
  #sub-icebreak .ib-srcs { grid-template-columns: 1fr; }
}

/* ===================== 文案板块网格：末行孤张居中 =====================
   本功能让文案板块从 10 张变 11 张：
     手机 3 列 = 3+3+3+2（末行 2 张，正常，无需处理）
     平板 4 列 = 4+4+3（同上）
     桌面 5 列 = 5+5+**1** → 末行只剩一张、靠左吊着很难看 → 让它居中。
   规则写法与 hero.css 里同事处理文案板块末行的那条完全同款（`:last-child:nth-child(…)`
   精确命中「这一行只有它一个」，5k+1 是因为桌面是 5 列）。
   ⚠️ 为什么写在自己的 icebreak.css 而不是 hero.css：hero.css 是同板块公共文件、
      多会话共改，铁律是「改别人的样式别动它」，新规则一律进自己的文件（本文件
      在 index.html 里排在 hero.css 之后加载，同优先级下后者生效）。 */
@media (min-width: 1024px) {
  #view-copy .func-grid > .func-card:last-child:nth-child(5n+1) { grid-column: 3; }
}
