/* ===== MOBILE-FIRST RESPONSIVE STYLES ===== */
/* 独立移动端适配层 — 不修改原有 CSS，只在此文件覆盖 */

/* ========================================
   BREAKPOINTS:
   - xs:  ≤ 375px  (iPhone SE / 小屏)
   - sm:  ≤ 480px  (一般手机)
   - md:  ≤ 768px  (大手机/小平板)
   - lg:  ≤ 991px  (平板)
   ======================================== */

/* ===== 0. 全局移动端基础 ===== */
@media (max-width: 768px) {
  /* 减小全局间距 */
  .section {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
  }
  .our-services.section,
  .about-us.section {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
  }

  /* 正文可读性 */
  body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* 触摸交互优化 */
  html {
    touch-action: manipulation;
  }
  a, button {
    -webkit-tap-highlight-color: transparent;
  }

  /* 防止横向溢出 */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* 图片自适应 */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* ===== 1. 顶部导航 ===== */
@media (max-width: 991px) {
  /* 修复：原模板在 992px 下隐藏了最后一个 li，需要在移动端全屏菜单中恢复显示 */
  .header-area .main-nav .nav li:last-child,
  .background-header .main-nav .nav li:last-child {
    display: block !important;
  }

  /* 汉堡菜单按钮优化 */
  .main-nav .menu-trigger {
    display: flex !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(238, 90, 36, 0.12);
    border-radius: 12px;
    border: 1px solid rgba(238, 90, 36, 0.25);
    z-index: 1001;
    text-indent: 0;
    cursor: pointer;
  }

  .main-nav .menu-trigger span,
  .main-nav .menu-trigger span:before,
  .main-nav .menu-trigger span:after {
    background-color: #ee5a24;
    width: 22px;
    height: 2px;
  }

  /* Hamburger → X animation */
  .main-nav .menu-trigger.active span {
    background-color: transparent;
  }
  .main-nav .menu-trigger.active span:before {
    background-color: #ee5a24;
    transform: translateY(6px) rotate(45deg);
  }
  .main-nav .menu-trigger.active span:after {
    background-color: #ee5a24;
    transform: translateY(-6px) rotate(-45deg);
  }

  /* ===== 强制覆盖模板 CSS：隐藏/显示导航 ===== */
  .header-area .main-nav .nav,
  .background-header .main-nav .nav {
    display: none !important;
  }
  .header-area .main-nav .nav.active,
  .background-header .main-nav .nav.active {
    display: flex !important;
  }

  /* ===== 全屏深色导航菜单 ===== */
  .main-nav .nav,
  .background-header .main-nav .nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    background: linear-gradient(180deg, rgba(11, 14, 26, 0.98), rgba(15, 18, 30, 0.99)) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    padding: 80px 30px 40px !important;
    overflow-y: auto !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: scale(0.95) !important;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
  }

  .main-nav .nav.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
  }

  /* ===== 覆盖模板 CSS：导航项样式 ===== */
  .main-nav .nav li,
  .header-area .main-nav .nav li,
  .background-header .main-nav .nav li {
    width: 100% !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border-bottom: none !important;
    border-top: none !important;
    opacity: 0;
    transform: translateY(20px);
  }

  .main-nav .nav.active .nav li {
    animation: navItemIn 0.4s ease forwards;
  }

  .main-nav .nav.active .nav li:nth-child(1) { animation-delay: 0.05s; }
  .main-nav .nav.active .nav li:nth-child(2) { animation-delay: 0.1s; }
  .main-nav .nav.active .nav li:nth-child(3) { animation-delay: 0.15s; }
  .main-nav .nav.active .nav li:nth-child(4) { animation-delay: 0.2s; }
  .main-nav .nav.active .nav li:nth-child(5) { animation-delay: 0.25s; }
  .main-nav .nav.active .nav li:nth-child(6) { animation-delay: 0.3s; }
  .main-nav .nav.active .nav li:nth-child(7) { animation-delay: 0.35s; }

  @keyframes navItemIn {
    to { opacity: 1; transform: translateY(0); }
  }

  /* ===== 覆盖模板 CSS：导航链接样式 ===== */
  .main-nav .nav li a,
  .header-area .main-nav .nav li a,
  .background-header .main-nav .nav li a {
    display: block !important;
    padding: 16px 24px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.88) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 14px !important;
    height: auto !important;
    line-height: 1.5 !important;
    transition: all 0.25s ease !important;
  }

  .main-nav .nav li a::after {
    display: none !important;
  }

  .main-nav .nav li a:hover,
  .main-nav .nav li a:active,
  .main-nav .nav li a.active,
  .header-area .main-nav .nav li a:hover,
  .background-header .main-nav .nav li a:hover,
  .header-area .main-nav .nav li a.active {
    background: rgba(238, 90, 36, 0.12) !important;
    color: #fff !important;
  }

  /* 最后一个 li（购物车按钮） */
  .main-nav .nav li:last-child,
  .header-area .main-nav .nav li:last-child,
  .background-header .main-nav .nav li:last-child {
    margin-top: 20px !important;
    padding-top: 20px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    display: block !important;
  }

  .main-nav .nav li:last-child a,
  .header-area .main-nav .nav li:last-child a,
  .background-header .main-nav .nav li:last-child a {
    border-radius: 12px !important;
    font-weight: 600 !important;
  }

  /* Logo 在移动端 */
  .main-nav .logo h4 {
    font-size: 20px;
    line-height: 80px;
  }
}

/* ===== 1c. 覆盖模板 CSS @767px 的强制浅色主题 ===== */
@media (max-width: 767px) {
  .header-area,
  .background-header,
  .header-area.header-sticky {
    background-color: rgba(11, 14, 26, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(20px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  }
  .header-area .container {
    padding: 0 !important;
  }
  .header-area .main-nav {
    overflow: visible !important;
  }
  /* logo 颜色修复 */
  .header-area .main-nav .logo h4,
  .background-header .main-nav .logo h4 {
    color: #fff !important;
  }
  .header-area .main-nav .logo h4 span,
  .background-header .main-nav .logo h4 span {
    color: #ee5a24 !important;
  }
  /* 完全重置模板的白色列表样式 */
  .header-area .main-nav .nav,
  .background-header .main-nav .nav,
  .header-area.header-sticky .nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    background: linear-gradient(180deg, rgba(11, 14, 26, 0.98), rgba(15, 18, 30, 0.99)) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 80px 30px 40px !important;
    overflow-y: auto !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: scale(0.95) !important;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
  }
  .header-area .main-nav .nav.active,
  .background-header .main-nav .nav.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
  }
  /* 导航项重置 */
  .header-area .main-nav .nav li,
  .background-header .main-nav .nav li,
  .header-area .main-nav .nav li:first-child {
    width: 100% !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border-top: none !important;
    border-bottom: none !important;
    opacity: 0;
    transform: translateY(20px);
  }
  .header-area .main-nav .nav.active li {
    animation: navItemIn 0.4s ease forwards;
  }
  .header-area .main-nav .nav.active li:nth-child(1) { animation-delay: 0.05s; }
  .header-area .main-nav .nav.active li:nth-child(2) { animation-delay: 0.1s; }
  .header-area .main-nav .nav.active li:nth-child(3) { animation-delay: 0.15s; }
  .header-area .main-nav .nav.active li:nth-child(4) { animation-delay: 0.2s; }
  .header-area .main-nav .nav.active li:nth-child(5) { animation-delay: 0.25s; }
  .header-area .main-nav .nav.active li:nth-child(6) { animation-delay: 0.3s; }
  .header-area .main-nav .nav.active li:nth-child(7) { animation-delay: 0.35s; }
  /* 导航链接样式完全重置 */
  .header-area .main-nav .nav li a,
  .background-header .main-nav .nav li a {
    display: block !important;
    padding: 16px 24px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    height: auto !important;
    line-height: 1.5 !important;
    color: rgba(255, 255, 255, 0.88) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 14px !important;
    transition: all 0.25s ease !important;
  }
  .header-area .main-nav .nav li a:hover,
  .background-header .main-nav .nav li a:hover,
  .header-area .main-nav .nav li a.active,
  .background-header .main-nav .nav li a.active {
    background: rgba(238, 90, 36, 0.12) !important;
    color: #fff !important;
  }
  /* 购物车按钮区域 */
  .header-area .main-nav .nav li:last-child,
  .background-header .main-nav .nav li:last-child {
    display: block !important;
    margin-top: 20px !important;
    padding-top: 20px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }
  /* 汉堡菜单按钮文字颜色 */
  .header-area .main-nav .menu-trigger span,
  .header-area .main-nav .menu-trigger span:before,
  .header-area .main-nav .menu-trigger span:after,
  .background-header .main-nav .menu-trigger span,
  .background-header .main-nav .menu-trigger span:before,
  .background-header .main-nav .menu-trigger span:after {
    background-color: #ee5a24 !important;
  }
  .header-area .main-nav .menu-trigger.active span {
    background-color: transparent !important;
  }
}

/* ===== 2. Hero Banner ===== */
@media (max-width: 768px) {
  .main-banner {
    min-height: auto;
    padding: 120px 0 60px;
  }

  .main-banner .row {
    flex-direction: column;
  }

  /* 文字区域 */
  .left-content.header-text {
    text-align: center;
    padding: 0 8px;
  }

  .left-content h6 {
    font-size: 12px;
    padding: 5px 14px;
    letter-spacing: 1.5px;
  }

  .left-content h2 {
    font-size: 28px;
    line-height: 1.35;
    margin-bottom: 16px;
  }

  .left-content p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
  }

  .left-content p br {
    display: none;
  }

  /* Hero 统计卡片横排 */
  .hero-stats {
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
  }

  .hero-stat {
    padding: 12px 14px;
    flex: 1;
    max-width: 120px;
  }

  .hero-stat-num {
    font-size: 22px;
  }

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

  /* Hero CTA 按钮 */
  #hero-form {
    text-align: center;
  }

  #hero-form .main-button {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    padding: 16px 24px;
    font-size: 16px;
  }

  /* 脑子动画缩小 */
  .right-image {
    order: -1;
    margin-bottom: 20px;
  }

  .hero-brain {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }

  .brain-emoji {
    font-size: 72px;
  }

  .brain-ring.ring-3 {
    display: none;
  }
}

@media (max-width: 375px) {
  .left-content h2 {
    font-size: 24px;
  }

  .hero-stat {
    padding: 10px 8px;
  }

  .hero-stat-num {
    font-size: 18px;
  }

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

  .hero-brain {
    width: 150px;
    height: 150px;
  }

  .brain-emoji {
    font-size: 60px;
  }
}

/* ===== 3. 搜索栏 & 筛选标签 ===== */
@media (max-width: 768px) {
  .search-bar {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .search-bar input {
    padding: 12px 18px 12px 42px;
    font-size: 14px;
    border-radius: 12px;
  }

  .search-bar .search-icon {
    font-size: 16px;
    left: 14px;
  }

  /* 筛选标签横向滚动 */
  .tab-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .tab-filters::-webkit-scrollbar {
    display: none;
  }

  .tab-filter {
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* ===== 4. 产品卡片 ===== */
@media (max-width: 768px) {
  /* 强制所有商品卡片双列排列，不管在哪个容器里 */
  .buff-card {
    margin-bottom: 16px !important;
    padding: 0 6px !important;
    width: 50% !important;
    float: left !important;
  }

  /* 确保包含商品的 row 允许换行 */
  .row {
    display: flex !important;
    flex-wrap: wrap !important;
  }

  .buff-card-inner {
    padding: 20px 14px;
    border-radius: 16px;
  }

  .buff-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 14px;
  }

  .buff-name {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
  }

  .buff-desc {
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 10px;
    /* 限制2行，双列更紧凑 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .buff-tags {
    gap: 4px;
    margin-bottom: 12px;
  }

  .buff-tag {
    font-size: 10px;
    padding: 3px 8px;
  }

  .buff-bottom {
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
  }

  .buff-price {
    font-size: 20px;
  }

  .buff-add {
    width: 100%;
    padding: 11px 16px;
    font-size: 13px;
    text-align: center;
    border-radius: 10px;
    /* 增大触摸目标 */
    min-height: 44px;
  }

  .buff-emoji {
    font-size: 44px;
    margin-bottom: 10px;
  }
}

/* 更小屏幕微调 */
@media (max-width: 375px) {
  .buff-card {
    padding: 0 4px;
  }

  .buff-card-inner {
    padding: 16px 10px;
  }

  .buff-avatar img {
    width: 80px;
    height: 80px;
  }

  .buff-name {
    font-size: 13px;
  }

  .buff-desc {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .buff-price {
    font-size: 18px;
  }
}

@media (max-width: 375px) {
  .buff-card-inner {
    padding: 16px 12px;
  }

  .buff-avatar img {
    width: 88px;
    height: 88px;
  }

  .buff-name {
    font-size: 13px;
  }

  .buff-desc {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .buff-price {
    font-size: 18px;
  }
}

/* ===== 5. 分区标题 ===== */
@media (max-width: 768px) {
  .section-heading h6 {
    font-size: 12px;
    letter-spacing: 2px;
  }

  .section-heading h2 {
    font-size: 24px;
    line-height: 1.35;
    margin-bottom: 12px;
  }

  .section-heading p {
    font-size: 14px;
    line-height: 1.7;
  }

  /* 技能进度条 */
  .progress-skill-bar {
    margin-bottom: 16px;
  }

  .progress-skill-bar h4 {
    font-size: 13px;
  }

  /* 大图标 */
  .section-icon-big {
    font-size: 80px;
    padding: 20px 0;
  }

  /* 期末考试区域 - 左边图片上下排列，产品保持双列 */
  .about-us .row {
    flex-direction: column;
  }

  .about-us .col-lg-4 {
    margin-bottom: 20px;
  }
}

/* ===== 6. 锦鲤抽奖 ===== */
@media (max-width: 768px) {
  .lucky-draw-section {
    padding: 50px 0;
  }

  .lucky-box {
    width: 90px;
    height: 90px;
    font-size: 42px;
    border-radius: 18px;
    margin: 20px auto;
  }

  .lucky-result {
    padding: 18px 16px;
    margin-top: 16px;
  }

  .lucky-result .lucky-title {
    font-size: 20px;
  }

  .lucky-result .lucky-desc {
    font-size: 13px;
  }

  .lucky-remaining {
    font-size: 12px;
  }
}

/* ===== 7. IQ 显示 ===== */
@media (max-width: 768px) {
  .iq-display {
    padding: 30px 20px;
    border-radius: 16px;
  }

  .iq-number {
    font-size: 48px;
  }

  .iq-label {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .iq-bar-wrap {
    height: 12px;
    border-radius: 6px;
  }

  .iq-bar {
    border-radius: 6px;
  }

  .iq-level {
    font-size: 14px;
  }
}

/* ===== 8. 晒单区 ===== */
@media (max-width: 768px) {
  .review-card {
    margin-bottom: 16px;
    padding: 0 6px;
    /* 双列排列 */
    width: 50% !important;
    float: left !important;
  }

  .review-card-inner {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .review-header {
    gap: 10px;
  }

  .review-avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .review-name {
    font-size: 14px;
  }

  .review-time {
    font-size: 11px;
  }

  .review-stars {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .review-text {
    font-size: 13px;
    line-height: 1.7;
  }

  .review-item {
    font-size: 11px;
    padding: 3px 10px;
  }

  .review-verified {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* ===== 9. 购物车侧边栏 ===== */
@media (max-width: 768px) {
  .cart-sidebar {
    width: 100%;
    max-width: 100vw;
    right: -100%;
    border-radius: 0;
  }

  .cart-sidebar.active {
    right: 0;
  }

  .cart-header {
    padding: 18px 20px;
  }

  .cart-header h3 {
    font-size: 16px;
  }

  .cart-items {
    padding: 14px 20px;
  }

  .cart-item {
    gap: 10px;
    padding: 12px 0;
  }

  .cart-item-emoji {
    font-size: 26px;
  }

  .cart-item-name {
    font-size: 13px;
  }

  .cart-item-price {
    font-size: 12px;
  }

  .cart-item-qty button {
    width: 34px;
    height: 34px;
    /* 最小触摸目标 */
    min-width: 44px;
    min-height: 44px;
    font-size: 18px;
  }

  .cart-footer {
    padding: 18px 20px;
  }

  .cart-total {
    font-size: 14px;
  }

  .cart-total-price {
    font-size: 20px;
  }

  .btn-checkout {
    padding: 16px;
    font-size: 16px;
    /* 全宽触摸目标 */
    min-height: 52px;
  }
}

/* ===== 10. 弹窗 / Modal ===== */
@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-box {
    width: 100%;
    max-width: 100vw;
    max-height: 88vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    margin: 0;
  }

  .modal-overlay.active .modal-box {
    transform: translateY(0);
  }

  .modal-body {
    padding: 30px 20px 40px;
  }

  .modal-close {
    top: 12px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  /* 结算弹窗 */
  .checkout-summary h3 {
    font-size: 20px;
    margin-bottom: 18px;
  }

  .checkout-item {
    font-size: 13px;
    padding: 10px 0;
  }

  .checkout-total {
    font-size: 18px;
  }

  /* 二维码支付 */
  .qr-real-img {
    width: 180px;
  }

  .qr-amount {
    font-size: 24px;
  }

  .qr-steps {
    padding: 14px 16px;
  }

  .qr-step {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .qr-step:last-child {
    margin-bottom: 0;
  }

  /* 证书 */
  .cert-canvas-wrap canvas {
    width: 100% !important;
    height: auto !important;
  }

  .cert-title {
    font-size: 22px;
  }

  .cert-actions {
    flex-direction: column;
    gap: 10px;
  }

  .cert-actions .main-button {
    width: 100%;
    justify-content: center;
  }

  .share-section {
    flex-direction: column;
    gap: 8px;
  }

  .share-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
}

/* ===== 11. Toast 通知 ===== */
@media (max-width: 768px) {
  .toast {
    bottom: 20px;
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(100px);
    max-width: none;
    width: auto;
    text-align: center;
    font-size: 13px;
    padding: 12px 16px;
    border-radius: 14px;
    white-space: normal;
  }

  .toast.show {
    transform: translateX(0) translateY(0);
  }
}

/* ===== 12. 返回顶部按钮 ===== */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 24px;
    right: 90px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(238, 90, 36, 0.4);
  }
}

/* ===== 12b. 浮动购物车按钮 ===== */
@media (max-width: 768px) {
  .floating-cart {
    bottom: 24px;
    right: 20px;
    width: 52px;
    height: 52px;
  }
  .floating-cart-icon {
    font-size: 22px;
  }
  .floating-cart-badge {
    font-size: 11px;
    min-width: 20px;
    height: 20px;
    top: -3px;
    right: -3px;
  }
}

/* ===== 13. Footer / 免责声明 ===== */
@media (max-width: 768px) {
  .disclaimer {
    font-size: 12px;
    padding: 14px 16px;
    line-height: 1.7;
    border-radius: 12px;
  }

  footer {
    padding: 30px 0 20px;
  }

  footer p {
    font-size: 12px;
  }
}

/* ===== 14. 进度条 ===== */
@media (max-width: 768px) {
  .scroll-progress {
    height: 2px;
  }
}

/* ===== 15. 触摸交互优化 ===== */
@media (max-width: 768px) {
  /* 所有可点击元素增大触摸区域 */
  .main-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
  }

  /* 禁用 hover 效果（手机上无意义且会导致"粘滞"） */
  .buff-card-inner:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: var(--shadow-card);
    background: var(--bg-card);
  }

  .buff-card-inner:hover::before {
    transform: scaleX(0);
  }

  .buff-card-inner:hover .buff-avatar img {
    transform: none;
    border-color: rgba(238, 90, 36, 0.15);
  }

  .buff-card-inner:hover .buff-emoji {
    transform: none;
    filter: drop-shadow(0 4px 16px rgba(238, 90, 36, 0.3));
  }

  /* 替换为 active 状态 */
  .buff-card-inner:active {
    transform: scale(0.98);
    border-color: rgba(238, 90, 36, 0.2);
  }

  .main-button:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(238, 90, 36, 0.35);
  }

  .main-button:active {
    transform: scale(0.97);
  }

  .tab-filter:hover {
    border-color: var(--glass-border);
    color: var(--text-muted);
    background: var(--glass);
  }

  .lucky-box:hover {
    transform: none;
    box-shadow: 0 8px 30px rgba(238, 90, 36, 0.3);
  }

  .lucky-box:active {
    transform: scale(0.95);
  }

  .review-card-inner:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: none;
  }

  /* 链接 & 按钮触摸反馈 */
  a, button {
    -webkit-tap-highlight-color: rgba(238, 90, 36, 0.15);
  }
}

/* ===== 16. 横屏手机适配 ===== */
@media (max-width: 768px) and (orientation: landscape) {
  .main-banner {
    padding: 100px 0 40px;
    min-height: auto;
  }

  .hero-brain {
    width: 120px;
    height: 120px;
    margin: 0 auto;
  }

  .brain-emoji {
    font-size: 50px;
  }

  .right-image {
    order: 0;
    margin-bottom: 0;
  }

  .main-banner .row {
    flex-direction: row;
  }

  .hero-stats {
    flex-direction: row;
    gap: 8px;
  }

  .hero-stat {
    padding: 8px 12px;
  }

  .lucky-box {
    width: 70px;
    height: 70px;
    font-size: 34px;
  }

  .iq-number {
    font-size: 40px;
  }
}

/* ===== 17. 安全区域适配（刘海屏） ===== */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .cart-footer {
      padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

    .modal-box {
      padding-bottom: env(safe-area-inset-bottom);
    }

    .toast {
      bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .back-to-top {
      bottom: calc(24px + env(safe-area-inset-bottom));
    }

    footer {
      padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
  }
}

/* ===== 18. 深色模式 & 减弱动画 ===== */
@media (prefers-reduced-motion: reduce) {
  .brain-particles .particle {
    animation: none;
    opacity: 0.3;
  }

  .brain-emoji {
    animation: none;
  }

  .brain-glow {
    animation: none;
    opacity: 0.5;
  }

  .brain-ring {
    animation: none;
    display: none;
  }

  .section-reveal {
    opacity: 1;
    transform: none;
  }

  .confetti-piece {
    animation: none;
    display: none;
  }
}

/* ===== 19. 加载态优化（弱网环境） ===== */
@media (max-width: 768px) {
  /* 骨架屏效果 —— 给产品卡片 */
  .buff-card-inner.loading {
    background: linear-gradient(
      90deg,
      var(--bg-card) 25%,
      rgba(255, 255, 255, 0.04) 50%,
      var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
  }

  @keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
}

/* ===== 20. 订单号复制框 ===== */
.order-id-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(238, 90, 36, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px auto;
  max-width: 340px;
}

.order-id-text {
  flex: 1;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-gold);
  font-family: 'Courier New', monospace;
  user-select: all;
  -webkit-user-select: all;
  word-break: break-all;
}

.order-id-copy {
  flex-shrink: 0;
  padding: 8px 16px;
  background: rgba(238, 90, 36, 0.15);
  border: 1px solid rgba(238, 90, 36, 0.25);
  border-radius: 8px;
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  min-width: 44px;
}

.order-id-copy:hover,
.order-id-copy:active {
  background: rgba(238, 90, 36, 0.25);
  border-color: rgba(238, 90, 36, 0.4);
}

/* 确认付款按钮 */
.btn-confirm-pay {
  width: 100%;
  justify-content: center;
  padding: 16px 24px;
  font-size: 16px;
  min-height: 52px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .order-id-box {
    padding: 10px 14px;
    margin: 12px auto;
    max-width: 100%;
  }

  .order-id-text {
    font-size: 16px;
    letter-spacing: 1.5px;
  }

  .order-id-copy {
    padding: 8px 14px;
    font-size: 12px;
  }
}

/* ===== 21. 底部弹窗滚动提示 ===== */
@media (max-width: 768px) {
  .modal-box {
    /* 允许内部滚动 */
    display: flex;
    flex-direction: column;
  }

  .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* 底部留出安全区 */
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  /* 顶部拖拽条（提示可下滑关闭） */
  .modal-box::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
}

/* ===== 22. 支付步骤在移动端更紧凑 ===== */
@media (max-width: 768px) {
  .qr-steps {
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 12px;
  }

  .qr-step {
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.6;
  }

  .qr-step:last-child {
    margin-bottom: 0;
  }

  .qr-step strong {
    color: var(--accent-gold);
    font-weight: 700;
  }

  .qr-real-img {
    width: 160px;
  }

  .qr-amount {
    font-size: 22px;
    margin-bottom: 14px;
  }

  .checkout-note {
    font-size: 11px;
    line-height: 1.6;
    padding: 0 8px;
  }

  /* 结算弹窗里的商品列表 */
  .checkout-item {
    font-size: 13px;
    padding: 10px 0;
    gap: 8px;
  }

  .checkout-item span:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .checkout-discount {
    font-size: 13px;
  }
}
