/* ==========================================================================
   AKOKE Buyer Web - 亚马逊式商用厨房设备商城
   深蓝顶栏 + 橙色主色，纯 CSS 无框架
   ========================================================================== */

:root {
  --navy: #131921;
  --navy-2: #232f3e;
  --accent: #febd69;
  --accent-2: #f3a847;
  --link: #007185;
  --bg: #f3f4f6;
  --card: #ffffff;
  --line: #dcdfe3;
  --text: #111827;
  --muted: #56606b;
  --ok: #067d62;
  --danger: #b12704;
  --shadow: 0 1px 3px rgba(15, 23, 42, .12), 0 1px 2px rgba(15, 23, 42, .08);
  --radius: 10px;
  --max: 1400px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------------------------------- 顶栏 --------------------------------- */
.topbar {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  white-space: nowrap;
}
.brand:hover { border-color: #fff; }
.brand-logo { font-size: 22px; font-weight: 800; letter-spacing: .5px; color: #fff; }
.brand-logo span { color: var(--accent); }
.brand-sub { font-size: 11px; color: #cbd5e1; }

.search {
  flex: 1;
  display: flex;
  align-items: stretch;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  min-width: 0;
}
.search-cat {
  border: 0;
  background: #e6e9ec;
  color: #333;
  font-size: 12px;
  padding: 0 8px;
  max-width: 130px;
}
.search input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 11px 12px;
  font-size: 15px;
  min-width: 0;
}
.search button {
  border: 0;
  background: var(--accent);
  width: 52px;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.search button:hover { background: var(--accent-2); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* 语言切换控件（页头显眼位置：EN | 中文） */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 6px;
  white-space: nowrap;
}
.lang-btn {
  background: none;
  border: 0;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 2px 5px;
  border-radius: 4px;
}
.lang-btn:hover { color: #fff; }
.lang-btn.active { color: var(--accent); text-decoration: underline 2px; text-underline-offset: 4px; }
.lang-sep { color: #4b5563; font-size: 11px; }

.top-item {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  white-space: nowrap;
}
.top-item:hover { border-color: #fff; }
.top-item small { font-size: 11px; color: #cbd5e1; }
.top-item strong { font-size: 13px; }
.cart-link { display: flex; align-items: flex-end; gap: 6px; position: relative; }
.cart-count {
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--accent);
  color: #131921;
  font-weight: 700;
  font-size: 12px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

/* -------------------------------- 二级导航 -------------------------------- */
.navbar {
  background: var(--navy-2);
  color: #e5e7eb;
  overflow-x: auto;
}
.navbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 20px;
  white-space: nowrap;
}
.navbar a {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.navbar a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.navbar a.active { box-shadow: inset 0 -2px 0 var(--accent); color: #fff; }

/* --------------------------------- 主布局 --------------------------------- */
.shell { max-width: var(--max); margin: 0 auto; padding: 18px 20px 60px; }
.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(105deg, #0f172a 0%, #1e3a5f 55%, #274b6d 100%);
  color: #fff;
  padding: 40px 44px;
  margin-bottom: 16px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(22px, 3vw, 34px); line-height: 1.2; letter-spacing: -.3px; }
.hero p { margin: 0; color: #cbd5e1; max-width: 620px; font-size: 15px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-tags span {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  background: var(--accent);
  color: #131921;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 8px;
  border: 0;
  box-shadow: 0 6px 18px rgba(254, 189, 105, .25);
}
.hero-cta:hover { background: var(--accent-2); }

/* 类目快选 */
.cat-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; margin-bottom: 18px; }
.cat-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #b9c0c8; }
.cat-tile i { display: block; font-size: 20px; font-style: normal; margin-bottom: 6px; }
.cat-tile small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; margin-top: 2px; }

/* 列表页布局 */
.list-layout { display: grid; grid-template-columns: 246px minmax(0, 1fr); gap: 18px; align-items: start; }
.sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 16px 18px;
  position: sticky;
  top: 108px;
}
.sidebar h4 { margin: 16px 0 8px; font-size: 13px; letter-spacing: .3px; color: var(--navy-2); text-transform: uppercase; }
.sidebar .filter-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; color: var(--muted); cursor: pointer; }
.sidebar .filter-item input { accent-color: var(--accent-2); }
.sidebar .filter-item:hover { color: var(--text); }
.price-inputs { display: flex; align-items: center; gap: 6px; }
.price-inputs input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}
.btn-ghost {
  background: #fff;
  border: 1px solid #c7ccd2;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
}
.btn-ghost:hover { background: #f5f6f7; }

/* 工具条 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar .result { font-size: 13px; color: var(--muted); }
.toolbar select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #f7f8f9;
  font-size: 13px;
}

/* 商品网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .14s, box-shadow .14s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .12); }
.card-media { position: relative; aspect-ratio: 1 / 1; background: #f7f8f9; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.05); }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(19, 25, 33, .88);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: .4px;
}
.card-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 39px; }
.card-title a:hover { color: var(--link); }
.card-en { font-size: 11px; color: #8a929c; }
.stars { color: #f0a02c; font-size: 12px; letter-spacing: 1px; }
.stars span { color: var(--link); letter-spacing: 0; margin-left: 4px; font-size: 12px; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.price { font-size: 21px; font-weight: 700; letter-spacing: -.5px; }
.price sup { font-size: 12px; font-weight: 600; top: -8px; }
.price-old { font-size: 12px; color: #8a929c; text-decoration: line-through; }
.ship { font-size: 11px; color: var(--muted); }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-primary {
  background: var(--accent);
  border: 1px solid #e2a546;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 700;
  color: #131921;
  flex: 1;
  transition: background .14s;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-dark {
  background: var(--navy-2);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
}
.btn-dark:hover { background: #34465c; }

/* -------------------------------- 详情页 -------------------------------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.gallery { position: sticky; top: 108px; }
.gallery-main {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.gallery-thumbs button {
  width: 62px; height: 62px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  padding: 0;
}
.gallery-thumbs button.active { border-color: var(--accent-2); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-info h1 { font-size: 24px; line-height: 1.3; margin: 0 0 4px; letter-spacing: -.3px; }
.detail-en { color: #8a929c; font-size: 12px; margin-bottom: 10px; }
.detail-price { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-price .price { font-size: 30px; }
.detail-price small { color: var(--muted); }
.detail-desc { color: #374151; padding: 14px 0; }
.spec-list { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; font-weight: 500; }
.detail-meta { font-size: 12px; color: var(--muted); margin-top: 14px; }

.buybox {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: 108px;
}
.buybox .stock { color: var(--ok); font-weight: 700; font-size: 13px; margin: 0 0 10px; }
.qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: fit-content; }
.qty button { width: 34px; height: 34px; border: 0; background: #f5f6f7; font-size: 16px; }
.qty button:hover { background: #e9ecef; }
.qty input { width: 52px; height: 34px; border: 0; text-align: center; font-size: 14px; }
.buybox .btn-primary { width: 100%; margin-top: 12px; }
.buybox .btn-dark { width: 100%; margin-top: 8px; }
.buybox .note { font-size: 11px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.buybox hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.buybox .service { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* -------------------------------- 购物车 -------------------------------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.panel-head h2 { margin: 0; font-size: 18px; }
.cart-line { display: grid; grid-template-columns: 104px minmax(0, 1fr) 120px 108px; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line img { width: 104px; height: 104px; object-fit: cover; border-radius: 8px; background: #f7f8f9; }
.cart-line .t { font-weight: 600; }
.cart-line .t small { display: block; color: #8a929c; font-weight: 400; font-size: 11px; }
.cart-line .p { font-weight: 700; font-size: 16px; }
.cart-line .qty button { width: 30px; height: 30px; }
.cart-line .qty input { width: 42px; height: 30px; }
.link-danger { color: var(--link); font-size: 12px; background: none; border: 0; padding: 0; }
.link-danger:hover { text-decoration: underline; color: var(--danger); }
.summary { padding: 18px; }
.summary .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: #374151; }
.summary .total { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 700; }
.summary .btn-primary { width: 100%; margin-top: 14px; padding: 12px; font-size: 15px; }
.summary .note { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* -------------------------------- 结算表单 -------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; padding: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1px solid #c7ccd2;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  background: #fff;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(243, 168, 71, .35); border-color: var(--accent-2); }
.field.full { grid-column: 1 / -1; }
.pay-methods { padding: 0 18px 18px; display: grid; gap: 8px; }
.pay-method { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; cursor: pointer; }
.pay-method input { accent-color: var(--accent-2); }
.pay-method.active { border-color: var(--accent-2); background: #fffaf1; }

/* --------------------------------- 空状态 --------------------------------- */
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 40px; font-style: normal; display: block; margin-bottom: 10px; }
.empty .btn-primary { display: inline-flex; width: auto; margin-top: 14px; padding: 10px 22px; }

/* -------------------------------- 聊天组件 -------------------------------- */
.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--navy-2);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .28);
  font-weight: 600;
}
.chat-fab:hover { background: #34465c; }
.chat-fab .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 82px;
  width: 352px;
  max-width: calc(100vw - 32px);
  height: 508px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 90;
  border: 1px solid var(--line);
}
.chat-panel.open { display: flex; }
.chat-head { background: var(--navy-2); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.chat-head .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #131921; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.chat-head .who { flex: 1; }
.chat-head .who strong { display: block; font-size: 13px; }
.chat-head .who small { color: #9fb0c3; font-size: 11px; }
.chat-head button { background: none; border: 0; color: #cbd5e1; font-size: 20px; line-height: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; background: #f8fafc; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; box-shadow: var(--shadow); white-space: pre-wrap; }
.msg.agent { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--accent); color: #131921; border-bottom-right-radius: 4px; }
.msg.sys { align-self: center; background: transparent; box-shadow: none; color: #8a929c; font-size: 11px; text-align: center; }
.chat-quick { display: flex; gap: 6px; padding: 8px 10px; flex-wrap: wrap; border-top: 1px solid var(--line); background: #fff; }
.chat-quick button { border: 1px solid var(--line); background: #f7f8f9; border-radius: 999px; font-size: 11px; padding: 5px 10px; color: var(--muted); }
.chat-quick button:hover { border-color: var(--accent-2); color: var(--text); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; font-size: 13px; outline: none; }
.chat-input input:focus { border-color: var(--accent-2); }
.chat-input button { border: 0; background: var(--navy-2); color: #fff; border-radius: 999px; width: 40px; display: grid; place-items: center; }
.chat-input button:hover { background: #34465c; }

/* -------------------------------- Toast ---------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------- 页脚 ---------------------------------- */
.footer { background: var(--navy-2); color: #cbd5e1; margin-top: 40px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 34px 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; font-size: 12px; }
.footer h5 { color: #fff; font-size: 13px; margin: 0 0 10px; }
.footer a { display: block; padding: 3px 0; color: #cbd5e1; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { background: var(--navy); color: #8a929c; text-align: center; padding: 16px; font-size: 12px; }

/* -------------------------------- 响应式 --------------------------------- */
@media (max-width: 1180px) {
  .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .buybox { grid-column: 1 / -1; position: static; }
  .gallery, .sidebar { position: static; }
  .cat-strip { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .list-layout, .cart-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .detail { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 84px minmax(0, 1fr); }
  .cart-line img { width: 84px; height: 84px; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .cat-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .shell { padding: 12px 12px 40px; }
  .hero { padding: 26px 20px; }
  .top-item.account { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .chat-panel { right: 8px; left: 8px; width: auto; bottom: 76px; height: 70vh; }
  .chat-fab { right: 12px; bottom: 12px; padding: 10px 14px; }
  .card-title { font-size: 13px; min-height: 36px; }
  .price { font-size: 18px; }
}

/* 打印 / 无图兜底 */
.noimg { display: grid; place-items: center; height: 100%; color: #9aa3ad; font-size: 12px; }
