/* ==========================================================================
   仿淘宝 · 基础样式
   变量 / 重置 / 公共组件(顶栏、头部、主导航、页脚、按钮、面包屑)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量 —— 改这里就能整体换肤
   -------------------------------------------------------------------------- */
:root {
  /* 主色:淘宝橙 */
  --orange:        #ff5000;
  --orange-deep:   #ff4400;
  --orange-light:  #ff7700;
  --orange-soft:   #fff3ee;
  --orange-line:   #ffd9c9;
  --grad-orange:   linear-gradient(90deg, #ff5000 0%, #ff7700 100%);
  --grad-btn:      linear-gradient(90deg, #ff9000 0%, #ff5000 100%);

  /* 背景 */
  --bg-page:       #f4f4f4;
  --bg-gray:       #f5f5f5;
  --white:         #fff;

  /* 文字 */
  --text:          #333;
  --text-sub:      #666;
  --text-mute:     #999;
  --text-light:    #bbb;
  --text-gray:     #6c6c6c;

  /* 线条 */
  --border:        #eee;
  --border-strong: #ddd;
  --border-input:  #ccc;

  /* 功能色 */
  --red:           #ff0036;   /* 详情页价格 */
  --green:         #00b578;
  --blue:          #1e90ff;

  /* 圆角 */
  --radius-s:      2px;
  --radius:        4px;
  --radius-l:      8px;
  --radius-pill:   999px;

  /* 布局 */
  --container:     1190px;
  --topbar-h:      35px;
  --header-h:      120px;
  --nav-h:         36px;

  /* 阴影 */
  --shadow-card:   0 2px 8px rgba(0, 0, 0, .06);
  --shadow-hover:  0 8px 22px rgba(0, 0, 0, .14);
  --shadow-pop:    0 4px 16px rgba(0, 0, 0, .12);

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-num: "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   2. 重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body, h1, h2, h3, h4, h5, h6,
p, ul, ol, li, dl, dt, dd, figure, fieldset { margin: 0; padding: 0; }

ul, ol { list-style: none; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .15s;
}
a:hover { color: var(--orange); }

img { display: block; max-width: 100%; border: 0; }
/* ABO 商品图大多是白底、非正方形棚拍图；完整展示主体，避免被卡片裁掉。 */
img[src^="assets/products/abo-sample/"],
img[src^="assets/products/abo/"],
img[src^="assets/products/open/"] {
  object-fit: contain !important;
  background: #fff;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  outline: none;
}
button { cursor: pointer; border: 0; background: none; }

table { border-collapse: collapse; border-spacing: 0; }

body {
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  min-width: var(--container);
}

/* 滚动条(webkit) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
::-webkit-scrollbar-track { background: #f0f0f0; }

/* --------------------------------------------------------------------------
   3. 布局助手
   -------------------------------------------------------------------------- */
.container {
  width: var(--container);
  margin: 0 auto;
}

.clearfix::after { content: ""; display: block; clear: both; }

.hide { display: none !important; }

/* 文字截断 */
.ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. 顶部工具条
   -------------------------------------------------------------------------- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-gray);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-gray);
  position: relative;
  z-index: 60;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
}
.topbar-left { display: flex; align-items: center; }
.topbar-left .loc { display: flex; align-items: center; gap: 4px; }
.topbar-left .loc:hover { color: var(--orange); cursor: pointer; }

.topbar-right { display: flex; align-items: center; }
.topbar-right > * { padding: 0 12px; }
.topbar-right > * + * { border-left: 1px solid #ddd; }
.topbar-right a:hover { color: var(--orange); }
.topbar-right .link-login { color: var(--orange); }
.topbar-right .link-reg { color: var(--orange); }
.topbar-right .caret { font-size: 9px; margin-left: 2px; opacity: .7; }

/* 带下拉的顶栏项 */
.topbar-item { position: relative; }
.topbar-item > .topbar-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -1px;
  min-width: 96px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-top: 0;
  padding: 6px 0;
  box-shadow: var(--shadow-pop);
  z-index: 70;
}
.topbar-item:hover > .topbar-menu { display: block; }
.topbar-item > .topbar-menu a {
  display: block;
  padding: 5px 14px;
  white-space: nowrap;
  color: var(--text-sub);
}
.topbar-item > .topbar-menu a:hover { background: var(--orange-soft); color: var(--orange); }

/* --------------------------------------------------------------------------
   5. 头部(Logo + 搜索)
   -------------------------------------------------------------------------- */
.header {
  background: #fff;
  padding: 22px 0 16px;
  position: relative;
  z-index: 50;
}
.header-inner { display: flex; align-items: flex-start; }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 200px;
  flex-shrink: 0;
  padding-top: 4px;
}
.logo-mark {
  width: 62px;
  height: 38px;
  border-radius: 6px;
  background: var(--grad-orange);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(255, 80, 0, .35);
}
.logo-text {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--grad-orange);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

/* 搜索区 */
.search {
  flex: 1;
  max-width: 660px;
  margin-left: 20px;
}
.search-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 12px;
}
.search-tabs span {
  padding: 3px 16px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  color: var(--text-sub);
  transition: .15s;
}
.search-tabs span:hover { color: var(--orange); }
.search-tabs span.on {
  background: var(--orange);
  color: #fff;
  font-weight: 700;
}

.search-box {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 2px 0 16px;
  background: #fff;
  border: 2px solid var(--orange);
  border-radius: 20px;
  overflow: hidden;
}
.search-box input {
  flex: 1;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}
.search-box input::placeholder { color: var(--text-light); }
.search-box .btn-search {
  width: 80px;
  height: 32px;
  border-radius: 16px;
  background: var(--grad-orange);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  transition: filter .15s;
}
.search-box .btn-search:hover { filter: brightness(1.06); }

.hotwords {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-mute);
}
.hotwords a { color: var(--text-mute); }
.hotwords a:hover { color: var(--orange); }
.hotwords a.hot { color: var(--orange); }

/* 右侧二维码 */
.header-qr {
  width: 190px;
  flex-shrink: 0;
  text-align: center;
  padding-top: 4px;
}
.header-qr .qr-box {
  width: 76px;
  height: 76px;
  margin: 0 auto 6px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.header-qr .qr-box img { width: 100%; height: 100%; object-fit: cover; }
.header-qr p { font-size: 12px; color: var(--text-sub); }
.header-qr p b { color: var(--orange); }

/* --------------------------------------------------------------------------
   6. 主导航
   -------------------------------------------------------------------------- */
.nav {
  background: #fff;
  border-bottom: 2px solid var(--orange);
  position: relative;
  z-index: 40;
}
.nav-inner { display: flex; align-items: stretch; height: var(--nav-h); }

.nav-cat-btn {
  width: 190px;
  flex-shrink: 0;
  background: var(--grad-orange);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  padding-left: 16px;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  padding-left: 4px;
}
.nav-links a {
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: var(--nav-h);
}
.nav-links a:hover { color: var(--orange); }
.nav-links a.hot { color: var(--orange); }

/* --------------------------------------------------------------------------
   7. 按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.08); color: #fff; }

.btn-cart {
  background: #ffeded;
  border-color: #ffc9b3;
  color: var(--orange);
  font-weight: 700;
}
.btn-cart:hover { background: #ffe0d6; color: var(--orange); }

.btn-ghost {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-sub);
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

.btn-lg { height: 46px; padding: 0 38px; font-size: 16px; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-block { display: flex; width: 100%; }

.btn-disabled,
.btn[disabled] {
  background: #e5e5e5 !important;
  border-color: #e5e5e5 !important;
  color: #bbb !important;
  cursor: not-allowed;
  filter: none !important;
}

/* --------------------------------------------------------------------------
   8. 面包屑
   -------------------------------------------------------------------------- */
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  font-size: 12px;
  color: var(--text-mute);
}
.crumb a { color: var(--text-mute); }
.crumb a:hover { color: var(--orange); }
.crumb .sep { color: var(--text-light); }
.crumb .cur { color: var(--text-sub); }

/* --------------------------------------------------------------------------
   9. 价格
   -------------------------------------------------------------------------- */
.price {
  color: var(--orange);
  font-weight: 700;
  font-family: var(--font-num);
  white-space: nowrap;
}
.price .sym { font-size: 12px; margin-right: 1px; }
.price .num { font-size: 18px; }

.price-sm .num { font-size: 14px; }
.price-lg .num { font-size: 30px; }
.price-lg .sym { font-size: 16px; }

.price-old {
  color: var(--text-light);
  text-decoration: line-through;
  font-size: 12px;
  font-weight: 400;
  font-family: var(--font-num);
}

/* --------------------------------------------------------------------------
   10. 商品卡片
   -------------------------------------------------------------------------- */
.goods-card {
  display: block;
  background: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.goods-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--orange-line);
  color: inherit;
}
.goods-card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-gray);
  overflow: hidden;
}
.goods-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.goods-card:hover .thumb img { transform: scale(1.05); }

.goods-card .badge {
  position: absolute;
  left: 0;
  top: 8px;
  padding: 2px 7px;
  background: var(--grad-orange);
  color: #fff;
  font-size: 11px;
  border-radius: 0 10px 10px 0;
}
.goods-card .info { padding: 9px 10px 12px; }
.goods-card .title {
  height: 38px;
  font-size: 13px;
  line-height: 19px;
  color: var(--text);
  margin-bottom: 7px;
  transition: color .15s;
}
.goods-card:hover .title { color: var(--orange); }
.goods-card .meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.goods-card .sales {
  font-size: 12px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.goods-card .shop-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-mute);
}
.goods-card .shop-line .shop-name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.goods-card .shop-line .loc { flex-shrink: 0; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 0 4px;
  height: 16px;
  line-height: 15px;
  border: 1px solid var(--orange);
  border-radius: var(--radius-s);
  color: var(--orange);
  font-size: 11px;
  vertical-align: 1px;
}
.tag-fill {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

/* --------------------------------------------------------------------------
   11. 通用面板 / 楼层标题
   -------------------------------------------------------------------------- */
.panel {
  background: #fff;
  border-radius: var(--radius);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}
.panel-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.panel-head .more { font-size: 12px; color: var(--text-mute); }

/* 楼层标题 */
.floor {
  margin-top: 26px;
}
.floor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.floor-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.floor-head h2::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--grad-orange);
}
.floor-head .sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-mute);
  margin-left: 2px;
}
.floor-head .more {
  font-size: 13px;
  color: var(--text-mute);
}
.floor-head .more:hover { color: var(--orange); }

/* --------------------------------------------------------------------------
   12. 页脚
   -------------------------------------------------------------------------- */
.footer {
  margin-top: 42px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.footer-promise {
  display: flex;
  justify-content: space-between;
  padding: 26px 40px;
  border-bottom: 1px solid var(--border);
}
.footer-promise .item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-promise .ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer-promise .tx b {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.footer-promise .tx span { font-size: 12px; color: var(--text-mute); }

.footer-links {
  display: flex;
  gap: 20px;
  padding: 26px 40px;
}
.footer-col { width: 150px; }
.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.footer-col a {
  display: block;
  font-size: 12px;
  line-height: 24px;
  color: var(--text-sub);
}
.footer-col a:hover { color: var(--orange); }

.footer-qr {
  margin-left: auto;
  display: flex;
  gap: 22px;
  text-align: center;
}
.footer-qr .box { width: 84px; }
.footer-qr .box img {
  width: 84px;
  height: 84px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  background: #fff;
}
.footer-qr .box p { font-size: 12px; color: var(--text-sub); margin-top: 6px; }

.footer-copy {
  background: var(--bg-gray);
  padding: 20px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
  line-height: 24px;
}
.footer-copy .row1 { margin-bottom: 4px; }
.footer-copy .row1 a { color: var(--text-sub); }
.footer-copy .row1 .sep { margin: 0 8px; color: var(--border-strong); }

/* --------------------------------------------------------------------------
   13. 商品网格 / 楼层标题(首页、列表页、详情页、购物车共用)
   -------------------------------------------------------------------------- */
.goods-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.like-head {
  margin: 30px 0 14px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  position: relative;
}
.like-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  background: var(--bg-page);
  position: relative;
  z-index: 2;
}
.like-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border-strong);
}

.load-more {
  margin-top: 26px;
  text-align: center;
}
.load-more button {
  height: 40px;
  padding: 0 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text-sub);
  font-size: 14px;
  transition: .18s;
}
.load-more button:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.load-more button[disabled] {
  color: var(--text-light);
  cursor: default;
  border-color: var(--border);
}

/* --------------------------------------------------------------------------
   14. 轻提示
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 320px;
  padding: 12px 22px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: 14px;
  border-radius: var(--radius);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.toast.show { opacity: 1; }

/* --------------------------------------------------------------------------
   15. 空状态
   -------------------------------------------------------------------------- */
.empty {
  padding: 80px 0;
  text-align: center;
  color: var(--text-mute);
}
.empty .ico {
  font-size: 54px;
  opacity: .28;
  margin-bottom: 12px;
}
.empty p { font-size: 14px; margin-bottom: 16px; }
/* Category/search page loading feedback. */
.page-loading {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0s linear 0.16s;
}

.page-loading.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.page-loading-card {
  min-width: 150px;
  padding: 22px 28px 18px;
  border: 1px solid rgba(255, 80, 0, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 32px rgba(30, 20, 10, 0.12);
  color: #666;
  text-align: center;
}

.page-loading-spinner {
  display: block;
  width: 38px;
  height: 38px;
  margin: 0 auto 12px;
  border: 4px solid #ffe1d2;
  border-top-color: #ff5000;
  border-right-color: #ff8a42;
  border-radius: 50%;
  animation: page-loading-spin 0.72s linear infinite;
}

.page-loading-card p {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
}

html.page-is-loading,
html.page-is-loading body {
  cursor: wait;
}

@keyframes page-loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .page-loading-spinner { animation-duration: 1.5s; }
}
