/* ========================================
   Products Mobile Redesign v20
   移动端专属设计 - Apple 风格版
   参考: Apple 官网设计语言
   - 完美解决文字可读性问题
   - Apple 风格边框和质感
   - 极致的视觉体验
   ======================================== */

/* ========================================
   移动端专属布局（<768px）
   ======================================== */

@media (max-width: 767px) {
  /* 重置基础布局 */
  .sec-products-tabbed {
    padding: 28px 0 36px 0;
    background: #f5f5f7;
  }

  .sec-products-tabbed .container {
    padding: 0;
    max-width: 100%;
  }

  /* 标题区域 */
  .sec-products-tabbed .section-title {
    margin-bottom: 20px;
    padding: 0 16px;
  }

  .sec-products-tabbed .section-title .label {
    font-size: 12px;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    text-transform: uppercase;
    color: #999;
    font-weight: 500;
  }

  .sec-products-tabbed .section-title h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #1d1d1f;
  }

  .sec-products-tabbed .section-title p {
    font-size: 15px;
    line-height: 1.6;
    color: #6e6e73;
    max-width: 100%;
    padding: 0;
  }

  /* 布局结构 */
  .sec-products-tabbed .products-tabbed-layout {
    display: block;
    grid-template-columns: none;
    gap: 0;
  }

  /* ========================================
     Apple 风格按钮设计
     ======================================== */

  .products-nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 0 20px 20px 20px;
    min-height: auto;
    background: transparent;
    overflow: visible;
  }

  /* Apple 风格按钮 */
  .product-nav-item {
    flex: 1;
    min-width: 0;
    height: 78px;
    padding: 10px 6px;
    border-radius: 14px;
    background: #ffffff;
    border: 0.5px solid rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.04),
      0 2px 4px rgba(0, 0, 0, 0.02);
  }

  .product-nav-item:active {
    transform: scale(0.96);
  }

  /* 移除浏览器默认的 focus 边框 */
  .product-nav-item:focus,
  .product-nav-item:focus-visible {
    outline: none;
    border: 0.5px solid rgba(0, 0, 0, 0.04);
  }

  /* 激活状态 - Apple 风格，使用半透明背景确保文字清晰 */
  .product-nav-item.active {
    background: rgba(0, 122, 255, 0.12);  /* 半透明蓝色背景 */
    border: 0.5px solid rgba(0, 0, 0, 0.04);  /* 保持与未激活相同的边框 */
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);  /* 单层品牌色阴影 */
  }

  .product-nav-item[data-product="gpu"].active {
    background: rgba(175, 82, 222, 0.12);
    border: 0.5px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px rgba(175, 82, 222, 0.15);
  }

  .product-nav-item[data-product="dedicated"].active {
    background: rgba(52, 199, 89, 0.12);
    border: 0.5px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px rgba(52, 199, 89, 0.15);
  }

  .product-nav-item[data-product="domain"].active {
    background: rgba(255, 149, 0, 0.12);
    border: 0.5px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.15);
  }

  /* 图标 - Apple 风格 */
  .nav-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
    border-radius: 10px;
    margin: 0;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .product-nav-item.active .nav-icon {
    background: rgba(0, 122, 255, 0.15);
    transform: scale(1.05);
  }

  .product-nav-item[data-product="gpu"].active .nav-icon {
    background: rgba(175, 82, 222, 0.15);
  }

  .product-nav-item[data-product="dedicated"].active .nav-icon {
    background: rgba(52, 199, 89, 0.15);
  }

  .product-nav-item[data-product="domain"].active .nav-icon {
    background: rgba(255, 149, 0, 0.15);
  }

  .nav-icon svg {
    width: 21px;
    height: 21px;
    color: #6e6e73;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* 激活时图标变为品牌色 */
  .product-nav-item.active .nav-icon svg {
    color: #007aff;
  }

  .product-nav-item[data-product="gpu"].active .nav-icon svg {
    color: #af52de;
  }

  .product-nav-item[data-product="dedicated"].active .nav-icon svg {
    color: #34c759;
  }

  .product-nav-item[data-product="domain"].active .nav-icon svg {
    color: #ff9500;
  }

  /* 文字 - Apple 风格，激活时使用品牌色 */
  .nav-content {
    text-align: center;
    flex: none;
    width: 100%;
  }

  .nav-content h3 {
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.3;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
  }

  /* 激活状态 - 文字使用品牌色，完美可读 */
  .product-nav-item.active .nav-content h3 {
    color: #007aff;
    font-weight: 600;
  }

  .product-nav-item[data-product="gpu"].active .nav-content h3 {
    color: #af52de;
  }

  .product-nav-item[data-product="dedicated"].active .nav-content h3 {
    color: #34c759;
  }

  .product-nav-item[data-product="domain"].active .nav-content h3 {
    color: #ff9500;
  }

  /* 隐藏副标题和箭头 */
  .nav-content p,
  .nav-arrow {
    display: none;
  }

  /* GPU 热门标签 - 完全隐藏，保持极简设计 */
  .product-nav-item[data-product="gpu"]::after {
    display: none;
  }

  /* ========================================
     内容区域
     ======================================== */

  .products-content {
    min-height: auto;
    padding: 0 16px;
    position: relative;
  }

  .product-detail {
    position: relative;
    inset: auto;
    display: block;
    grid-template-columns: none;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: none;
    transition: all 0.3s ease;
    pointer-events: none;
  }

  .product-detail.active {
    opacity: 1;
    visibility: visible;
    max-height: 2000px;
    pointer-events: auto;
  }

  /* 隐藏图标卡片 */
  .detail-visual {
    display: none !important;
  }

  /* 内容卡片 - Apple 风格 */
  .detail-content {
    min-height: auto;
    height: auto;
    gap: 18px;
    animation: mobile-fade-in 0.35s ease;
    background: white;
    padding: 22px 18px;
    border-radius: 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.04);
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.04),
      0 4px 16px rgba(0, 0, 0, 0.02);
  }

  @keyframes mobile-fade-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* 标题 */
  .detail-content h2 {
    font-size: 20px;
    font-weight: 600;
    padding-bottom: 14px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: none;
    -webkit-text-fill-color: #1d1d1f;
    color: #1d1d1f;
    display: block;
    line-height: 1.4;
    letter-spacing: -0.01em;
  }

  .detail-content h2::after,
  .detail-content h2::before {
    display: none;
  }

  /* 描述文字 */
  .detail-content .description {
    font-size: 14px;
    line-height: 1.65;
    color: #6e6e73;
    margin-bottom: 0;
  }

  /* 特性列表 */
  .features-list {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  .feature-item {
    padding: 14px;
    background: #f5f5f7;
    border: none;
    border-radius: 10px;
    gap: 10px;
    min-height: auto;
    transition: background 0.2s ease;
  }

  .feature-item::before {
    display: none;
  }

  .feature-item:active {
    background: #ebebed;
  }

  .check-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #34c759;
  }

  .feature-item span {
    font-size: 14px;
    line-height: 1.6;
    color: #1d1d1f;
    font-weight: 400;
  }

  /* 标签设计 - Apple 风格 */
  .detail-tags {
    gap: 8px;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
  }

  .detail-tag {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 400;
    border-radius: 6px;
    background: #f5f5f7;
    border: none;
    color: #6e6e73;
    line-height: 1.5;
  }

  .detail-tag::before {
    display: none;
  }

  .product-detail[data-product="vps"] .detail-tag {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
  }

  .product-detail[data-product="gpu"] .detail-tag {
    background: rgba(175, 82, 222, 0.1);
    color: #af52de;
  }

  .product-detail[data-product="dedicated"] .detail-tag {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
  }

  .product-detail[data-product="domain"] .detail-tag {
    background: rgba(255, 149, 0, 0.1);
    color: #ff9500;
  }

  /* 按钮设计 - Apple 风格 */
  .detail-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
  }

  .btn-primary-large,
  .btn-outline-large {
    width: 100%;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    justify-content: center;
    gap: 6px;
    box-shadow: none;
    transition: all 0.2s ease;
    line-height: 1.5;
  }

  .btn-primary-large {
    background: #007aff;
    border: none;
    color: white;
  }

  .btn-primary-large::before {
    display: none;
  }

  .btn-primary-large:active {
    transform: scale(0.98);
    background: #0051d5;
  }

  .product-detail[data-product="gpu"] .btn-primary-large {
    background: #af52de;
  }

  .product-detail[data-product="gpu"] .btn-primary-large:active {
    background: #8e44ad;
  }

  .product-detail[data-product="dedicated"] .btn-primary-large {
    background: #34c759;
  }

  .product-detail[data-product="dedicated"] .btn-primary-large:active {
    background: #28a745;
  }

  .product-detail[data-product="domain"] .btn-primary-large {
    background: #ff9500;
  }

  .product-detail[data-product="domain"] .btn-primary-large:active {
    background: #e67e00;
  }

  .btn-outline-large {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
  }

  .btn-outline-large:active {
    transform: scale(0.98);
    background: #f5f5f7;
  }

  .btn-primary-large svg,
  .btn-outline-large svg {
    width: 16px;
    height: 16px;
  }
}

/* ========================================
   小屏手机优化（<480px）
   ======================================== */

@media (max-width: 479px) {
  .sec-products-tabbed {
    padding: 24px 0 32px 0;
  }

  .sec-products-tabbed .section-title {
    margin-bottom: 18px;
    padding: 0 12px;
  }

  .sec-products-tabbed .section-title h2 {
    font-size: 26px;
  }

  .sec-products-tabbed .section-title p {
    font-size: 14px;
  }

  .products-nav {
    gap: 6px;
    padding: 0 16px 18px 16px;
  }

  .product-nav-item {
    height: 72px;
    padding: 9px 5px;
  }

  .nav-icon {
    width: 30px;
    height: 30px;
  }

  .nav-icon svg {
    width: 19px;
    height: 19px;
  }

  .nav-content h3 {
    font-size: 12px;
  }

  .products-content {
    padding: 0 12px;
  }

  .detail-content {
    padding: 18px 16px;
    gap: 16px;
  }

  .detail-content h2 {
    font-size: 18px;
  }

  .feature-item {
    padding: 12px;
  }

  .feature-item span {
    font-size: 13px;
  }
}

/* ========================================
   超小屏手机优化（<360px）
   ======================================== */

@media (max-width: 359px) {
  .products-nav {
    gap: 5px;
    padding: 0 12px 16px 12px;
  }

  .product-nav-item {
    height: 68px;
    padding: 8px 4px;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
  }

  .nav-icon svg {
    width: 17px;
    height: 17px;
  }

  .nav-content h3 {
    font-size: 11px;
  }
}

/* ========================================
   触摸优化
   ======================================== */

@media (max-width: 767px) {
  .product-nav-item,
  .feature-item,
  .detail-tag,
  .btn-primary-large,
  .btn-outline-large {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
  }

  .product-nav-item img,
  .nav-icon svg {
    pointer-events: none;
  }

  .products-content {
    -webkit-overflow-scrolling: touch;
  }
}

/* ========================================
   横屏模式优化
   ======================================== */

@media (max-width: 767px) and (orientation: landscape) {
  .sec-products-tabbed {
    padding: 20px 0 28px 0;
  }

  .sec-products-tabbed .section-title {
    margin-bottom: 14px;
  }

  .sec-products-tabbed .section-title h2 {
    font-size: 22px;
  }

  .sec-products-tabbed .section-title p {
    font-size: 13px;
  }

  .products-nav {
    gap: 6px;
    padding: 0 16px 16px 16px;
  }

  .product-nav-item {
    height: 68px;
  }

  .detail-content {
    padding: 16px;
  }

  .features-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
