/* ============================================================
   DIY 工坊 · 意见反馈组件（全站公共）
   类名统一 fb- 前缀，避免与各页样式冲突。
   入口：顶栏 .fb-nav-bug（宽屏绝对定位，不挤动搜索框/头像）
   ============================================================ */

/* ---------- 顶栏 bug 入口：与 .main-nav a 完全同规格 ---------- */
.fb-nav-bug{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 13px;border-radius:8px;
  font-size:14.5px;font-weight:400;line-height:1.6;letter-spacing:normal;
  color:rgba(255,255,255,.9);background:transparent;border:none;
  cursor:pointer;white-space:nowrap;font-family:inherit;
}
.fb-nav-bug:hover,.fb-nav-bug:focus{background:transparent;color:rgba(255,255,255,.9);}
.fb-nav-bug:focus-visible{outline:2px solid #fff;outline-offset:2px;}

/* 宽屏：头像右侧有充足留白时，脱离文档流定位，搜索框/头像位置零变化。
   断点估算：容器 max-width:1600 + 两侧留白/内边距需容纳约 62px 的按钮。 */
@media (min-width:1680px){
  .topbar .nav-right{position:relative;}
  .fb-nav-bug{
    position:absolute;left:calc(100% + 10px);top:50%;
    transform:translateY(-50%);margin:0;
  }
}

/* 无顶栏页面的降级悬浮按钮 */
.fb-fab-fallback{
  position:fixed;right:20px;bottom:24px;z-index:900;
  display:inline-flex;align-items:center;gap:7px;height:44px;padding:0 18px;
  border-radius:22px;background:#e85a1f;color:#fff;font-size:14px;font-weight:600;
  box-shadow:0 8px 24px rgba(232,90,31,.38);cursor:pointer;border:none;font-family:inherit;
}
.fb-fab-fallback:hover{background:#cf4712;}
.fb-fab-fallback svg{width:18px;height:18px;}

/* ---------- 遮罩与弹窗 ---------- */
.fb-overlay{
  position:fixed;inset:0;z-index:1000;
  background:rgba(20,20,26,.46);backdrop-filter:blur(2px);
  display:flex;align-items:center;justify-content:center;padding:28px 18px;
  opacity:0;pointer-events:none;transition:opacity .2s;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
}
.fb-overlay.fb-open{opacity:1;pointer-events:auto;}
.fb-modal{
  width:100%;max-width:580px;max-height:92vh;background:#fff;border-radius:16px;
  box-shadow:0 24px 60px rgba(20,20,28,.22),0 2px 8px rgba(20,20,28,.08);
  display:flex;flex-direction:column;overflow:hidden;
  transform:translateY(14px) scale(.985);transition:transform .22s cubic-bezier(.2,.8,.25,1);
  color:#1c1c1f;font-size:15px;line-height:1.6;
}
.fb-overlay.fb-open .fb-modal{transform:none;}

.fb-head{display:flex;align-items:flex-start;gap:12px;padding:22px 24px 16px;border-bottom:1px solid #e9e9ec;}
.fb-head-ic{width:38px;height:38px;border-radius:10px;background:#fdf0e8;color:#e85a1f;display:flex;align-items:center;justify-content:center;flex:none;}
.fb-head-ic svg{width:20px;height:20px;}
.fb-head h2{margin:0;font-size:18px;font-weight:650;line-height:1.35;}
.fb-head p{margin:2px 0 0;font-size:12.5px;color:#8a8a92;}
.fb-close{margin-left:auto;width:34px;height:34px;border-radius:8px;color:#8a8a92;display:flex;align-items:center;justify-content:center;flex:none;cursor:pointer;border:none;background:transparent;}
.fb-close:hover{background:#f6f6f8;color:#1c1c1f;}
.fb-close svg{width:18px;height:18px;}

.fb-body{padding:18px 24px 6px;overflow-y:auto;}
.fb-foot{padding:14px 24px 18px;border-top:1px solid #e9e9ec;background:#fcfcfd;display:flex;align-items:center;gap:12px;}

/* ---------- 类型选择 ---------- */
.fb-types{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-bottom:17px;}
.fb-type{
  border:1.5px solid #e9e9ec;border-radius:10px;padding:11px 6px 9px;
  display:flex;flex-direction:column;align-items:center;gap:6px;
  font-size:12.5px;color:#58585f;background:#fff;cursor:pointer;font-family:inherit;transition:.14s;
}
.fb-type svg{width:19px;height:19px;color:#8a8a92;}
.fb-type:hover{border-color:#d7d7db;background:#f6f6f8;}
.fb-type.fb-active{border-color:#e85a1f;background:#fdf0e8;color:#cf4712;font-weight:650;}
.fb-type.fb-active svg{color:#e85a1f;}

/* ---------- 字段 ---------- */
.fb-field{margin-bottom:15px;}
.fb-field>label{display:flex;align-items:center;font-size:13.5px;font-weight:650;margin-bottom:7px;}
.fb-req{color:#e85a1f;margin-left:3px;}
.fb-opt{font-weight:400;color:#8a8a92;font-size:12px;margin-left:7px;}
.fb-textarea{
  width:100%;border:1px solid #d7d7db;border-radius:9px;padding:11px 13px;
  font-size:14px;font-family:inherit;color:#1c1c1f;resize:vertical;line-height:1.6;background:#fff;
}
.fb-textarea:focus{outline:none;border-color:#e85a1f;box-shadow:0 0 0 3px rgba(232,90,31,.12);}
.fb-textarea.fb-invalid{border-color:#dc2626;box-shadow:0 0 0 3px rgba(220,38,38,.1);}
.fb-count{text-align:right;font-size:11.5px;color:#8a8a92;margin-top:4px;}
.fb-errline{display:none;align-items:center;gap:6px;font-size:12.5px;color:#dc2626;margin-top:6px;}
.fb-errline.fb-show{display:flex;}
.fb-errline svg{width:13.5px;height:13.5px;}

/* ---------- 截图 ---------- */
.fb-drop{
  border:1.5px dashed #d7d7db;border-radius:9px;padding:18px 14px;text-align:center;
  color:#8a8a92;font-size:13px;cursor:pointer;transition:.15s;background:#fafafc;
}
.fb-drop:hover,.fb-drop.fb-drag{border-color:#e85a1f;background:#fdf0e8;color:#cf4712;}
.fb-drop svg{width:22px;height:22px;margin:0 auto 5px;display:block;}
.fb-drop b{color:#cf4712;font-weight:650;}
.fb-thumbs{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px;}
.fb-thumb{position:relative;width:76px;height:76px;border-radius:9px;overflow:hidden;border:1px solid #e9e9ec;}
.fb-thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.fb-thumb button{
  position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;
  background:rgba(0,0,0,.62);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;
}
.fb-thumb button svg{width:12px;height:12px;}

/* ---------- 联系方式 ---------- */
.fb-account{
  display:flex;align-items:center;gap:10px;background:#e8f7ee;border:1px solid #bbe7c9;
  border-radius:9px;padding:10px 13px;font-size:13px;color:#157347;margin-bottom:10px;
}
.fb-account .fb-avatar{
  width:28px;height:28px;border-radius:50%;background:#fff;color:#16a34a;border:1px solid #bbe7c9;
  display:flex;align-items:center;justify-content:center;font-weight:650;font-size:12px;flex:none;
}
.fb-account b{font-weight:650;}
.fb-account .fb-switch{margin-left:auto;font-size:12px;color:#8a8a92;text-decoration:underline;cursor:pointer;background:none;border:none;font-family:inherit;}
.fb-input{
  width:100%;height:42px;border:1px solid #d7d7db;border-radius:9px;padding:0 13px;
  font-size:13.5px;font-family:inherit;color:#1c1c1f;background:#fff;
}
.fb-input:focus{outline:none;border-color:#e85a1f;box-shadow:0 0 0 3px rgba(232,90,31,.12);}

/* ---------- 自动采集 ---------- */
.fb-context{border:1px solid #e9e9ec;border-radius:9px;overflow:hidden;margin-bottom:4px;}
.fb-context summary{
  list-style:none;display:flex;align-items:center;gap:8px;padding:10px 13px;
  font-size:12.5px;color:#58585f;cursor:pointer;user-select:none;
}
.fb-context summary::-webkit-details-marker{display:none;}
.fb-context summary .fb-ok-ic{width:14px;height:14px;color:#16a34a;flex:none;}
.fb-context summary .fb-chev{margin-left:auto;transition:transform .2s;color:#8a8a92;width:15px;height:15px;}
.fb-context[open] summary .fb-chev{transform:rotate(180deg);}
.fb-ctx-grid{display:grid;grid-template-columns:88px 1fr;gap:6px 12px;padding:4px 13px 13px;border-top:1px dashed #e9e9ec;font-size:12px;margin:0;}
.fb-ctx-grid dt{color:#8a8a92;padding-top:1px;}
.fb-ctx-grid dd{margin:0;color:#58585f;word-break:break-all;min-width:0;}
.fb-ctx-grid dd.fb-mono{font-family:ui-monospace,"SF Mono","Cascadia Code",Consolas,monospace;font-size:11.5px;}
.fb-ctx-errors{
  grid-column:1/-1;background:#202026;color:#ffd9d0;border-radius:8px;padding:9px 11px;
  font-family:ui-monospace,"SF Mono","Cascadia Code",Consolas,monospace;font-size:11px;line-height:1.55;
  white-space:pre-wrap;word-break:break-all;max-height:120px;overflow:auto;margin-top:4px;
}
.fb-ctx-empty{color:#8a8a92;}

/* ---------- 底部按钮 ---------- */
.fb-privacy{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#8a8a92;cursor:pointer;background:none;border:none;text-align:left;font-family:inherit;padding:0;}
.fb-privacy:hover{color:#cf4712;}
.fb-privacy svg{width:13.5px;height:13.5px;flex:none;}
.fb-foot-btns{margin-left:auto;display:flex;gap:10px;}
.fb-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  border-radius:9px;font-size:14px;font-weight:650;height:40px;padding:0 18px;
  cursor:pointer;font-family:inherit;transition:.15s;white-space:nowrap;
}
.fb-btn svg{width:16px;height:16px;}
.fb-btn-ghost{border:1px solid #d7d7db;color:#58585f;background:#fff;}
.fb-btn-ghost:hover{background:#f6f6f8;color:#1c1c1f;}
.fb-btn-brand{background:#e85a1f;color:#fff;border:1px solid #e85a1f;}
.fb-btn-brand:hover{background:#cf4712;border-color:#cf4712;}
.fb-btn-brand:disabled{opacity:.7;cursor:not-allowed;}
.fb-spin{animation:fb-spin .8s linear infinite;}
@keyframes fb-spin{to{transform:rotate(360deg);}}

/* 提交失败条 */
.fb-submit-err{
  display:none;align-items:flex-start;gap:8px;margin:0 24px 4px;padding:10px 13px;
  background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;border-radius:9px;font-size:12.5px;
}
.fb-submit-err.fb-show{display:flex;}
.fb-submit-err svg{width:15px;height:15px;flex:none;margin-top:2px;}

/* ---------- 成功态 ---------- */
.fb-success{padding:38px 30px 32px;text-align:center;}
.fb-ok-ring{
  width:64px;height:64px;border-radius:50%;background:#e8f7ee;color:#16a34a;
  display:flex;align-items:center;justify-content:center;margin:0 auto 16px;
  animation:fb-pop .4s cubic-bezier(.2,1.4,.4,1);
}
.fb-ok-ring svg{width:32px;height:32px;}
@keyframes fb-pop{from{transform:scale(.4);opacity:0;}to{transform:scale(1);opacity:1;}}
.fb-success h3{margin:0 0 7px;font-size:20px;font-weight:650;}
.fb-success>p{margin:0 auto 20px;font-size:13.5px;color:#8a8a92;max-width:380px;}
.fb-ticket{
  display:inline-flex;align-items:center;gap:10px;border:1.5px dashed #d7d7db;border-radius:10px;
  padding:11px 16px;background:#fafafc;margin-bottom:22px;
}
.fb-ticket .fb-tk-label{font-size:12px;color:#8a8a92;}
.fb-ticket .fb-tk-no{font-family:ui-monospace,"SF Mono","Cascadia Code",Consolas,monospace;font-size:16px;font-weight:700;color:#cf4712;letter-spacing:.03em;}
.fb-ticket button{color:#8a8a92;display:flex;padding:4px;border-radius:6px;cursor:pointer;background:none;border:none;}
.fb-ticket button:hover{color:#e85a1f;background:#fdf0e8;}
.fb-success-btns{display:flex;gap:10px;justify-content:center;}

/* ---------- 轻提示 ---------- */
.fb-mini-toast{
  position:fixed;left:50%;bottom:84px;transform:translateX(-50%) translateY(10px);z-index:1100;
  background:#1c1c1f;color:#fff;font-size:13px;padding:9px 16px;border-radius:9px;
  opacity:0;pointer-events:none;transition:.2s;max-width:90vw;text-align:center;
}
.fb-mini-toast.fb-show{opacity:1;transform:translateX(-50%) translateY(0);}

/* ---------- 响应式：移动端底部抽屉 ---------- */
@media (max-width:860px){
  .fb-types{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:600px){
  .fb-overlay{padding:0;align-items:flex-end;}
  .fb-modal{max-height:94vh;border-radius:16px 16px 0 0;}
  .fb-foot{flex-wrap:wrap;}
  .fb-foot-btns{width:100%;}
  .fb-foot-btns .fb-btn{flex:1;}
  .fb-ctx-grid{grid-template-columns:76px 1fr;}
}
@media (prefers-reduced-motion:reduce){
  .fb-overlay,.fb-modal,.fb-ok-ring{animation:none!important;transition:none!important;}
}
