/* ============================================================================
 * 全站聚焦环（键盘可达性）：聚焦时用主色暖棕描边，替代浏览器默认的蓝色框。
 * 这三条是「看得见焦点」的底线 —— 不要删、不要改回 outline: none。
 * 键盘 Tab / 输入框聚焦都靠它定位，鼠标点击的默认环也只换颜色、不改变有无。
 * ==========================================================================*/
:focus-visible {
  outline: 3px solid var(--accent, #b5845c);
  outline-offset: 2px;
}
/* 鼠标/程序聚焦（非键盘）：只把默认环的颜色换成暖棕，不凭空造出新环 */
:focus:not(:focus-visible) {
  outline-color: var(--accent, #b5845c);
}

/* ============================================================================
 * 服装工作台 · 结果块公共组件样式
 * ----------------------------------------------------------------------------
 * 「帮我搭」和「帮我写」的结果页共用这一份，不要再各写一套。
 * 包含：朋友圈卡片 / 顾客话术分组 / 反馈三按钮 / 就地提示条 / 就地错误重试
 * 依赖页面 :root 里的设计变量（--surface --border --text --text-2 --accent ...）
 * ==========================================================================*/

[hidden] { display: none !important; }

/* —— 底部整行按钮（换一批、换平台…） —— */
.foot-row { display: flex; gap: 8px; }
.foot-btn {
  flex: 1; min-height: 48px; border: 1px solid var(--border); border-radius: 13px;
  background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.foot-btn:active { background: var(--accent-soft); }
.foot-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }

/* —— 反馈三按钮（用了 / 改了再用 / 没用） —— */
.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.feedback .fb-label { font-size: 13.5px; color: var(--text-2); }
.feedback .fb-btn {
  min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer;
}
.feedback .fb-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.feedback .fb-thanks { font-size: 13px; color: var(--accent-strong); }

/* —— 就地提示条（替代 alert） —— */
.notice {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top));
  width: calc(100% - 40px); max-width: 390px;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid var(--accent); border-radius: 12px;
  padding: 12px 14px; font-size: 14.5px; line-height: 1.5;
  z-index: 70; box-shadow: var(--shadow-soft);
}
.notice.error { background: #f7e8e6; border-color: #d8b3ae; color: #b3544e; }

/* —— 就地错误 + 重试 —— */
.inline-error {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  background: #f7e8e6; border: 1px solid #e3c6c1; border-radius: 12px; padding: 12px 14px;
}
.inline-error .ie-text { flex: 1; font-size: 14px; color: #b3544e; line-height: 1.5; }
.inline-error .ie-retry {
  flex: 0 0 auto; min-height: 44px; padding: 0 16px; border: none; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 14.5px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}

/* —— 朋友圈卡片：角度标签 + 正文 + 复制这条 —— */
.moment-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px; margin-top: 10px; box-shadow: var(--shadow-soft); }
.moment-card:first-child { margin-top: 0; }
.moment-tag { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--accent-strong);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; }
.moment-text { font-size: 15px; line-height: 1.75; color: var(--text); margin: 0 0 10px; white-space: pre-line; }

/* —— 通用复制按钮 —— */
.copy-line { min-height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer; }
.copy-line:active { background: var(--accent-soft); color: var(--accent-strong); }

/* —— 顾客话术分组：可折叠，每组多条 —— */
.talk-group { border: 1px solid var(--border); border-radius: var(--radius-md); margin-top: 10px;
  background: var(--surface); box-shadow: var(--shadow-soft); overflow: hidden; }
.talk-group:first-child { margin-top: 0; }
.talk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  min-height: 48px; border: none; background: none; font-family: inherit; cursor: pointer;
  padding: 0 14px; font-size: 15px; font-weight: 650; color: var(--text); }
.talk-head .chev { color: var(--text-2); font-size: 15px; }
.talk-body { padding: 0 14px 12px; }
.talk-item { padding: 10px 0; }
.talk-item + .talk-item { border-top: 1px solid var(--border); }
.talk-item .talk-text { font-size: 15px; line-height: 1.7; color: var(--text); margin: 0 0 8px; }

/* —— 结果页分段标签（帮我搭 / 帮我写的微信结果 共用） —— */
.seg-tabs { display: flex; gap: 6px; margin-top: 14px; background: #f4efe8; border-radius: 14px; padding: 4px; }
.seg {
  flex: 1; min-height: 48px; border: none; border-radius: 11px; background: transparent;
  color: var(--text-2); font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.seg.active { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-soft); }
.seg-status { font-size: 10.5px; font-weight: 400; color: var(--text-2); }
.seg-status.loading { color: var(--accent); }
.seg-status.ready { color: var(--text-2); }
.seg-status.error { color: #b3544e; }
.seg-panel { margin-top: 12px; }

/* —— 结果页顶部：本次输入摘要 + 「改一下」 —— */
.result-summary {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 10px 10px 14px; box-shadow: var(--shadow-soft);
}
.result-summary .rs-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.result-summary .rs-text b { color: var(--text); font-weight: 650; }
.result-summary .rs-edit {
  flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--accent-strong);
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.result-summary .rs-edit:active { background: var(--accent-soft); }

/* —— 就地加载（失败时不清空已有内容） —— */
.result-loading { margin-top: 14px; font-size: 14.5px; color: var(--text-2); }

/* —— 列表缩略图（帮我搭最近搭过 / 首页最近做的 / 我的·我做过的 共用） ——
   三种状态长得一样，不会出现裂图、也不会撑高列表：
     · 有图      → <img> 铺满容器
     · 没有图    → 占位块（页面传进来的线条图标）
     · 图 404    → onError 切成同一个占位块
   尺寸不在这里定，由各页面的 class 给（.ri-icon / .recent-thumb / .rc-thumb），
   所以加载前加载后容器高度完全一致，列表不会跳动。 */
.thumb-box { flex: 0 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.thumb-box > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-box .tb-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }


/* ============================================================================
 * 共用组件样式（2026-09-21 抽公共）
 * 下面这几组原先是「帮我搭 / 帮我写 / 帮我拆」各有一份，现在统一放这里；
 * AI助手的「查看完整内容」也直接复用同一套，不另做样式。
 * 配套的 DOM 构造函数在 js/result-blocks.js。
 * ==========================================================================*/

/* —— 放图缩略图行（对应 js/upload-block.js，四个页面共用）—— */
.thumb-row { display: flex; gap: 8px; }
.thumb-tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 74px;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--accent-soft);
}
.thumb-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del {
  position: absolute;
  top: 0; right: 0;
  width: 44px; height: 44px;      /* 点击区域 ≥44px */
  border: none; background: transparent;
  cursor: pointer; padding: 0;
  display: flex; align-items: flex-start; justify-content: flex-end;
}
.thumb-del::after {
  content: '×';
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin: 2px;
  border-radius: 50%;
  background: rgba(58,53,49,.72);
  color: #fff; font-size: 15px; line-height: 1;
}
.add-tile {
  flex: 1 1 0;
  min-width: 0;
  max-width: 74px;
  aspect-ratio: 1;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fbfaf8;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.add-tile:active { border-color: var(--accent); background: var(--accent-soft); }
.add-tile .plus { font-size: 24px; line-height: 1; color: var(--accent); }

/* —— 搭配卡片（帮我搭的结果 + AI助手长回答里的「完整搭配」）—— */
.outfit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 12px;
  box-shadow: var(--shadow-soft);
}
.outfit-combo-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.outfit-combo-row .outfit-combo { margin-bottom: 0; flex: 1; }
.outfit-combo { font-size: 16px; font-weight: 680; color: var(--text); line-height: 1.5; margin-bottom: 12px; }
.outfit-row { margin-bottom: 10px; }
.outfit-row .row-label {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent-strong);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; margin-right: 8px;
}
.outfit-row .row-text { font-size: 13.5px; color: var(--text); line-height: 1.65; }
.outfit-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.outfit-action {
  flex: 1; min-height: 44px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.outfit-action.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.alt-toggle {
  min-height: 44px; border: none; background: none; color: var(--accent-strong);
  font-size: 13.5px; font-family: inherit; cursor: pointer; padding: 0; margin: -4px 0 0; display: block;
}
.alt-text { margin-top: 8px; }

/* —— 拆解两块列表（帮我拆的结果 + AI助手长回答里的「拆解」）—— */
.td-block { margin-top: 16px; }
.td-h { margin: 0 0 10px; font-size: 15px; font-weight: 650; color: var(--text); }
.td-list {
  margin: 0; padding: 4px 14px; list-style: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
}
.td-item { position: relative; padding: 12px 0 12px 18px; font-size: 16.5px; line-height: 1.7; color: var(--text); }
.td-item + .td-item { border-top: 1px solid var(--border); }
.td-item::before {
  content: ''; position: absolute; left: 2px; top: 22px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* —— 输入框清空按钮（×，见 js/result-blocks.js 的 FWBlocks.attachClearButton）——
   帮我搭 / 帮我写 / 帮我拆 的输入框共用。按钮绝对定位在输入框内部右侧：
   · line（单行）垂直居中；area（多行文本域）贴右上角，避开右下角的语音按钮
   · 只在输入框有内容时出现（.is-filled）
   · 焦点环沿用文件顶部的全局 :focus-visible，这里不写 outline: none */
.fw-clear-wrap {
  position: relative; display: block;
  /* 放进 flex 行里时（帮我搭的 .input-row）要能像原来的输入框一样撑满剩余宽度 */
  flex: 1 1 auto; min-width: 0;
}
.fw-clear-wrap > input,
.fw-clear-wrap > textarea { width: 100%; }
.fw-clear-btn {
  position: absolute; top: 50%; transform: translateY(-50%); right: 8px;
  width: 30px; height: 30px; padding: 0; line-height: 1;
  display: none; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: var(--border, #ece7de); color: var(--text-2, #7d756c);
  font-family: inherit; font-size: 17px; cursor: pointer;
}
.fw-clear-btn.is-area { top: 8px; transform: none; }
.fw-clear-wrap.is-filled .fw-clear-btn { display: flex; }
.fw-clear-btn:active { background: var(--accent-soft, #f0e5d8); color: var(--accent-strong, #9a6a44); }
/* 有按钮时给输入框右侧留出空间，文字不会跑到按钮底下
   （用 !important：本文件在页面 <style> 之前加载，同优先级会输给页面自己的 padding） */
.fw-has-clear { padding-right: 44px !important; }
