/* ─── 移动端响应式 (从 style.css 分离) ─────────────────────────────── */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  .header {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header h1 { font-size: 15px; margin-left: 8px; }
  .date-badge { font-size: 11px; margin-left: 8px; }

  .header-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }

  .header-right .btn-outline {
    padding: 5px 10px;
    font-size: 12px;
  }

  .desktop-toolbar { display: none !important; }
  .desktop-cat-nav { display: none !important; }

  .mobile-toolbar { display: flex; }

  .content {
    padding: 10px;
    overflow-x: hidden;
  }

  .product-table { display: none; }

  /* 移动端表格样式（如果显示则左对齐） */
  .product-table th,
  .product-table td {
    text-align: left !important;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 100%;
  }

  .product-card {
    padding: 10px 12px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    overflow: hidden;
  }

  .product-card:last-child { border-bottom: none; }

  .product-card h4 {
    font-size: 14px;
    margin-bottom: 2px;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .product-card .card-model {
    font-size: 11px;
    margin-bottom: 0;
    word-break: break-all;
  }

  .product-card .card-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .product-card .card-right {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    max-width: 45%;
  }

  /* 价格浮层 */
  .product-card .card-prices {
    position: absolute;
    top: -8px;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    z-index: 2;
  }

  .product-card .card-prices .price-main {
    font-size: 14px;
  }

  .product-card .card-prices .price-sep {
    margin: 0 3px;
    opacity: 0.7;
  }

  /* 加入购物车按钮浮层 */
  .card-actions {
    margin-top: auto;
    padding-top: 4px;
  }

  .btn-cart-add {
    padding: 5px 12px;
    font-size: 11px;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
    transition: all 0.15s;
  }

  .btn-cart-add:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
  }

  .breadcrumb { padding: 8px 0; font-size: 12px; }

  .config-layout {
    grid-template-columns: 1fr;
  }

  .config-summary {
    position: static;
  }

  .cfg-main {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .cfg-left { order: 1; position: static; }
  .cfg-right { order: 2; }

  .cfg-component-tabs {
    gap: 4px;
    padding: 8px 10px;
  }

  .cfg-comp-tab {
    padding: 6px 10px;
    font-size: 12px;
  }

  .cfg-product-list { max-height: none; }

  .cfg-product-actions { gap: 6px; }
  .cfg-product-price { font-size: 14px; }
  .cfg-select-btn { padding: 4px 10px; font-size: 11px; }

  .cfg-product-img { width: 44px; height: 44px; }
  .cfg-product-img .img-placeholder { font-size: 20px; }

  .cfg-product-card { padding: 10px; gap: 8px; }

  .configurator-tabs { border-radius: 8px; }
  .config-tab { padding: 10px 14px; font-size: 13px; }

  .modal-content {
    width: calc(100vw - 24px);
    max-height: 90vh;
    border-radius: 10px;
  }

  .scraper-output { max-height: 200px; font-size: 11px; }
  .scraper-options { flex-direction: column; gap: 8px; }

  .status-bar {
    padding: 5px 14px;
    font-size: 11px;
  }

  .cfg-total-price { font-size: 18px; }

  .pagination-bar {
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  .pagination-size { width: 100%; text-align: center; }

  /* ─── 配置器移动端：组件列表 ─── */
  .cfg-component-tabs { display: none; }
  .cfg-main { display: none; }

  .cfg-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .cfg-mobile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f5;
    cursor: pointer;
    transition: background 0.15s;
  }

  .cfg-mobile-item:active { background: #f8f8ff; }

  .cfg-mobile-item-info {
    flex: 1;
    min-width: 0;
  }

  .cfg-mobile-item-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
  }

  .cfg-mobile-item-detail {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }

  .cfg-mobile-item-detail.placeholder {
    color: #bbb;
  }

  .cfg-mobile-select-btn {
    padding: 6px 16px;
    border: 1px solid var(--primary);
    border-radius: 18px;
    background: white;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .cfg-mobile-select-btn:active {
    background: var(--primary);
    color: white;
  }

  .cfg-mobile-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 12px;
    font-size: 16px;
    font-weight: 600;
    border-top: 2px solid var(--primary);
    margin-top: 8px;
  }

  .cfg-add-all-cart-btn {
    width: calc(100% - 24px);
    margin: 12px;
    display: block;
  }

  .req-star-sm { color: var(--error); font-size: 12px; }

  /* ─── 配置器移动端：产品选择弹窗 ─── */
  .cfg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f5;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
  }

  .cfg-modal-title {
    font-size: 16px;
    font-weight: 600;
  }

  .cfg-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f5;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
  }

  .cfg-modal-search-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f5;
    position: sticky;
    top: 60px;
    background: white;
    z-index: 9;
  }

  .cfg-modal-search-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #e0e0e8;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
  }

  .cfg-modal-search-input:focus {
    border-color: var(--primary);
  }

  .cfg-modal-search-btn,
  .cfg-modal-filter-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .cfg-modal-search-btn {
    background: var(--primary);
    color: white;
  }

  .cfg-modal-filter-btn {
    background: #f0f0f5;
    color: var(--text-secondary);
  }

  .cfg-modal-brands {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    border-bottom: 1px solid #f0f0f5;
    -webkit-overflow-scrolling: touch;
  }

  .cfg-modal-brands.hidden { display: none; }

  .cfg-modal-brand-tab {
    padding: 5px 14px;
    border: 1px solid #e0e0e8;
    border-radius: 16px;
    background: white;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
  }

  .cfg-modal-brand-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .cfg-modal-product-list {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .cfg-modal-product-list .cfg-product-card {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e8e8f0;
    display: flex;
    gap: 10px;
    background: white;
  }

  .cfg-modal-product-list .cfg-product-card.selected {
    border-color: var(--primary);
    background: #f8f8ff;
  }

  .cfg-modal-product-list .cfg-product-info {
    flex: 1;
    min-width: 0;
  }

  .cfg-modal-product-list .cfg-product-name {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
  }

  .cfg-modal-product-list .cfg-product-model,
  .cfg-modal-product-list .cfg-product-specs,
  .cfg-modal-product-list .cfg-product-brand {
    font-size: 11px;
    color: var(--text-secondary);
    word-break: break-word;
  }

  .cfg-modal-product-list .cfg-product-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
  }

  .cfg-modal-product-list .cfg-product-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--cost-price);
  }

  .cfg-modal-product-list .cfg-select-btn {
    padding: 5px 14px;
    font-size: 12px;
  }

  .cfg-modal-product-list .cfg-product-img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }

  .cfg-modal-footer-count {
    text-align: center;
    padding: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid #f0f0f5;
  }
}

@media (max-width: 480px) {
  .header h1 { font-size: 14px; }

  .header-right .btn-outline span {
    display: none;
  }

  .config-tab { font-size: 12px; padding: 8px 10px; }

  .cfg-comp-tab { font-size: 11px; padding: 5px 8px; }

  .cfg-product-name { font-size: 13px; }
  .cfg-product-model, .cfg-product-specs { font-size: 10px; }

  .mobile-cat-btn { padding: 5px 10px; font-size: 12px; }
}

@media (max-width: 480px) {
  .front-login-box {
    width: calc(100vw - 32px);
    padding: 28px 20px;
  }
}
