/* ============================================================
   Harmony 优化层 —— 移动端兼容 + 体验增强
   加载顺序：assets/site.css 之后
   原则：不改变原站视觉风格，只做兼容性、易用性、性能增强
   ============================================================ */

/* ---------- 1. 全局基础 ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 110px; /* 固定导航点击锚点时避免被遮挡 */
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

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

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

::selection {
  background: rgba(255, 60, 0, 0.35);
  color: #fff;
}

/* 桌面端自定义滚动条 */
@media (min-width: 1025px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: #0a0e27;
  }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff3c00, #1a73e8);
    border-radius: 8px;
    border: 2px solid #0a0e27;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff6b00, #4a90e2);
  }
}

/* ---------- 2. 导航栏：整齐换行 + 断点优化 ---------- */
.navbar {
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
  padding-top: max(18px, env(safe-area-inset-top));
}

.nav-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 8px;
}

.nav-links a {
  white-space: nowrap;
}

/* 平板 / 窄桌面：改用汉堡菜单，避免导航被挤成多行 */
@media (max-width: 1100px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

/* 中等桌面：导航换行时增大首屏顶部留白，避免与固定导航重叠 */
@media (min-width: 1101px) and (max-width: 1365px) {
  .hero {
    padding-top: 180px;
  }
}

/* 1366 ~ 1620：压缩导航间距与字号，保持单行 */
@media (min-width: 1366px) and (max-width: 1620px) {
  .nav-links {
    gap: 12px;
  }
  .nav-links a {
    font-size: 0.85rem;
  }
  .hero {
    padding-top: 130px;
  }
}

/* 移动端菜单打开时锁定页面滚动 */
html.menu-open {
  overflow: hidden;
}

html.menu-open .cta-float-wrap {
  display: none;
}

/* ---------- 3. Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh; /* 移动浏览器地址栏兼容 */
}

@media (max-width: 768px) {
  .hero-buttons {
    flex-wrap: wrap;
    gap: 12px;
  }
  .hero-logo-badge-row {
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero-badge {
    font-size: 0.95rem;
    padding: 10px 18px;
    line-height: 1.55;
    text-align: left;
  }
  .hero-title br {
    display: none; /* 移动端让标题自然断行 */
  }
  .hero-title {
    font-size: clamp(1.7rem, 7.4vw, 2.4rem);
  }
  .hero-subtitle {
    font-size: 0.95rem;
    padding: 0 4px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(1.55rem, 7.8vw, 1.9rem);
  }
  .btn-vertical {
    padding: 10px 12px;
  }
  .btn-vertical .v-char {
    font-size: 0.85rem;
  }
}

/* ---------- 4. 联系我们：修复单列时的网格列溢出 ---------- */
@media (max-width: 1024px) {
  .contact-wrapper {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 32px !important;
  }
  .contact-btn-area {
    grid-column: auto;
  }
  .contact-info,
  .contact-company {
    min-width: 0;
  }
}

/* ---------- 5. 平台卡片：内容可收缩，避免撑破容器 ---------- */
.platform-info {
  min-width: 0;
}
.platform-info h3,
.platform-info p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 480px) {
  .platform-card {
    flex-direction: column;
    gap: 16px;
  }
  .platform-tag {
    white-space: normal;
  }
}

/* ---------- 6. 统计数字：小屏自适应 ---------- */
@media (max-width: 480px) {
  .stat-item-pair {
    min-width: 0;
    padding: 20px 16px;
    gap: 20px;
  }
  .stat-item-pair .stat-number {
    font-size: 1.8rem;
  }
  .stat-item-pair .stat-label {
    font-size: 0.8rem;
    white-space: normal;
  }
}

/* ---------- 6.1 统计数字：手机端用实色，避免渐变文字在部分机型发暗/不显示 ---------- */
@media (max-width: 768px) {
  .stat-number,
  .stat-item-pair .stat-number {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: #ff5a1f !important;
    white-space: nowrap;
    font-size: clamp(1.5rem, 7.5vw, 2rem);
  }
}

/* ---------- 7. 价格表：移动端横向滚动优化 ---------- */
.pt-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 60, 0, 0.5) transparent;
}
.pt-wrap::-webkit-scrollbar {
  height: 6px;
}
.pt-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 60, 0, 0.5);
  border-radius: 3px;
}

@media (max-width: 768px) {
  .price-table {
    min-width: 640px;
  }
}

/* ---------- 7.1 价格表：手机端改为卡片式，免横向滑动 ---------- */
@media (max-width: 768px) {
  .pt-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }
  .price-table,
  .price-table tbody,
  .price-table tr,
  .price-table td {
    display: block;
    width: 100%;
  }
  .price-table {
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
  }
  .price-table thead {
    display: none;
  }
  .price-table tr {
    margin-bottom: 14px;
    padding: 6px 16px 14px;
    border: 1px solid var(--dark-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
  }
  .price-table tr.pt-featured {
    border-color: rgba(255, 60, 0, 0.45);
  }
  .price-table td {
    border: none !important;
    padding: 8px 0 !important;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .price-table td::before {
    display: block;
    margin-bottom: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
  }
  .price-table td:nth-child(1) {
    padding-top: 12px !important;
  }
  .price-table td:nth-child(1)::before {
    content: none;
  }
  .price-table td:nth-child(2)::before {
    content: "核心内容";
  }
  .price-table td:nth-child(3)::before {
    content: "价格";
  }
  .price-table td:nth-child(4)::before {
    content: "备注";
  }
  .price-table td:nth-child(3) {
    font-size: 1.05rem;
  }
}

/* ---------- 8. 触摸目标：移动端按钮高度 ≥ 44px ---------- */
@media (max-width: 768px) {
  .btn-primary,
  .btn-v-primary,
  .btn-v-secondary,
  .coop-btn,
  .pricing-btn,
  .form-submit {
    min-height: 44px;
  }
  .mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: 100%;
  }
}

/* ---------- 8.1 右侧悬浮 CTA：移动端改窄边竖排，尽量减少遮挡正文 ---------- */
@media (max-width: 768px) {
  .cta-float-wrap {
    top: auto !important;
    right: 0 !important;
    bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    transform: none !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 6px !important;
  }
  .cta-float-btn {
    writing-mode: vertical-rl !important;
    padding: 12px 6px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    letter-spacing: 2px !important;
    min-width: 0 !important;
    border-radius: 8px 0 0 8px !important;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.35) !important;
  }
  .footer {
    padding-bottom: 84px;
  }
}

/* ---------- 9. 推荐服务：极窄屏防溢出 ---------- */
@media (max-width: 360px) {
  #recommend [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- 10. 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
