/**
 * 移动端专用样式
 * 基于设备检测脚本添加的CSS类进行样式优化
 */

/* 样式加载保护 - 防止初始化时的闪烁 */
body:not(.mobile-detection-ready) .nav-links {
  visibility: hidden;
}

body.mobile-detection-ready .nav-links {
  visibility: visible;
  transition: all 0.3s ease;
}

/* 设备类型过渡保护 */
body {
  transition: none;
}

body.mobile-detection-ready {
  transition: all 0.3s ease;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: var(--transition);
  z-index: 1001;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 44px; /* 符合移动端触摸标准 */
  min-height: 44px;
}

.mobile-menu-toggle:hover {
  background: var(--glass-bg);
  color: var(--secondary);
}

.mobile-menu-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

/* 移动端导航样式 */
.device-mobile .mobile-menu-toggle {
  display: block !important;
}

.device-mobile .nav-container {
  position: relative;
}

.device-mobile .nav-links.mobile-nav {
  position: fixed !important;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(250, 250, 250, 0.95) 100%
  );
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex !important;
  flex-direction: column;
  padding: 80px 30px 30px;
  transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1000;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.device-mobile .nav-links.mobile-nav.mobile-nav-open {
  left: 0;
}

.device-mobile .nav-links.mobile-nav a {
  display: block;
  padding: 15px 0;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--medium-gray);
  transition: var(--transition);
}

.device-mobile .nav-links.mobile-nav a:hover {
  color: var(--secondary);
  padding-left: 10px;
}

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

/* 移动端遮罩层 */
.device-mobile .nav-links.mobile-nav.mobile-nav-open::before {
  content: "";
  position: fixed;
  top: 0;
  left: 280px;
  width: calc(100vw - 280px);
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* 移动端头部优化 */
.device-mobile header {
  padding: 15px 20px;
  position: relative;
}

.device-mobile .logo {
  font-size: 1.5rem;
}

/* 移动端主视觉区域优化 */
.device-mobile .hero {
  padding: 60px 0 50px; /* 增加顶部内边距避免导航栏遮挡 */
  text-align: center;
}

/* 移动端主内容区域防遮挡 */
.device-mobile main {
  padding-top: 80px; /* 为固定导航栏预留空间 */
}

.device-mobile .section {
  scroll-margin-top: 80px; /* 锚点跳转时的偏移量 */
}

.device-mobile .hero-layout {
  grid-template-columns: 1fr;
  gap: 30px;
}

.device-mobile .sponsor-name {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 15px;
}

.device-mobile .hero-tagline {
  font-size: 1.3rem;
  line-height: 1.4;
  margin-bottom: 20px;
}

.device-mobile .hero-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 25px;
}

.device-mobile .spokesperson-image {
  max-width: 280px;
  margin: 0 auto;
}

/* 移动端统计数据优化 */
.device-mobile .hero-stats {
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 30px;
}

.device-mobile .stat-item {
  padding: 20px 15px;
}

.device-mobile .stat-number {
  font-size: 2rem;
}

.device-mobile .stat-label {
  font-size: 0.9rem;
}

/* 移动端按钮优化 */
.device-mobile .cta-button,
.device-mobile .btn-primary,
.device-mobile .btn-secondary {
  min-height: 48px !important;
  padding: 14px 24px !important;
  font-size: 1rem !important;
  border-radius: 12px !important;
  display: block !important;
  width: 100% !important;
  max-width: 280px !important;
  margin: 0 auto !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.device-mobile .cta-buttons {
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

/* 移动端章节标题优化 */
.device-mobile .section {
  padding: 60px 0;
}

.device-mobile .section-title h2 {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 15px;
}

.device-mobile .section-title p {
  font-size: 1rem;
  line-height: 1.6;
}

/* 移动端网格布局优化 */
.device-mobile .strengths-grid,
.device-mobile .support-grid {
  grid-template-columns: 1fr;
  gap: 25px;
  padding: 0 10px;
}

.device-mobile .strength-card,
.device-mobile .support-card {
  padding: 30px 25px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(248, 250, 252, 0.9) 100%
  );
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.1);
  transition: all 0.3s ease;
}

.device-mobile .strength-card:hover,
.device-mobile .support-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
}

.device-mobile .strength-card h3,
.device-mobile .support-card h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: var(--primary);
  font-weight: 600;
}

.device-mobile .strength-card p,
.device-mobile .support-card p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* 六大支持体系特殊优化 */
.device-mobile .support-item {
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.05) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  border: 2px solid rgba(212, 175, 55, 0.15);
  border-radius: 20px;
  padding: 35px 25px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.device-mobile .support-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(212, 175, 55, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

.device-mobile .support-item:hover::before {
  left: 100%;
}

.device-mobile .support-item h4 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 15px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.device-mobile .support-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.device-mobile .support-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(212, 175, 55, 0.2);
  border-color: var(--secondary);
}

/* 移动端表格优化 */
.device-mobile .budget-table {
  font-size: 0.9rem;
}

.device-mobile .budget-table th,
.device-mobile .budget-table td {
  padding: 12px 8px;
}

.device-mobile .budget-container {
  padding: 25px 15px;
  margin: 0 10px;
}

/* 移动端表单优化 */
.device-mobile .modal-content {
  width: 95%;
  margin: 20px auto;
  max-height: 90vh;
  border-radius: 16px;
}

.device-mobile .appointment-form {
  padding: 25px 20px;
}

.device-mobile .form-group {
  margin-bottom: 20px;
}

.device-mobile .form-group label {
  font-size: 1rem;
  margin-bottom: 8px;
}

.device-mobile .form-group input,
.device-mobile .form-group textarea {
  padding: 14px 16px;
  font-size: 16px; /* 防止iOS缩放 */
  border-radius: 10px;
  min-height: 48px;
}

.device-mobile .form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.device-mobile .form-actions {
  flex-direction: column;
  gap: 15px;
  margin-top: 25px;
}

.device-mobile .btn-cancel,
.device-mobile .btn-submit {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  min-height: 48px;
}

/* 移动端流程步骤优化 */
.device-mobile .process-flow {
  flex-direction: column;
  align-items: center;
}

.device-mobile .process-step {
  margin: 0 0 30px 0;
  max-width: 280px;
}

.device-mobile .process-flow::before {
  display: none;
}

/* 移动端页脚优化 */
.device-mobile .footer {
  padding: 50px 0 30px;
  background: linear-gradient(135deg, var(--primary) 0%, #1a1a2e 100%);
  position: relative;
  overflow: hidden;
}

.device-mobile .footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--secondary),
    var(--accent-gold),
    var(--secondary)
  );
}

.device-mobile .footer-container {
  grid-template-columns: 1fr;
  gap: 40px;
  text-align: center;
  padding: 0 20px;
}

.device-mobile .footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.device-mobile .footer-logo span {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--accent-gold);
  margin-top: 5px;
  letter-spacing: 2px;
}

.device-mobile .footer-text {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.device-mobile .contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
}

.device-mobile .contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  transition: all 0.3s ease;
}

.device-mobile .contact-item:hover {
  background: rgba(212, 175, 55, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.device-mobile .contact-item i {
  font-size: 1.2rem;
  color: var(--accent-gold);
  min-width: 20px;
}

.device-mobile .contact-item div {
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
}

.device-mobile .footer-section h4 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--white);
  font-weight: 600;
}

.device-mobile .footer-section p,
.device-mobile .footer-section a {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

.device-mobile .footer-section a:hover {
  color: var(--accent-gold);
}

/* 底部版权信息优化 */
.device-mobile .footer-bottom {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.device-mobile .footer-bottom p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* 触摸设备优化 */
.has-touch a,
.has-touch button {
  -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
}

.has-touch .strength-card,
.has-touch .support-card {
  transition: transform 0.2s ease;
}

.has-touch .strength-card:active,
.has-touch .support-card:active {
  transform: scale(0.98);
}

/* 小屏幕设备额外优化 */
.screen-xs .sponsor-name {
  font-size: 2.2rem;
}

.screen-xs .hero-tagline {
  font-size: 1.2rem;
}

.screen-xs .section-title h2 {
  font-size: 1.8rem;
}

.screen-xs .modal-content {
  width: 98%;
  margin: 10px auto;
}

.screen-xs .appointment-form {
  padding: 20px 15px;
}

/* 平板设备优化 */
.device-tablet .hero-stats {
  grid-template-columns: repeat(2, 1fr);
}

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

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

.device-tablet .modal-content {
  width: 80%;
  max-width: 600px;
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
  .device-mobile .hero {
    padding: 40px 0 30px;
  }

  .device-mobile .sponsor-name {
    font-size: 2rem;
  }

  .device-mobile .hero-tagline {
    font-size: 1.1rem;
  }

  .device-mobile .section {
    padding: 40px 0;
  }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .device-mobile .spokesperson-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .device-mobile .nav-links.mobile-nav {
    background: linear-gradient(
      135deg,
      rgba(18, 18, 18, 0.95) 0%,
      rgba(33, 33, 33, 0.95) 100%
    );
  }

  .device-mobile .nav-links.mobile-nav a {
    color: var(--white);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

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

/* 强制移动端样式应用 - 解决兼容性问题 */
@media (max-width: 768px) {
  body.device-mobile .nav-links.mobile-nav {
    display: flex !important;
    position: fixed !important;
  }

  body.device-mobile .mobile-menu-toggle {
    display: block !important;
  }

  body.device-mobile .nav-links:not(.mobile-nav) {
    display: none !important;
  }

  /* 确保导航栏高度一致 */
  body.device-mobile .navbar {
    height: 80px !important;
    display: flex !important;
    align-items: center !important;
  }

  /* 修复运营体系布局 */
  body.device-mobile .advantages-container {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
  }

  body.device-mobile .advantage {
    margin-bottom: 25px !important;
    padding: 25px 20px !important;
    border-radius: 15px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08) !important;
  }

  body.device-mobile .advantage-number {
    font-size: 1.2rem !important;
    margin-bottom: 10px !important;
  }
}

@media (max-width: 480px) {
  body.device-mobile .sponsor-name {
    font-size: 2.2rem !important;
  }

  body.device-mobile .hero-tagline {
    font-size: 1.2rem !important;
  }

  /* 小屏幕下的额外优化 */
  body.device-mobile .mobile-menu-toggle {
    right: 15px !important;
    padding: 10px !important;
  }

  body.device-mobile .support-item {
    padding: 25px 20px !important;
  }

  body.device-mobile .contact-item {
    padding: 12px 15px !important;
    font-size: 0.9rem !important;
  }
}

/* 打印样式 */
@media print {
  .mobile-menu-toggle,
  .nav-links.mobile-nav {
    display: none !important;
  }
}

/* 移动端hero区域调整 */
body.device-mobile .hero {
  min-height: 840px !important;
}

body.device-mobile .hero-content {
  margin-top: 30px !important; /* 增加移动端内容顶部外边距 */
  padding: 0 20px !important;
}

body.device-mobile .sponsor-tag {
  margin-top: 20px !important; /* 增加移动端标签顶部外边距 */
  font-size: 0.8rem !important;
  padding: 6px 16px !important;
}
