/* ==================== 通用响应式布局 ==================== */

/* 基础重置与优化 */
* {
  box-sizing: border-box;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* 确保所有容器在移动端正确适应 */
.container, 
.container-fluid,
.center,
.type-area {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
}

/* ==================== 移动端优先断点设置 ==================== */
/* 超小屏幕 (手机, <576px) */
@media (max-width: 575.98px) {
  /* 全局容器适配 */
  .container {
    max-width: 100% !important;
    padding: 0 15px !important;
  }

  .center,
  .type-area {
    width: 100% !important;
    padding: 0 15px;
  }

  /* 字体大小适配 */
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 24px !important;
  }

  h2 {
    font-size: 20px !important;
  }

  h3 {
    font-size: 18px !important;
  }

  /* 首页服务项 - 单列布局 */
  .service .service-item {
    width: 100% !important;
    margin-left: 0 !important;
    margin-bottom: 20px;
    height: auto !important;
    padding: 30px 20px !important;
    float: none !important;
    display: block !important;
  }

  /* 选择我们区块 */
  .choose {
    height: auto !important;
    padding: 40px 0 !important;
  }

  .choose .choose-box .choose-item {
    width: 50% !important;
    margin-bottom: 30px;
    float: none !important;
    display: inline-block !important;
    vertical-align: top !important;
  }

  /* 案例展示 */
  .case .case-item {
    width: 100% !important;
    float: none !important;
  }

  /* 团队介绍 */
  .team-per-item,
  .team-per-item-center {
    width: 45% !important;
    margin: 2.5% !important;
  }

  /* 新闻页面 */
  .news-list-item {
    flex-direction: column;
  }

  .news-list-item img {
    width: 100% !important;
    margin-bottom: 15px;
  }

  /* 联系表单 */
  .contact-form {
    padding: 20px;
  }

  /* 按钮调整 */
  .btn {
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
    max-width: 100%;
  }
}

/* 小屏幕 (平板, 576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .service .service-item {
    width: 48% !important;
    margin-left: 2% !important;
    margin-bottom: 20px;
  }

  .service .service-item:nth-child(2n+1) {
    margin-left: 0 !important;
  }

  .choose .choose-box .choose-item {
    width: 50% !important;
  }

  .team-per-item,
  .team-per-item-center {
    width: 30% !important;
  }

  .products-layout {
    flex-direction: column;
  }

  .products-sidebar {
    width: 100% !important;
    min-width: 100% !important;
  }
}

/* 中等屏幕 (平板/小笔记本, 768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .service .service-item {
    width: 48% !important;
    margin-left: 2% !important;
    margin-bottom: 20px;
  }

  .service .service-item:nth-child(2n+1) {
    margin-left: 0 !important;
  }

  .choose .choose-box .choose-item {
    width: 50% !important;
  }

  .team-per-item {
    width: 30% !important;
  }

  .team-per-item-center {
    width: 35% !important;
  }
}

/* 大屏幕 (桌面, 992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* 保持现有样式，微调 */
  .service .service-item {
    width: 23.5% !important;
  }
}

/* 超大屏幕 (大桌面, ≥1200px) */
@media (min-width: 1200px) {
  /* 保持现有样式 */
}

/* ==================== 页面特定响应式优化 ==================== */

/* 首页特定优化 */
@media (max-width: 767.98px) {
  #lead {
    padding: 1.5rem !important;
    flex-direction: column;
    text-align: center;
  }

  #lead span {
    font-size: 2rem !important;
  }

  .home-carousel__track {
    /* 按图片真实比例自适应，避免固定高度产生的空白间距 */
    aspect-ratio: 1800 / 766 !important;
    height: auto !important;
  }
}

/* 关于我们页面优化 */
@media (max-width: 991.98px) {
  .page-about .container {
    max-width: 100% !important;
    padding: 0 15px;
  }

  .about-intro {
    flex-direction: column;
  }

  .about-intro .col-md-6 {
    width: 100%;
    margin-bottom: 30px;
  }
}

/* 产品页面优化 */
@media (max-width: 767.98px) {
  .product-detail {
    padding: 20px 15px;
  }

  .product-gallery {
    flex-direction: column;
  }

  .product-specs {
    font-size: 14px;
  }
}

/* 新闻页面优化 */
@media (max-width: 767.98px) {
  .news-detail {
    padding: 20px 15px;
  }

  .news-content {
    font-size: 15px;
    line-height: 1.8;
  }
}

/* 项目案例页面优化 */
@media (max-width: 767.98px) {
  .project-grid {
    grid-template-columns: 1fr !important;
  }

  .project-item {
    margin-bottom: 20px;
  }
}

/* ==================== 触摸设备优化 ==================== */
@media (hover: none) and (pointer: coarse) {
  /* 增大点击区域 */
  .top-status-bar__link,
  .btn,
  a {
    min-height: 44px;
    min-width: 44px;
  }

  /* 优化下拉菜单 */
  .top-status-bar__dropdown {
    opacity: 0;
    visibility: hidden;
  }

  .top-status-bar__item--has-dropdown.is-dropdown-open .top-status-bar__dropdown {
    opacity: 1;
    visibility: visible;
  }
}

/* ==================== 打印样式 ==================== */
@media print {
  .top-status-bar,
  .home-carousel,
  .no-print {
    display: none !important;
  }
}

/* ==================== 综合布局适配 ==================== */

/* 确保所有布局在各种屏幕尺寸下正确显示 */
.row {
  margin-left: -15px !important;
  margin-right: -15px !important;
}

[class*="col-"] {
  padding-left: 15px !important;
  padding-right: 15px !important;
}

/* Flex布局支持 */
.d-flex {
  display: flex !important;
  flex-wrap: wrap !important;
}

/* 响应式Flex方向 */
@media (max-width: 767.98px) {
  .flex-md-row {
    flex-direction: column !important;
  }
  
  /* 表格和长内容允许横向滚动 */
  .table-responsive,
  table,
  .long-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 表单元素宽度100% */
  input, 
  select, 
  textarea,
  button,
  .form-control {
    max-width: 100% !important;
    width: 100% !important;
  }
  
  /* 导航菜单调整 */
  .nav,
  .navbar-nav {
    flex-direction: column !important;
    width: 100% !important;
  }
  
  .nav-item,
  .nav-link {
    width: 100% !important;
    text-align: center !important;
  }
}

/* ==================== 响应式图片和媒体 ==================== */
.responsive-img {
  width: 100%;
  height: auto;
}

.bg-image {
  background-size: cover !important;
  background-position: center !important;
}

/* ==================== 无障碍访问优化 ==================== */
/* 高对比度模式 */
@media (prefers-contrast: high) {
  body {
    background: white !important;
    color: black !important;
  }

  a {
    color: blue !important;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== 打印样式优化 ==================== */
@media print {
  .top-status-bar,
  .home-carousel,
  .no-print,
  nav,
  header,
  footer {
    display: none !important;
  }
  
  body {
    padding-top: 0 !important;
    font-size: 12pt;
    color: black;
    background: white;
  }
  
  a {
    color: black !important;
    text-decoration: underline !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 80%;
  }
  
  .container {
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* ==================== 横屏模式优化 ==================== */
@media (max-width: 896px) and (orientation: landscape) {
  body {
    padding-top: 64px !important;
  }
  
  .top-status-bar__inner {
    height: 64px !important;
  }
  
  .home-carousel__track {
    aspect-ratio: 1800 / 766 !important;
    height: auto !important;
  }
}

/* ================================================
   团队与合作伙伴 - 专门响应式优化
   ================================================ */

/* 超小屏幕 (手机) */
@media (max-width: 575.98px) {
  /* 移除最小宽度限制 */
  #team-introduction > div,
  #lead,
  [style*="min-width: 970px"] {
    min-width: 100% !important;
    width: 100% !important;
    padding: 0 15px !important;
  }
  
  /* 团队标题 */
  #lead {
    padding: 20px 15px !important;
  }
  
  #lead span {
    font-size: 24px !important;
  }
  
  /* 团队列表容器 - 改为垂直排列 */
  #team-per-list {
    height: auto !important;
    white-space: normal !important;
  }
  
  /* 团队成员项 */
  .team-per-item,
  .team-per-item-center {
    width: 47% !important;
    margin: 1.5% !important;
    display: inline-block !important;
    vertical-align: top !important;
    height: auto !important;
  }
  
  /* 团队成员图片 */
  .team-per-item img {
    width: 100% !important;
    height: auto !important;
  }
  
  /* 团队介绍部分 */
  #team-per-int-list {
    width: 100% !important;
    padding: 0 15px !important;
  }
  
  #team-per-int-list h4 {
    font-size: 18px !important;
  }
  
  #team-per-int-list p,
  #team-per-int-list [style*="width:500px"] {
    width: 100% !important;
    font-size: 14px !important;
    padding: 0 10px !important;
  }
  
  /* 合作伙伴部分 */
  [style*="background: #fff;padding: 0 30px;margin-top:60px;margin-bottom: 30px"] {
    min-width: 100% !important;
    padding: 20px 15px !important;
  }
  
  /* 合作伙伴展示容器 */
  .shown {
    width: 100% !important;
    height: auto !important;
  }
  
  /* 合作伙伴列表 - 改为网格 */
  #company-list {
    width: 100% !important;
    position: relative !important;
    left: 0 !important;
    white-space: normal !important;
    text-align: center !important;
  }
  
  /* 合作伙伴Logo */
  #company-list img {
    width: 140px !important;
    margin: 10px !important;
    display: inline-block !important;
    height: auto !important;
  }
  
  /* 强制停止JavaScript动画（jQuery animate 通过内联 left 移动，需用 !important 覆盖内联样式） */
  #company-list {
    animation: none !important;
    transition: none !important;
    left: 0 !important;
  }
}

/* 小屏幕 (平板) */
@media (min-width: 576px) and (max-width: 767.98px) {
  /* 移除最小宽度限制 */
  #team-introduction > div,
  #lead,
  [style*="min-width: 970px"] {
    min-width: 100% !important;
    width: 100% !important;
    padding: 0 15px !important;
  }
  
  /* 团队成员项 */
  .team-per-item,
  .team-per-item-center {
    width: 31% !important;
    margin: 1% !important;
  }
  
  /* 团队介绍部分 */
  #team-per-int-list {
    width: 100% !important;
    max-width: 500px !important;
  }
  
  #team-per-int-list p {
    width: 100% !important;
  }
  
  /* 合作伙伴Logo */
  #company-list img {
    width: 160px !important;
  }
}

/* 中等屏幕 (小笔记本) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* 调整最小宽度 */
  #team-introduction > div,
  [style*="min-width: 970px"] {
    min-width: 100% !important;
    width: 95% !important;
  }
  
  /* 团队成员项 */
  .team-per-item {
    width: 17% !important;
  }
  
  .team-per-item-center {
    width: 22% !important;
  }
}

/* ==================== 超宽屏优化 ==================== */
@media (min-width: 1600px) {
  .center,
  .type-area {
    max-width: 1400px !important;
    margin: 0 auto !important;
  }
}

@media (min-width: 1920px) {
  .center,
  .type-area {
    max-width: 1600px !important;
  }
}

/* ==================== 产品介绍 / 贷款帮助 整体宽度改为响应式 ==================== */
/* 两个区块结构相同（section-services + id="products" + .container），此规则同时覆盖 */
#products .container,
.section.section-services .container {
  width: 100% !important;
  max-width: 1600px !important;
  padding-left: clamp(15px, 5vw, 80px) !important;
  padding-right: clamp(15px, 5vw, 80px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ==================== 移动端卡片灰色边框 ==================== */
/* index.html: 产品/贷款帮助卡片(.product-card)、公司案例(.partner-item)
   news.html: 新闻列表(.partner-item)
   project.html: 人才招聘(.case-item)
   about_us.html: 门店/优势卡片(.about-terminal-item) */
@media (max-width: 767.98px) {
  .product-card,
  .partner .partner-item,
  .case .case-item,
  .about-terminal-item {
    border: 1px solid #ddd !important;
    border-radius: 0 !important;
    overflow: hidden;
  }

  .about-terminal-item {
    padding: 15px !important;
  }
}

