.feishu-global-launcher {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(130, 145, 175, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-secondary, #62718a);
  font: 600 13px/1 inherit;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.feishu-global-launcher:hover {
  color: var(--primary, #6678e8);
  border-color: rgba(102, 120, 232, 0.45);
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.feishu-global-launcher kbd,
.fgs-shortcut {
  min-width: 26px;
  padding: 3px 6px;
  border: 1px solid rgba(130, 145, 175, 0.25);
  border-bottom-color: rgba(96, 110, 140, 0.42);
  border-radius: 5px;
  background: rgba(244, 247, 252, 0.9);
  color: #7b879c;
  font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  box-shadow: 0 1px 0 rgba(52, 64, 84, 0.08);
}

.fgs-lock-scroll { overflow: hidden !important; }

.fgs-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: min(9vh, 72px) 20px 20px;
  background: rgba(14, 23, 40, 0.46);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.fgs-overlay.is-open { display: flex; }

.fgs-dialog {
  width: min(900px, 100%);
  max-height: min(82vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(206, 215, 232, 0.9);
  border-radius: 8px;
  background: rgba(251, 252, 255, 0.98);
  color: #263349;
  box-shadow: 0 26px 80px rgba(25, 37, 65, 0.28), 0 4px 18px rgba(25, 37, 65, 0.12);
  transform: translateY(-8px) scale(.99);
  opacity: 0;
  animation: fgs-enter .18s ease forwards;
}

@keyframes fgs-enter {
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.fgs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}

.fgs-app-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fff;
  background: #526de8;
  box-shadow: 0 8px 18px rgba(82, 109, 232, .24);
}

.fgs-title { min-width: 0; flex: 1; }
.fgs-title strong { display: block; font-size: 16px; line-height: 1.3; }
.fgs-title span { display: block; margin-top: 2px; color: #8490a5; font-size: 12px; }

.fgs-close,
.fgs-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dce3ef;
  border-radius: 7px;
  background: #fff;
  color: #708099;
  cursor: pointer;
}

.fgs-close:hover,
.fgs-icon-btn:hover { color: #4f67dc; border-color: #bfcaf4; background: #f5f7ff; }

.fgs-search-wrap { padding: 0 18px 12px; }
.fgs-search {
  height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 10px;
  border: 1px solid #cfd8e7;
  border-radius: 8px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.fgs-search:focus-within { border-color: #7689ed; box-shadow: 0 0 0 3px rgba(102, 120, 232, .12); }
.fgs-search > i { color: #7a89a1; text-align: center; }
.fgs-search input {
  width: 100%; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent;
  color: #263349; font: 500 15px/1.4 inherit;
}
.fgs-search input::placeholder { color: #a0aabd; }
.fgs-search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.fgs-search-clear { display: none; }
.fgs-search-clear.is-visible { display: inline-grid; }

.fgs-filters {
  padding: 0 18px 13px;
  border-bottom: 1px solid #e6ebf3;
}

.fgs-filter-main {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.fgs-segments {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #dce3ef;
  border-radius: 7px;
  background: #f5f7fb;
}
.fgs-segments button {
  height: 30px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent;
  color: #718098; font: 600 12px/1 inherit; cursor: pointer;
}
.fgs-segments button.is-active { background: #fff; color: #526de8; box-shadow: 0 1px 4px rgba(55, 70, 105, .12); }

.fgs-select,
.fgs-field input {
  width: 100%; height: 38px; min-width: 0; border: 1px solid #d8e0ec; border-radius: 7px;
  background: #fff; color: #425069; padding: 0 10px; font: 500 13px/1 inherit; outline: none;
}
.fgs-select:focus,
.fgs-field input:focus { border-color: #7689ed; box-shadow: 0 0 0 3px rgba(102, 120, 232, .1); }

.fgs-more {
  height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px;
  border: 1px solid #d8e0ec; border-radius: 7px; background: #fff; color: #64748c;
  font: 600 13px/1 inherit; cursor: pointer; white-space: nowrap;
}
.fgs-more:hover { color: #526de8; border-color: #bfcaf4; }
.fgs-more i:last-child { font-size: 10px; transition: transform .18s ease; }
.fgs-more[aria-expanded="true"] i:last-child { transform: rotate(180deg); }

.fgs-advanced {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding-top: 11px;
}
.fgs-advanced.is-open { display: grid; }
.fgs-field { min-width: 0; }
.fgs-field label { display: block; margin: 0 0 5px; color: #7b879b; font-size: 11px; font-weight: 600; }
.fgs-reset { height: 38px; padding: 0 11px; border: 0; background: transparent; color: #748198; cursor: pointer; }
.fgs-reset:hover { color: #526de8; }

.fgs-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  color: #7c899d;
  font-size: 12px;
  background: #f8f9fc;
  border-bottom: 1px solid #e8edf4;
}
.fgs-status strong { color: #43516a; }
.fgs-status-error { color: #c44f55 !important; }

.fgs-results {
  min-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.fgs-result {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 132px 34px;
  gap: 12px;
  align-items: start;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid #ebeff5;
  background: transparent;
  cursor: pointer;
  transition: background .15s ease;
}
.fgs-result:hover,
.fgs-result.is-selected { background: #f4f6ff; }
.fgs-result:last-child { border-bottom: 0; }
.fgs-avatar {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px;
  background: #e9edff; color: #526de8; font-size: 14px; font-weight: 700;
}
.fgs-result-main { min-width: 0; }
.fgs-result-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.fgs-result-meta strong { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.fgs-sender { color: #7f8ca0; font-size: 12px; }
.fgs-type {
  padding: 2px 6px; border-radius: 5px; background: #eef1f6; color: #758198; font-size: 10px; font-weight: 600;
}
.fgs-message {
  display: block;
  margin: 0;
  overflow: visible;
  color: #415069;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fgs-message mark { padding: 0 2px; border-radius: 2px; background: #fff0a8; color: #5e4a00; }
.fgs-time { padding-top: 2px; text-align: right; color: #8793a6; font-size: 11px; line-height: 1.5; }
.fgs-time strong { display: block; color: #5d6a80; font-size: 12px; }
.fgs-copy { opacity: 0; }
.fgs-result:hover .fgs-copy,
.fgs-result.is-selected .fgs-copy { opacity: 1; }

.fgs-empty {
  min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; color: #8894a8;
}
.fgs-empty i { margin-bottom: 13px; color: #aab5c8; font-size: 28px; }
.fgs-empty strong { color: #4b596f; font-size: 14px; }
.fgs-empty span { margin-top: 6px; font-size: 12px; }
.fgs-spinner { animation: fgs-spin .8s linear infinite; }
@keyframes fgs-spin { to { transform: rotate(360deg); } }

.fgs-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-top: 1px solid #e6ebf3;
  background: #fbfcfe;
}
.fgs-footer-hint { color: #8a96aa; font-size: 11px; }
.fgs-pager { display: flex; align-items: center; gap: 8px; }
.fgs-pager span { min-width: 68px; text-align: center; color: #6f7d93; font-size: 12px; }
.fgs-pager button { width: 32px; height: 30px; }

.fgs-toast {
  position: absolute; left: 50%; bottom: 58px; z-index: 2; transform: translateX(-50%) translateY(6px);
  padding: 8px 12px; border-radius: 6px; background: rgba(38, 51, 73, .94); color: #fff;
  font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.fgs-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .feishu-global-launcher span { display: none; }
  .feishu-global-launcher kbd { display: none; }
  .feishu-global-launcher { width: 38px; padding: 0; justify-content: center; }
  .fgs-overlay { padding: 0; align-items: stretch; }
  .fgs-dialog { width: 100%; max-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; }
  .fgs-head { padding: 12px 14px 10px; }
  .fgs-title span { display: none; }
  .fgs-search-wrap, .fgs-filters { padding-inline: 14px; }
  .fgs-filter-main { grid-template-columns: 1fr auto; }
  .fgs-segments { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); }
  .fgs-advanced { grid-template-columns: 1fr 1fr; }
  .fgs-reset { grid-column: 1 / -1; }
  .fgs-result { grid-template-columns: 34px minmax(0, 1fr) 32px; padding-inline: 14px; gap: 10px; }
  .fgs-time { grid-column: 2; grid-row: 2; text-align: left; display: flex; gap: 6px; }
  .fgs-time strong { display: inline; }
  .fgs-copy { opacity: 1; grid-column: 3; grid-row: 1; }
  .fgs-footer { padding-inline: 14px; }
  .fgs-footer-hint { display: none; }
}

@media (max-width: 430px) {
  .fgs-advanced { grid-template-columns: 1fr; }
  .fgs-status { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 7px; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .fgs-dialog { animation: none; opacity: 1; transform: none; }
  .fgs-spinner { animation: none; }
}
