/* AIBuy 2026-11-13 polish: messages, account sidebar gap, profile GUID,
   discovery card radius, price-lib header/dividers, tools sidebar scrollbar.
   Overlay only; do not restyle unrelated pages. */

/* ========== 1. 消息中心 ========== */
:root:not(#_v3) .messages-page {
  padding: 28px 24px 48px;
}
:root:not(#_v3) .messages-panel {
  border-radius: 16px;
  border-color: color-mix(in srgb, var(--ink, #1a2c28) 8%, transparent);
  box-shadow: 0 10px 28px color-mix(in srgb, #26444e 7%, transparent);
  overflow: hidden;
}
:root:not(#_v3) .messages-heading {
  padding: 26px 28px 18px;
  gap: 16px;
}
:root:not(#_v3) .messages-heading h1 {
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
:root:not(#_v3) .messages-heading p {
  margin-top: 6px;
  font-size: 13px;
}
:root:not(#_v3) .messages-back {
  height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--ink, #1a2c28) 10%, transparent);
  border-radius: 999px;
  background: var(--card, #fff);
}
:root:not(#_v3) .messages-back:hover {
  color: #2d829b;
  border-color: color-mix(in srgb, #2d829b 35%, transparent);
  background: color-mix(in srgb, #2d829b 6%, #fff);
}
:root:not(#_v3) .messages-channel-tabs {
  gap: 8px;
  padding: 0 24px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink, #1a2c28) 8%, transparent);
}
:root:not(#_v3) .messages-channel-tabs > button {
  min-height: 44px;
  padding: 8px 14px 10px;
  border-radius: 10px 10px 0 0;
  font-size: 14px;
  gap: 8px;
}
:root:not(#_v3) .messages-channel-tabs > button[aria-selected="true"]:after {
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 2px;
  background: #2d829b;
}
:root:not(#_v3) .messages-channel-tabs > button > span,
:root:not(#_v3) .messages-tabs button span {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
:root:not(#_v3) .messages-toolbar {
  padding: 0 24px;
}
:root:not(#_v3) .messages-tabs button {
  padding: 13px 2px;
}
:root:not(#_v3) .messages-mark-read {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
}
:root:not(#_v3) .messages-mark-read:hover:enabled {
  background: color-mix(in srgb, #2d829b 7%, transparent);
}
:root:not(#_v3) .message-item {
  gap: 14px;
  padding: 16px 24px;
  align-items: flex-start;
  transition: background 0.14s ease;
}
:root:not(#_v3) .message-item:last-child {
  border-bottom: 0;
}
:root:not(#_v3) .message-item.is-unread {
  background: color-mix(in srgb, #2d829b 5.5%, transparent);
}
:root:not(#_v3) .message-item:hover {
  background: color-mix(in srgb, #2d829b 4%, transparent);
}
:root:not(#_v3) .message-item .message-avatar,
:root:not(#_v3) .message-item .message-avatar img,
:root:not(#_v3) .message-item .post-avatar,
:root:not(#_v3) .message-item .post-avatar img {
  border-radius: 50%;
}
:root:not(#_v3) .message-meta {
  align-items: baseline;
  column-gap: 8px;
  row-gap: 2px;
}
:root:not(#_v3) .message-meta time {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #737a85);
}
:root:not(#_v3) .message-content {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
}
:root:not(#_v3) .message-quote {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
}
:root:not(#_v3) .message-unread-dot {
  width: 8px;
  height: 8px;
  margin-top: 10px;
}
:root:not(#_v3) .messages-empty {
  min-height: 320px;
  padding: 56px 28px;
  gap: 0;
}
:root:not(#_v3) .messages-empty > svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  padding: 14px;
  box-sizing: content-box;
  border-radius: 50%;
  background: color-mix(in srgb, #2d829b 8%, transparent);
  color: #2d829b;
  opacity: 1;
}
:root:not(#_v3) .messages-empty h2 {
  font-size: 16px;
  font-weight: 650;
}
:root:not(#_v3) .messages-empty p {
  margin-top: 8px;
  max-width: 28em;
}
:root:not(#_v3) .messages-error {
  margin: 12px 24px;
  border-radius: 10px;
}
:root:not(#_v3) .messages-pagination {
  padding: 16px;
}
:root:not(#_v3) .messages-pagination button {
  border-radius: 8px;
  min-height: 34px;
  padding: 0 12px;
}

@media (max-width: 650px) {
  :root:not(#_v3) .messages-page {
    padding: 0 0 20px;
  }
  :root:not(#_v3) .messages-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  :root:not(#_v3) .messages-heading,
  :root:not(#_v3) .messages-channel-tabs,
  :root:not(#_v3) .messages-toolbar,
  :root:not(#_v3) .message-item {
    padding-left: 16px;
    padding-right: 16px;
  }
  :root:not(#_v3) .messages-heading {
    padding-top: 18px;
    padding-bottom: 14px;
  }
  :root:not(#_v3) .message-meta time {
    margin-left: 0;
    width: 100%;
    flex-basis: 100%;
  }
}

/* Keep the private chat chrome light; only tighten the shared channel tabs. */
:root:not(#_v3) .messages-page.is-private {
  padding: 0;
}
:root:not(#_v3) .messages-page.is-private > .messages-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* ========== 2. 个人中心左侧栏：补上与左右/底部一致的顶距 ========== */
@media (min-width: 761px) {
  :root:not(#_v3) .directory-inner-shell.account-layout-shell:not(.profile-layout-shell):not(:has(> .site-announcement)) .account-page {
    padding-top: calc(var(--internal-header-height, 54px) + 12px) !important;
  }
  :root:not(#_v3) .directory-inner-shell.account-layout-shell:not(.profile-layout-shell):not(:has(> .site-announcement)) .account-sidebar {
    padding-top: 18px !important;
    margin-top: 0 !important;
  }
  :root:not(#_v3) .directory-inner-shell.account-layout-shell:not(.profile-layout-shell):not(:has(> .site-announcement)) .account-workspace {
    padding-top: 12px !important;
  }
}

/* ========== 3. 个人主页 GUID：加大、去糊 ========== */
:root:not(#_v3) .user-profile-page .user-profile-guid {
  margin: 8px 0 0;
  color: var(--ink, #1a2c28);
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
  text-shadow: none !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (max-width: 760px) {
  :root:not(#_v3) .user-profile-page .user-profile-guid {
    font-size: 13px;
  }
}

/* ========== 4. 个人主页右侧「新鲜资源」「你可能会喜欢」圆角 ========== */
@media (min-width: 761px) {
  :root:not(#_v3) .user-profile-page .user-profile-discovery {
    padding-top: calc(var(--profile-header-height, 56px) + 16px) !important;
    padding-left: 4px;
    padding-right: 4px;
  }
  :root:not(#_v3) .user-profile-page .user-profile-discovery-section {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: none;
  }
}

/* ========== 5. AI 比价库：商品标题去绿底、声明移入标题行、横线拉满 ========== */
@media (min-width: 701px) {
  :root:not(#_v3) .directory-workspace-deals .price-quotes-top {
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background: color-mix(in srgb, var(--ui-surface, #fff) 88%, transparent);
  }
  /* Match .price-spec-column .price-column-heading exactly: 48px, same typography. */
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-top .price-quotes-heading,
  :root:not(#_v3)[data-theme="dark"] .directory-workspace-deals .price-quotes-top .price-quotes-heading,
  :root:not(#_v3)[data-theme="dark"] .directory-workspace-deals .price-quotes-heading {
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    color: inherit !important;
    background: transparent !important;
    border-radius: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border-bottom: 1px solid var(--shared-line, transparent) !important;
    box-shadow: none !important;
    font-size: 14px !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px 16px;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading-row > div:first-child {
    flex: 0 1 auto;
    width: auto !important;
    min-width: 0;
    max-width: 42%;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-kicker {
    display: none !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading h2,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-top .price-quotes-heading h2 {
    margin: 0 !important;
    color: inherit !important;
    font-size: 17px !important;
    font-weight: 650 !important;
    line-height: normal !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading .price-snapshot-note {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 !important;
    text-align: center;
    color: #748684 !important;
    font-size: 12px !important;
    line-height: normal !important;
    font-weight: 400 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  :root:not(#_v3)[data-theme="dark"] .directory-workspace-deals .price-quotes-heading .price-snapshot-note {
    color: #a9c0b9 !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quote-controls {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: auto !important;
    height: auto !important;
    color: inherit;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-quote-label {
    display: none !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-low-toggle {
    color: #5b6f6c !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-low-track {
    background: color-mix(in srgb, var(--ink, #1a2c28) 12%, transparent) !important;
    border-color: color-mix(in srgb, var(--ink, #1a2c28) 18%, transparent) !important;
  }
  /* Same single-line small grey style as 「71 规格」 */
  :root:not(#_v3) .directory-workspace-deals .price-quotes-top .price-quotes-heading .price-quote-count,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading .price-quote-count {
    display: inline-flex !important;
    flex-direction: row !important;
    flex: none !important;
    align-items: baseline !important;
    gap: 0.25em !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: normal !important;
    color: #748684 !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
    min-width: 0 !important;
    height: auto !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-top .price-quotes-heading .price-quote-count small,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading .price-quote-count small {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: normal !important;
    color: inherit !important;
  }
  /* Keep 「71 规格」 typography identical to 「315 条报价」 */
  :root:not(#_v3) .directory-workspace-deals .price-spec-column .price-column-heading > span,
  :root:not(#_v3) .directory-workspace-deals .price-column-heading > span,
  :root:not(#_v3) .directory-workspace-deals .price-count {
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: normal !important;
    color: #748684 !important;
  }
}
:root:not(#_v3) .directory-workspace-deals .price-offer-table-head {
  padding-left: 16px !important;
  padding-right: 16px !important;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid color-mix(in srgb, var(--ui-text, #23392d) 9%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ui-text, #23392d) 9%, transparent);
}
:root:not(#_v3) .directory-workspace-deals .price-quotes-viewport .price-offer-list {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: calc(var(--quote-footer-height, 0px) + 5px) !important;
}
:root:not(#_v3) .directory-workspace-deals .price-offer-row {
  padding-left: 16px !important;
  padding-right: 16px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid color-mix(in srgb, var(--ui-text, #23392d) 9%, #e3e9eb) !important;
}
:root:not(#_v3) .directory-workspace-deals .price-quotes-footer,
:root:not(#_v3) .directory-workspace-deals .price-quotes-footer.is-hidden {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none;
}

@media (max-width: 900px) {
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading .price-snapshot-note {
    font-size: 11px !important;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading-row > div:first-child {
    max-width: 36%;
  }
}

@media (max-width: 700px) {
  /* Mobile uses .mobile-price-picker for the product name, so only surface the
     disclaimer line (the old footer bar is gone). Place it above the sort row. */
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-top .price-quotes-heading {
    display: block !important;
    padding: 2px 12px 8px !important;
    min-height: 0 !important;
    background: transparent !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading-row {
    display: block !important;
    flex-wrap: wrap !important;
    gap: 0;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading-row > div:first-child,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading h2,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading .price-quote-controls,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-quote-label {
    display: none !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-quotes-heading .price-snapshot-note {
    display: block !important;
    flex: none;
    width: 100%;
    max-width: 100%;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 11px !important;
    line-height: 1.45;
    -webkit-line-clamp: unset;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-table-head,
  :root:not(#_v3) .directory-workspace-deals .price-offer-row {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ========== 6. AI 工具左侧导航：隐藏滚动条，保留滚动 ========== */
:root:not(#_v3) .directory-home-shell [data-directory-pane="tools"] .directory-sidebar-scroll,
:root:not(#_v3) .directory-home-shell [data-directory-pane="tools"] > .directory-workspace > .directory-sidebar {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
:root:not(#_v3) .directory-home-shell [data-directory-pane="tools"] .directory-sidebar-scroll::-webkit-scrollbar,
:root:not(#_v3) .directory-home-shell [data-directory-pane="tools"] > .directory-workspace > .directory-sidebar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}


/* ========== 7. 比价库报价表：满宽 60/8.333/8.333/8.334/15（窄桌面 minmax 防溢出）；首列左对齐，其余列居中；库存徽章紧贴数字 ========== */
@media (min-width: 901px) {
  :root:not(#_v3) .directory-workspace-deals .price-quotes,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-top,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-viewport,
  :root:not(#_v3) .directory-workspace-deals .price-quotes-viewport .price-offer-list,
  :root:not(#_v3) .directory-workspace-deals .price-offer-list {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-table-head,
  :root:not(#_v3) .directory-workspace-deals .price-offer-row {
    display: grid !important;
    /* 60 / 8.333 / 8.333 / 8.334 / 15 when wide; mins keep 0.03 CNY / 70044 / 采集时间 / 前往商品 on one line below 1440 */
    grid-template-columns: minmax(0, 1fr) minmax(64px, 8.333%) minmax(60px, 8.333%) minmax(60px, 8.334%) minmax(100px, 15%) !important;
    column-gap: 0 !important;
    justify-content: stretch !important;
    justify-items: stretch;
    align-items: center;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-table-head > *,
  :root:not(#_v3) .directory-workspace-deals .price-offer-row > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  /* 商家/商品：左对齐 */
  :root:not(#_v3) .directory-workspace-deals .price-offer-table-head > :first-child,
  :root:not(#_v3) .directory-workspace-deals .price-offer-product {
    justify-self: stretch;
    width: 100%;
    text-align: left;
  }
  /* 价格 / 库存 / 采集时间 / 操作：列内居中，表头与内容同一中线 */
  :root:not(#_v3) .directory-workspace-deals .price-offer-table-head > :not(:first-child) {
    justify-self: stretch !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    text-align: center !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-table-head .price-sort-button {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-content: center !important;
    width: 100%;
    max-width: 100%;
    padding: 0 !important;
    gap: 0;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-table-head .price-sort-button > span:first-child {
    grid-column: 2;
    justify-self: center;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-table-head .price-sort-arrows {
    grid-column: 3;
    justify-self: start;
    margin-left: 3px;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-price {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center !important;
    align-items: baseline;
    width: 100%;
    text-align: center;
    white-space: nowrap;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-stock {
    justify-self: center !important;
    width: auto !important;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    flex: 0 0 auto;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-update,
  :root:not(#_v3) .directory-workspace-deals .price-offer-update time {
    justify-self: stretch;
    width: 100%;
    text-align: center !important;
    margin: 0 !important;
    white-space: nowrap;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-action {
    justify-self: stretch !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    width: 100% !important;
    text-align: center !important;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-action a {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: auto !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  :root:not(#_v3) .directory-workspace-deals .price-offer-product {
    width: 100%;
    min-width: 0;
  }
}
