/* ============================================================
   SHMD 汽车配件查询系统 - iOS 风格动画优化
   ============================================================ */
:root {
  --primary: #1E40AF;
  --primary-light: #3B82F6;
  --accent: #DC2626;
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --text: #1C1C1E;
  --text-gray: #6E6E73;
  --text-light: #8E8E93;
  --border: #E5E5EA;
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  --shadow: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 8px 32px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.15);
  --radius: 14px;
  --radius-sm: 10px;
  /* iOS 缓动曲线 */
  --ease-ios: cubic-bezier(0.25, 0.1, 0.25, 1.0);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========== 图标 ========== */
.icon-gear:before, .icon-search:before, .icon-car:before, .icon-list:before, .icon-user:before, .icon-camera:before {
  content: ''; display: inline-block; width: 26px; height: 26px; background: currentColor;
  mask-size: contain; -webkit-mask-size: contain;
  mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat;
  mask-position: center; -webkit-mask-position: center;
}
.icon-search:before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='2'/%3E%3Cline x1='15' y1='15' x2='21' y2='21' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='2'/%3E%3Cline x1='15' y1='15' x2='21' y2='21' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.icon-car:before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 11l1.5-4h11l1.5 4M5 11h14v5a1 1 0 01-1 1h-1a1 1 0 01-1-1v-1H8v1a1 1 0 01-1 1H6a1 1 0 01-1-1v-5zM7 8h10l1 3H6l1-3z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='7' cy='15' r='1.5' fill='black'/%3E%3Ccircle cx='17' cy='15' r='1.5' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 11l1.5-4h11l1.5 4M5 11h14v5a1 1 0 01-1 1h-1a1 1 0 01-1-1v-1H8v1a1 1 0 01-1 1H6a1 1 0 01-1-1v-5zM7 8h10l1 3H6l1-3z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='7' cy='15' r='1.5' fill='black'/%3E%3Ccircle cx='17' cy='15' r='1.5' fill='black'/%3E%3C/svg%3E");
}
.icon-list:before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='4' width='3' height='16' rx='0.5' fill='black'/%3E%3Crect x='6' y='4' width='2' height='16' rx='0.5' fill='black'/%3E%3Crect x='9' y='4' width='4' height='16' rx='0.5' fill='black'/%3E%3Crect x='14' y='4' width='2' height='16' rx='0.5' fill='black'/%3E%3Crect x='17' y='4' width='5' height='16' rx='0.5' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='4' width='3' height='16' rx='0.5' fill='black'/%3E%3Crect x='6' y='4' width='2' height='16' rx='0.5' fill='black'/%3E%3Crect x='9' y='4' width='4' height='16' rx='0.5' fill='black'/%3E%3Crect x='14' y='4' width='2' height='16' rx='0.5' fill='black'/%3E%3Crect x='17' y='4' width='5' height='16' rx='0.5' fill='black'/%3E%3C/svg%3E");
}
.icon-gear:before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3' fill='black'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3' fill='black'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.icon-user:before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='black'/%3E%3Cpath d='M4 20c0-4 4-7 8-7s8 3 8 7' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='black'/%3E%3Cpath d='M4 20c0-4 4-7 8-7s8 3 8 7' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}
.icon-camera:before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 16a4 4 0 100-8 4 4 0 000 8z' fill='black'/%3E%3Cpath d='M3 6h3l2-2h8l2 2h3a2 2 0 012 2v11a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 16a4 4 0 100-8 4 4 0 000 8z' fill='black'/%3E%3Cpath d='M3 6h3l2-2h8l2 2h3a2 2 0 012 2v11a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* ========== iOS 风格 Header ========== */
.header {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 99;
  border-bottom: .5px solid rgba(0,0,0,.08);
  transition: all .35s var(--ease-ios);
}
.header-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.header h1 {
  font-size: 16px; font-weight: 600; letter-spacing: -.2px;
  display: flex; align-items: center; justify-content: space-between;
}
.header h1 img { flex-shrink: 0; }

/* ========== 轮播海报 ========== */
.banner {
  position: relative; overflow: hidden;
  margin: 0 16px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.banner-track { display: flex; transition: transform .6s var(--ease-ios); }
.banner-slide {
  flex: 0 0 100%; height: 200px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: #fff;
}
.banner-slide h2 { font-size: 28px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.5px; animation: slideUpFade .6s var(--ease-out) both; }
.banner-slide p { font-size: 15px; opacity: .9; animation: slideUpFade .6s .1s var(--ease-out) both; }
.banner-dots {
  display: flex; justify-content: center; gap: 6px;
  position: absolute; bottom: 12px; left: 0; right: 0;
}
.banner-dots span {
  width: 6px; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,.45);
  transition: all .4s var(--ease-spring);
}
.banner-dots span.active { background: #fff; width: 18px; }

/* ========== 主内容区 ========== */
.main-content { padding-bottom: 90px; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ========== 页面板块切换 (iOS 风格 push) ========== */
.page-section { display: none; }
.page-section.active { display: block; animation: pageEnter .4s var(--ease-out) both; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========== Tab 卡片 ========== */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.tab-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 10px;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid transparent;
  box-shadow: var(--shadow);
  transition: all .35s var(--ease-spring);
  position: relative;
  overflow: hidden;
}
/* iOS 点按回弹 */
.tab-card:active { transform: scale(.96); transition: transform .1s var(--ease-ios); }
.tab-card.active {
  border-color: var(--primary-light);
  background: #EEF2FF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tab-card i { width: 36px; height: 36px; display: block; margin: 0 auto 8px; color: var(--primary); transition: transform .35s var(--ease-spring); }
.tab-card.active i { transform: scale(1.15); }
.tab-card .tab-title { font-size: 15px; font-weight: 600; }
.tab-card .tab-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* Tab 入场交错动画 */
.tab-card:nth-child(1) { animation: cardUp .5s 0s var(--ease-out) both; }
.tab-card:nth-child(2) { animation: cardUp .5s .08s var(--ease-out) both; }
.tab-card:nth-child(3) { animation: cardUp .5s .16s var(--ease-out) both; }
@keyframes cardUp {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tab Panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .35s var(--ease-out) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  transition: box-shadow .3s var(--ease-ios), transform .3s var(--ease-ios);
}
.card:active { transform: scale(.99); }
.card-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; letter-spacing: -.2px; }

/* ========== 表单 (iOS 风格) ========== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--primary-light); margin-bottom: 6px;
  letter-spacing: .3px; text-transform: none;
  transition: color .2s var(--ease-ios);
}
.form-input, .form-select {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit;
  background: #F9F9FB;
  transition: all .25s var(--ease-ios);
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-light);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}
.form-input::placeholder { color: #C7C7CC; }

/* ========== 按钮 (iOS 风格) ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 11px 22px;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all .2s var(--ease-ios);
  position: relative; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* iOS 点按缩放 */
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(30,64,175,.3);
}
.btn-primary:hover { background: #1A3596; box-shadow: 0 4px 16px rgba(30,64,175,.4); }
.btn-accent {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(30,64,175,.3);
}
.btn-outline {
  background: #fff; color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); background: #F5F7FF; }
.wechat-btn { background: #07C160; color: #fff; font-size: 16px; font-weight: 600; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ========== 搜索 ========== */
.search-row { display: flex; gap: 8px; }
.search-input-group { flex: 1; margin-bottom: 0; }
.search-btn-group { flex-shrink: 0; margin-bottom: 0; }
#search-hint { margin-top: 8px; font-size: 12px; color: var(--text-light); transition: color .3s var(--ease-ios); }

/* ========== 结果弹窗 ========== */
.results-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 1500; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.results-overlay.active { display: flex; }
.results-panel {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column;
  animation: sheetUp .35s cubic-bezier(0.32, 0.72, 0, 1);
}
@media (min-width: 769px) {
  .results-overlay { align-items: center; }
  .results-panel {
    border-radius: 16px; max-height: 85vh;
  }
}
.results-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: .5px solid var(--border);
  flex-shrink: 0;
}
.results-panel-title { font-size: 17px; font-weight: 600; }
.results-panel-close {
  border: none; background: #F2F2F7; width: 28px; height: 28px;
  border-radius: 50%; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.results-panel-body {
  flex: 1; overflow-y: auto; padding: 12px 16px 30px;
  -webkit-overflow-scrolling: touch;
}
.results-count { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.results-group-title {
  font-size: 16px; font-weight: 700; color: #fff;
  padding: 10px 16px; margin: 8px -16px 6px;
  letter-spacing: 1px;
}
.rg-front, .rg-rear { background: var(--primary); }
.results-group-title span { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); margin-left: 4px; }
#results-list { display: flex; flex-direction: column; gap: 8px; }

/* ========== 品牌触发按钮 ========== */
.brand-trigger {
  cursor: pointer; -webkit-user-select: none; user-select: none;
  display: flex; align-items: center; gap: 6px; color: #222;
  transition: all .2s var(--ease-ios);
}
.brand-trigger:active { transform: scale(.98); }
.brand-trigger.placeholder { color: #999; }
.brand-trigger::after {
  content: ''; margin-left: auto; opacity: .4;
  width: 12px; height: 7px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ========== iOS风格品牌选择弹窗 ========== */
.brand-picker-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0);
  z-index: 2000;
  display: flex; align-items: flex-end; justify-content: center;
  transition: background .35s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}
.brand-picker-overlay.active {
  background: rgba(0,0,0,.4);
  pointer-events: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.brand-picker {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 500px; height: 85vh;
  display: flex; flex-direction: column; position: relative;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(0.32, 0.72, 0, 1);
}
.brand-picker-overlay.active .brand-picker {
  transform: translateY(0);
}

/* 桌面端：弹窗居中 */
@media (min-width: 769px) {
  .brand-picker-overlay {
    align-items: center;
  }
  .brand-picker {
    border-radius: 16px;
    height: auto; max-height: 80vh;
    width: 640px; max-width: 90vw;
    transform: scale(.95);
    opacity: 0;
    transition: transform .25s cubic-bezier(0.32, 0.72, 0, 1), opacity .25s ease;
  }
  .brand-picker-overlay.active .brand-picker {
    transform: scale(1);
    opacity: 1;
  }
  .bp-item {
    margin: 0; padding-left: 0; padding-right: 0;
  }
}

.brand-picker-body {
  flex: 1; overflow-y: auto; padding: 8px 20px 30px;
  -webkit-overflow-scrolling: touch;
}

.brand-picker-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: .5px solid var(--border);
  flex-shrink: 0;
}
.bp-title { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.bp-close {
  border: none; background: none; color: var(--primary);
  font-size: 16px; font-weight: 500; cursor: pointer;
  padding: 4px 8px; border-radius: 8px;
  transition: background .15s;
}
.bp-close:active { background: #F2F2F7; }

.bp-section {
  margin: 0 -20px; padding: 0 20px 10px;
  background: #fff;
}
.bp-section-title {
  font-size: 13px; font-weight: 700; color: #555;
  background: #F2F3F5;
  padding: 8px 20px; margin: 0 -20px 6px;
  position: sticky; top: 0; z-index: 2;
  letter-spacing: 1px;
}
.bp-item {
  padding: 13px 0; font-size: 16px;
  border-bottom: .5px solid #EEE;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background .12s ease, color .12s ease;
}
.bp-item:last-child { border-bottom: none; }
.bp-item:active { background: #EEF2FF; transition: none; }
.bp-item.selected { color: var(--primary); font-weight: 600; }
.bp-item.selected::after { content: '✓'; margin-left: auto; color: var(--primary); font-weight: 700; }

/* 面包屑 */
.bp-crumbs {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 20px; font-size: 12px;
  border-bottom: .5px solid var(--border);
  overflow-x: auto; white-space: nowrap;
}
.bp-crumb { color: var(--text-light); }
.bp-crumb.active { color: var(--primary); font-weight: 600; }
.bp-crumb-arrow { color: var(--text-light); font-size: 14px; }

/* 返回按钮 */
.bp-back {
  border: none; background: none; color: var(--primary);
  font-size: 15px; font-weight: 500; cursor: pointer;
  padding: 4px 8px; border-radius: 8px;
  transition: background .15s;
}
.bp-back:active { background: #F2F2F7; }

/* 年份网格 */
.bp-year-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 12px 0;
}
.bp-year-item {
  padding: 16px 8px; text-align: center;
  background: #F5F6FA; border-radius: 12px;
  font-size: 16px; font-weight: 500; cursor: pointer;
  transition: all .25s cubic-bezier(0.32, 0.72, 0, 1);
}
.bp-year-item:active {
  background: var(--primary); color: #fff;
  transform: scale(.94); transition: all .1s;
}

/* ★ 右侧字母索引 */
.brand-index {
  position: absolute; right: 6px; top: 60px; bottom: 20px;
  display: flex; flex-direction: column; justify-content: space-around;
  align-items: center; padding: 2px 0;
  z-index: 10; pointer-events: auto;
}
.brand-index span {
  font-size: 13px; color: var(--primary); font-weight: 700;
  width: 26px; height: 20px; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; border-radius: 4px;
  -webkit-user-select: none; user-select: none;
  transition: background .1s, transform .1s;
}
.brand-index span:active { background: #EEF2FF; transform: scale(1.4); color: #DC2626; }

/* ========== 级联下拉 ========== */
.cascade-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cascade-item {
  flex: 1; min-width: 120px;
  animation: cascadeIn .4s var(--ease-out) both;
}
.cascade-item:nth-child(1) { animation-delay: 0s; }
.cascade-item:nth-child(2) { animation-delay: .05s; }
.cascade-item:nth-child(3) { animation-delay: .1s; }
@keyframes cascadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.cascade-item label { display: block; font-size: 11px; font-weight: 500; color: #888; margin-bottom: 4px; }
.cascade-actions { display: flex; gap: 8px; margin-top: 14px; }
.cascade-actions .btn { flex: 1; }

/* ========== 配件卡片 ========== */
#results-body { display: flex; flex-direction: column; gap: 10px; }

.part-card {
  display: flex; align-items: stretch; gap: 12px;
  background: #fff; border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  cursor: pointer;
  transition: box-shadow .15s;
  animation: cardUp .3s ease both;
}
.part-card:active { background: #FAFAFA; }

/* 缩略图 */
.part-card-img {
  width: 80px; height: 80px; min-width: 80px;
  border-radius: 6px; overflow: hidden;
  background: #F5F6F8;
  display: flex; align-items: center; justify-content: center;
}
.part-card-img img { width: 100%; height: 100%; object-fit: contain; }
.part-card-img-empty { background: #F0F1F5; }

/* 信息区 */
.part-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.part-card-title {
  font-size: 15px; font-weight: 600; color: #1a1a1a;
  line-height: 1.35; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.part-card-sub {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #888;
}
.part-card-code { font-family: "SF Mono","Menlo",monospace; color: #aaa; font-size: 11px; }

/* 红框标签 */
.part-card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.part-card-tags span {
  font-size: 11px; color: #E53935; font-weight: 500;
  border: 1px solid #E53935; padding: 2px 8px; border-radius: 3px;
  line-height: 1.4;
}

/* 适用车型 */
.part-card-models {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.part-card-models span {
  font-size: 11px; color: #888; background: #F5F6F8;
  padding: 2px 6px; border-radius: 3px;
}

/* 价格 */
.part-card-price {
  display: flex; flex-direction: column; align-items: flex-end;
  justify-content: flex-start; gap: 2px;
  padding-top: 2px; min-width: 64px;
}
.price-main { font-size: 17px; font-weight: 700; color: #E53935; }
.price-sub { font-size: 11px; color: #999; }

@media (max-width: 768px) {
  .part-card { padding: 12px; gap: 10px; }
  .part-card-img { width: 64px; height: 64px; min-width: 64px; }
  .part-card-title { font-size: 14px; }
  .price-main { font-size: 15px; }
}

/* ========== VIN 区 ========== */
.vin-search-bar { display: flex; gap: 8px; }
.vin-search-bar .vin-input {
  flex: 1; font-size: 20px !important; letter-spacing: 4px;
  font-family: "SF Mono", "Menlo", "Courier New", monospace !important;
  text-align: center; text-transform: uppercase;
}
.vin-cam-btn { flex-shrink: 0; width: 44px; height: 44px; font-size: 20px; padding: 0; border-radius: var(--radius-sm); }
.vin-decode-card {
  background: transparent; border: none;
  border-radius: var(--radius); padding: 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
  animation: fadeUp .4s var(--ease-out) both;
}

/* ========== 结果区域 ========== */
.result-area { margin-top: 20px; animation: fadeUp .4s var(--ease-out) both; }
.result-count { font-size: 15px; font-weight: 600; margin-bottom: 10px; letter-spacing: -.2px; }
/* 旧表格头隐藏（卡片模式不需要） */
#results-table thead { display: none; }
#results-table, #results-table tbody, #results-table tr, #results-table td {
  display: contents;
}
.table-wrap {
  background: none; border-radius: 0; box-shadow: none; overflow: visible;
}
#results-body .part-number, #results-body .tag, #results-body .tag-cat { display: none; }
.part-number {
  font-family: "SF Mono", "Menlo", monospace;
  color: var(--primary); font-weight: 600; font-size: 12px;
  background: #EEF2FF; padding: 3px 10px; border-radius: 6px;
}
.tag {
  display: inline-block; background: #F2F2F7; color: var(--primary-light);
  padding: 3px 10px; border-radius: 6px; font-size: 11px; margin: 2px;
  transition: all .2s var(--ease-ios);
}

/* ========== 分页 ========== */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 16px 0; }
.pagination button {
  min-width: 36px; padding: 8px 12px;
  border: 1.5px solid var(--border); background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 14px;
  transition: all .25s var(--ease-ios);
}
.pagination button:active { transform: scale(.94); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .3; }

/* ========== 弹窗 (iOS Sheet 风格) ========== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 2000; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; animation: overlayIn .25s var(--ease-out) both; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px;
  padding: 24px 20px 34px; width: 700px; max-width: 100vw;
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: sheetUp .4s var(--ease-spring) both;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border: none;
  background: #F2F2F7; border-radius: 50%;
  cursor: pointer; font-size: 16px;
  color: var(--primary-light);
  transition: all .2s var(--ease-ios);
}
.modal-close:active { background: #E5E5EA; transform: scale(.9); }
.modal h3 { font-size: 17px; font-weight: 600; margin-bottom: 16px; letter-spacing: -.3px; }

/* 详情弹窗 */
  width: 100%; height: 200px; background: #F5F6F8;
  border-radius: 12px; overflow: hidden; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;


/* 分割线 */

/* 网格 */
  display: flex; align-items: baseline; gap: 4px;
  padding: 9px 0; 
  line-height: 1.5; min-height: 38px;

  font-size: 13px; font-weight: 700; color: #111;
  padding: 9px 0; min-height: 38px;
  line-height: 1.5;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  font-weight: 400; color: var(--primary);
  white-space: nowrap;

/* 车型 */
  display: flex; align-items: center; gap: 6px;
  padding: 8px 0; border-bottom: 1px solid #F2F2F7;
  font-size: 12px; white-space: nowrap; overflow-x: auto;
  flex-wrap: nowrap;

/* 价格 */
  display: flex; align-items: baseline; gap: 4px;
  padding: 9px 0; min-height: 38px; 

/* 大图预览 */
#image-viewer {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.92);
  z-index: 2500; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
}
#image-viewer.active { display: flex; animation: overlayIn .2s var(--ease-out) both; }
#image-viewer img {
  max-width: 95vw; max-height: 95vh;
  object-fit: contain; border-radius: 8px;
  animation: imgZoom .4s var(--ease-spring) both;
}
@keyframes imgZoom {
  from { transform: scale(.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ========== 空态 ========== */
.empty-state { text-align: center; padding: 48px 20px; animation: fadeUp .4s var(--ease-out) both; }
.empty-state p { color: var(--primary-light); font-size: 14px; }
.empty-state .sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ========== 加载动画 (iOS 风格) ========== */
.spinner-wrap { display: none; text-align: center; padding: 40px; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: iosSpin .7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes iosSpin { to { transform: rotate(360deg); } }

/* ========== 底部导航 (iOS Tab Bar 风格) ========== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: .5px solid rgba(0,0,0,.1);
  display: flex; z-index: 99;
  padding: 8px 0; padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav .nav-item {
  flex: 1; padding: 4px 0;
  border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #8E8E93; font-family: inherit;
  transition: color .25s var(--ease-ios);
}
.bottom-nav .nav-item.active { color: var(--primary); }
.bottom-nav .nav-icon i { width: 22px; height: 22px; display: inline-block; transition: transform .3s var(--ease-spring); }
.bottom-nav .nav-item.active .nav-icon i { transform: scale(1.1); }
.bottom-nav .nav-label { font-size: 10px; font-weight: 500; letter-spacing: .2px; }

/* ========== 品牌卡片 ========== */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.brand-card {
  padding: 12px 8px; text-align: center; background: var(--card);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .3s var(--ease-spring);
}
.brand-card:active { transform: scale(.95); }
.brand-card.selected {
  border-color: var(--primary); background: #EEF2FF;
  color: var(--primary); font-weight: 600;
  transform: scale(1.03);
}

/* ========== Toast (iOS 风格) ========== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 20px;
  color: #fff; font-weight: 500; font-size: 13px;
  z-index: 9999; letter-spacing: .1px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  animation: toastIn .4s var(--ease-spring) both, toastOut .3s 2.8s var(--ease-in) forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

/* ========== 隐藏页脚 ========== */
.footer { text-align: center; padding: 24px; color: var(--text-light); font-size: 12px; }
.hidden { display: none !important; }

/* ========== 扫描框 ========== */
.scan-frame { position: absolute; top: 15%; left: 10%; right: 10%; bottom: 25%; pointer-events: none; }
.scan-frame::before, .scan-frame::after, .scan-frame-inner::before, .scan-frame-inner::after {
  content: ''; position: absolute; width: 20px; height: 20px;
  border-color: #34C759; border-style: solid;
  animation: scanPulse 2s ease-in-out infinite;
}
.scan-frame::before { top: 0; left: 0; border-width: 3px 0 0 3px; }
.scan-frame::after { top: 0; right: 0; border-width: 3px 3px 0 0; }
.scan-frame-inner::before { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.scan-frame-inner::after { bottom: 0; right: 0; border-width: 0 3px 3px 0; }
@keyframes scanPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ========== 后台统计 ========== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  transition: transform .3s var(--ease-spring);
}
.stat-card:active { transform: scale(.97); }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--primary); letter-spacing: -.5px; }
.stat-card .lbl { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.stat-card:nth-child(1) { animation: statIn .4s 0s var(--ease-out) both; }
.stat-card:nth-child(2) { animation: statIn .4s .06s var(--ease-out) both; }
.stat-card:nth-child(3) { animation: statIn .4s .12s var(--ease-out) both; }
.stat-card:nth-child(4) { animation: statIn .4s .18s var(--ease-out) both; }
@keyframes statIn {
  from { opacity: 0; transform: scale(.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== 后台工具栏 ========== */
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* ========== 管理面板 ========== */
.panel { display: none; }
.panel.active { display: block; animation: fadeUp .3s var(--ease-out) both; }

/* ========== 点击行（卡片模式不使用table行） ========== */

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  body { font-size: 15px; }
  .container { padding: 0 8px; max-width: 100%; }
  .header { padding: 10px 0; }
  .header h1 { font-size: 15px; }
  .header-inner { padding: 0 10px; }
  .banner { margin: 0 8px 12px; }
  .banner-slide { height: 140px; }
  .banner-slide h2 { font-size: 20px; }
  .main-content { padding-bottom: 70px; }

  .tabs { gap: 6px; }
  .tab-card { padding: 14px 6px; border-radius: 12px; }
  .tab-card i { width: 28px; height: 28px; margin-bottom: 4px; }
  .tab-card .tab-title { font-size: 13px; }
  .tab-card .tab-desc { font-size: 11px; }

  .card { padding: 14px; margin-bottom: 8px; }
  .card-title { font-size: 15px; }

  .search-row { flex-direction: column; gap: 6px; }
  .search-row .btn { width: 100%; }

  .form-input, .form-select { padding: 10px; font-size: 16px; }
  .form-group label { font-size: 11px; }

  .cascade-row { flex-direction: column; gap: 6px; }
  .cascade-item { min-width: 0; }
  .cascade-actions { flex-direction: column; gap: 6px; }

  /* 卡片全宽即可 */

  .pagination { gap: 3px; padding: 10px 0; }
  .pagination button { min-width: 28px; padding: 6px 8px; font-size: 12px; }

  .vin-search-bar .vin-input { font-size: 16px !important; letter-spacing: 2px; }
  .vin-decode-card { grid-template-columns: 1fr; }

  .modal {
    border-radius: 16px;
    padding: 16px 14px 28px;
    max-width: 100vw;
  }

  .admin-layout { flex-direction: column; }
  .admin-layout .sidebar { width: 100%; overflow-x: auto; padding: 0; }
  .admin-layout .sidebar nav { display: flex; white-space: nowrap; }
  .admin-layout .sidebar nav a { border-left: none; border-bottom: 2px solid transparent; padding: 8px 10px; font-size: 11px; }
  .admin-layout .sidebar nav a.active { border-bottom-color: var(--primary); }
  .admin-layout .sidebar .logo { display: none; }
  .admin-layout .main { padding: 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .num { font-size: 22px; }
  .toolbar { flex-direction: column; }
  .form-row { grid-template-columns: 1fr !important; }
  .login-page { align-items: flex-start; padding-top: 40px; }
}

/* === 详情行交替色 === */

/* 详情弹窗交替行色 */
#detail-content > * { margin: 0; }


  display: flex; align-items: baseline; gap: 4px;


/* === 产品详情 === */







@media (max-width: 768px) {
/* === 产品详情 TABLE === */

/* === 产品详情 TABLE === */
.dt-table { display: table; width: 100%; }
.dt-tr { display: table-row; }
.dt-tr-w { background: #fff; }
.dt-tr-g { background: #F7F8FA; }
.dt-td { display: table-cell; vertical-align: middle; padding: 10px 14px; border-bottom: 1px solid #E8E8ED; }
.dt-td.half { width: 50%; }
.dt-td.full { width: 100%; }
.dt-td .cell-inner { display: flex; align-items: baseline; gap: 4px; }
.dt-img-wrap { width: 100%; height: 200px; background: #F5F6F8; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.dt-img-wrap img { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.dt-title { font-size: 18px; font-weight: 700; }
.dt-lbl { font-size: 13px; font-weight: 700; color: #111; white-space: nowrap; }
.dt-lbl::after { content: '：'; }
.dt-val { font-size: 13px; color: #555; }
.dt-price { font-size: 16px; font-weight: 700; color: #E53935; }
.dt-section-label { font-size: 13px; font-weight: 700; color: #111; }
.dt-section-label::after { content: '：'; }
.dt-section-text { font-size: 13px; color: var(--primary); }
.dt-section-text span:not(:last-child)::after { content: '、'; color: #ccc; }
@media (max-width: 768px) { .dt-img-wrap { height: 160px; } }

.vin-cam-menu {
  position: absolute; right: 0; top: 100%; z-index: 50;
  background: #fff; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.15);
  overflow: hidden; min-width: 120px;
}
.vin-cam-menu div {
  padding: 12px 16px; font-size: 14px; cursor: pointer;
  white-space: nowrap; border-bottom: 1px solid #F2F2F7;
}
.vin-cam-menu div:last-child { border-bottom: none; }
.vin-cam-menu div:active { background: #F2F2F7; }
.vin-search-bar { position: relative; }

/* ===== 智能助手 ===== */
