/* ==========================================
   site.css — 静态站点补充样式
   在 base.css / utilities.css / components.css 之后引入
   ========================================== */

/* ---------- 整体布局骨架（替代 App.vue） ---------- */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.main-content {
  flex: 1;
}

/* ---------- 移动端菜单（原 v-if 由 JS 控制，现由类控制） ---------- */
.site-header .mobile-menu {
  display: none;
}
.site-header .mobile-menu.is-open {
  display: block;
  animation: mobileMenuIn 0.25s ease;
}
@keyframes mobileMenuIn {
  from {
    opacity: 0;
    transform: scaleY(0.96);
    transform-origin: top;
  }
  to {
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
  }
}

/* ---------- 卡片图片统一填充（原 ResponsiveImage / 背景图占位） ---------- */
.tech-img-placeholder,
.app-img-placeholder,
.article-img-wrapper,
.product-img-wrapper,
.news-img-placeholder,
.quality-image .img-placeholder,
.featured-img,
.app-cover .img-placeholder,
.cat-img-placeholder,
.prod-img {
  position: relative;
  overflow: hidden;
}

.tech-img-placeholder img,
.app-img-placeholder img,
.article-img-wrapper img,
.product-img-wrapper img,
.news-img-placeholder img,
.quality-image .img-placeholder img,
.featured-img img,
.app-cover .img-placeholder img,
.cat-img-placeholder img,
.prod-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 高度由各组件样式定义（180px / 200px / 260px 等），此处保证图片填满 */

/* ---------- 首页：不显示移动端底部咨询条 ---------- */
.is-home .mobile-bottom-bar {
  display: none !important;
}

/* ---------- 页脚移动端底部条留白 ---------- */
body:not(.is-home) .site-footer {
  padding-bottom: 80px;
}

/* ---------- 面包屑（静态页：首页 / 当前页） ---------- */

/* ---------- 咨询表单：错误提示与成功态 ---------- */
.form-error-msg {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #c94a4a;
}
/* 咨询表单内错误提示绝对定位（对齐原版 InquiryForm，不占文档流） */
.form-wrapper .form-error-msg {
  position: absolute;
  bottom: 0;
  left: 0;
  margin-top: 0;
}

/* ---------- 无障碍：键盘可达的图标按钮 ---------- */
.action-icon:focus-visible,
.desktop-float:focus-visible {
  outline: 2px solid #0b6b5a;
  outline-offset: 2px;
}

/* ---------- 全局：hidden 属性强制隐藏（防止 .d-flex 等类覆盖 UA 默认样式） ---------- */
[hidden] {
  display: none !important;
}

/* ---------- 折叠面板（FAQ）：原版 v-show 逻辑的 CSS 等价 ---------- */
.accordion .accordion-body {
  display: none;
}
.accordion .accordion-item.is-active .accordion-body {
  display: block;
}
/* 产品详情 FAQ 折叠 */
.faq-answer {
  display: none;
}
.faq-item.is-active .faq-answer {
  display: block;
}

/* ==========================================
   样式对齐修复（与原 Vue 版逐项对齐）
   ========================================== */

/* 1. a 标签卡片恢复块级/弹性布局（原组件为 div，a 默认 inline 导致高度塌陷） */
a.card,
a.featured-news,
a.product-card,
a.research-card,
a.service-card,
a.entrance-card {
  display: block;
}
/* 需要纵向弹性布局的卡片（原组件样式在 components.css 中先于本文件加载） */
a.article-card,
a.result-card {
  display: flex;
  flex-direction: column;
}
/* 新闻分类页列表项：a 标签需恢复 flex 横向布局（防被上方 a.card 规则覆盖） */
a.news-list-item {
  display: flex;
}

/* 2. 标题字号对齐全局 typography（修正组件合并时的 .text-h3 污染） */
.text-h3 {
  font-size: 20px;
}
/* 应用领域页 grid 间距对齐原版（该页 gap-6 未定义，回退 grid 默认 24px） */
.application-matrix .grid {
  gap: 24px;
}
@media (min-width: 1200px) and (max-width: 1439px) {
  .text-h3 {
    font-size: 18px;
  }
}
@media (max-width: 767px) {
  .text-h3 {
    font-size: 18px;
  }
}
/* 登记弹窗标题保持组件原值 24px */
.modal-content .text-h3 {
  font-size: 24px;
}

/* 3. CTA 区按钮高度修正（Home 页 .btn-lg 定义被组件合并全局化） */
.cta-section .btn-lg {
  height: auto;
  padding: 12px 32px;
}

/* 5. 表单提交按钮 / 页面 Hero 按钮高度（原版为全局 .btn 的 44/48px） */
.form-card .btn-lg,
.form-wrapper .btn-lg,
.consult-form-container .btn-lg,
.hero-cta-btn {
  height: 48px;
}
@media (max-width: 1199px) {
  .form-card .btn-lg,
  .form-wrapper .btn-lg,
  .consult-form-container .btn-lg,
  .hero-cta-btn {
    height: 44px;
  }
}
/* 表单提交按钮水平内边距（原版 .px-8 = 80px，防被 Home 页 .btn-lg padding 覆盖） */
.form-wrapper .submit-cta-btn,
.consult-form-container .submit-cta-btn {
  padding-left: 80px;
  padding-right: 80px;
}

/* 4. 图片加载失败兜底：隐藏破图标记，露出容器底色 */
img.is-broken {
  visibility: hidden;
}

/* 6. 组件合并覆盖修正（第二轮全站样式对比） */
/* 搜索页全局 .search-btn（页内大搜索按钮）不得影响导航栏搜索图标 */
.site-header .header-actions .search-btn,
.site-header .header-actions .action-icon.search-btn {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 32px;
  height: 32px;
  min-width: 0;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
/* CTA 区次级按钮：原版 btn-secondary+text-white → 白字（防 .btn-secondary 覆盖） */
.btn-secondary.text-white,
.cta-hover-btn {
  color: #ffffff;
  border: 1px solid #ffffff !important;
}
/* 新闻页搜索框：原版无上下内边距、字号继承 16px */
.news-filters .search-input {
  font-size: 16px;
  padding: 0 0 0 36px;
}
/* 科研合作页合作机构卡：原版 p-3 类未生效 → 无内边距 */
.partner-logo-item {
  padding: 0;
}
/* 科研成果页搜索框：原版无内边距、字号继承 16px */
.research-result-list-page .search-input {
  font-size: 16px;
  padding: 0;
}
/* p 标签使用 .text-h3 时保持正常字重（原版 .text-h3 无 font-weight 定义） */
p.text-h3 {
  font-weight: 400;
}
/* .text-h3/.text-h2/.text-h1 全局 color 污染修正：与 .text-white 并用时以 $color-white 纯白为准 */
.text-h3.text-white,
.text-h2.text-white,
.text-h1.text-white {
  color: #ffffff;
}

/* 2026-09-05 12:44（北京）：新增商业级二级导航、语言切换与移动子导航。 */
.site-header .nav-group { position: relative; height: 100%; display: flex; align-items: center; }
.site-header .nav-submenu {
  position: absolute; top: calc(100% - 6px); left: 50%; transform: translate(-50%, 8px);
  min-width: 190px; padding: 8px; background: #fff; border: 1px solid var(--hesora-border);
  border-radius: 10px; box-shadow: 0 12px 28px rgba(11,47,42,.12); opacity: 0; visibility: hidden;
  pointer-events: none; transition: opacity var(--hesora-transition), transform var(--hesora-transition); z-index: 120;
}
.site-header .nav-submenu-wide { min-width: 210px; }
.site-header .nav-submenu a { display: block; padding: 10px 12px; border-radius: 7px; color: var(--hesora-text); font-size: 14px; white-space: nowrap; }
.site-header .nav-submenu a:hover, .site-header .nav-submenu a:focus-visible { color: var(--hesora-primary); background: var(--hesora-primary-light); }
.site-header .nav-group:hover .nav-submenu, .site-header .nav-group:focus-within .nav-submenu { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); }
.site-header .language-switch { min-width: 42px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 9px; border: 1px solid var(--hesora-border); border-radius: 8px; color: var(--hesora-text); font-size: 14px; font-weight: 600; }
.site-header .language-switch:hover, .site-header .language-switch:focus-visible { color: var(--hesora-primary); border-color: var(--hesora-primary); background: var(--hesora-primary-light); }
.site-header .mobile-nav-section { border-bottom: 1px solid rgba(217,229,224,.7); }
.site-header .mobile-nav-subitems { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 8px; padding: 0 20px 10px 28px; }
.site-header .mobile-nav-subitems a { padding: 8px 6px; color: var(--hesora-text-secondary); font-size: 14px; border-radius: 6px; }
.site-header .mobile-nav-subitems a:hover, .site-header .mobile-nav-subitems a:focus-visible { color: var(--hesora-primary); background: var(--hesora-primary-light); }
.site-header .mobile-lang-entry { padding-top: 10px; padding-bottom: 16px; }
.site-header .mobile-lang-entry a { color: var(--hesora-primary); font-weight: 600; }
@media (min-width: 1200px) { .site-header .mobile-nav-subitems { display: none; } }
@media (max-width: 767px) { .site-header .header-actions { gap: 8px; } .site-header .language-switch { height: 32px; min-width: 38px; padding: 0 7px; } }

/* 2026-09-05 12:44（北京）：新增登记下载隐私勾选与成功状态。 */
#registration-modal .checkbox-label { display:flex; gap:10px; align-items:flex-start; color:var(--hesora-text-secondary); font-size:14px; line-height:1.6; }
#registration-modal .checkbox-label input { width:18px; height:18px; margin-top:3px; flex:0 0 auto; }
#registration-modal .form-success-box { padding:10px 12px; border-radius:8px; background:var(--hesora-primary-light); color:var(--hesora-primary); font-size:13px; }

/* 2026-09-05 12:44（北京）：新增统一咨询表单隐私与成功状态。 */
form[data-inquiry-form] .checkbox-label { display:flex; align-items:flex-start; gap:10px; color:var(--hesora-text-secondary); font-size:14px; line-height:1.6; }
form[data-inquiry-form] .checkbox-label input { width:18px; height:18px; margin-top:3px; flex:0 0 auto; }
.form-success-box { padding:10px 12px; border-radius:8px; background:var(--hesora-primary-light); color:var(--hesora-primary); font-size:13px; }

/* 2026-09-05 12:44（北京）：公共悬浮按钮使用原生 button 后保持原有视觉，并补充统一焦点态。 */
.contact-entry button.desktop-float {
  padding: 0;
  font: inherit;
  appearance: none;
}
.language-switch:focus-visible,
.nav-item:focus-visible,
.nav-submenu a:focus-visible,
.mobile-nav-item:focus-visible,
.mobile-nav-subitem:focus-visible {
  outline: 2px solid var(--hesora-accent);
  outline-offset: 3px;
}

/* 2026-09-05 12:44（北京）：统一表单接口失败反馈，不输出服务端内部错误细节。 */
.form-error-box {
  padding: 12px 16px;
  border: 1px solid rgba(201, 74, 74, 0.28);
  border-radius: var(--hesora-radius-control);
  background: rgba(201, 74, 74, 0.06);
  color: var(--hesora-error);
}

