/* 静态站增强样式：仅补充「React 原本用条件渲染控制、现在由 hidden 属性控制」的部分
 * 不覆盖原站任何既有规则，只做显隐与少量状态样式。
 */

/* hidden 属性必须生效（原站部分元素用了 flex/grid，会覆盖浏览器默认） */
[hidden] { display: none !important; }

/* Mega Menu / 移动抽屉：默认隐藏，由 main.js 去掉 hidden 显示 */
.mega-menu[hidden],
.mobile-navigation[hidden] { display: none !important; }

/* 注意：.mega-menu 的定位（left:50% + translate(-50%)）由原站 site.css 负责，
 * 这里不要再覆盖 left/top，否则面板会整体偏移、左半列跑出屏幕。 */

/* 移动端导航分组按钮（本静态站注入） */
.mobile-nav-toggle { cursor: pointer; }

/* Tab / 开关变体容器 */
.tab-variant[hidden],
.switch-variant[hidden] { display: none !important; }

/* 表单状态提示（统一色板，与各页面 .cx-error 保持一致） */
.static-form-status { margin-top: 12px; font-size: 13px; line-height: 1.6; }
.static-form-status.is-ok { color: #17603a; }
.static-form-status.is-error { color: #c0392b; }
/* 字段级错误：不覆盖 .cx-error 的字号/字重，只补布局 */
.static-field-error { display: block; margin-top: 5px; }
/* 校验失败的输入框：统一红色描边，覆盖不同页面各自的表单风格差异 */
form [aria-invalid="true"] { border-color: #c0392b !important; background-color: #fdf3f2; }

/* 键盘可达性：折叠/开关按钮显式手型 */
main [aria-expanded],
[role="switch"],
.nav-menu-button { cursor: pointer; }

/* 尊重系统减少动效设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   修复补丁 · 2026-10-14（经 Playwright 线上实测验证）
   ---------------------------------------------------------------------
   FIX-1  Astra 回顶按钮与 WhatsApp 悬浮按钮重叠（桌面 + 移动）
   FIX-3  [装饰列|内容列] 网格缺图标时，正文掉进窄列导致一字一行
   FIX-4  /accounting/partners/ 移动端 service-notes 内 31px 窄列塌陷
   ===================================================================== */

/* --- FIX-1 · 回顶按钮避让 WhatsApp 悬浮按钮 ---
   实测：.wa-float 高 58px、距底约 16px；#ast-scroll-top 距底 29px，
   两者重叠 32×32px（桌面端同样重叠 1024px²）。把回顶按钮抬到 WhatsApp 之上。 */
#ast-scroll-top.ast-scroll-to-top-right {
  bottom: 92px !important;
}

/* --- FIX-3 · 网格窄列塌陷 ---
   这些容器设计为「窄装饰列 + 宽内容列」两列网格；当图标/装饰元素缺失、
   只剩内容一个子元素时，内容会掉进窄列（实测 54 / 150 / 172 / 218px），
   表现为一字一行。让唯一子元素横跨全部列即可恢复。 */
.bl-scope .asp-plain > :only-child,
.bl-scope .scenario-card > :only-child,
.bl-scope .inv-related-item > :only-child,
.bl-scope .bills-container > :only-child {
  grid-column: 1 / -1 !important;
}

/* asp-plain 专用：原有 .asp-plain-icon:empty 兜底只在「图标元素存在但为空」时生效，
   「图标元素整个不存在」时兜底失效，这里补齐同类情况（直接改单列）。 */
.bl-scope .accounting-startups-page .asp-plain:not(:has(> .asp-plain-icon)),
.bl-scope .accounting-small-business-page .asp-plain:not(:has(> .asp-plain-icon)),
.bl-scope .accounting-accounting-firms-page .asp-plain:not(:has(> .asp-plain-icon)),
.bl-scope .accounting-mobile-page .asp-plain:not(:has(> .asp-plain-icon)),
.bl-scope .accounting-windows-page .asp-plain:not(:has(> .asp-plain-icon)) {
  grid-template-columns: 1fr !important;
}

/* --- FIX-4 · partners 页移动端 service-notes 塌陷 ---
   实测 390px 下子容器 grid=31px 258px，文本掉进 31px 列（11-12 行）。
   窄屏强制单列；桌面端该网格正常，不动。 */
@media (max-width: 1024px) {
  .bl-scope .accounting-partners-service .service-notes > * {
    grid-template-columns: 1fr !important;
  }
}

