/* ==========================================================================
   新乡隆耀机械设备有限公司官网 — 全站自定义样式
   --------------------------------------------------------------------------
   【文件分工】
   - tailwind.css : Tailwind CSS v3 编译产物（工具类），由 _dev 目录构建，勿手改
   - site.css     : 本文件，普通 CSS，写交互状态与本项目专有组件
                    改完直接刷新浏览器即可生效，不需要任何构建工具
   【引入顺序】HTML 中必须先 tailwind.css 再 site.css（后者覆盖前者）
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 基础设置
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* 锚点跳转时避开吸顶导航 */
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #1f4e8c;
  color: #fff;
}

/* 表单控件在部分浏览器下的默认外观统一 */
input,
textarea,
select,
button {
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   2. 顶部导航
   -------------------------------------------------------------------------- */

/* 吸顶后加一道极轻的阴影，滚动时层次更清楚（无动画特效） */
.site-header.is-scrolled {
  box-shadow: 0 2px 14px rgba(8, 24, 46, 0.12);
}

/* 桌面端导航链接：当前页高亮，hover 出现细下划线 */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  color: #e8eef7;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: #e8791b;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav-link:hover,
.nav-link.is-current {
  color: #fff;
}

.nav-link:hover::after,
.nav-link.is-current::after {
  transform: scaleX(1);
}

/* 移动端菜单：高度过渡展开，纯 CSS，无依赖 */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.mobile-menu.is-open {
  max-height: 420px;
}

.mobile-menu a {
  display: block;
  padding: 12px 4px;
  color: #e8eef7;
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu a.is-current,
.mobile-menu a:hover {
  color: #f0a044;
}

/* 汉堡按钮：三条线，展开时旋转成 X */
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   3. 首页轮播（自动播放，原生 JS 驱动）
   -------------------------------------------------------------------------- */
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.carousel-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* 轮播上的深蓝渐变遮罩：保证白字在任何底图上都清晰 */
.carousel-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 24, 46, 0.76) 0%,
    rgba(8, 24, 46, 0.58) 42%,
    rgba(8, 24, 46, 0.26) 100%
  );
}

.carousel-dot {
  width: 28px;
  height: 4px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.2s ease, width 0.25s ease;
}

.carousel-dot.is-active {
  width: 44px;
  background: #e8791b;
}

.carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  background: rgba(8, 24, 46, 0.25);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.carousel-arrow:hover {
  background: #1f4e8c;
  border-color: #1f4e8c;
}

/* --------------------------------------------------------------------------
   4. 产品卡片：hover 轻微上浮（需求点 5）
   -------------------------------------------------------------------------- */
.product-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: #b4cce7;
  box-shadow: 0 12px 32px rgba(8, 24, 46, 0.14);
}

/* 卡片图片 hover 时极轻微放大，克制、不花哨 */
.product-card:hover .product-card__img {
  transform: scale(1.035);
}

.product-card__img {
  transition: transform 1.35s ease;
}

/* --------------------------------------------------------------------------
   5. 产品分类筛选按钮
   -------------------------------------------------------------------------- */
.filter-btn {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn.is-active {
  background: #1f4e8c;
  border-color: #1f4e8c;
  color: #fff;
}

/* 被筛掉的产品卡：直接隐藏（JS 切换 hidden 属性） */
.product-item[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   6. 页内小组件
   -------------------------------------------------------------------------- */

/* 数字统计条的竖向分隔线，仅桌面生效 */
.stat-divider + .stat-divider {
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

/* 时间线 / 流程步骤左侧竖线 */
.step-line::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: -18px;
  width: 1px;
  background: #d6e0ec;
}

/* 表单输入统一外观（Tailwind 类已在 HTML 中给出，这里只补 focus 细节） */
.form-input:focus {
  outline: none;
  border-color: #1f4e8c;
  box-shadow: 0 0 0 3px rgba(31, 78, 140, 0.12);
}

/* --------------------------------------------------------------------------
   7. 无障碍与降级
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #e8791b;
  outline-offset: 3px;
}

/* 系统开启「减少动态效果」时关闭所有过渡与平滑滚动 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* 打印时隐藏导航、页脚和按钮，只留正文 */
@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   8. 询盘表单：mailto 兜底区块（方案 B）
   纯 CSS，不依赖 Tailwind 构建；配色沿用 brand / accent / steel 主色。
   -------------------------------------------------------------------------- */
.inquiry-fallback[hidden] {
  display: none !important;
}

.inquiry-fallback {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #d6e0ec;
  border-left: 3px solid #e8791b;
  border-radius: 2px;
  background: #f8fafd;
}

.inquiry-fallback__title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #123058;
}

.inquiry-fallback__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #63758d;
}

.inquiry-fallback__mail {
  font-weight: 700;
  color: #1f4e8c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inquiry-fallback__preview {
  display: block;
  width: 100%;
  margin-top: 0.875rem;
  padding: 0.75rem;
  border: 1px solid #d6e0ec;
  border-radius: 2px;
  background: #fff;
  color: #123058;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.7;
  resize: vertical;
}

.inquiry-fallback__preview:focus {
  outline: none;
  border-color: #1f4e8c;
  box-shadow: 0 0 0 3px rgba(31, 78, 140, 0.12);
}

.inquiry-fallback__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid #1f4e8c;
  border-radius: 2px;
  background: #fff;
  color: #1f4e8c;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-copy:hover {
  background: #1f4e8c;
  color: #fff;
}

.inquiry-fallback__status {
  font-size: 0.8125rem;
  color: #63758d;
}

.inquiry-fallback__status.is-ok {
  color: #1a7f45;
  font-weight: 700;
}

.inquiry-fallback__status.is-err {
  color: #c0392b;
  font-weight: 700;
}

/* 页脚备案号：做成可点击链接，保持页脚文字色并加下划线，hover 提亮 */
.beian-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.beian-link:hover {
  color: #ffffff;
}

/* ==========================================================================
   多语言切换下拉（由 i18n/build.py 自动注入到各页，中文/英文/俄文共用）
   用原生 <details> 实现：无需 JS，点击展开、键盘可操作、移动端友好。
   ========================================================================== */
.lang-select {
  position: relative;
  flex: none;
}

.lang-select__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 4px;
  color: #fff;
  line-height: 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.lang-select__trigger::-webkit-details-marker { display: none; }
.lang-select__trigger::marker { content: ""; }
.lang-select__trigger:hover { background: rgba(255, 255, 255, .12); }
.lang-select[open] .lang-select__trigger { background: rgba(255, 255, 255, .16); }

.lang-select__flag {
  width: 22px;
  height: 15px;
  display: block;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
}

.lang-select__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;              /* 触发按钮靠导航右端，菜单向左展开，避免被屏幕右缘截断 */
  left: auto;
  z-index: 80;
  min-width: 172px;
  padding: 6px;
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.lang-select__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 5px;
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.lang-select__option:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.lang-select__option.is-active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.lang-select__option .lang-select__label { flex: 1 1 auto; }
.lang-select__check {
  width: 16px;
  height: 16px;
  color: #f59e0b;
  flex: none;
}
.lang-select__option:not(.is-active) .lang-select__check { visibility: hidden; }

/* 移动端：汉堡菜单里的切换器左对齐铺开一点 */
.mobile-menu .lang-select { margin-bottom: 4px; }
.mobile-menu .lang-select__menu { left: 0; }
