/* ==================== 基础重置 ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4F7CFF;
  --primary-light: #EEF2FF;
  --green: #22C55E;
  --green-light: #DCFCE7;
  --orange: #F97316;
  --orange-light: #FFF7ED;
  --red: #EF4444;
  --red-light: #FEF2F2;
  --purple: #A855F7;
  --purple-light: #F3E8FF;
  --teal: #14B8A6;
  --teal-light: #F0FDFA;
  --gray-50: #F8F9FA;
  --gray-100: #F1F3F5;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #ADB5BD;
  --gray-500: #6C757D;
  --gray-600: #495057;
  --gray-700: #343A40;
  --gray-900: #212529;
  --text: #1A1A2E;
  --text-sub: #6C757D;
  --bg: #F5F6FA;
  --card-bg: #FFFFFF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
  --tab-height: 72px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* ==================== 页面切换 ==================== */
.page {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
  opacity: 0;
  will-change: transform, opacity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--tab-height);
  visibility: hidden;
}
.page.active { 
  transform: translateX(0); 
  opacity: 1;
  visibility: visible;
}
.page.slide-out { transform: translateX(-20%); }

/* ==================== Header ==================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--gray-100);
  min-height: 60px;
}
.header-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.header-right { display: flex; align-items: center; gap: 4px; }
.header-title { font-size: 17px; font-weight: 700; color: var(--text); }
.header-sub { font-size: 12px; color: var(--text-sub); margin-top: 1px; }
.avatar {
  width: 38px; height: 38px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.avatar-logo {
  width: 38px; height: 38px;
  border-radius: 12px;
  object-fit: cover;
}

.icon-btn {
  width: 36px; height: 36px;
  background: var(--gray-100);
  border: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray-600);
  transition: all 0.2s; position: relative;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.92); background: var(--gray-200); }
.danger-btn { color: var(--red); }
.danger-btn:hover { background: var(--red-light); }

.back-btn {
  width: 36px; height: 36px;
  background: transparent;
  border: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text);
  transition: all 0.2s;
}
.back-btn svg { width: 20px; height: 20px; }
.back-btn:active { background: var(--gray-100); }

.text-btn {
  font-size: 13px; color: var(--primary);
  background: transparent; border: none;
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
  font-weight: 500;
}
.text-btn-white {
  font-size: 13px; color: var(--primary);
  background: var(--primary-light); border: none;
  cursor: pointer; padding: 5px 12px; border-radius: 8px;
  font-weight: 500; margin-left: auto;
}

.badge {
  position: absolute; top: -2px; right: -2px;
  width: 16px; height: 16px;
  background: var(--red);
  border-radius: 50%;
  font-size: 10px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}

/* ==================== 多选工具栏 ==================== */
.select-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  position: sticky;
  top: 60px;
  z-index: 99;
}

.select-toolbar.active {
  display: flex;
}

.toolbar-count {
  font-weight: 500;
  font-size: 13px;
}

.toolbar-actions {
  display: flex;
  gap: 6px;
}

.toolbar-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.2);
  color: white;
  transition: opacity 0.2s;
}

.toolbar-btn:active {
  opacity: 0.7;
}

.toolbar-btn-small {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.2);
  color: white;
  white-space: nowrap;
}

.toolbar-btn-small:active {
  opacity: 0.7;
}

.toolbar-btn-small.danger {
  background: rgba(239,68,68,0.3);
}

.toolbar-btn-small.danger:active {
  background: rgba(239,68,68,0.5);
}

/* ==================== 统计卡片 ==================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 16px 6px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 22px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-sub); margin-top: 4px; }
.stat-blue .stat-num { color: var(--primary); }
.stat-green .stat-num { color: var(--green); }
.stat-orange .stat-num { color: var(--orange); }
.stat-red .stat-num { color: var(--red); }

/* ==================== 快捷操作 ==================== */
.section-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  padding: 14px 16px 8px;
}
.section-title-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 0;
}
.section-title-row .section-title { padding: 0; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 16px;
}
.quick-btn {
  background: var(--card-bg);
  border: none; border-radius: var(--radius-sm);
  padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; box-shadow: var(--shadow);
  transition: all 0.2s;
}
.quick-btn:active { transform: scale(0.95); box-shadow: none; }
.quick-btn span { font-size: 12px; color: var(--text-sub); font-weight: 500; }

.quick-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.quick-icon svg { width: 20px; height: 20px; }
.bg-blue { background: var(--primary); }
.bg-purple { background: var(--purple); }
.bg-teal { background: var(--teal); }
.bg-orange { background: var(--orange); }

/* ==================== 分类标签 ==================== */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 6px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--card-bg);
  font-size: 13px; color: var(--text-sub);
  cursor: pointer; font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ==================== 库存列表 ==================== */
.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 16px;
}

.item-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.item-card:active { transform: scale(0.98); box-shadow: none; }
.item-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}
.item-card.status-ok::before { background: var(--green); }
.item-card.status-low::before { background: var(--orange); }
.item-card.status-out::before { background: var(--red); }
.item-card.status-none::before { background: var(--gray-300); }

/* 多选模式 */
.item-card.selected {
  background: var(--primary-light);
}

.select-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
  transition: all 0.2s;
  margin-right: 10px;
}

.select-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.select-checkbox.indeterminate {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-size: 16px;
}

.item-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 8px;
}
.item-info { flex: 1; }
.item-name { font-size: 15px; font-weight: 700; color: var(--text); }
.item-model { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.item-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.item-tag {
  font-size: 11px; padding: 2px 8px;
  border-radius: 10px; font-weight: 500;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-orange { background: var(--orange-light); color: var(--orange); }
.tag-red { background: var(--red-light); color: var(--red); }
.tag-gray { background: var(--gray-100); color: var(--gray-500); }

.item-qty-wrap {
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.item-qty { font-size: 24px; font-weight: 800; line-height: 1; color: var(--text); }
.item-unit { font-size: 12px; color: var(--text-sub); }

.item-bottom {
  display: flex; align-items: center; justify-content: space-between;
}
.item-progress-wrap { flex: 1; margin-right: 12px; }
.item-progress-bar {
  height: 5px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}
.item-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.progress-ok { background: var(--green); }
.progress-low { background: var(--orange); }
.progress-out { background: var(--red); }

.item-actions { display: flex; gap: 6px; }
.item-action-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: none; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
  transition: all 0.15s;
}
.item-action-btn:active { transform: scale(0.9); }

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
}
.empty-icon { font-size: 52px; margin-bottom: 12px; }
.empty-text { font-size: 16px; font-weight: 600; color: var(--gray-500); }
.empty-sub { font-size: 13px; margin-top: 6px; }

/* ==================== 搜索框 ==================== */
.search-box {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-100);
  border-radius: 12px;
  padding: 8px 12px;
}
.search-box svg { width: 16px; height: 16px; color: var(--gray-400); flex-shrink: 0; }
.search-box input {
  flex: 1; border: none; background: transparent;
  font-size: 15px; color: var(--text); outline: none;
}
.clear-btn {
  background: transparent; border: none; color: var(--gray-400);
  cursor: pointer; font-size: 14px; padding: 2px;
}

/* ==================== 底部导航 ==================== */
.tab-bar {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: var(--tab-height);
  background: var(--card-bg);
  border-top: 1px solid var(--gray-100);
  display: flex; align-items: flex-start;
  padding: 8px 0 0;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: none;
  cursor: pointer; padding: 4px 0;
  color: var(--gray-400);
  font-size: 11px; font-weight: 500;
  transition: color 0.2s;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--primary); }
.tab-item.active svg { stroke: var(--primary); }

.tab-add-btn { position: relative; }
.add-circle {
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(79,124,255,0.4);
  margin-top: -16px; position: relative; z-index: 1;
}
.add-circle svg { width: 24px; height: 24px; stroke: #fff; }

/* ==================== 表单 ==================== */
.form-container { padding: 16px 16px 100px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  display: block; margin-bottom: 6px;
}
.required { color: var(--red); }
.form-input {
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 15px; color: var(--text);
  outline: none; transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--gray-400); }
.form-textarea { resize: none; font-family: inherit; }
.form-row { display: flex; gap: 12px; }

/* ==================== 联想推荐下拉 ==================== */
.suggest-wrapper { position: relative; }
.suggest-list {
  position: absolute; left: 0; right: 0; top: 100%;
  z-index: 100;
  background: var(--card-bg);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-height: 260px; overflow-y: auto;
  margin-top: 2px;
  display: none;
  -webkit-overflow-scrolling: touch;
}
.suggest-list.show { display: block; }
.suggest-item {
  padding: 10px 14px;
  font-size: 14px; color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 8px;
  transition: background 0.15s;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.active { background: var(--primary-light); }
.suggest-item .suggest-tag {
  font-size: 11px; color: var(--primary);
  background: var(--primary-light);
  padding: 1px 6px; border-radius: 4px;
  white-space: nowrap;
}
.suggest-item .suggest-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item .suggest-extra {
  font-size: 11px; color: var(--text-sub);
  white-space: nowrap;
}
.suggest-hint {
  font-size: 11px; color: var(--primary);
  margin-top: 4px;
  display: none;
}
.suggest-hint.show { display: block; }
.flex1 { flex: 1; min-width: 0; }
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: '▾';
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); pointer-events: none; font-size: 12px;
}
.select-wrapper select { appearance: none; cursor: pointer; }

.qty-control {
  display: flex; align-items: center; gap: 0;
  background: var(--card-bg);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-btn {
  width: 44px; height: 46px;
  background: var(--gray-50); border: none;
  font-size: 20px; color: var(--primary);
  cursor: pointer; font-weight: 300; flex-shrink: 0;
  transition: background 0.15s;
}
.qty-btn:active { background: var(--primary-light); }
.qty-input {
  flex: 1; border: none; outline: none;
  text-align: center; font-size: 18px; font-weight: 700;
  color: var(--text); background: transparent; padding: 0;
  -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button { display: none; }

.submit-btn {
  width: 100%;
  background: var(--primary);
  color: #fff; border: none;
  border-radius: var(--radius);
  padding: 15px;
  font-size: 16px; font-weight: 700;
  cursor: pointer; margin-top: 8px;
  box-shadow: 0 4px 14px rgba(79,124,255,0.35);
  transition: all 0.2s;
}
.submit-btn:active { transform: scale(0.98); opacity: 0.9; }

.btn-outline {
  flex: 1;
  background: var(--gray-100);
  color: var(--text-sub); border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-outline:active { background: var(--gray-200); }

/* ==================== 设置页 ==================== */
.settings-container {
  padding: 16px;
}

.settings-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.settings-title {
  font-size: 12px;
  color: var(--text-sub);
  padding: 12px 16px 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--gray-100);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:active {
  background: var(--gray-50);
}

.settings-item-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 12px;
}

.settings-item-icon.danger-icon {
  background: var(--red-light);
}

.settings-item-info {
  flex: 1;
}

.settings-item-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.settings-item-name.danger-text {
  color: var(--red);
}

.settings-item-desc {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.settings-item svg {
  width: 18px;
  height: 18px;
  color: var(--gray-400);
}

/* ==================== AI 识别页 ==================== */
.ai-container { padding: 16px 16px 100px; }
.upload-zone {
  background: var(--card-bg);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer; transition: all 0.2s;
}
.upload-zone:active { border-color: var(--primary); background: var(--primary-light); }
.upload-icon { font-size: 44px; margin-bottom: 12px; }
.upload-text { font-size: 16px; font-weight: 700; color: var(--text); }
.upload-sub { font-size: 13px; color: var(--text-sub); margin-top: 6px; }

.preview-wrap { position: relative; margin-bottom: 16px; }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.preview-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.preview-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.preview-thumb .thumb-delete {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.55); color: #fff;
  border: none; border-radius: 50%;
  font-size: 12px; line-height: 22px;
  text-align: center; cursor: pointer;
  padding: 0;
}
.preview-thumb .thumb-delete:hover { background: rgba(239,68,68,0.8); }
.preview-thumb .thumb-status {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 2px 4px;
  font-size: 10px; color: #fff;
  text-align: center;
}
.thumb-status.pending { background: rgba(0,0,0,0.4); }
.thumb-status.done { background: rgba(34,197,94,0.8); }
.thumb-status.error { background: rgba(239,68,68,0.8); }
.thumb-status.processing { background: rgba(79,124,255,0.8); }
.preview-actions {
  display: flex; gap: 8px; justify-content: center;
}
.preview-actions .reupload-btn {
  position: static;
  background: rgba(79,124,255,0.1); color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 6px 16px; font-size: 13px;
  cursor: pointer;
}
.preview-actions .reupload-btn:hover {
  background: var(--primary); color: #fff;
}
.reupload-btn-legacy {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.5); color: #fff;
  border: none; border-radius: 8px;
  padding: 5px 12px; font-size: 12px;
  cursor: pointer;
}

.ai-btn {
  width: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; border: none;
  border-radius: var(--radius);
  padding: 15px;
  font-size: 16px; font-weight: 700;
  cursor: pointer; margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(118,75,162,0.35);
  transition: all 0.2s;
}
.ai-btn:active { transform: scale(0.98); }
.ai-btn-icon { font-size: 18px; }

.ai-loading {
  text-align: center; padding: 30px;
  color: var(--text-sub); font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.ai-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ai-result-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 12px;
}
.ai-result-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ai-result-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  position: relative;
  padding-right: 40px; /* 给删除按钮留位置 */
}
}
.ai-item-info { flex: 1; }
.ai-item-name { font-size: 14px; font-weight: 700; }
.ai-item-detail { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.ai-item-edit {
  width: 32px; height: 32px;
  background: var(--primary-light);
  border: none; border-radius: 8px;
  color: var(--primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.ai-result-actions { display: flex; gap: 10px; }

.ai-tips {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.tips-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.tips-item { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; line-height: 1.5; }

/* ==================== API Key 配置 ==================== */
.api-key-panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--primary);
}
.api-key-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.api-key-hint { font-size: 12px; color: var(--text-sub); margin-bottom: 10px; }
.api-key-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 10px; }
.api-key-link { font-size: 12px; color: var(--primary); background: none; border: none; cursor: pointer; text-decoration: underline; flex-shrink: 0; }
.api-key-save { flex: 1; padding: 10px; font-size: 14px; margin-top: 0; }
.api-key-status { font-size: 12px; color: var(--green); margin-top: 8px; text-align: center; }

/* AI 模型切换器 */
.api-model-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-model-btn {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.ai-model-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* ==================== 详情页 ==================== */
.detail-hero {
  background: var(--card-bg);
  padding: 20px 16px;
  margin: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.detail-name { font-size: 22px; font-weight: 800; color: var(--text); }
.detail-model { font-size: 14px; color: var(--text-sub); margin-top: 4px; }
.detail-qty-row {
  display: flex; align-items: baseline; gap: 6px;
  margin-top: 16px;
}
.detail-qty { font-size: 48px; font-weight: 900; color: var(--primary); line-height: 1; }
.detail-unit { font-size: 18px; color: var(--text-sub); }
.detail-warn { font-size: 13px; color: var(--text-sub); margin-top: 6px; }
.detail-type { font-size: 13px; color: var(--primary); margin-top: 6px; background: var(--primary-light); display: inline-block; padding: 2px 10px; border-radius: 12px; }

.detail-action-row {
  display: flex; gap: 10px; margin-top: 16px;
}
.detail-action-btn {
  flex: 1; padding: 12px;
  border-radius: var(--radius-sm); border: none;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.2s;
}
.btn-use { background: var(--red-light); color: var(--red); }
.btn-restock { background: var(--green-light); color: var(--green); }
.btn-set { background: var(--primary-light); color: var(--primary); }

.detail-meta {
  background: var(--card-bg);
  margin: 0 16px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.meta-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.meta-item:last-child { border-bottom: none; }
.meta-key { font-size: 14px; color: var(--text-sub); }
.meta-val { font-size: 14px; font-weight: 600; color: var(--text); }

.detail-logs {
  margin: 0 16px 16px;
}
.logs-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.log-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 11px 14px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.log-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.log-use { background: var(--red-light); }
.log-restock { background: var(--green-light); }
.log-set { background: var(--primary-light); }
.log-info { flex: 1; }
.log-action { font-size: 13px; font-weight: 600; color: var(--text); }
.log-time { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.log-qty { font-size: 15px; font-weight: 800; }
.log-qty.use { color: var(--red); }
.log-qty.restock { color: var(--green); }

/* ==================== 录入明细 ==================== */
.detail-entries {
  margin: 0 16px 16px;
}
.entries-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.entries-count {
  font-size: 11px; font-weight: 500; color: var(--white);
  background: var(--primary); border-radius: 10px;
  padding: 1px 8px; line-height: 18px;
}
.entry-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 11px 14px; margin-bottom: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.15s;
}
.entry-item:active { background: var(--bg); }
.entry-left { flex: 1; }
.entry-method { font-size: 13px; font-weight: 600; color: var(--text); }
.entry-time { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.entry-right { text-align: right; }
.entry-qty { font-size: 14px; font-weight: 700; color: var(--primary); }
.entry-price { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.entry-unit-price { font-size: 11px; color: var(--text-sub); opacity: 0.7; }
.entry-edit-icon { font-size: 14px; margin-left: 10px; opacity: 0.4; flex-shrink: 0; }

/* ==================== 分类管理页 ==================== */
.cat-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.cat-emoji {
  width: 42px; height: 42px;
  background: var(--gray-100);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.cat-name { flex: 1; font-size: 15px; font-weight: 700; color: var(--text); }
.cat-count { font-size: 13px; color: var(--text-sub); margin-right: 8px; }
.cat-edit {
  width: 30px; height: 30px;
  background: var(--gray-100);
  border-radius: 8px; border: none;
  color: var(--primary); cursor: pointer; font-size: 14px;
}
.cat-del {
  width: 30px; height: 30px;
  background: var(--red-light);
  border-radius: 8px; border: none;
  color: var(--red); cursor: pointer; font-size: 14px;
}

/* ==================== 甜甜圈图 ==================== */
.donut-chart {
  width: 90px; height: 90px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.donut-hole {
  position: absolute;
  inset: 16px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: var(--text);
}

/* ==================== 统计页 ==================== */
.stats-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.stats-card-title {
  font-size: 14px; font-weight: 700; color: var(--text-sub);
  margin-bottom: 14px;
}
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-item { }
.bar-label-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text);
  margin-bottom: 4px;
}
.bar-track {
  height: 8px; background: var(--gray-100);
  border-radius: 4px; overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 4px;
  background: var(--primary);
  transition: width 0.8s ease;
}
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-label { font-size: 13px; color: var(--text-sub); flex: 1; }
.legend-val { font-size: 13px; font-weight: 700; color: var(--text); }

/* ==================== 通知页 ==================== */
.notify-item {
  display: flex; gap: 12px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.notify-icon { font-size: 24px; flex-shrink: 0; }
.notify-content { flex: 1; }
.notify-title { font-size: 14px; font-weight: 700; color: var(--text); }
.notify-body { font-size: 13px; color: var(--text-sub); margin-top: 4px; line-height: 1.5; }
.notify-time { font-size: 11px; color: var(--gray-400); margin-top: 6px; }

/* ==================== 弹窗 ==================== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 400;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.overlay.active { opacity: 1; pointer-events: all; }

.modal {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 430px;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  z-index: 500;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 0 env(safe-area-inset-bottom, 0);
}
.modal.active { transform: translateX(-50%) translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
  font-size: 17px; font-weight: 700;
  border-bottom: 1px solid var(--gray-100);
}
.modal-header button {
  background: var(--gray-100); border: none;
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: 14px; color: var(--gray-500);
}
.modal-body { padding: 16px 20px; }
.modal-footer {
  display: flex; gap: 10px;
  padding: 0 20px 20px;
}

.adjust-tabs { display: flex; gap: 0; background: var(--gray-100); border-radius: 10px; padding: 3px; }
.adj-tab {
  flex: 1; padding: 8px; border: none;
  background: transparent; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-sub);
  cursor: pointer; transition: all 0.2s;
}
.adj-tab.active { background: var(--card-bg); color: var(--text); box-shadow: 0 1px 6px rgba(0,0,0,0.1); }
.adj-desc { font-size: 13px; color: var(--text-sub); margin-top: 10px; }

.emoji-picker {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
}
.emoji-picker span {
  font-size: 24px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer;
  background: var(--gray-100); transition: all 0.15s;
}
.emoji-picker span:active { transform: scale(0.9); }
.emoji-picker span.selected { background: var(--primary-light); outline: 2px solid var(--primary); }

/* ==================== 登录/注册页 ==================== */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 40px;
  min-height: 100vh;
  background: #f6f8ff;
}
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.auth-logo-img {
  width: 72px; height: 72px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(79,124,255,0.18);
  margin-bottom: 12px;
}
.auth-logo-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}
.auth-logo-sub {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
}
.auth-tabs {
  display: flex;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  width: 100%;
  max-width: 360px;
  margin-bottom: 20px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.18s;
}
.auth-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,124,255,0.25);
}
#auth-form-login,
#auth-form-register {
  width: 100%;
  max-width: 360px;
}
.auth-submit-btn {
  width: 100%;
  margin-top: 8px;
  font-size: 16px;
  padding: 14px;
}
.auth-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
}
.auth-link {
  color: var(--primary);
  cursor: pointer;
}
.auth-skip {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: underline;
  cursor: pointer;
  padding: 8px;
}

/* ==================== 设置页账号卡片 ==================== */
.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.account-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.account-info {
  flex: 1;
  min-width: 0;
}
.account-email {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-sub);
}
.sync-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-sub);
}
.sync-dot.synced { background: var(--green); }
.account-logout-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.account-logout-btn:active { background: #f5f5f5; }

/* ==================== 云端加载条 ==================== */
#cloud-loading-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.cloud-loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  animation: cloud-dot-blink 1s infinite;
}
@keyframes cloud-dot-blink {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.75);
  color: #fff; font-size: 14px; font-weight: 500;
  padding: 10px 20px; border-radius: 24px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: all 0.25s;
  z-index: 600;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==================== 滚动条 ==================== */
.page::-webkit-scrollbar { width: 0; display: none; }

/* ==================== 过期提示 ==================== */
.expire-warn { color: var(--red); font-weight: 700; }
.expire-ok { color: var(--green); }

/* ==================== 响应式移动端适配 ==================== */
@media (max-height: 700px) {
  .stats-row { padding: 10px 16px 4px; }
  .detail-qty { font-size: 36px; }
}

/* ==================== 云端同步 ==================== */
.sync-status-card {
  display: flex;
  align-items: center;
  padding: 14px;
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 8px;
  gap: 12px;
}
.sync-status-icon { font-size: 28px; }
.sync-status-info { flex: 1; }
.sync-status-name { font-size: 15px; font-weight: 600; color: var(--text); }
.sync-status-desc { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.sync-status-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-sub);
  transition: background 0.3s;
}
.sync-status-indicator.synced { background: var(--green); }
.sync-status-indicator.syncing { background: var(--primary); animation: pulse 1s infinite; }
.sync-status-indicator.error { background: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* 云同步设置弹窗 */
.sync-setup-guide { padding: 4px 0; }
.sync-step {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.sync-step-num {
  width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.sync-step-content { flex: 1; }
.sync-step-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.sync-step-desc { font-size: 12px; color: var(--text-sub); line-height: 1.5; }
.sync-step-desc a { text-decoration: none; }

.sync-success-icon {
  width: 56px; height: 56px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
}
.sync-success-text { font-size: 16px; font-weight: 600; color: var(--text); text-align: center; }
.sync-success-desc { font-size: 12px; color: var(--text-sub); text-align: center; margin-top: 4px; }

/* 开关样式 */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-200);
  border-radius: 28px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ==================== 弧形弹出菜单 ==================== */
.fab-menu-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s;
}
.fab-menu-overlay.show { opacity: 1; }

.fab-menu {
  display: none;
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}
.fab-menu.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  animation: fabIn 0.3s ease-out forwards;
}

.fab-item:nth-child(1) { animation-delay: 0ms; }
.fab-item:nth-child(2) { animation-delay: 50ms; }
.fab-item:nth-child(3) { animation-delay: 100ms; }

@keyframes fabIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fab-icon {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab-icon:active { transform: scale(0.9); }
.fab-icon svg { width: 24px; height: 24px; stroke: #fff; }
.fab-item span {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  white-space: nowrap;
}

/* ==================== 筛选列表页 ==================== */
.filter-count {
  font-size: 13px;
  color: var(--text-sub);
  margin-left: 8px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--gray-100);
}

.filter-tab {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  background: var(--card-bg);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-tab.active {
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.filter-tab:active { transform: scale(0.95); }

/* 分组维度标签 */
.group-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}

.group-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 8px;
  margin: 4px 2px;
}
.group-tab.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}
.group-tab:active { transform: scale(0.98); }

.filter-divider {
  width: 1px;
  height: 24px;
  background: var(--gray-200);
  margin: 0 4px;
}

/* ==================== 可点击元素样式 ==================== */
.stat-card.clickable { cursor: pointer; transition: transform 0.2s; }
.stat-card.clickable:active { transform: scale(0.98); }

.legend-item.clickable { cursor: pointer; transition: background 0.2s; padding: 8px 10px; border-radius: 8px; }
.legend-item.clickable:hover { background: var(--gray-50); }

.bar-item.clickable { cursor: pointer; }
.bar-item.clickable:active .bar-fill { opacity: 0.7; }

.stats-clickable { cursor: pointer; transition: transform 0.2s; }
.stats-clickable:active { transform: scale(0.98); }

/* ==================== 搜索页智能分组 ==================== */
.smart-group {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin: 12px 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.smart-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}
.smart-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.smart-group-count { font-size: 12px; color: var(--text-sub); }
.smart-group-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.smart-group-content.expanded { max-height: 500px; }
.smart-group-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.2s;
}
.smart-group-item:last-child { border-bottom: none; }
.smart-group-item:active { background: var(--gray-50); }

/* 合并组样式 */
.merged-group {
  border-left: 3px solid var(--primary);
}
.merged-badge {
  font-size: 10px;
  background: var(--primary);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}
.group-item-count {
  font-size: 11px;
  color: var(--text-sub);
  font-weight: normal;
  margin-left: 6px;
}
.merged-item {
  padding-left: 10px;
}
.merged-model-tag {
  font-size: 12px;
  color: var(--primary);
  background: var(--gray-50);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

/* ==================== 首页合并组样式 ==================== */
/* 合并卡片与普通卡片样式一致 */
.merged-card {
  margin-bottom: 12px;
  cursor: pointer;
}
.merged-card.selected .item-top {
  opacity: 0.7;
}

/* 合并详情展开区域 */
.merged-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  border-top: 1px solid var(--gray-100);
  margin: 0 -14px -14px;
  padding: 0 14px;
  background: var(--gray-50);
}
.merged-detail.expanded {
  max-height: 500px;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* 合并详情子项 */
.merged-detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--gray-200);
  cursor: pointer;
  transition: background 0.2s;
}
.merged-detail-item:last-child {
  border-bottom: none;
}
.merged-detail-item:active {
  background: rgba(0,0,0,0.03);
}
.merged-detail-item.selected {
  background: var(--primary-light);
  border-radius: 8px;
  padding-left: 6px;
  padding-right: 6px;
  margin: 2px 0;
  border-bottom: none;
}
.merged-detail-left {
  flex: 1;
  min-width: 0;
}
.merged-detail-model {
  font-size: 12px;
  color: var(--primary);
  background: rgba(79, 124, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 4px;
}
.item-progress-mini {
  width: 50px;
  flex-shrink: 0;
}
.item-progress-mini .item-progress-bar {
  height: 4px;
}

/* ==================== AI匹配提示 ==================== */
.ai-match-hint {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-match-hint::before {
  content: '🔗';
}

/* ==================== AI识别物品类型标签 ==================== */
.ai-item-type {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 8px;
  font-weight: 500;
}

/* ==================== AI原始识别预览 ==================== */
.ai-original-hint {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary);
}
.ai-original-label {
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 4px;
}
.ai-original-text {
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

/* ==================== AI名称简化提示 ==================== */
.ai-simplify-hint {
  font-size: 12px;
  color: var(--green);
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 6px;
}
.simplify-label {
  font-weight: 500;
}

/* ==================== AI多件拆分提示 ==================== */
.ai-split-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--orange-light);
  color: var(--orange);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 12px;
}
.split-icon {
  font-size: 16px;
}

/* ==================== AI原始预览（小卡片） ==================== */
.ai-original-preview {
  font-size: 12px;
  color: var(--text-sub);
  margin: 4px 0;
  padding: 4px 8px;
  background: var(--gray-100);
  border-radius: 4px;
  display: inline-block;
}

/* ==================== 编辑弹窗提示文本 ==================== */
.hint-text {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: normal;
}

/* ==================== 识别结果头部 ==================== */
.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.add-item-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
}

.add-item-btn svg {
  width: 14px;
  height: 14px;
}

/* ==================== 删除按钮 ==================== */
.ai-item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-item-delete:hover {
  background: var(--red);
  color: #fff;
}

/* ==================== 组合销售分割线 ==================== */
.ai-combo-divider {
  text-align: center;
  padding: 8px 0;
  color: var(--text-sub);
  font-size: 12px;
  position: relative;
}

.ai-combo-divider::before,
.ai-combo-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--gray-200);
}

.ai-combo-divider::before {
  left: 0;
}

.ai-combo-divider::after {
  right: 0;
}

/* ==================== 占位文本 ==================== */
.ai-item-name .placeholder {
  color: var(--text-sub);
  font-style: italic;
}
