/* gdus.work floating widgets: feedback + restricted AI assistant.
   Everything is namespaced with .gw- / #gdus-widget-root so the mirrored
   Qifeiye/WordPress theme CSS cannot leak into (or break) these panels. */
#gdus-widget-root,
#gdus-widget-root *,
#gdus-widget-root *::before,
#gdus-widget-root *::after {
  box-sizing: border-box;
}
#gdus-widget-root {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
               "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #20303f;
  -webkit-font-smoothing: antialiased;
}
#gdus-widget-root button,
#gdus-widget-root input,
#gdus-widget-root textarea {
  font-family: inherit;
  font-size: 14px;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}
#gdus-widget-root button { cursor: pointer; }

.gw-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.gw-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 17px 0 15px;
  border: 0;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, #1274c9 0%, #0a4f9e 100%);
  box-shadow: 0 6px 18px rgba(8, 62, 124, .32);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.gw-btn:hover  { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(8, 62, 124, .40); }
.gw-btn:active { transform: translateY(0); }
.gw-btn:focus-visible { outline: 3px solid #7fc0ff; outline-offset: 2px; }
.gw-btn svg   { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor;
                stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gw-btn-ai    { background: linear-gradient(135deg, #17a2a2 0%, #0b6f9c 100%);
                box-shadow: 0 6px 18px rgba(9, 96, 116, .30); }
.gw-btn-ai:hover { box-shadow: 0 9px 22px rgba(9, 96, 116, .42); }
.gw-btn.is-open { opacity: .55; }

.gw-panel {
  position: fixed;
  right: 22px;
  bottom: 138px;
  z-index: 2147483001;
  width: 366px;
  max-height: min(600px, calc(100vh - 170px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(10, 79, 158, .10);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(12, 45, 84, .24);
  animation: gw-rise .2s ease-out;
}
.gw-panel[hidden] { display: none !important; }
@keyframes gw-rise {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.gw-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(120deg, #1274c9, #0a4f9e);
}
.gw-panel-chat { height: min(540px, calc(100vh - 170px)); }
/* Lift the header above the scrolling transcript so a clipped half-line
   reads as scrolled content instead of a broken layout. */
.gw-panel-chat .gw-head {
  position: relative; z-index: 1;
  background: linear-gradient(120deg, #17a2a2, #0b6f9c);
  box-shadow: 0 3px 10px rgba(6, 51, 73, .18);
}
.gw-head-icon {
  width: 30px; height: 30px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; background: rgba(255, 255, 255, .18);
}
.gw-head-icon svg { width: 17px; height: 17px; fill: none; stroke: #fff;
                    stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gw-head-txt { flex: 1; min-width: 0; }
.gw-head-txt b { display: block; font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.gw-head-txt small { display: block; font-size: 11px; opacity: .82; }
.gw-x {
  flex: none; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 7px; background: transparent;
  color: #fff; font-size: 21px; line-height: 1;
}
.gw-x:hover { background: rgba(255, 255, 255, .18); }
.gw-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ---------- feedback ---------- */
.gw-fbody { padding: 15px 16px 17px; }
.gw-lead { margin: 0 0 12px; font-size: 12.5px; color: #5c6b7a; }
.gw-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; margin-bottom: 14px;
  border: 1px solid #dbe9f7; border-radius: 10px;
  background: linear-gradient(180deg, #f4f9ff, #fbfdff);
}
.gw-card-ico {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #1274c9; color: #fff; font-size: 13px; font-weight: 700;
}
.gw-card b { display: block; font-size: 12.5px; color: #0a4f9e; }
.gw-card a  { display: inline-block; margin-top: 2px; font-size: 14px;
              font-weight: 700; color: #0a5bb2; text-decoration: none;
              word-break: break-all; }
.gw-card a:hover { text-decoration: underline; }
.gw-card span { display: block; font-size: 12px; color: #6b7b8b; margin-top: 3px; }
.gw-field { margin-bottom: 10px; }
.gw-field > label { display: block; margin-bottom: 5px; font-size: 12px;
                    color: #4a5b6c; font-weight: 600; }
.gw-field i { color: #e05252; font-style: normal; }
.gw-input, .gw-textarea {
  display: block; width: 100%; padding: 9px 11px;
  border: 1px solid #d7e0e9; border-radius: 8px;
  background: #fff; color: #20303f; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.gw-input:focus, .gw-textarea:focus {
  border-color: #1274c9; box-shadow: 0 0 0 3px rgba(18, 116, 201, .12);
}
.gw-textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.gw-2col { display: flex; gap: 9px; }
.gw-2col > .gw-field { flex: 1; min-width: 0; }
.gw-hp { position: absolute !important; left: -9999px !important;
         width: 1px !important; height: 1px !important; overflow: hidden !important; }
.gw-submit {
  width: 100%; height: 40px; margin-top: 3px;
  border: 0; border-radius: 8px; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, #1274c9, #0a4f9e);
}
.gw-submit:hover:not(:disabled) { filter: brightness(1.07); }
.gw-submit:disabled { opacity: .6; cursor: default; }
.gw-note { margin-top: 9px; min-height: 18px; font-size: 12px; color: #5c6b7a; }
.gw-note.ok  { color: #12864c; }
.gw-note.err { color: #c23b3b; }

/* ---------- chat ---------- */
.gw-msgs { padding: 15px 14px 6px; }
.gw-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.gw-msg.user { flex-direction: row-reverse; }
.gw-avatar {
  width: 27px; height: 27px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; background: #0b6f9c;
}
.gw-msg.user .gw-avatar { background: #8fa2b4; }
.gw-bubble {
  max-width: 82%; padding: 9px 12px; border-radius: 11px;
  font-size: 13px; white-space: pre-wrap; word-break: break-word;
  background: #f1f5f9; color: #26384a;
  border-top-left-radius: 3px;
}
.gw-msg.user .gw-bubble {
  background: #0a5bb2; color: #fff; border-top-left-radius: 11px;
  border-top-right-radius: 3px;
}
.gw-bubble.typing { color: #7a8b9c; letter-spacing: 2px; }
.gw-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px 47px; }
.gw-chip {
  padding: 5px 10px; border: 1px solid #cfe1f2; border-radius: 14px;
  background: #f7fbff; color: #0a5bb2; font-size: 12px;
}
.gw-chip:hover { background: #e8f3ff; }
.gw-chips[hidden] { display: none !important; }  /* display:flex overrides UA [hidden] */
.gw-compose {
  flex: none; display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 12px; border-top: 1px solid #e8eef4; background: #fafcfe;
}
.gw-compose textarea {
  flex: 1; min-width: 0; height: 38px; max-height: 88px;
  padding: 9px 10px; border: 1px solid #d7e0e9; border-radius: 8px;
  background: #fff; color: #20303f; outline: none; resize: none;
}
.gw-compose textarea:focus { border-color: #17a2a2; }
.gw-send {
  flex: none; height: 38px; padding: 0 15px; border: 0; border-radius: 8px;
  color: #fff; font-weight: 700; background: #0b6f9c;
}
.gw-send:hover:not(:disabled) { filter: brightness(1.08); }
.gw-send:disabled { opacity: .55; cursor: default; }
.gw-foot { flex: none; padding: 7px 12px 9px; text-align: center;
           font-size: 11px; color: #93a1af; background: #fafcfe; }

/* ---------- mobile ---------- */
@media (max-width: 520px) {
  .gw-dock { right: 12px; bottom: 12px; gap: 8px; }
  .gw-btn { height: 46px; width: 46px; padding: 0; justify-content: center; border-radius: 50%; }
  .gw-btn span { display: none; }
  .gw-panel {
    right: 12px; left: 12px; bottom: 108px; width: auto;
    max-height: calc(100vh - 130px);
  }
  .gw-panel-chat { height: min(520px, calc(100vh - 130px)); }
  .gw-bubble { max-width: 86%; }
}
