/* ==== AIBuy site-wide polish v3 (Grok Bot 2026-11-03). Visual-only overrides; layout, markup and behaviour untouched.
   `:root:not(#_v3)` lifts specificity above the existing layered rules without !important. Detection pages keep their own v2 styling. ==== */
:root:not(#_v3) {
  --v3-r: 14px; --v3-r-sm: 10px;
  --v3-line: var(--ui-line, #d7e1da);
  --v3-accent: var(--ui-accent, #2e6b50);
  --v3-primary: var(--ui-primary, #2e6b50);
  --v3-soft: var(--ui-accent-soft, #e3efe7);
  --v3-surface: var(--ui-surface, #fff);
  --v3-shadow: 0 1px 2px rgba(22, 52, 37, .05), 0 10px 28px -18px rgba(22, 52, 37, .28);
  --v3-shadow-hover: 0 2px 4px rgba(22, 52, 37, .06), 0 16px 34px -18px rgba(22, 52, 37, .38);
  --v3-ring: 0 0 0 4px color-mix(in srgb, var(--v3-accent) 16%, transparent);
}
:root:not(#_v3)[data-theme="dark"] { --v3-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 28px -20px rgba(0,0,0,.75); --v3-shadow-hover: 0 1px 0 rgba(255,255,255,.04) inset, 0 16px 34px -18px rgba(0,0,0,.85); }

/* ---------- Header (shared) ---------- */
:root:not(#_v3) .directory-topbar { backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); }
:root:not(#_v3) .directory-topbar .main-nav .directory-nav-tab { border-radius: 9px; transition: color .15s, background-color .15s; }
:root:not(#_v3) .directory-topbar .main-nav .directory-nav-tab:hover:not(.active) { background-color: color-mix(in srgb, var(--v3-accent) 7%, transparent); }
:root:not(#_v3) .directory-topbar .main-nav .directory-nav-tab.active { font-weight: 650; }
:root:not(#_v3) .directory-topbar :is(.header-save, .theme-toggle, .account-link) { border-radius: 999px; transition: color .15s, background-color .15s; }
:root:not(#_v3) .directory-topbar :is(.header-save, .theme-toggle, .account-link):hover { background-color: color-mix(in srgb, var(--v3-accent) 8%, transparent); color: var(--v3-accent); }
:root:not(#_v3) .app-shell :is(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--ui-focus, var(--v3-accent)); outline-offset: 2px; }

/* ---------- Footer (shared) ---------- */
:root:not(#_v3) .site-footer .footer-links a { border-radius: 6px; padding: 2px 6px; transition: color .15s, background-color .15s; }
:root:not(#_v3) .site-footer .footer-links a:hover { color: var(--v3-accent); background-color: color-mix(in srgb, var(--v3-accent) 8%, transparent); }

/* ---------- AI 工具 directory (/?view=tools) ---------- */
:root:not(#_v3) .directory-home-shell .directory-sidebar { border-radius: 16px; box-shadow: var(--v3-shadow); }
:root:not(#_v3) .directory-home-shell .directory-side-item { border-radius: var(--v3-r-sm); transition: background-color .15s, color .15s; }
:root:not(#_v3) .directory-home-shell .directory-side-item:hover:not(.active) { background-color: color-mix(in srgb, var(--v3-accent) 6%, transparent); }
:root:not(#_v3) .directory-home-shell .directory-side-item b { border-radius: 999px; min-width: 22px; text-align: center; }
:root:not(#_v3) .directory-sidebar-heading .directory-submit-link { border-radius: 999px; }
:root:not(#_v3) .directory-home-shell .directory-tools-search .directory-search-form.directory-header-search { border-radius: 14px; box-shadow: var(--v3-shadow); transition: box-shadow .15s, border-color .15s; }
:root:not(#_v3) .directory-home-shell .directory-tools-search .directory-search-form.directory-header-search:focus-within { box-shadow: var(--v3-ring), var(--v3-shadow); }
:root:not(#_v3) .directory-search-form .directory-search-submit { border-radius: 10px; font-weight: 600; }
:root:not(#_v3) .directory-home-shell .directory-card { border-radius: var(--v3-r); box-shadow: var(--v3-shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
:root:not(#_v3) .directory-home-shell .directory-card:hover { transform: translateY(-2px); box-shadow: var(--v3-shadow-hover); border-color: color-mix(in srgb, var(--v3-accent) 38%, var(--v3-line)); }
:root:not(#_v3) .directory-home-shell .directory-card .directory-logo { border-radius: 12px; }
:root:not(#_v3) .directory-home-shell .directory-card-title strong, :root:not(#_v3) .directory-home-shell .directory-card-title h3 { letter-spacing: -.2px; }
:root:not(#_v3) .directory-home-shell .directory-card-divider { opacity: .7; }
:root:not(#_v3) .directory-home-shell .directory-card-action { border-radius: 6px; transition: color .15s; }
:root:not(#_v3) .directory-home-shell .directory-favorite { border-radius: 999px; transition: background-color .15s, color .15s; }
:root:not(#_v3) .directory-home-shell .directory-favorite:hover { background-color: color-mix(in srgb, var(--v3-accent) 9%, transparent); color: var(--v3-accent); }
:root:not(#_v3) .directory-home-shell .directory-section-heading { padding-bottom: 4px; }
:root:not(#_v3) .directory-home-shell .directory-sorter button { border-radius: 8px; }

/* ---------- AI 低价资源库 (/?view=deals) ---------- */
:root:not(#_v3) .directory-workspace-deals :is(.price-category-option, .price-spec-option) { border-radius: var(--v3-r-sm); transition: background-color .15s, color .15s; }
:root:not(#_v3) .directory-workspace-deals :is(.price-category-option, .price-spec-option):hover:not([aria-pressed="true"]) { background-color: color-mix(in srgb, var(--v3-accent) 6%, transparent); }
:root:not(#_v3) .directory-workspace-deals :is(.price-category-option, .price-spec-option)[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--v3-accent); }
:root:not(#_v3) .directory-workspace-deals .price-count { font-variant-numeric: tabular-nums; }
:root:not(#_v3) .directory-workspace-deals .price-offer-table-head { border-radius: 10px; }
:root:not(#_v3) .directory-workspace-deals .price-offer-row { transition: background-color .15s; }
:root:not(#_v3) .directory-workspace-deals .price-offer-row:hover { background-color: color-mix(in srgb, var(--v3-accent) 5%, var(--v3-surface)); }
:root:not(#_v3) .directory-workspace-deals .price-offer-row a, :root:not(#_v3) .directory-workspace-deals .price-offer-row button { border-radius: 8px; transition: filter .15s, transform .15s; }
:root:not(#_v3) .directory-workspace-deals .price-offer-row a:hover { filter: brightness(1.08); }
:root:not(#_v3) .directory-workspace-deals .price-quotes { font-variant-numeric: tabular-nums; }
:root:not(#_v3) .directory-workspace-deals .price-quotes > :first-child { border-radius: var(--v3-r); }

/* ---------- AI 资源对接 + 交易避坑 (/?view=matching, /matching/N, /?view=risk, /risk) ---------- */
:root:not(#_v3) :is(.match-rail-section button, .match-category-trigger, .match-mine-link, .risk-rail-item) { border-radius: var(--v3-r-sm); transition: background-color .15s, color .15s; }
:root:not(#_v3) :is(.match-rail-section button, .match-category-trigger, .match-mine-link, .risk-rail-item):hover:not(.active) { background-color: color-mix(in srgb, var(--v3-accent) 6%, transparent); }
:root:not(#_v3) :is(.match-item, .risk-item) { transition: background-color .15s, box-shadow .15s; }
:root:not(#_v3) :is(.match-item, .risk-item):hover:not(.selected) { background-color: color-mix(in srgb, var(--v3-accent) 4%, var(--v3-surface)); }
:root:not(#_v3) :is(.match-item, .risk-item).selected { box-shadow: inset 3px 0 0 var(--v3-accent); }
:root:not(#_v3) .match-item-avatar { box-shadow: 0 0 0 2px var(--v3-surface), 0 0 0 3px color-mix(in srgb, var(--v3-accent) 18%, var(--v3-line)); border-radius: 50%; }
:root:not(#_v3) .match-item-classification { border-radius: 6px; }
:root:not(#_v3) .match-toolbar :is(input, select) { border-radius: 10px; transition: box-shadow .15s, border-color .15s; }
:root:not(#_v3) .match-toolbar :is(input, select):focus { box-shadow: var(--v3-ring); }
:root:not(#_v3) .match-toolbar button, :root:not(#_v3) .risk-toolbar button { border-radius: 10px; }
:root:not(#_v3) .match-list-heading strong, :root:not(#_v3) .risk-list-heading strong { letter-spacing: -.2px; }
:root:not(#_v3) .match-result-count { font-variant-numeric: tabular-nums; }
:root:not(#_v3) .match-pagination :is(a, button) { border-radius: 8px; }
:root:not(#_v3) .match-detail-placeholder { opacity: .9; }

/* ---------- Auth pages (/login, /register, /reset-password, and login-gated pages) ---------- */
:root:not(#_v3) .auth-split .auth-promo { border-radius: 22px; }
:root:not(#_v3) .auth-split .auth-form-panel .auth-form-heading h1 { letter-spacing: -.5px; }
:root:not(#_v3) .auth-split .auth-form-eyebrow { letter-spacing: .5px; }
:root:not(#_v3) .auth-split .account-auth-fields :is(input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input:not([type]), select) { border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
:root:not(#_v3) .auth-split .account-auth-fields :is(input, select):focus { border-color: var(--ui-focus, var(--v3-accent)); box-shadow: var(--v3-ring); outline: none; }
:root:not(#_v3) .auth-split .button.dark.auth-submit { border-radius: 12px; font-weight: 650; letter-spacing: .3px; box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--v3-primary) 90%, transparent); transition: background-color .15s, transform .15s, box-shadow .15s; }
:root:not(#_v3) .auth-split .button.dark.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 26px -14px color-mix(in srgb, var(--v3-primary) 95%, transparent); }
:root:not(#_v3) .auth-split .auth-password-toggle { border-radius: 8px; }
:root:not(#_v3) .auth-split .account-auth-switch a { text-underline-offset: 3px; }
:root:not(#_v3) .auth-split .auth-email-provider { border-radius: 999px; }

/* ---------- Account / appeal / contact-assistance / messages / profile (logged-in pages) ---------- */
:root:not(#_v3) :is(.account-page, .account-appeal-page) :is(section, .account-card, .account-panel) { border-radius: var(--v3-r); }
:root:not(#_v3) :is(.account-page, .account-appeal-page) .button { border-radius: 10px; }
:root:not(#_v3) .account-appeal-error { border-radius: 12px; }
:root:not(#_v3) .account-nav button { border-radius: var(--v3-r-sm); }

/* ---------- About (/about) ---------- */
:root:not(#_v3) .company-about .company-button { border-radius: 12px; transition: transform .15s, box-shadow .15s, background-color .15s; }
:root:not(#_v3) .company-about .company-button:hover { transform: translateY(-1px); box-shadow: var(--v3-shadow-hover); }
:root:not(#_v3) .company-about :is(.company-offering-item, .company-node) { border-radius: 16px; transition: box-shadow .18s, transform .18s; }
:root:not(#_v3) .company-about .company-offering-item:hover { box-shadow: var(--v3-shadow-hover); transform: translateY(-2px); }

/* ---------- Mobile nav (shared) ---------- */
:root:not(#_v3) .mobile-navigation { box-shadow: 0 12px 30px -12px rgba(22, 52, 37, .35); }

/* v3 extras: card-framed auth form, softer deals header */
:root:not(#_v3) .auth-split .auth-form-panel .account-auth-fields { padding: 30px 30px 26px; border: 1px solid color-mix(in srgb, var(--ui-text, #23392d) 8%, var(--v3-line)); border-radius: 20px; background: var(--v3-surface); box-shadow: var(--v3-shadow); }
@media (max-width: 640px) { :root:not(#_v3) .auth-split .auth-form-panel .account-auth-fields { padding: 22px 18px 20px; border-radius: 16px; } }
:root:not(#_v3) .directory-workspace-deals .price-quotes > :first-child { background-image: linear-gradient(135deg, color-mix(in srgb, var(--v3-accent) 10%, transparent), transparent 70%); }

@media (prefers-reduced-motion: reduce) {
  :root:not(#_v3) .app-shell * { transition: none !important; }
  :root:not(#_v3) .app-shell :is(.directory-card, .auth-submit, .company-button, .company-offering-item):hover { transform: none !important; }
}
