/**
 * 移动端专用样式 — 仅在小屏设备生效
 * PC 端样式见 style.css，本文件不做 PC 端修改
 */

/* ===== 平板及以下 (≤1024px) ===== */
@media (max-width: 1024px) {
  :root {
    --section-padding: 64px 32px;
  }

  .header {
    padding: 0 32px;
  }

  .header-inner {
    padding: 0;
    gap: 16px;
  }

  .hero {
    padding: calc(var(--header-height) + 48px) 32px 48px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }

  .hero-glass-card {
    width: 100%;
    max-width: 100%;
  }

  .about-inner {
    flex-direction: column;
    gap: 40px;
  }

  .about-image {
    flex: none;
    width: 100%;
    max-width: 100%;
    height: 280px;
  }

  .service-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .partner-logo {
    flex: 0 0 180px;
    width: 180px;
  }

  .partner-logo img {
    width: 148px;
    height: 56px;
  }

  /* 语言切换 — 简写模式 */
  .header-right .lang-switch {
    flex-shrink: 0;
    gap: 0;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
  }

  .lang-divider {
    display: none;
  }

  .lang-btn .lang-full {
    display: none;
  }

  .lang-btn .lang-short[hidden] {
    display: inline-flex !important;
  }

  .lang-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: var(--fw-semibold);
    border-radius: 4px;
    line-height: 1;
  }

  .lang-btn.active {
    background: rgba(249, 115, 22, 0.28);
    color: var(--accent);
  }

  .header-right .btn-header-cta {
    display: none;
  }
}

/* ===== 手机 (≤768px) ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --section-padding: 48px 20px;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
  }

  /* Header — 移除 backdrop-filter 避免 fixed 菜单被裁剪 */
  .header {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(17, 24, 39, 0.98);
  }

  .header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    min-height: var(--header-height);
  }

  .header .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    min-width: 0;
    flex: none;
    gap: 0;
  }

  .header .logo-text {
    display: none;
  }

  .header-right {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
  }

  .header-right .lang-switch,
  .header-right .nav-toggle {
    pointer-events: auto;
  }

  .nav-toggle {
    display: flex;
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
    padding: 6px;
    -webkit-tap-highlight-color: transparent;
  }

  /* 移动端全屏侧栏菜单 */
  .nav.nav-mobile,
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    background: rgba(17, 24, 39, 0.98);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 20px 32px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1001;
  }

  .nav.open {
    transform: translateX(0);
  }

  .nav a {
    font-size: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .header-right .lang-switch {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
  }

  .header-right .btn-header-cta {
    display: none;
  }

  .lang-divider {
    display: none;
  }

  .lang-btn .lang-full {
    display: none;
  }

  .lang-btn .lang-short[hidden] {
    display: inline-flex !important;
  }

  .lang-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: var(--fw-semibold);
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .lang-btn.active {
    background: rgba(249, 115, 22, 0.28);
    color: var(--accent);
  }

  .header .logo img {
    width: 72px;
    height: 42px;
  }

  /* Hero — 统计卡片在上，按钮并排置于下方 */
  .hero {
    min-height: auto;
    padding: calc(var(--header-height) + 28px) 20px 36px;
  }

  .hero-inner {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }

  .hero-content {
    display: contents;
  }

  .hero-tag {
    order: 1;
    display: block;
    width: 100%;
    text-align: center;
  }

  .hero-title {
    order: 2;
    width: 100%;
    text-align: center;
    font-size: 28px;
    line-height: 1.25;
  }

  .hero-subtitle {
    order: 3;
    width: 100%;
    text-align: center;
    font-size: 14px;
    line-height: 1.65;
  }

  .hero-glass-card {
    order: 4;
    width: 100%;
    max-width: 100%;
    padding: 20px;
    gap: 16px;
  }

  .hero-buttons {
    order: 5;
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
  }

  .hero-buttons .btn-primary,
  .hero-buttons .btn-outline {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 13px 16px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero-stat-num {
    font-size: 24px;
    min-width: 52px;
  }

  .hero-stat-label {
    font-size: 12px;
  }

  /* Stats */
  .stats-bar {
    padding: 24px 16px;
  }

  .stats-bar-inner {
    flex-wrap: wrap;
    gap: 20px 12px;
  }

  .stat-item {
    flex: 0 0 calc(50% - 6px);
  }

  .stat-num {
    font-size: 28px;
  }

  /* Sections common */
  .section-title {
    font-size: 26px;
  }

  .about .section-title {
    font-size: 28px;
  }

  .section-subtitle {
    font-size: 14px;
  }

  .about,
  .services,
  .partners,
  .advantages,
  .industries {
    padding: var(--section-padding);
  }

  .services-inner,
  .partners-inner,
  .advantages-inner {
    gap: 32px;
  }

  .about-image {
    height: 220px;
  }

  .about-content {
    align-items: center;
    text-align: center;
  }

  .about-features {
    align-items: center;
    width: 100%;
  }

  .about-feature {
    justify-content: center;
  }

  .service-card {
    padding: 24px;
  }

  /* Partners — 全部 Logo 连续两列排列，不拆行留空 */
  .partners-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .partners-header {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }

  .partner-row {
    display: contents;
  }

  .partner-logo {
    flex: none;
    width: 100%;
    max-width: none;
    height: 72px;
    padding: 10px;
  }

  .partner-logo img {
    width: 100%;
    max-width: 100%;
    height: 44px;
    object-fit: contain;
  }

  /* Advantages */
  .advantages-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .advantage-card {
    padding: 22px;
  }

  /* Industries */
  .industry-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .industry-card {
    padding: 20px;
  }

  /* Contact */
  .contact {
    min-height: auto;
    padding: 40px 16px;
    justify-content: center;
    background-position: center;
  }

  .contact-inner {
    justify-content: center;
  }

  .contact-form-card {
    max-width: 100%;
    padding: 28px 20px;
    gap: 16px;
    text-align: center;
  }

  .contact-form-card .section-tag,
  .contact-form-card h2,
  .contact-info {
    text-align: center;
  }

  .contact-form {
    text-align: left;
  }

  .contact-form-card h2 {
    font-size: 20px;
  }

  .form-group input {
    height: 48px;
    font-size: 16px;
  }

  .btn-submit {
    min-height: 48px;
  }

  /* Contact modal */
  .contact-modal {
    padding: 16px;
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .contact-modal-dialog {
    padding: 36px 24px 24px;
    max-width: 100%;
  }

  .contact-modal-message {
    font-size: 15px;
  }

  .contact-modal-confirm {
    min-height: 48px;
  }

  /* CTA */
  .cta-banner {
    padding: 36px 20px;
  }

  .cta-inner {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .cta-text h2 {
    font-size: 22px;
  }

  .cta-text p {
    font-size: 14px;
  }

  .btn-cta {
    width: 100%;
    text-align: center;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
  }

  /* Footer */
  .footer {
    padding: 36px 20px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-col {
    align-items: center;
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-logo .logo-text {
    align-items: center;
    text-align: center;
  }

  .footer-logo .logo-name-zh {
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
    font-size: 18px;
    letter-spacing: 2px;
  }

  .footer-logo .logo-name-en {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    white-space: normal;
    line-height: 1.3;
    text-align: center;
  }

  .footer-desc {
    text-align: center;
  }

  .footer-copyright {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-legal {
    justify-content: center;
  }

  /* Legal pages */
  .legal-main {
    padding: calc(var(--header-height) + 20px) 16px 40px;
  }

  .legal-inner {
    padding: 28px 20px;
    border-radius: 8px;
  }

  .legal-back {
    margin-bottom: 20px;
    min-height: 44px;
    align-items: center;
  }

  .legal-title {
    font-size: 24px;
  }

  .legal-content h2 {
    font-size: 16px;
    margin-top: 24px;
  }

  .legal-content p,
  .legal-content li {
    font-size: 14px;
  }

  /* Back to top */
  .back-to-top {
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }

  /* Touch feedback */
  .btn-primary,
  .btn-outline,
  .btn-cta,
  .btn-submit,
  .contact-modal-confirm,
  .back-to-top,
  .nav-toggle,
  .lang-btn {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ===== 小屏手机 (≤480px) ===== */
@media (max-width: 480px) {
  .hero-title {
    font-size: 24px;
  }

  .hero-buttons {
    flex-direction: row;
    gap: 10px;
  }

  .hero-buttons .btn-primary,
  .hero-buttons .btn-outline {
    flex: 1;
    width: auto;
    padding: 12px 10px;
    font-size: 13px;
  }

  .section-title {
    font-size: 24px;
  }

  .about .section-title {
    font-size: 26px;
  }

  .stat-item {
    flex: 0 0 calc(50% - 6px);
  }

  html[lang="en"] .footer-logo .logo-name-zh {
    text-align: center;
  }
}

/* ===== 横屏手机 ===== */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: 24px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-content {
    display: contents;
  }

  .hero-glass-card {
    width: 100%;
    max-width: 100%;
  }

  .hero-buttons {
    flex-direction: row;
  }

  .nav {
    padding: 16px 20px;
  }

  .nav a {
    padding: 10px 0;
  }
}
