/* ==========================================================================
   AIBuy Social, Floating Search & X-Style Polish (2026-11-24 v3)
   1. AI 资源对接: X (Twitter) feed redesign + compact Search Icon button
   2. AI 工具: Ultra-clean card (no "访问官网", no divider, no visit count) + 3 aligned icons (♡ ☆ 💬) + compact Search Icon
   3. AI 比价库: Zero-height-bloat Line-1 inline 3 icons (♡ ☆ 💬) + compact Search Icon
   4. 交易避坑: Compact Search Icon + homepage URL submission + rail clip
   5. Floating Search Modal (.aibuy-smodal) with built-in Blocked Words (屏蔽词) & Douyin-style results
   6. Floating Comment Popover Window (.aibuy-cmodal) with AI moderation feedback
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Eliminate Wasted Top Toolbar & Header Rows (Desktop) + Hide Bulky Search Bars
   -------------------------------------------------------------------------- */
:root:not(#_v3) .match-board .match-controls .match-search,
:root:not(#_v3) .match-board .match-controls .match-blocked-toggle,
:root:not(#_v3) .risk-board .risk-toolbar .risk-search,
:root:not(#_v3) .directory-tools-shell .directory-search-form {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Desktop: remove the entire 48px wasted header row on AI 资源对接 & 交易避坑!
   Both the feed column and detail column now start flush from the very top edge. */
@media (min-width: 701px) {
  :root:not(#_v3) .match-board .match-columns {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  :root:not(#_v3) .match-board .match-columns::after,
  :root:not(#_v3) .risk-board .risk-main::after {
    display: none !important;
  }

  :root:not(#_v3) .match-board .match-columns > .match-controls,
  :root:not(#_v3) .risk-board .risk-main > .risk-toolbar {
    display: block !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  :root:not(#_v3) .match-board .match-columns > .match-list {
    grid-column: 1 !important;
    grid-row: 1 !important;
    height: 100% !important;
  }

  :root:not(#_v3) .match-board .match-columns > .match-resizer {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  :root:not(#_v3) .match-board .match-columns > .match-detail {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  :root:not(#_v3) .match-board .match-list:not(.aibuy-has-search) > .match-list-heading,
  :root:not(#_v3) .risk-board .risk-list:not(.aibuy-has-search) > .risk-list-heading {
    display: none !important;
  }

  :root:not(#_v3) .match-board .match-list:not(.aibuy-has-search) > .match-list-scroll,
  :root:not(#_v3) .risk-board .risk-list:not(.aibuy-has-search) > .risk-list-scroll {
    padding-top: 0 !important;
    scroll-padding-top: 0 !important;
  }

  /* Same zero-waste flush top edge for 交易避坑 */
  :root:not(#_v3) .risk-board .risk-main {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  :root:not(#_v3) .risk-board .risk-list,
  :root:not(#_v3) .risk-board .risk-detail {
    grid-row: 1 !important;
    height: 100% !important;
  }
}

/* Left-Sidebar Refined Compact Compose CTA (Soft Emerald Pill, Pixel-Locked Icon!) */
.aibuy-rail-compose {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  height: 32px;
  margin: 0 0 8px;
  padding: 0 10px 0 13.5px; /* 13.5 + 1px border = 14.5px exact icon axis match! */
  border: 1px solid color-mix(in srgb, var(--ui-accent, #1f6b53) 26%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ui-accent, #1f6b53) 10%, transparent);
  color: var(--ui-accent, #1f6b53) !important;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 140ms cubic-bezier(0.22, 1, 0.36, 1), padding 0.36s cubic-bezier(0.22, 1, 0.36, 1), gap 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.aibuy-rail-compose:hover {
  background: var(--ui-accent, #1f6b53);
  border-color: var(--ui-accent, #1f6b53);
  color: #ffffff !important;
}

.aibuy-rail-compose:active {
  transform: scale(0.97);
}

.aibuy-rail-compose svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
}

.aibuy-rail-compose-label {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: max-width 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
  max-width: 140px;
  opacity: 1;
}

html[data-theme="dark"] .aibuy-rail-compose {
  background: rgba(65, 184, 131, 0.14);
  border-color: rgba(110, 231, 183, 0.28);
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .aibuy-rail-compose:hover {
  background: #228061;
  border-color: #228061;
  color: #ffffff !important;
}

@media (min-width: 701px) {
  .is-rail-collapsed .aibuy-rail-compose {
    padding-left: 13.5px !important;
    padding-right: 0 !important;
    gap: 0 !important;
  }

  .is-rail-collapsed .aibuy-rail-compose .aibuy-rail-compose-label {
    max-width: 0 !important;
    opacity: 0 !important;
  }
}

/* Mobile X-Style Floating Compose FAB + Left-Origin Filter Drawer + Sleek 4-Board Mobile Layout */
.aibuy-mobile-fab,
.aibuy-mob-seg,
.aibuy-mob-plat-wrap,
.aibuy-mob-tools-search,
.aibuy-mob-tools-cats,
.aibuy-risk-mob-hint {
  display: none;
}

@media (max-width: 700px) {
  /* Critical: NEVER show desktop .risk-rail sidebar on mobile phones */
  :root:not(#_v3) .risk-board > .risk-rail {
    display: none !important;
  }

  /* Hide native top-right + button on mobile so ONLY the X-style bottom-right FAB appears */
  :root:not(#_v3) .match-board .match-toolbar .match-publish,
  :root:not(#_v3) .risk-board .risk-toolbar .risk-publish {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Hide top filter strip when reading a post / risk detail on mobile */
  :root:not(#_v3) .match-board.aibuy-mob-detail-open .match-controls,
  :root:not(#_v3) .match-board.aibuy-mob-detail-open .match-controls-inner,
  :root:not(#_v3) .match-board.aibuy-mob-detail-open .match-toolbar,
  :root:not(#_v3) .match-board.aibuy-mob-detail-open .match-mobile-filters,
  :root:not(#_v3) .risk-board.aibuy-mob-detail-open .risk-toolbar,
  :root:not(#_v3) .risk-board.aibuy-mob-detail-open .risk-mobile-filter {
    display: none !important;
  }

  /* X-Style bottom-right floating + FAB (auto-hides on detail views & other tabs!) */
  .aibuy-mobile-fab {
    position: fixed;
    right: 16px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    z-index: 88;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--ui-accent, #1f6b53);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 62, 45, 0.34), 0 2px 6px rgba(15, 62, 45, 0.16);
    cursor: pointer;
    opacity: 1;
    transform: scale(1);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1), background-color 150ms ease;
    -webkit-tap-highlight-color: transparent;
  }

  .aibuy-mobile-fab:active {
    transform: scale(0.92);
  }

  .aibuy-mobile-fab.is-hidden {
    opacity: 0;
    transform: scale(0.75);
    pointer-events: none;
  }

  .aibuy-mobile-fab svg {
    width: 23px;
    height: 23px;
  }

  html[data-theme="dark"] .aibuy-mobile-fab {
    background: #228061;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55);
  }
}

@media (max-width: 650px) {
  /* ========================================================================
     Board 1 (Mobile): AI 资源对接 — Balanced Top Filter Bar + Zero-Duplicate Dropdown
     ======================================================================== */
  /* Fix CSS Grid row-2 offset bug: pin dropdown snugly right beneath the top-left button! */
  :root:not(#_v3) .match-mobile-filters {
    grid-area: auto !important;
    grid-row: 1 / -1 !important;
    top: calc(100% + 4px) !important;
    transform-origin: 0% 0% !important;
    padding: 10px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  /* Remove duplicated 方向 (already in 全部/供/求) & 平台 (already on top bar) from dropdown! */
  :root:not(#_v3) .match-mobile-filters select[aria-label="方向"],
  :root:not(#_v3) .match-mobile-filters select[aria-label="平台"] {
    display: none !important;
  }

  :root:not(#_v3) .match-mobile-filters > select {
    flex: 1 1 calc(50% - 4px) !important;
    width: auto !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
  }

  :root:not(#_v3) .match-mobile-filters > button {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
  }

  /* Fix Risk mobile filter dropdown origin & exact top position directly under risk-toolbar */
  html:not(#a1):not(#a2):not(#a3):not(#a4):not(#_v3) .directory-risk-shell .risk-main > .risk-mobile-filter,
  :root:not(#_v3) .risk-mobile-filter {
    top: calc(var(--h92-top, 50px) + 48px) !important;
    transform-origin: 0% 0% !important;
  }

  /* Compact, purposeful mobile filter bar */
  :root:not(#_v3) .directory-main-matching .match-toolbar,
  :root:not(#_v3) .risk-board .risk-toolbar {
    min-height: 44px !important;
    height: 44px !important;
    padding: 4px 12px !important;
  }

  :root:not(#_v3) .match-board .match-toolbar-main,
  :root:not(#_v3) .risk-board .risk-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 7px !important;
    width: 100% !important;
  }

  :root:not(#_v3) .v15-filter-toggle {
    order: 1 !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    height: 32px !important;
    padding: 0 11px !important;
    gap: 5px !important;
    border-radius: 999px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }

  :root:not(#_v3) .v15-filter-toggle svg {
    width: 14.5px !important;
    height: 14.5px !important;
    flex: 0 0 14.5px !important;
  }

  :root:not(#_v3) .match-board .v15-filter-toggle::after,
  :root:not(#_v3) .risk-board .v15-filter-toggle::after {
    content: "筛选";
    line-height: 1;
    white-space: nowrap;
  }

  /* On matching board, render badge from data-aibuy-cnt (only non-topbar dropdown filters!) */
  :root:not(#_v3) .match-board .v15-filter-toggle .v15-badge {
    display: none !important;
  }

  :root:not(#_v3) .match-board .v15-filter-toggle[data-aibuy-cnt]:not([data-aibuy-cnt=""])::after {
    content: "筛选·" attr(data-aibuy-cnt);
  }

  :root:not(#_v3) .match-board .v15-filter-toggle.has-active:not([aria-expanded="true"]):not([data-aibuy-cnt]),
  :root:not(#_v3) .match-board .v15-filter-toggle.has-active:not([aria-expanded="true"])[data-aibuy-cnt=""] {
    background: var(--ui-surface, #ffffff) !important;
    border-color: color-mix(in srgb, var(--ui-line, #d6e2dc) 95%, transparent) !important;
    color: var(--ui-text, #162921) !important;
  }

  :root:not(#_v3) .match-board .v15-filter-toggle[data-aibuy-cnt]:not([data-aibuy-cnt=""]):not([aria-expanded="true"]) {
    background: color-mix(in srgb, var(--ui-accent, #1f6b53) 10%, var(--ui-surface, #ffffff)) !important;
    border-color: color-mix(in srgb, var(--ui-accent, #1f6b53) 45%, transparent) !important;
    color: var(--ui-accent, #1f6b53) !important;
  }

  html[data-theme="dark"]:not(#_v3) .v15-filter-toggle {
    background: rgba(65, 184, 131, 0.12) !important;
    border-color: rgba(110, 231, 183, 0.28) !important;
    color: #6ee7b7 !important;
  }

  html[data-theme="dark"]:not(#_v3) .v15-filter-toggle[aria-expanded="true"] {
    background: #228061 !important;
    border-color: #228061 !important;
    color: #ffffff !important;
  }

  /* Center Quick Platform Pill in AI 资源对接 mobile bar */
  .aibuy-mob-plat-wrap {
    order: 2;
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 84px;
    max-width: 158px;
    height: 32px;
  }

  .aibuy-mob-plat-select {
    width: 100%;
    height: 32px;
    padding: 0 24px 0 11px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ui-line, #d6e2dc) 95%, transparent);
    background: var(--ui-surface, #ffffff);
    color: color-mix(in srgb, var(--ui-text, #162921) 84%, transparent);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
  }

  .aibuy-mob-plat-select.is-active {
    border-color: color-mix(in srgb, var(--ui-accent, #1f6b53) 48%, transparent);
    background: color-mix(in srgb, var(--ui-accent, #1f6b53) 9%, var(--ui-surface, #ffffff));
    color: var(--ui-accent, #1f6b53);
  }

  .aibuy-mob-plat-chev {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    pointer-events: none;
    color: color-mix(in srgb, var(--ui-text, #23392d) 52%, transparent);
  }

  .aibuy-mob-plat-select.is-active + .aibuy-mob-plat-chev {
    color: var(--ui-accent, #1f6b53);
  }

  html[data-theme="dark"] .aibuy-mob-plat-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(154, 204, 181, 0.18);
    color: rgba(226, 240, 233, 0.88);
  }

  html[data-theme="dark"] .aibuy-mob-plat-select.is-active {
    background: rgba(65, 184, 131, 0.18);
    border-color: rgba(110, 231, 183, 0.42);
    color: #6ee7b7;
  }

  html[data-theme="dark"] .aibuy-mob-plat-chev {
    color: rgba(203, 224, 214, 0.65);
  }

  /* Quick iOS-style 全部 / 供 / 求 segmented control on the right side of the mobile filter bar */
  .aibuy-mob-seg {
    order: 3;
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ui-text, #162921) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--ui-line, #dce6e1) 80%, transparent);
    flex: 0 0 auto;
  }

  html[data-theme="dark"] .aibuy-mob-seg {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(154, 204, 181, 0.14);
  }

  .aibuy-mob-seg button {
    height: 26px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: color-mix(in srgb, var(--ui-text, #23392d) 64%, transparent);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
    -webkit-tap-highlight-color: transparent;
  }

  .aibuy-mob-seg button.is-active {
    background: var(--ui-surface, #ffffff);
    color: var(--ui-accent, #1f6b53);
    box-shadow: 0 1px 3px rgba(10, 30, 20, 0.1);
  }

  html[data-theme="dark"] .aibuy-mob-seg button {
    color: rgba(203, 224, 214, 0.68);
  }

  html[data-theme="dark"] .aibuy-mob-seg button.is-active {
    background: rgba(65, 184, 131, 0.22);
    color: #6ee7b7;
    box-shadow: none;
  }

  /* Subtle right-aligned status pill on mobile 交易避坑 bar */
  .aibuy-risk-mob-hint {
    order: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 500;
    color: color-mix(in srgb, var(--ui-text, #23392d) 54%, transparent);
    white-space: nowrap;
  }

  html[data-theme="dark"] .aibuy-risk-mob-hint {
    color: rgba(203, 224, 214, 0.62);
  }

  /* ========================================================================
     Board 2 (Mobile): AI 比价库 — Proper Top Breathing Room & Sleek Picker/Sort Rhythm
     ======================================================================== */
  :root:not(#_v3) .price-workspace > .mobile-price-picker {
    padding: 12px 0 8px !important;
    margin: 0 !important;
    gap: 8px !important;
  }

  :root:not(#_v3) .mobile-price-picker button {
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 11px !important;
    gap: 7px !important;
    border-radius: 11px !important;
    border: 1px solid color-mix(in srgb, var(--ui-line, #d6e2dc) 95%, transparent) !important;
    background: var(--ui-surface, #ffffff) !important;
    box-shadow: 0 1px 3px rgba(10, 34, 24, 0.045) !important;
    transition: border-color 150ms ease, background-color 150ms ease !important;
  }

  :root:not(#_v3) .mobile-price-picker button strong {
    font-size: 13px !important;
    font-weight: 650 !important;
    letter-spacing: -0.01em !important;
  }

  :root:not(#_v3) .mobile-price-picker button svg {
    width: 15px !important;
    height: 15px !important;
  }

  html[data-theme="dark"]:not(#_v3) .mobile-price-picker button {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(154, 204, 181, 0.16) !important;
    box-shadow: none !important;
  }

  :root:not(#_v3) .directory-workspace-deals .price-quotes-top {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
  }

  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading {
    padding: 0 0 4px !important;
    margin: 0 !important;
    min-height: 0 !important;
    border-bottom: 0 !important;
  }

  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading-row {
    padding: 0 !important;
    margin: 0 !important;
  }

  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading .price-snapshot-note {
    font-size: 11px !important;
    line-height: 1.35 !important;
    padding: 0 2px !important;
    margin: 0 !important;
    opacity: 0.72 !important;
  }

  :root:not(#_v3) .directory-workspace-deals .mobile-price-sort {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 2px 6px !important;
    margin: 0 0 4px !important;
    gap: 8px !important;
    border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent) !important;
  }

  :root:not(#_v3) .directory-workspace-deals .mobile-price-sort > span {
    font-size: 11.5px !important;
    margin-right: 2px !important;
    opacity: 0.7 !important;
  }

  :root:not(#_v3) .directory-workspace-deals .mobile-price-sort .price-sort-button {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--ui-text, #162921) 5%, transparent) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
  }

  html[data-theme="dark"]:not(#_v3) .directory-workspace-deals .mobile-price-sort .price-sort-button {
    background: rgba(255, 255, 255, 0.07) !important;
  }

  /* ========================================================================
     Board 3 (Mobile): AI 工具 — Cohesive Search Pill + Category Trigger + Quick Category Bar
     ======================================================================== */
  :root:not(#_v3) .directory-tools-shell .directory-tools-search {
    position: relative !important;
    top: auto !important;
    margin: 0 !important;
    padding: 10px 0 6px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    height: auto !important;
    min-height: 0 !important;
  }

  :root:not(#_v3) .directory-tools-shell .mobile-directory-toolbar {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  :root:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button[aria-controls="mobile-tool-categories"] {
    flex: 0 0 auto !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 12px !important;
    gap: 5px !important;
    border-radius: 999px !important;
    border: 1px solid color-mix(in srgb, var(--ui-accent, #1f6b53) 26%, var(--ui-line, #d6e2dc)) !important;
    background: var(--ui-surface, #ffffff) !important;
    color: var(--ui-text, #162921) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(10, 34, 24, 0.045) !important;
  }

  :root:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button[aria-controls="mobile-tool-categories"] svg {
    width: 15px !important;
    height: 15px !important;
    color: var(--ui-accent, #1f6b53) !important;
  }

  html[data-theme="dark"]:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button[aria-controls="mobile-tool-categories"] {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(110, 231, 183, 0.24) !important;
    color: #eef7f3 !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"]:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button[aria-controls="mobile-tool-categories"] svg {
    color: #6ee7b7 !important;
  }

  :root:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button.aibuy-mob-tools-search {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    border: 1px solid color-mix(in srgb, var(--ui-line, #d6e2dc) 95%, transparent) !important;
    background: var(--ui-surface, #ffffff) !important;
    color: color-mix(in srgb, var(--ui-text, #23392d) 54%, transparent) !important;
    font: inherit !important;
    font-size: 12.5px !important;
    text-align: left !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(10, 34, 24, 0.045) !important;
    -webkit-tap-highlight-color: transparent;
  }

  :root:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button.aibuy-mob-tools-search.is-active {
    border-color: color-mix(in srgb, var(--ui-accent, #1f6b53) 48%, transparent) !important;
    color: var(--ui-text, #14251d) !important;
    font-weight: 600 !important;
  }

  :root:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button.aibuy-mob-tools-search svg {
    width: 15px !important;
    height: 15px !important;
    flex: 0 0 15px !important;
    color: var(--ui-accent, #1f6b53) !important;
  }

  :root:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button.aibuy-mob-tools-search span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html[data-theme="dark"]:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button.aibuy-mob-tools-search {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(154, 204, 181, 0.18) !important;
    color: rgba(203, 224, 214, 0.68) !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"]:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button.aibuy-mob-tools-search svg {
    color: #5eead4 !important;
  }

  html[data-theme="dark"]:not(#_v3) .directory-tools-shell .mobile-directory-toolbar > button.aibuy-mob-tools-search.is-active {
    color: #eef7f3 !important;
    border-color: rgba(110, 231, 183, 0.44) !important;
  }

  /* Horizontal quick-category pill bar on mobile AI 工具 */
  .aibuy-mob-tools-cats {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 1px 0 3px;
    margin: 0 -2px;
  }

  .aibuy-mob-tools-cats::-webkit-scrollbar {
    display: none;
  }

  .aibuy-mob-tools-cat {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ui-line, #dce6e1) 92%, transparent);
    background: var(--ui-surface, #ffffff);
    color: color-mix(in srgb, var(--ui-text, #23392d) 72%, transparent);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
    -webkit-tap-highlight-color: transparent;
  }

  .aibuy-mob-tools-cat.is-active {
    background: var(--ui-accent, #1f6b53);
    border-color: var(--ui-accent, #1f6b53);
    color: #ffffff;
    font-weight: 600;
  }

  html[data-theme="dark"] .aibuy-mob-tools-cat {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(154, 204, 181, 0.14);
    color: rgba(210, 228, 220, 0.74);
  }

  html[data-theme="dark"] .aibuy-mob-tools-cat.is-active {
    background: #228061;
    border-color: #228061;
    color: #ffffff;
  }

  /* Hide redundant "查看分类 ↗" link on mobile since quick category pills + 分类 drawer are right above */
  :root:not(#_v3) .directory-tools-shell .directory-section-heading > a {
    display: none !important;
  }

  :root:not(#_v3) .directory-tools-shell .directory-section-heading {
    margin-bottom: 10px !important;
  }
}

/* Unify only the small inner reply/login CTA pill with AIBuy emerald accent */
:root:not(#_v3) .match-board button.match-comment-reply {
  background: var(--ui-accent, #1f6b53) !important;
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   2. Top Navbar: Remove "关于我们" + Ergonomic Center-Right Hero Search Pill
   -------------------------------------------------------------------------- */
:root:not(#_v3) .directory-topbar .header-about,
:root:not(#_v3) header a.header-about {
  display: none !important;
}

@media (min-width: 1060px) {
  :root:not(#_v3) .directory-topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px !important;
    gap: 12px !important;
  }

  :root:not(#_v3) .directory-topbar > .brand {
    position: absolute !important;
    left: 16px !important;
    top: 10.5px !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  :root:not(#_v3) .directory-topbar > .main-nav {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    height: 100% !important;
    margin: 0 !important;
  }

  :root:not(#_v3) .directory-topbar > .aibuy-topbar-search-wrap {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    order: 2 !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin-left: 2px !important;
  }

  :root:not(#_v3) .directory-topbar > .top-actions {
    position: absolute !important;
    right: 16px !important;
    top: 11.5px !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
  }
}

.aibuy-topbar-search-wrap {
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.aibuy-topbar-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 180px;
  max-width: 180px;
  min-width: 150px;
  height: 34px;
  padding: 0 8px 0 11px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--ui-accent, #1f6b53) 22%, var(--ui-line, #d4e2db));
  background: color-mix(in srgb, var(--ui-text, #162921) 2.5%, var(--ui-surface, #ffffff));
  color: color-mix(in srgb, var(--ui-text, #1d3228) 64%, transparent);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px -3px rgba(15, 50, 36, 0.08);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.aibuy-topbar-search-pill:hover {
  border-color: color-mix(in srgb, var(--ui-accent, #1f6b53) 55%, transparent);
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #14261e);
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--ui-accent, #1f6b53) 24%, transparent);
}

.aibuy-topbar-search-pill.is-active {
  border-color: color-mix(in srgb, var(--ui-accent, #1f6b53) 52%, transparent);
  background: color-mix(in srgb, var(--ui-accent, #1f6b53) 6%, var(--ui-surface, #ffffff));
  color: var(--ui-text, #14261e);
}

.aibuy-topbar-search-pill > svg {
  width: 15.5px;
  height: 15.5px;
  flex: 0 0 15.5px;
  color: var(--ui-accent, #1f6b53);
}

.aibuy-topbar-search-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aibuy-topbar-search-pill.is-active .aibuy-topbar-search-text {
  font-weight: 600;
  color: var(--ui-text, #12241c);
}

.aibuy-topbar-search-blockbadge {
  flex: 0 0 auto;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.aibuy-topbar-search-blockbadge:empty {
  display: none;
}

.aibuy-topbar-search-kbd {
  flex: 0 0 auto;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--ui-text, #23392d) 6%, transparent);
  color: color-mix(in srgb, var(--ui-text, #23392d) 54%, transparent);
  border: 1px solid color-mix(in srgb, var(--ui-line, #d5e2dc) 90%, transparent);
}

html[data-theme="dark"] .aibuy-topbar-search-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(110, 231, 183, 0.24);
  color: rgba(215, 234, 225, 0.72);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .aibuy-topbar-search-pill:hover,
html[data-theme="dark"] .aibuy-topbar-search-pill.is-active {
  background: rgba(65, 184, 131, 0.13);
  border-color: rgba(110, 231, 183, 0.48);
  color: #eef7f3;
}

html[data-theme="dark"] .aibuy-topbar-search-pill > svg {
  color: #5eead4;
}

html[data-theme="dark"] .aibuy-topbar-search-pill.is-active .aibuy-topbar-search-text {
  color: #eef7f3;
}

html[data-theme="dark"] .aibuy-topbar-search-blockbadge {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

html[data-theme="dark"] .aibuy-topbar-search-kbd {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(154, 204, 181, 0.18);
  color: rgba(203, 224, 214, 0.65);
}

/* Medium screens (1060..1160px): keep compact pill comfortable between nav and right actions */
@media (max-width: 1160px) and (min-width: 1060px) {
  .aibuy-topbar-search-pill {
    width: 152px;
    max-width: 152px;
    min-width: 140px;
    padding: 0 8px 0 10px;
    font-size: 12px;
  }
  .aibuy-topbar-search-kbd {
    display: none;
  }
}

/* Compact/Mobile: show crisp pill/icon cleanly in right top-actions */
@media (max-width: 1059px) {
  .aibuy-topbar-search-wrap {
    position: static;
    transform: none;
  }
  .aibuy-topbar-search-pill {
    width: auto;
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }
  .aibuy-topbar-search-kbd {
    display: none;
  }
}

@media (max-width: 700px) {
  .aibuy-topbar-search-pill .aibuy-topbar-search-text {
    display: none;
  }
  .aibuy-topbar-search-pill {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
}

/* Removable Scope Chip inside Floating Search Modal ([ 比价库 × ]) */
.aibuy-smodal-scope-chip {
  flex: 0 0 auto;
  height: 25px;
  padding: 0 5px 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 11%, transparent);
  color: var(--ui-accent, #1b6b51);
}

.aibuy-smodal-scope-chip.is-all {
  display: none;
}

.aibuy-smodal-scope-chip button {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  opacity: 0.7;
  transition: background-color 140ms ease, opacity 140ms ease;
}

.aibuy-smodal-scope-chip button:hover {
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 18%, transparent);
  opacity: 1;
}

html[data-theme="dark"] .aibuy-smodal-scope-chip {
  background: rgba(65, 184, 131, 0.16);
  color: #6ee7b7;
}

/* Whisper-Quiet Single-Line Utility Strip (Underline Tabs + Collapsible 屏蔽词 Toggle) */
.aibuy-smodal-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e3ece7) 78%, transparent);
}

html[data-theme="dark"] .aibuy-smodal-subbar {
  border-bottom-color: rgba(154, 204, 181, 0.11);
}

.aibuy-smodal-scopes {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  min-width: 0;
}

.aibuy-smodal-scope-tab {
  position: relative;
  height: 100%;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ui-text, #23392d) 54%, transparent);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms ease;
}

.aibuy-smodal-scope-tab:hover {
  color: var(--ui-text, #14251d);
}

.aibuy-smodal-scope-tab.is-active {
  color: var(--ui-accent, #1b6b51);
  font-weight: 700;
}

.aibuy-smodal-scope-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--ui-accent, #1b6b51);
}

html[data-theme="dark"] .aibuy-smodal-scope-tab {
  color: rgba(203, 224, 214, 0.56);
}

html[data-theme="dark"] .aibuy-smodal-scope-tab:hover {
  color: #eef7f3;
}

html[data-theme="dark"] .aibuy-smodal-scope-tab.is-active {
  color: #6ee7b7;
}

html[data-theme="dark"] .aibuy-smodal-scope-tab.is-active::after {
  background: #6ee7b7;
}

.aibuy-smodal-subright {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.aibuy-smodal-block-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: color-mix(in srgb, var(--ui-text, #23392d) 56%, transparent);
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.aibuy-smodal-block-toggle:hover,
.aibuy-smodal-block-toggle.is-expanded {
  background: color-mix(in srgb, var(--ui-text, #23392d) 6%, transparent);
  color: var(--ui-text, #14251d);
}

.aibuy-smodal-block-toggle.has-terms {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  font-weight: 600;
}

html[data-theme="dark"] .aibuy-smodal-block-toggle {
  color: rgba(203, 224, 214, 0.62);
}

html[data-theme="dark"] .aibuy-smodal-block-toggle:hover,
html[data-theme="dark"] .aibuy-smodal-block-toggle.is-expanded {
  background: rgba(255, 255, 255, 0.07);
  color: #eef7f3;
}

html[data-theme="dark"] .aibuy-smodal-block-toggle.has-terms {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.14);
}

/* Post preview row inside floating search modal */
.aibuy-smodal-post-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 75%, transparent);
  transition: background-color 140ms ease;
}

.aibuy-smodal-post-row:hover {
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 6%, transparent);
}

.aibuy-smodal-post-side {
  flex: 0 0 auto;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 12%, transparent);
  color: var(--ui-accent, #1b6b51);
}

.aibuy-smodal-post-side.is-need {
  background: rgba(217, 119, 6, 0.13);
  color: #b45309;
}

html[data-theme="dark"] .aibuy-smodal-post-side.is-need {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}

.aibuy-smodal-post-main {
  flex: 1 1 auto;
  min-width: 0;
}

.aibuy-smodal-post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 3px;
}

.aibuy-smodal-post-author {
  font-weight: 700;
  color: var(--ui-text, #14251d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-smodal-post-author {
  color: #eaf5ef;
}

.aibuy-smodal-post-sub {
  font-size: 11px;
  color: color-mix(in srgb, var(--ui-text, #23392d) 52%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-smodal-post-sub {
  color: rgba(196, 219, 208, 0.56);
}

.aibuy-smodal-post-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ui-text, #162921) 82%, transparent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html[data-theme="dark"] .aibuy-smodal-post-text {
  color: rgba(226, 239, 232, 0.84);
}

.aibuy-smodal-all-group {
  margin-bottom: 16px;
}

.aibuy-smodal-all-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.aibuy-smodal-all-group-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ui-text, #162921);
}

html[data-theme="dark"] .aibuy-smodal-all-group-title {
  color: #eaf5ef;
}

.aibuy-search-trigger-badge {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.aibuy-search-trigger-badge:empty {
  display: none;
}

.aibuy-search-trigger-reset {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: color-mix(in srgb, var(--ui-text, #23392d) 8%, transparent);
  color: color-mix(in srgb, var(--ui-text, #23392d) 68%, transparent);
  cursor: pointer;
  padding: 0;
}

.aibuy-search-trigger-reset.is-show {
  display: inline-flex;
}

.aibuy-search-trigger-reset svg {
  width: 12px;
  height: 12px;
}

.aibuy-search-trigger-reset:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

/* --------------------------------------------------------------------------
   3. Floating Search Modal (.aibuy-smodal) — Minimalist Spotlight + Silky Backdrop Fade
   -------------------------------------------------------------------------- */
.aibuy-smodal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2650;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 20px;
  visibility: hidden;
  pointer-events: none;
  background-color: rgba(5, 11, 9, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition:
    background-color 240ms ease,
    backdrop-filter 240ms ease,
    -webkit-backdrop-filter 240ms ease,
    visibility 0s linear 240ms;
}

.aibuy-smodal-backdrop.is-open {
  visibility: visible;
  pointer-events: auto;
  background-color: rgba(5, 11, 9, 0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color 380ms cubic-bezier(0.22, 1, 0.36, 1),
    backdrop-filter 380ms cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-backdrop-filter 380ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.aibuy-smodal {
  width: min(580px, calc(100vw - 24px));
  max-height: min(76vh, 660px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #162921);
  border: 1px solid color-mix(in srgb, var(--ui-line, #dce6e1) 88%, transparent);
  box-shadow: 0 28px 72px -14px rgba(5, 18, 12, 0.32), 0 4px 16px rgba(5, 18, 12, 0.08);
  transform: translate3d(0, -12px, 0) scale(0.975);
  opacity: 0;
  transition:
    transform 220ms ease,
    opacity 190ms ease;
}

.aibuy-smodal-backdrop.is-open .aibuy-smodal {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  transition:
    transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] .aibuy-smodal {
  background: #13251e;
  color: #e6f2ec;
  border-color: rgba(154, 204, 181, 0.16);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.62);
}

/* Search Input Header inside Floating Modal */
.aibuy-smodal-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e3ece7) 80%, transparent);
}

html[data-theme="dark"] .aibuy-smodal-top {
  border-bottom-color: rgba(154, 204, 181, 0.12);
}

.aibuy-smodal-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: color-mix(in srgb, var(--ui-text, #23392d) 48%, transparent);
}

.aibuy-smodal-ico svg {
  width: 17px;
  height: 17px;
}

html[data-theme="dark"] .aibuy-smodal-ico {
  color: rgba(196, 219, 208, 0.56);
}

.aibuy-smodal-plat {
  flex: 0 0 auto;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--ui-line, #d4e2db) 90%, transparent);
  background: transparent;
  color: var(--ui-text, #162921);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

html[data-theme="dark"] .aibuy-smodal-plat {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(154, 204, 181, 0.18);
  color: #eaf5ef;
}

.aibuy-smodal-form {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.aibuy-smodal-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ui-text, #12241c);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  outline: none;
}

html[data-theme="dark"] .aibuy-smodal-input {
  color: #eef7f3;
}

.aibuy-smodal-input::placeholder {
  color: color-mix(in srgb, var(--ui-text, #23392d) 40%, transparent);
  font-weight: 400;
}

html[data-theme="dark"] .aibuy-smodal-input::placeholder {
  color: rgba(196, 219, 208, 0.42);
}

.aibuy-smodal-submit {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--ui-accent, #1f6b53);
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

html[data-theme="dark"] .aibuy-smodal-submit {
  background: #228061;
  color: #ffffff;
}

.aibuy-smodal-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--ui-text, #23392d) 48%, transparent);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.aibuy-smodal-close:hover {
  background: color-mix(in srgb, var(--ui-text, #23392d) 7%, transparent);
  color: var(--ui-text, #12241c);
}

html[data-theme="dark"] .aibuy-smodal-close {
  color: rgba(215, 232, 224, 0.6);
}

/* Collapsible Blocked Words (屏蔽词) Drawer — Smooth 0fr -> 1fr Expand! */
.aibuy-smodal-blockdrawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms cubic-bezier(0.22, 1, 0.36, 1);
  background: color-mix(in srgb, var(--ui-text, #23392d) 2%, var(--ui-surface, #ffffff));
}

.aibuy-smodal-blockdrawer.is-expanded {
  grid-template-rows: 1fr;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e3ece7) 80%, transparent);
}

html[data-theme="dark"] .aibuy-smodal-blockdrawer {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .aibuy-smodal-blockdrawer.is-expanded {
  border-bottom-color: rgba(154, 204, 181, 0.11);
}

.aibuy-smodal-blockdrawer-inner {
  overflow: hidden;
  min-height: 0;
}

.aibuy-smodal-blockbar {
  padding: 9px 14px 10px;
}

.aibuy-smodal-block-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.aibuy-smodal-block-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ui-line, #d5e2dc) 95%, transparent);
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #162921);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.aibuy-smodal-block-input:focus {
  border-color: var(--ui-accent, #1b6b51);
}

html[data-theme="dark"] .aibuy-smodal-block-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(154, 204, 181, 0.18);
  color: #eef7f3;
}

.aibuy-smodal-block-add {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ui-accent, #1b6b51) 30%, transparent);
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 9%, transparent);
  color: var(--ui-accent, #1b6b51);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

html[data-theme="dark"] .aibuy-smodal-block-add {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.28);
}

/* Compact active blocked chips strip (shown even when drawer is collapsed if terms exist) */
.aibuy-smodal-block-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e3ece7) 75%, transparent);
}

html[data-theme="dark"] .aibuy-smodal-block-tags {
  border-bottom-color: rgba(154, 204, 181, 0.1);
}

.aibuy-smodal-block-tags:empty {
  display: none;
}

.aibuy-block-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 8px 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(220, 38, 38, 0.09);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.22);
}

html[data-theme="dark"] .aibuy-block-chip {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.28);
}

.aibuy-block-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.75;
}

.aibuy-block-chip button:hover {
  opacity: 1;
}

.aibuy-block-clearall {
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ui-text, #23392d) 54%, transparent);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
}

/* Scrollable Results Body inside Floating Search Modal (collapses when empty!) */
.aibuy-smodal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 58vh;
  overflow-y: auto;
  padding: 12px 14px 14px;
  overscroll-behavior: contain;
}

.aibuy-smodal-body.is-empty {
  display: none;
}

/* Hidden by Blocked Word filter on live DOM items */
.aibuy-blocked-hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   4. AI 资源对接 — X (Twitter) Feed Redesign
   -------------------------------------------------------------------------- */
:root:not(#_v3) .match-board .match-item {
  display: block !important;
  padding: 13px 16px 10px !important;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 88%, transparent) !important;
  transition: background-color 150ms ease, box-shadow 150ms ease !important;
}

:root:not(#_v3) .match-board .match-item:hover:not(.selected) {
  background-color: color-mix(in srgb, var(--ui-text, #1a2e25) 2.8%, var(--ui-surface, #ffffff)) !important;
}

:root:not(#_v3) .match-board .match-item.selected,
:root:not(#_v3) .match-board .match-item.selected:hover {
  background-color: color-mix(in srgb, var(--ui-accent, #1b6b51) 7.5%, var(--ui-surface, #ffffff)) !important;
  box-shadow: inset 3px 0 0 var(--ui-accent, #1b6b51) !important;
}

html[data-theme="dark"]:not(#_v3) .match-board .match-item:hover:not(.selected) {
  background-color: rgba(255, 255, 255, 0.035) !important;
}

html[data-theme="dark"]:not(#_v3) .match-board .match-item.selected,
html[data-theme="dark"]:not(#_v3) .match-board .match-item.selected:hover {
  background-color: rgba(58, 179, 132, 0.11) !important;
  box-shadow: inset 3px 0 0 var(--ui-accent, #41b883) !important;
}

:root:not(#_v3) .match-board .match-item-header {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) auto 28px !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  column-gap: 11px !important;
  row-gap: 2px !important;
  margin: 0 !important;
}

:root:not(#_v3) .match-board .match-item-avatar {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  align-self: start !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  margin: 1px 0 0 !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-text, #1a2e25) 10%, transparent) !important;
  overflow: hidden !important;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

:root:not(#_v3) .match-board .match-item:hover .match-item-avatar {
  transform: scale(1.03);
}

:root:not(#_v3) .match-board .match-item-avatar img {
  width: 40px !important;
  height: 40px !important;
  flex-basis: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

:root:not(#_v3) .match-board .match-item-heading {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

:root:not(#_v3) .match-board .match-item-heading .match-item-name {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em !important;
  color: var(--ui-text, #0f172a) !important;
}

:root:not(#_v3) .match-board .match-item-heading .match-item-name > span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

:root:not(#_v3) .match-board .match-item-classification {
  grid-column: 2 / span 2 !important;
  grid-row: 2 !important;
  justify-self: start !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: color-mix(in srgb, var(--ui-text, #23392d) 54%, transparent) !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

:root:not(#_v3) .match-board .match-item-classification .match-item-platform {
  display: inline !important;
  color: inherit !important;
  font-weight: 500 !important;
}

:root:not(#_v3) .match-board .match-item-classification .match-item-platform::after {
  content: " · ";
  opacity: 0.65;
  margin: 0 2px;
}

:root:not(#_v3) .match-board .match-item-classification .match-item-category {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: inherit !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

:root:not(#_v3) .match-board .match-item-header > .match-side {
  grid-column: 3 !important;
  grid-row: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 21px !important;
  min-width: 26px !important;
  padding: 0 7px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

:root:not(#_v3) .match-board .match-item-header > .post-more-trigger {
  grid-column: 4 !important;
  grid-row: 1 !important;
  width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0.65;
}

:root:not(#_v3) .match-board .match-item-open {
  display: block !important;
  width: calc(100% - 51px) !important;
  margin: 6px 0 0 51px !important;
  padding: 0 !important;
  background: transparent !important;
}

:root:not(#_v3) .match-board .match-item-preview {
  font-size: 14.5px !important;
  line-height: 1.58 !important;
  letter-spacing: -0.004em !important;
  color: color-mix(in srgb, var(--ui-text, #16261e) 92%, transparent) !important;
}

html[data-theme="dark"]:not(#_v3) .match-board .match-item-preview {
  color: rgba(235, 245, 240, 0.92) !important;
}

:root:not(#_v3) .match-board .match-item-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin: 7px 0 0 43px !important;
  width: calc(100% - 43px) !important;
  min-height: 30px !important;
}

:root:not(#_v3) .match-board .match-item-meta > time {
  order: 2 !important;
  margin-left: auto !important;
  min-width: 0 !important;
  padding-right: 2px !important;
  font-size: 11.5px !important;
  font-variant-numeric: tabular-nums !important;
  color: color-mix(in srgb, var(--ui-text, #23392d) 48%, transparent) !important;
}

:root:not(#_v3) .match-board .match-item-meta > .match-status {
  order: 3 !important;
}

:root:not(#_v3) .match-board .match-item-meta .post-interaction-bar--feed {
  order: 1 !important;
  display: grid !important;
  grid-template-columns: 58px 58px 48px 36px !important;
  align-items: center !important;
  justify-items: start !important;
  column-gap: 4px !important;
  width: auto !important;
  max-width: 240px !important;
  flex: 0 1 auto !important;
  margin: 0 !important;
  color: color-mix(in srgb, var(--ui-text, #23392d) 54%, transparent) !important;
}

:root:not(#_v3) .match-board .post-interaction-bar--feed .post-interaction {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  justify-self: start !important;
  gap: 2px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  transition: color 140ms ease !important;
}

:root:not(#_v3) .match-board .post-interaction-bar--feed .post-interaction.post-interaction--comment {
  display: none !important;
}

:root:not(#_v3) .match-board .post-interaction-bar--feed .post-interaction .post-interaction-count {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  margin-left: 1px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

:root:not(#_v3) .match-board .post-interaction-bar--feed .post-interaction-icon {
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

:root:not(#_v3) .match-board .post-interaction-bar--feed .post-interaction-icon svg {
  width: 15.5px !important;
  height: 15.5px !important;
}

:root:not(#_v3) .match-board .post-interaction:active .post-interaction-icon {
  transform: scale(0.86) !important;
}

:root:not(#_v3) .match-board .post-interaction--like:hover,
:root:not(#_v3) .match-board .post-interaction--like.is-active {
  color: #f91880 !important;
}
:root:not(#_v3) .match-board .post-interaction--like:hover .post-interaction-icon {
  background-color: rgba(249, 24, 128, 0.11) !important;
}

:root:not(#_v3) .match-board .post-interaction--dislike:hover,
:root:not(#_v3) .match-board .post-interaction--dislike.is-active {
  color: #d97706 !important;
}
:root:not(#_v3) .match-board .post-interaction--dislike:hover .post-interaction-icon {
  background-color: rgba(217, 119, 6, 0.11) !important;
}

:root:not(#_v3) .match-board .post-interaction--bookmark:hover,
:root:not(#_v3) .match-board .post-interaction--bookmark.is-active {
  color: var(--ui-accent, #16795c) !important;
}
:root:not(#_v3) .match-board .post-interaction--bookmark:hover .post-interaction-icon {
  background-color: color-mix(in srgb, var(--ui-accent, #16795c) 12%, transparent) !important;
}

:root:not(#_v3) .match-board .post-interaction--share:hover {
  color: #0ea5e9 !important;
}
:root:not(#_v3) .match-board .post-interaction--share:hover .post-interaction-icon {
  background-color: rgba(14, 165, 233, 0.12) !important;
}

:root:not(#_v3) .match-board .match-detail-tags > span:not(.match-side) {
  border-radius: 999px !important;
  padding: 3px 9px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
}

:root:not(#_v3) .match-board .match-detail-body p {
  font-size: 15.5px !important;
  line-height: 1.72 !important;
}

:root:not(#_v3) .match-board .post-interaction-bar--detail {
  padding: 6px 0 !important;
  margin-top: 14px !important;
  margin-bottom: 6px !important;
  border-top: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent) !important;
}

:root:not(#_v3) .match-board .post-interaction-bar--detail .post-interaction-icon {
  width: 36px !important;
  height: 36px !important;
  flex: 0 0 36px !important;
}

/* --------------------------------------------------------------------------
   5. Risk Left-Rail Overlap Fix (view=risk — DESKTOP ONLY!)
   -------------------------------------------------------------------------- */
@media (min-width: 701px) {
  :root:not(#_v3) .risk-board .risk-rail {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  :root:not(#_v3) .risk-board .risk-rail-scroll,
  :root:not(#_v3) .risk-board .risk-rail > div:not(.risk-rail-note):not(.risk-rail-head):not(.risk-rail-brand) {
    min-height: 0 !important;
  }

  :root:not(#_v3) .risk-board .risk-rail-note {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    background: var(--ui-surface, #ffffff) !important;
    border-top: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent) !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 6 !important;
  }

  html[data-theme="dark"]:not(#_v3) .risk-board .risk-rail-note {
    background: var(--ui-surface, #172823) !important;
  }

  #aibuy-unify-root > .risk-platform-list {
    z-index: 4 !important;
  }

  :root:not(#_v3) .risk-board:not(.is-rail-collapsed) .risk-platform-filter .risk-rail-label {
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
}

/* --------------------------------------------------------------------------
   6. Universal 3-Icon Compact Engagement Bar (♡ Like, ☆ Favorite, 💬 Comment)
   -------------------------------------------------------------------------- */
.aibuy-engage-bar {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: color-mix(in srgb, var(--ui-text, #23392d) 52%, transparent);
  user-select: none;
  -webkit-user-select: none;
}

html[data-theme="dark"] .aibuy-engage-bar {
  color: rgba(203, 224, 214, 0.58);
}

.aibuy-ebtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

.aibuy-ebtn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  display: block;
}

.aibuy-ebtn:active {
  transform: scale(0.88);
}

.aibuy-ebtn .aibuy-ecnt {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  line-height: 1;
}

.aibuy-ebtn .aibuy-ecnt:empty {
  display: none;
}

.aibuy-ebtn[data-act="like"]:hover,
.aibuy-ebtn[data-act="like"].is-active {
  color: #f91880;
  background-color: rgba(249, 24, 128, 0.1);
}

.aibuy-ebtn[data-act="bookmark"]:hover,
.aibuy-ebtn[data-act="bookmark"].is-active,
.aibuy-ebtn[data-act="tool-fav"]:hover,
.aibuy-ebtn[data-act="tool-fav"].is-active {
  color: #e59a0c;
  background-color: rgba(229, 154, 12, 0.12);
}

.aibuy-ebtn[data-act="comment"]:hover,
.aibuy-ebtn[data-act="comment"].has-comments {
  color: var(--ui-accent, #16795c);
}
.aibuy-ebtn[data-act="comment"]:hover {
  background-color: color-mix(in srgb, var(--ui-accent, #16795c) 11%, transparent);
}

.aibuy-ebtn[data-act="share"]:hover {
  color: #0ea5e9;
  background-color: rgba(14, 165, 233, 0.11);
}

html[data-theme="dark"] .aibuy-ebtn[data-act="comment"]:hover,
html[data-theme="dark"] .aibuy-ebtn[data-act="comment"].has-comments {
  color: #4ade80;
}

/* ---- AI 工具 (.directory-card): Compact sleek card + 3 icons at bottom-right ---- */
:root:not(#_v3) .directory-tools-shell .directory-grid {
  gap: 10px !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 11px 12px 7px !important;
  border-radius: 13px !important;
  gap: 0 !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card .directory-card-top {
  gap: 8px !important;
  margin-bottom: 6px !important;
  align-items: center !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card .directory-logo {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  flex: 0 0 34px !important;
  border-radius: 8px !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card .directory-logo img {
  width: 22px !important;
  height: 22px !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card .directory-card-title {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card .directory-card-title h3 {
  font-size: 13.5px !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card .directory-card-title span {
  display: block !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  margin-top: 1px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card p,
:root:not(#_v3) .directory-tools-shell .directory-card .directory-card-desc {
  font-size: 12px !important;
  line-height: 1.44 !important;
  min-height: 34px !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card .directory-card-divider,
:root:not(#_v3) .directory-tools-shell .directory-card .directory-card-footer {
  display: none !important;
}

:root:not(#_v3) .directory-tools-shell .directory-card > .directory-card-top > .directory-favorite {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.aibuy-engage-bar--tool {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: auto;
  margin-left: auto;
  margin-right: -4px;
  padding-top: 2px;
}

.aibuy-engage-bar--tool .aibuy-ebtn {
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
}

/* ---- AI 比价库 (.price-offer-row): ♡ ☆ 💬 right beside compact "前往" (flush-right primary CTA) ---- */
@media (min-width: 901px) {
  :root:not(#_v3) .price-workspace .price-offer-table-head,
  :root:not(#_v3) .price-workspace .price-offer-row {
    grid-template-columns: minmax(200px, 1fr) 78px 66px 76px 154px !important;
    column-gap: 8px !important;
  }

  :root:not(#_v3) .price-workspace .price-offer-table-head > :last-child {
    text-align: right !important;
    padding-right: 12px !important;
  }
}

:root:not(#_v3) .price-offer-row .price-offer-price {
  white-space: nowrap !important;
}

:root:not(#_v3) .price-offer-row .price-offer-product > h3 {
  padding-right: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

:root:not(#_v3) .price-offer-row .price-offer-action {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 7px !important;
  min-width: 0 !important;
}

:root:not(#_v3) .price-offer-row .price-offer-action > a {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 56px !important;
  padding: 0 11px !important;
  white-space: nowrap !important;
}

:root:not(#_v3) .price-offer-row .aibuy-engage-bar--price {
  position: static !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 1px !important;
  padding: 0 !important;
  background: none !important;
}

.aibuy-ds-offer-top .aibuy-engage-bar--price,
.aibuy-ds-offer-act .aibuy-engage-bar--price {
  position: static !important;
  flex: 0 0 auto;
  background: none !important;
  padding-left: 0;
}

.aibuy-ds-offer-act {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.aibuy-engage-bar--price .aibuy-ebtn {
  height: 24px;
  min-width: 24px;
  padding: 0 4px;
  font-size: 11px;
}

.aibuy-engage-bar--price .aibuy-ebtn svg {
  width: 13.5px;
  height: 13.5px;
}

/* ---- 交易避坑 (.risk-item & .risk-detail) ---- */
.aibuy-engage-bar--risk {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 72%, transparent);
}

.aibuy-engage-bar--risk .aibuy-ebtn[data-act="share"] {
  margin-left: auto;
}

.aibuy-engage-bar--risk-detail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 10px 0;
  border-top: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent);
}

.aibuy-engage-bar--risk-detail .aibuy-ebtn {
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  background: color-mix(in srgb, var(--ui-text, #23392d) 4%, transparent);
}

/* --------------------------------------------------------------------------
   7. Douyin-Style Cards & Result Lists inside Floating Search Modal
   -------------------------------------------------------------------------- */
.aibuy-ds-sec-label {
  font-size: 12px;
  font-weight: 700;
  color: color-mix(in srgb, var(--ui-text, #23392d) 58%, transparent);
  margin: 2px 0 9px;
}

.aibuy-entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.aibuy-entity-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--ui-line, #dce6e1) 95%, transparent);
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 3.2%, var(--ui-surface, #ffffff));
}

html[data-theme="dark"] .aibuy-entity-card {
  background: rgba(65, 184, 131, 0.06);
  border-color: rgba(154, 204, 181, 0.16);
}

.aibuy-entity-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.aibuy-entity-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: 0 0 38px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 14%, transparent);
  color: var(--ui-accent, #1b6b51);
  font-weight: 800;
  font-size: 14px;
}

html[data-theme="dark"] .aibuy-entity-avatar {
  color: #6ee7b7;
  background: rgba(65, 184, 131, 0.18);
}

.aibuy-entity-info {
  min-width: 0;
  flex: 1 1 auto;
}

.aibuy-entity-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.aibuy-entity-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ui-text, #13251d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-entity-name {
  color: #eef7f3;
}

.aibuy-entity-tag {
  flex: 0 0 auto;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 14%, transparent);
  color: var(--ui-accent, #1b6b51);
}

.aibuy-entity-tag.is-unclaimed {
  background: color-mix(in srgb, var(--ui-text, #23392d) 8%, transparent);
  color: color-mix(in srgb, var(--ui-text, #23392d) 65%, transparent);
}

html[data-theme="dark"] .aibuy-entity-tag {
  background: rgba(65, 184, 131, 0.18);
  color: #6ee7b7;
}

html[data-theme="dark"] .aibuy-entity-tag.is-unclaimed {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(215, 232, 224, 0.72);
}

.aibuy-entity-meta {
  margin-top: 2px;
  font-size: 11.5px;
  color: color-mix(in srgb, var(--ui-text, #23392d) 58%, transparent);
}

html[data-theme="dark"] .aibuy-entity-meta {
  color: rgba(203, 224, 214, 0.65);
}

.aibuy-entity-subshop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--ui-surface, #ffffff);
  border: 1px solid color-mix(in srgb, var(--ui-line, #e2ebe6) 90%, transparent);
  font-size: 12px;
}

html[data-theme="dark"] .aibuy-entity-subshop {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(154, 204, 181, 0.14);
}

.aibuy-entity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ui-accent, #1b6b51) 35%, transparent);
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 8%, transparent);
  color: var(--ui-accent, #1b6b51);
  text-decoration: none;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.aibuy-entity-btn:hover {
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 16%, transparent);
}

html[data-theme="dark"] .aibuy-entity-btn {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.3);
}

.aibuy-ds-offer-list {
  display: flex;
  flex-direction: column;
}

.aibuy-ds-offer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 48px 142px;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent);
}

.aibuy-ds-offer-main {
  min-width: 0;
}

.aibuy-ds-offer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.aibuy-ds-offer-merchant {
  font-size: 13px;
  font-weight: 700;
  color: var(--ui-text, #162921);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-ds-offer-merchant {
  color: #edf7f2;
}

.aibuy-ds-offer-prod {
  margin-top: 2px;
  font-size: 12px;
  color: color-mix(in srgb, var(--ui-text, #23392d) 64%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-ds-offer-prod {
  color: rgba(203, 224, 214, 0.68);
}

.aibuy-ds-spec-pill {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 11%, transparent);
  color: var(--ui-accent, #1b6b51);
}

.aibuy-ds-price {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ui-accent, #1b6b51);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-ds-price {
  color: #6ee7b7;
}

.aibuy-ds-stock {
  font-size: 11px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 10%, transparent);
  color: var(--ui-accent, #1b6b51);
  font-variant-numeric: tabular-nums;
}

.aibuy-ds-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ui-accent, #1f6b53);
  color: #ffffff !important;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-ds-go {
  background: #228061;
}

/* Matching Board Douyin-Style Author Strip (when searching) */
.aibuy-match-authors {
  position: relative;
  z-index: 2;
  margin-top: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 90%, transparent);
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 3%, var(--ui-surface, #ffffff));
}

:root:not(#_v3) .match-list:has(> .aibuy-match-authors) > .match-list-scroll {
  padding-top: 0 !important;
}

html[data-theme="dark"] .aibuy-match-authors {
  background: rgba(65, 184, 131, 0.05);
}

.aibuy-match-authors-title {
  font-size: 11.5px;
  font-weight: 700;
  color: color-mix(in srgb, var(--ui-text, #23392d) 58%, transparent);
  margin-bottom: 8px;
}

.aibuy-match-authors-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aibuy-author-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px 6px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ui-line, #dbe5e0) 95%, transparent);
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #162921);
  text-decoration: none;
  font-size: 12.5px;
  transition: border-color 140ms ease, transform 140ms ease;
}

html[data-theme="dark"] .aibuy-author-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(154, 204, 181, 0.16);
  color: #ebf6f1;
}

.aibuy-author-chip:hover {
  border-color: var(--ui-accent, #1b6b51);
  transform: translateY(-1px);
}

.aibuy-author-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.aibuy-author-chip small {
  font-size: 11px;
  opacity: 0.62;
}

.aibuy-risk-id-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  margin-top: 7px;
  border-radius: 10px;
  background: color-mix(in srgb, #d97706 6%, var(--ui-surface, #ffffff));
  border: 1px solid color-mix(in srgb, #d97706 25%, transparent);
}

html[data-theme="dark"] .aibuy-risk-id-card {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(251, 191, 36, 0.22);
}

.aibuy-risk-url-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 10%, transparent);
  color: var(--ui-accent, #1b6b51);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   8. Floating Comment Popover Window (.aibuy-cmodal)
   -------------------------------------------------------------------------- */
.aibuy-cmodal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
  background-color: rgba(5, 11, 9, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition:
    background-color 240ms ease,
    backdrop-filter 240ms ease,
    -webkit-backdrop-filter 240ms ease,
    visibility 0s linear 240ms;
}

.aibuy-cmodal-backdrop.is-open {
  visibility: visible;
  pointer-events: auto;
  background-color: rgba(5, 11, 9, 0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color 380ms cubic-bezier(0.22, 1, 0.36, 1),
    backdrop-filter 380ms cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-backdrop-filter 380ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.aibuy-cmodal {
  width: min(540px, calc(100vw - 24px));
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #172a22);
  border: 1px solid color-mix(in srgb, var(--ui-line, #dce6e1) 92%, transparent);
  box-shadow: 0 24px 64px -12px rgba(8, 24, 17, 0.28), 0 4px 16px rgba(8, 24, 17, 0.08);
  transform: translate3d(0, 14px, 0) scale(0.965);
  opacity: 0;
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1), opacity 210ms ease;
}

.aibuy-cmodal-backdrop.is-open .aibuy-cmodal {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

html[data-theme="dark"] .aibuy-cmodal {
  background: #13251e;
  color: #e6f2ec;
  border-color: rgba(154, 204, 181, 0.16);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.56);
}

.aibuy-cmodal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent);
}

.aibuy-cmodal-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.aibuy-cmodal-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.aibuy-cmodal-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 12%, transparent);
  color: var(--ui-accent, #1b6b51);
}

html[data-theme="dark"] .aibuy-cmodal-badge {
  background: rgba(65, 184, 131, 0.16);
  color: #5eead4;
}

.aibuy-cmodal-ext {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ui-accent, #1b6b51);
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 999px;
  transition: background-color 140ms ease;
}

.aibuy-cmodal-ext svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.aibuy-cmodal-ext:hover {
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 10%, transparent);
}

html[data-theme="dark"] .aibuy-cmodal-ext {
  color: #6ee7b7;
}

.aibuy-cmodal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ui-text, #12241c);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

html[data-theme="dark"] .aibuy-cmodal-title {
  color: #eef7f3;
}

.aibuy-cmodal-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ui-text, #23392d) 60%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-cmodal-sub {
  color: rgba(203, 224, 214, 0.68);
}

.aibuy-cmodal-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ui-text, #23392d) 62%, transparent);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.aibuy-cmodal-close:hover {
  background: color-mix(in srgb, var(--ui-text, #23392d) 8%, transparent);
  color: var(--ui-text, #12241c);
}

html[data-theme="dark"] .aibuy-cmodal-close {
  color: rgba(215, 232, 224, 0.72);
}

.aibuy-cmodal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--ui-text, #23392d) 2.2%, var(--ui-surface, #ffffff));
  border-bottom: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 80%, transparent);
}

html[data-theme="dark"] .aibuy-cmodal-actions {
  background: rgba(255, 255, 255, 0.025);
  border-bottom-color: rgba(154, 204, 181, 0.12);
}

.aibuy-cmodal-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ui-line, #dbe5e0) 90%, transparent);
  background: var(--ui-surface, #ffffff);
  color: color-mix(in srgb, var(--ui-text, #23392d) 78%, transparent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

html[data-theme="dark"] .aibuy-cmodal-act {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(154, 204, 181, 0.16);
  color: rgba(226, 240, 233, 0.85);
}

.aibuy-cmodal-act svg {
  width: 14px;
  height: 14px;
}

.aibuy-cmodal-act[data-act="like"]:hover,
.aibuy-cmodal-act[data-act="like"].is-active {
  color: #f91880;
  border-color: rgba(249, 24, 128, 0.35);
  background: rgba(249, 24, 128, 0.09);
}

.aibuy-cmodal-act[data-act="bookmark"]:hover,
.aibuy-cmodal-act[data-act="bookmark"].is-active {
  color: #e59a0c;
  border-color: rgba(229, 154, 12, 0.4);
  background: rgba(229, 154, 12, 0.11);
}

.aibuy-cmodal-act[data-act="share"] {
  margin-left: auto;
}

.aibuy-cmodal-act[data-act="share"]:hover {
  color: #0ea5e9;
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.1);
}

.aibuy-cmodal-body {
  flex: 1 1 auto;
  min-height: 180px;
  overflow-y: auto;
  padding: 14px 18px 16px;
  overscroll-behavior: contain;
}

.aibuy-cmodal-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: color-mix(in srgb, var(--ui-text, #23392d) 70%, transparent);
}

html[data-theme="dark"] .aibuy-cmodal-section-label {
  color: rgba(203, 224, 214, 0.72);
}

.aibuy-cmodal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  gap: 10px;
  color: color-mix(in srgb, var(--ui-text, #23392d) 55%, transparent);
  font-size: 13px;
}

.aibuy-cmodal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px 36px;
  gap: 8px;
  color: color-mix(in srgb, var(--ui-text, #23392d) 54%, transparent);
}

.aibuy-cmodal-empty svg {
  width: 28px;
  height: 28px;
  opacity: 0.45;
}

.aibuy-cmodal-empty p {
  margin: 0;
  font-size: 13px;
}

.aibuy-cmt-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.aibuy-cmt-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
}

.aibuy-cmt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 12%, transparent);
}

.aibuy-cmt-main {
  min-width: 0;
}

.aibuy-cmt-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  font-size: 12.5px;
}

.aibuy-cmt-author {
  font-weight: 700;
  color: var(--ui-text, #13241c);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-cmt-author {
  color: #eaf5ef;
}

.aibuy-cmt-time {
  font-size: 11.5px;
  color: color-mix(in srgb, var(--ui-text, #23392d) 48%, transparent);
  white-space: nowrap;
}

.aibuy-cmt-content {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.58;
  color: color-mix(in srgb, var(--ui-text, #182b23) 92%, transparent);
  white-space: pre-wrap;
  word-break: break-word;
}

html[data-theme="dark"] .aibuy-cmt-content {
  color: rgba(235, 245, 240, 0.92);
}

.aibuy-cmt-reply-at {
  color: var(--ui-accent, #16795c);
  font-weight: 600;
  margin-right: 4px;
}

html[data-theme="dark"] .aibuy-cmt-reply-at {
  color: #5eead4;
}

.aibuy-cmt-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.aibuy-cmt-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  margin-left: -6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--ui-text, #23392d) 52%, transparent);
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

.aibuy-cmt-btn svg {
  width: 12.5px;
  height: 12.5px;
}

.aibuy-cmt-btn.is-liked,
.aibuy-cmt-btn[data-cact="like"]:hover {
  color: #f91880;
  background: rgba(249, 24, 128, 0.09);
}

.aibuy-cmt-btn[data-cact="delete"]:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.09);
}

.aibuy-cmt-replies {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--ui-line, #dce6e1) 85%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aibuy-cmt-replies .aibuy-cmt-item {
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 8px;
}

.aibuy-cmt-replies .aibuy-cmt-avatar {
  width: 24px;
  height: 24px;
}

.aibuy-cmodal-foot {
  padding: 12px 16px 14px;
  border-top: 1px solid color-mix(in srgb, var(--ui-line, #e4ece8) 85%, transparent);
  background: var(--ui-surface, #ffffff);
}

html[data-theme="dark"] .aibuy-cmodal-foot {
  background: #11211b;
  border-top-color: rgba(154, 204, 181, 0.14);
}

.aibuy-cmodal-replying {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  margin-bottom: 8px;
  border-radius: 9px;
  font-size: 12px;
  background: color-mix(in srgb, var(--ui-accent, #1b6b51) 9%, transparent);
  color: var(--ui-accent, #1b6b51);
}

.aibuy-cmodal-replying.is-show {
  display: flex;
}

.aibuy-cmodal-replying button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.aibuy-cmodal-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.aibuy-cmodal-input {
  flex: 1 1 auto;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 13px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--ui-line, #d6e2dc) 95%, transparent);
  background: color-mix(in srgb, var(--ui-text, #23392d) 2.5%, var(--ui-surface, #ffffff));
  color: var(--ui-text, #14251d);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  resize: none;
  outline: none;
}

.aibuy-cmodal-input:focus {
  border-color: var(--ui-accent, #1b6b51);
  background: var(--ui-surface, #ffffff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent, #1b6b51) 14%, transparent);
}

html[data-theme="dark"] .aibuy-cmodal-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(154, 204, 181, 0.18);
  color: #eef7f3;
}

.aibuy-cmodal-send {
  flex: 0 0 auto;
  height: 40px;
  min-width: 76px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ui-accent, #1f6b53);
  color: #ffffff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.aibuy-cmodal-send:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.aibuy-cmodal-login-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
}

.aibuy-cmodal-login-bar span {
  font-size: 13px;
  color: color-mix(in srgb, var(--ui-text, #23392d) 68%, transparent);
}

html[data-theme="dark"] .aibuy-cmodal-login-bar span {
  color: rgba(203, 224, 214, 0.74);
}

.aibuy-cmodal-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ui-accent, #1f6b53);
  color: #ffffff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

html[data-theme="dark"] .aibuy-cmodal-send,
html[data-theme="dark"] .aibuy-cmodal-login-btn {
  background: #228061;
  color: #ffffff !important;
}

.aibuy-cmodal-err {
  margin-top: 6px;
  font-size: 12px;
  color: #dc2626;
}

.aibuy-cmodal-spin {
  width: 16px;
  height: 16px;
  animation: aibuyCmodalRot 0.78s linear infinite;
}
.aibuy-cmodal-spin circle {
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 34 22;
}
@keyframes aibuyCmodalRot {
  to { transform: rotate(360deg); }
}

.aibuy-social-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2700;
  transform: translate3d(-50%, 10px, 0);
  opacity: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: #14261e;
  color: #f0f9f4;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.aibuy-social-toast.is-show {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

html[data-theme="dark"] .aibuy-social-toast {
  background: #e6f4ec;
  color: #0f231b;
}

@media (max-width: 650px) {
  /* Mobile comment modal: ergonomic bottom sheet */
  .aibuy-cmodal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .aibuy-cmodal {
    width: 100%;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
    transform: translate3d(0, 28px, 0);
  }
  .aibuy-cmodal-backdrop.is-open .aibuy-cmodal {
    transform: translate3d(0, 0, 0);
  }

  /* Mobile search modal: pinned cleanly near TOP so on-screen keyboard never covers it! */
  .aibuy-smodal-backdrop {
    align-items: flex-start;
    padding: 12px 10px 16px;
  }
  .aibuy-smodal {
    width: 100%;
    max-height: 80vh;
    border-radius: 16px;
    transform: translate3d(0, -14px, 0) scale(0.98);
  }
  .aibuy-smodal-backdrop.is-open .aibuy-smodal {
    transform: translate3d(0, 0, 0) scale(1);
  }
}
