/* ============================================================
   潮布时 · UI v4 增强层
   只做增量：焦点可达性 / 触摸目标 / 购物车信息层级 / 动效降级
   不改原有布局结构，可整段删除回滚
   ============================================================ */

/* 1. 键盘焦点可见（原本全靠鼠标 hover，键盘与开关设备无法识别焦点） */
:focus-visible { outline: 2px solid #FF5A1F; outline-offset: 2px; border-radius: 6px; }
/* 工作端登录框内联写了 outline:none，这里补回焦点环 */
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #FF5A1F !important; outline-offset: 2px;
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* 2. 文本选中色（默认蓝色与品牌橙冲突） */
::selection { background: rgba(255, 90, 31, .16); color: #111; }

/* 3. 抽屉滚动条（Windows 默认滚动条粗且灰，压住内容） */
.drawer-body { scrollbar-width: thin; scrollbar-color: #ddd8d3 transparent; }
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb { background: #ddd8d3; border-radius: 99px; }
.drawer-body::-webkit-scrollbar-thumb:hover { background: #c9c2bb; }

/* 4. 关闭按钮：11×17px 的 ✕ 太小，手机点不中 → 44×44 触摸区 */
.drawer-close {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: #a0a0a0;
  font-size: 18px; line-height: 1; border-radius: 50%; cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.drawer-close:hover { background: #f5f3f0; color: #111; }
.drawer-close:active { transform: scale(.9); }

/* 5. 购物车行：规格/单价/数量/小计四级信息，替代原来的「数量待确认」 */
.cart-item { align-items: flex-start; position: relative; }
.cart-item .ci-thumb {
  width: 72px; height: 72px; flex: 0 0 72px; border-radius: 12px;
  background: #f7f7f5; display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 24px; line-height: 1;
}
.cart-item .ci-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cart-item .meta { min-width: 0; flex: 1; }
.cart-item .meta .n { font-weight: 700; font-size: 14px; line-height: 1.45; padding-right: 24px; }
.cart-item .meta .s { color: #8a8a8a; font-size: 12px; margin-top: 4px; line-height: 1.5; }
.cart-item .ci-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.cart-item .meta .p { color: #FF5A1F; font-weight: 900; font-size: 15px; margin: 0; text-align: right; white-space: nowrap; }
.cart-item .meta .p small { display: block; color: #a8a8a8; font-weight: 400; font-size: 11px; margin-top: 2px; }
.cart-item .del {
  position: absolute; top: 10px; right: 0;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: #c8c8c8;
  font-size: 13px; line-height: 1; border-radius: 50%; cursor: pointer; transition: .2s;
}
.cart-item .del:hover { color: #FF3B00; background: #FFF1EB; }

/* 6. 数量步进器 */
.qty-box { display: inline-flex; align-items: center; border: 1.5px solid #eeeee9; border-radius: 10px; overflow: hidden; background: #fff; }
.qty-box button {
  width: 30px; height: 30px; border: none; background: transparent;
  color: #555; font-size: 15px; line-height: 1; cursor: pointer;
  transition: background .15s, color .15s;
}
.qty-box button:hover { background: #FFF1EB; color: #FF5A1F; }
.qty-box button:active { transform: scale(.94); }
.qty-box .qty-num { min-width: 30px; text-align: center; font-size: 13px; font-weight: 700; color: #111; font-variant-numeric: tabular-nums; }

/* 7. 抽屉底部提示行（起批进度 / 发货说明） */
.cart-hint { display: none; font-size: 12px; line-height: 1.6; color: #8a8a8a; margin-bottom: 12px; }
.cart-hint.warn { display: block; color: #FF3B00; }
.cart-hint.ok { display: block; color: #0d9458; }

/* 8. 按钮反馈：按下有回应，主按钮带品牌色投影 */
.btn:active, .cb-f-btn:active { transform: translateY(1px) scale(.985); }
.btn.primary { box-shadow: 0 6px 18px -8px rgba(255, 90, 31, .6); }
.btn.primary:hover { box-shadow: 0 10px 24px -10px rgba(255, 90, 31, .75); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* 9. 触摸目标：底部导航 48px；页脚链接只在触屏尺寸下加高，桌面保持紧凑 */
.mobile-nav a { min-height: 48px; justify-content: center; }
@media (max-width: 860px) {
  .cb-f-links a { min-height: 34px; display: flex; align-items: center; }
}

/* 10. 商品图加载淡入，避免白块突现 */
.card .img img { animation: cbImgIn .38s ease both; }
@keyframes cbImgIn { from { opacity: 0; } to { opacity: 1; } }

/* 11. 抽屉空态 */
.drawer-body .empty { text-align: center; padding: 44px 0; color: #999; font-size: 13px; }
.drawer-body .empty .ico { font-size: 40px; margin-bottom: 12px; opacity: .55; }

/* 12. 首屏骨架屏（接口未返回时占位，消除白屏） */
.cb-skel { padding: 24px 0 40px; }
.cb-skel-hero {
  height: 220px; border-radius: 20px; margin-bottom: 28px;
  background: linear-gradient(100deg, #f3f1ee 30%, #faf9f7 50%, #f3f1ee 70%);
  background-size: 220% 100%; animation: cbShimmer 1.3s ease-in-out infinite;
}
.cb-skel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cb-skel-card { border-radius: 16px; border: 1px solid #f0eee9; padding: 10px; }
.cb-skel-img {
  aspect-ratio: 1; border-radius: 12px; margin-bottom: 12px;
  background: linear-gradient(100deg, #f3f1ee 30%, #faf9f7 50%, #f3f1ee 70%);
  background-size: 220% 100%; animation: cbShimmer 1.3s ease-in-out infinite;
}
.cb-skel-line { height: 12px; border-radius: 6px; margin-bottom: 8px;
  background: linear-gradient(100deg, #f3f1ee 30%, #faf9f7 50%, #f3f1ee 70%);
  background-size: 220% 100%; animation: cbShimmer 1.3s ease-in-out infinite;
}
.cb-skel-line.w70 { width: 70%; }
.cb-skel-line.w40 { width: 40%; height: 10px; }
@keyframes cbShimmer { 0% { background-position: 120% 0; } 100% { background-position: -20% 0; } }
@media (max-width: 1024px) { .cb-skel-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .cb-skel-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .cb-skel-hero { height: 160px; } }

/* 13. 接口异常时的自救页 */
.cb-offline { text-align: center; padding: 72px 20px 96px; }
.cb-offline .ico { font-size: 46px; margin-bottom: 14px; opacity: .85; }
.cb-offline h3 { font-size: 20px; font-weight: 900; color: #111; margin: 0 0 10px; }
.cb-offline p { font-size: 14px; line-height: 1.8; color: #8a8a8a; margin: 0 auto 22px; max-width: 420px; }
.cb-offline-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 14. 尊重系统的「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 15. 工作端无图商品占位（与前台 .img-ph 一致） */
.adm-noimg {
  width: 48px; height: 48px; border-radius: 8px;
  background: repeating-linear-gradient(45deg, #faf8f5, #faf8f5 6px, #f5f2ee 6px, #f5f2ee 12px);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #c3b3a7; user-select: none;
}

/* 18. 登录问候仪式 */
.cb-greet-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(255, 90, 31, .16), transparent 60%), rgba(17, 17, 17, .55);
  backdrop-filter: blur(3px);
  animation: cbGreetFade .3s ease both;
}
.cb-greet-card {
  background: #fff; border-radius: 24px; padding: 38px 52px;
  text-align: center; min-width: 300px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  animation: cbGreetPop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.cb-greet-badge {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  background: linear-gradient(135deg, #FF5A1F, #FF8C42);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
  box-shadow: 0 10px 24px rgba(255, 90, 31, .35);
  animation: cbGreetBounce .7s cubic-bezier(.34, 1.56, .64, 1) .1s both;
}
.cb-greet-head { font-size: 26px; font-weight: 900; color: #111; letter-spacing: 1px; }
.cb-greet-name { font-size: 18px; font-weight: 800; color: #FF5A1F; margin-top: 10px; }
.cb-greet-line { font-size: 14px; color: #888; margin-top: 16px; line-height: 1.6; }
@keyframes cbGreetFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cbGreetPop { from { opacity: 0; transform: scale(.82) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes cbGreetBounce { 0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* 16. 工作端表格：表头吸顶 + 悬停行高亮 */
#panel table thead th { position: sticky; top: 0; background: #fff; z-index: 1; box-shadow: 0 1px 0 #eee; }
#panel table tbody tr { transition: background .12s; }
#panel table tbody tr:hover { background: #fafaf6; }

/* 17. 数据分析卡片 */
.ana-card { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
.ana-card h3 { font-size: 14px; margin: 0 0 12px; color: #333; }
#panel .btn.active { background: #111; color: #fff; border-color: #111; }
@media (max-width: 900px) {
  #anaRoot [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  #anaRoot [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}

/* 19. 工作端手机适配增强 */
/* 编辑器弹窗：响应式宽度，手机端不再被压缩 */
.editor-card { width: 100%; max-width: 720px; flex-shrink: 0; box-sizing: border-box; }
/* 编辑器字段标签（提示文字） */
.form-grid .field label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; font-weight: 600; }
.form-grid .field input, .form-grid .field select, .form-grid .field textarea { width: 100%; box-sizing: border-box; }

@media (max-width: 768px) {
  .editor-card { padding: 18px 14px !important; border-radius: 14px; }
  /* 库存矩阵：输入格加大到 44px 触摸友好，16px 字体防 iOS 自动放大 */
  #matrixTable input { width: 52px !important; min-height: 44px; font-size: 16px !important; }
  #matrixTable th, #matrixTable td { padding: 6px 4px !important; }
  /* 库存矩阵第一列（颜色）吸顶，横向滚动时可见 */
  #matrixTable th:first-child, #matrixTable td:first-child { position: sticky; left: 0; background: #f9f9f9; z-index: 2; }
  #matrixTable td:first-child { background: #fafafa; }
}

/* 20. 首页视觉美化 */
/* 担保项图标：emoji 放进统一圆角徽章，更精致 */
.cb-g-ico {
  width: 54px; height: 54px; border-radius: 16px;
  background: linear-gradient(135deg, #FFF3EC, #FFE4D3);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1; margin-bottom: 16px;
}
.cb-g-item { padding: 26px 22px; }
/* 章节标题：加一条橙色装饰短横线 */
.section-title::after {
  content: ''; display: block; width: 34px; height: 3px;
  border-radius: 99px; background: linear-gradient(90deg, #FF5A1F, #FFB37A);
  margin-top: 8px;
}
/* 流程步骤号：橙色小徽章 */
.cb-flow-n {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  background: #FFF3EC; color: #FF5A1F; font-size: 11px; font-weight: 900; letter-spacing: 2px;
  margin-bottom: 12px;
}
/* 担保项图标徽章悬停微动 */
.cb-g-item:hover .cb-g-ico { transform: scale(1.06); }
.cb-g-ico { transition: transform .25s; }

/* 21. 首页封面手机端上下布局 */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
  .hero-grid > div:last-child { max-width: 340px; margin: 0 auto; width: 100%; }
}

/* 22. 首页下半部分：匹配新标题的时尚风格 */
/* 章节大标题：左侧橙色竖条 + 更大更粗 */
.section-h2 {
  position: relative; padding-left: 20px;
  font-size: clamp(28px, 4.5vw, 44px) !important; font-weight: 900; letter-spacing: -1px;
}
.section-h2::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 6px; border-radius: 99px;
  background: linear-gradient(180deg, #FF5A1F, #FFB37A);
}
/* 数据区：黑底白字，带一点层次感的渐变（不要纯黑） */
.stats {
  background: linear-gradient(135deg, #262626 0%, #111 52%, #0b0b0b 100%);
  border: none; border-radius: 20px;
  box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .45);
}
.stats .stat .num { color: #fff; }
.stats .stat .num em { color: #FF5A1F; font-style: normal; }
.stats .stat .label { color: #b0b0b0; }
/* 担保卡片：加一点不规则感（顶部橙色细条，靠左） */
.cb-g-item { position: relative; overflow: hidden; }
.cb-g-item::before {
  content: ''; position: absolute; left: 0; top: 0; width: 46%; height: 3px;
  background: linear-gradient(90deg, #FF5A1F, transparent); border-radius: 99px;
}

/* 24. 零售会员折扣标签：4/5/6折 */
.disc-tag {
  display: inline-block; background: #FF5A1F; color: #fff;
  font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 4px;
  margin-right: 6px; vertical-align: middle; letter-spacing: .5px; line-height: 1.4;
}
.disc-tag.dark { background: #111; }

/* 25. 手机端微调：小屏上折扣角标/价格更紧凑 */
@media (max-width: 400px) {
  .disc-tag { font-size: 10px; padding: 2px 5px; margin-right: 4px; letter-spacing: 0; }
  .card .price { font-size: 16px; }
  .card .price small { font-size: 11px; }
}

/* 26. 橱窗分类标签：小类（子类）与展开按钮样式 */
.chip-sub { background: #f7f7f5; border-color: #eee; color: #888; font-size: 13px; }
.chip-more { background: #FFF3EC; border-color: #FFD9C7; color: #FF5A1F; font-weight: 800; }
.chip-more:hover { background: #FFE4D3; }

/* 27. 用户中心：卡片化布局（含手机端响应式） */
.uc-card { background: #fff; border-radius: 16px; padding: 18px 16px; border: 1px solid var(--line); margin-bottom: 14px; }
.uc-title { font-size: 16px; font-weight: 900; margin-bottom: 12px; }
.uc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.uc-stat { background: #fff; border-radius: 14px; padding: 14px 8px; text-align: center; border: 1px solid var(--line); }
.uc-stat-num { font-size: 20px; font-weight: 900; color: var(--orange); }
.uc-stat-k { font-size: 12px; color: #999; margin-top: 4px; }
.uc-recs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.uc-pref { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.uc-pref-item { background: #faf8f5; border-radius: 12px; padding: 12px 8px; text-align: center; }
.uc-pref-item .n { display: block; font-size: 18px; font-weight: 900; color: #111; }
.uc-pref-item .k { display: block; font-size: 11px; color: #999; margin-top: 3px; }
.uc-pref-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.uc-pref-cat { display: inline-block; background: #FFF1EB; color: #FF5A1F; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.uc-hscroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.uc-hitem { flex-shrink: 0; width: 84px; cursor: pointer; }
@media (max-width: 400px) {
  .uc-stats { grid-template-columns: repeat(2, 1fr); }
  .uc-recs { grid-template-columns: repeat(2, 1fr); }
  .uc-stat-num { font-size: 18px; }
}


