/**
 * 长沙市峰言科技有限公司 - 响应式样式
 * 移动优先设计：基础样式为移动端，通过 min-width 媒体查询向上适配
 */

/* ============ 小屏幕基础调整 (< 768px) ============ */

/* 头部 */
.header-search-box {
  display: none;
}

.header-user-area {
  gap: var(--space-sm);
}

.mobile-menu-toggle {
  display: flex;
}

.nav-category-list {
  position: fixed;
  top: var(--header-total-height);
  left: 0;
  right: 0;
  background: var(--brand-primary);
  flex-direction: column;
  height: auto;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s;
  z-index: 999;
  box-shadow: var(--shadow-lg);
}

.nav-category-list.mobile-open {
  max-height: 400px;
}

.nav-category-item {
  height: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-category-item a {
  height: auto;
  padding: 12px var(--space-lg);
}

/* 底部 */
.footer-main {
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.footer-bottom-inner {
  flex-direction: column;
  text-align: center;
}

/* 首页横幅 */
.homepage-banner {
  padding: var(--space-sm) 0;
  max-height: 120px;
}

.homepage-banner h1 {
  font-size: var(--text-xl);
}

.homepage-banner-subtitle {
  font-size: var(--text-sm);
}

.homepage-banner-actions {
  flex-direction: column;
  gap: var(--space-sm);
}

.banner-cta-btn {
  width: 80%;
  text-align: center;
}

/* 产品网格 */
.product-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

/* 新闻预览 */
.news-preview-list {
  grid-template-columns: 1fr;
}

/* 统计栏 */
.stats-ribbon-inner {
  flex-direction: column;
  gap: var(--space-md);
}

.stats-ribbon-inner .stats-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* 两栏布局 */
.two-col-layout {
  grid-template-columns: 1fr;
}

.two-col-layout--reverse {
  grid-template-columns: 1fr;
}

/* 服务卡片 */
.service-card-large {
  flex-direction: column;
}

.service-card-thumb {
  width: 100%;
  height: 180px;
}

/* 服务详情 */
.service-detail-top {
  flex-direction: column;
}

.service-detail-gallery {
  width: 100%;
}

.service-detail-main-img {
  height: 220px;
}

.service-detail-buttons {
  flex-direction: column;
}

.service-detail-meta {
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.related-products-grid {
  grid-template-columns: 1fr;
}

/* 关于我们 */
.about-license-grid {
  grid-template-columns: 1fr;
}

.team-grid {
  grid-template-columns: 1fr;
}

.about-stats-grid {
  grid-template-columns: repeat(2, 1fr);
}

.qualification-grid {
  grid-template-columns: 1fr;
}

/* 联系我们 */
.contact-info-grid {
  grid-template-columns: 1fr;
}

.map-placeholder {
  height: 200px;
}

/* 支付页 */
.payment-layout {
  grid-template-columns: 1fr;
}

.payment-service-card {
  position: static;
}

/* 新闻页 */
.news-article-card {
  flex-direction: column;
}

.news-article-thumb {
  width: 100%;
  height: 180px;
}

/* 招聘页 */
.career-position-header {
  flex-direction: column;
}

/* 法务文档 */
.legal-document {
  padding: var(--space-lg) var(--space-md);
}

/* Cookie 条幅 */
.cookie-notice {
  flex-direction: column;
  text-align: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}

/* 成交通知 */
.order-notification {
  left: 10px;
  right: 10px;
  max-width: none;
  bottom: 10px;
}

/* 浮动按钮 */
.back-to-top-btn {
  right: 12px;
  bottom: 70px;
  width: 38px;
  height: 38px;
}

.ai-chat-widget {
  right: 12px;
  bottom: 118px;
  width: 38px;
  height: 38px;
}

/* 面包屑 */
.breadcrumb-nav {
  font-size: var(--text-xs);
  overflow-x: auto;
  white-space: nowrap;
}

/* 分页 */
.pagination-bar {
  flex-wrap: wrap;
}

/* 404 */
.error-code {
  font-size: 64px;
}

/* ============ 平板适配 (>= 768px) ============ */
@media (min-width: 768px) {
  .header-search-box {
    display: block;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .nav-category-list {
    position: static;
    flex-direction: row;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  .nav-category-item {
    border-bottom: none;
  }

  .footer-main {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer-bottom-inner {
    flex-direction: row;
    text-align: left;
  }

  .homepage-banner {
    padding: var(--space-md) 0;
    max-height: 160px;
  }

  .homepage-banner h1 {
    font-size: var(--text-2xl);
  }

  .homepage-banner-actions {
    flex-direction: row;
  }

  .banner-cta-btn {
    width: auto;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }

  .news-preview-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-ribbon-inner {
    flex-direction: row;
  }

  .stats-ribbon-inner .stats-item {
    display: block;
  }

  .two-col-layout {
    grid-template-columns: 200px 1fr;
  }

  .two-col-layout--reverse {
    grid-template-columns: 1fr 240px;
  }

  .service-card-large {
    flex-direction: row;
  }

  .service-card-thumb {
    width: 200px;
    height: 150px;
  }

  .service-detail-top {
    flex-direction: row;
  }

  .service-detail-gallery {
    width: 340px;
  }

  .service-detail-buttons {
    flex-direction: row;
  }

  .about-license-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .news-article-card {
    flex-direction: row;
  }

  .news-article-thumb {
    width: 220px;
    height: 150px;
  }

  .career-position-header {
    flex-direction: row;
  }

  .payment-layout {
    grid-template-columns: 1fr 300px;
  }

  .cookie-notice {
    flex-direction: row;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
  }

  .back-to-top-btn,
  .ai-chat-widget {
    width: 44px;
    height: 44px;
  }

  .back-to-top-btn {
    right: 20px;
    bottom: 80px;
  }

  .ai-chat-widget {
    right: 20px;
    bottom: 136px;
  }

  .related-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .legal-document {
    padding: var(--space-xxl) var(--space-xl);
  }
}

/* ============ 桌面端适配 (>= 1024px) ============ */
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .news-preview-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .two-col-layout {
    grid-template-columns: 240px 1fr;
  }

  .two-col-layout--reverse {
    grid-template-columns: 1fr 280px;
  }

  .service-card-thumb {
    width: 220px;
    height: 165px;
  }

  .service-detail-gallery {
    width: 400px;
  }

  .service-detail-main-img {
    height: 300px;
  }

  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .qualification-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .map-placeholder {
    height: 300px;
  }

  .payment-layout {
    grid-template-columns: 1fr 340px;
  }

  .news-article-thumb {
    width: 240px;
    height: 160px;
  }

  .related-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .error-code {
    font-size: 96px;
  }
}

/* ============ 大屏幕适配 (>= 1280px) ============ */
@media (min-width: 1280px) {
  :root {
    --container-width: min(100%, 1200px);
  }

  .header-search-box {
    max-width: 400px;
  }
}

/* ============ 打印样式 ============ */
@media print {
  .site-header,
  .site-footer,
  .cookie-notice,
  .order-notification,
  .float-btn,
  .ai-chat-widget,
  .back-to-top-btn,
  .page-loader,
  .login-modal-overlay {
    display: none !important;
  }

  .page-main {
    padding-top: 0;
  }

  body {
    background: white;
    color: black;
  }

  a {
    color: black;
    text-decoration: underline;
  }
}

/* 热销推荐 - 手机端改为纵向网格,避免横向溢出 */
.hot-products-scroll {
  overflow-x: visible;
  overflow-y: visible;
}

.hot-products-track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  width: 100%;
  min-width: 0;
}

.hot-product-card {
  width: auto;
  flex-shrink: 1;
}
