/* 栖木家居 · 暖木色自然家居风 */
:root {
  --wood: #8f6f47;
  --wood-deep: #6d5334;
  --wood-light: #d9b98a;
  --cream: #faf6ef;
  --paper: #fffdf8;
  --ink: #4a3b2a;
  --ink-soft: #8a7a63;
  --line: #e8ddcc;
  --green: #7f9c8a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--cream); color: var(--ink); }
a { text-decoration: none; color: inherit; }
img { display: block; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6%; background: linear-gradient(135deg, #7c6848, #a3845a);
  color: #fff; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(90, 70, 40, .25);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8d5ac, #b58d5f);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #5d4326; box-shadow: inset 0 -2px 4px rgba(0,0,0,.2);
}
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.brand-sub { font-size: 11px; opacity: .85; letter-spacing: 1px; }
.topnav { display: flex; gap: 6px; }
.topnav a {
  padding: 7px 16px; border-radius: 18px; font-size: 14px;
  transition: all .2s;
}
.topnav a:hover, .topnav a.on { background: rgba(255, 255, 255, .22); }
.cart-link { display: flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 18px; background: rgba(0,0,0,.15); font-size: 14px; }
.cart-link:hover { background: rgba(0,0,0,.3); }
.cart-badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  text-align: center; border-radius: 9px; background: #f0c078; color: #5d4326;
  font-size: 12px; font-weight: 700; padding: 0 5px;
}

/* ---------- 主体 ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 24px 16px 70px; }
.section-title { font-size: 20px; font-weight: 700; margin: 26px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 5px; height: 20px; background: var(--wood); border-radius: 3px; }

/* ---------- 首页 ---------- */
.carousel { border-radius: 14px; overflow: hidden; box-shadow: 0 6px 18px rgba(90,70,40,.18); }
.banner-slide {
  height: 320px; display: flex; flex-direction: column; justify-content: center;
  padding: 0 60px; color: #fff; border-radius: 14px;
}
.banner-slide .bt { font-size: 30px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 2px 6px rgba(0,0,0,.2); }
.banner-slide .bs { margin-top: 10px; font-size: 15px; opacity: .95; }
.banner-slide .bb {
  margin-top: 20px; align-self: flex-start; padding: 9px 22px; border-radius: 20px;
  background: rgba(255,255,255,.9); color: var(--wood-deep); font-size: 14px; font-weight: 700;
}
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; text-align: center; cursor: pointer; transition: all .25s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 18px rgba(90,70,40,.15); border-color: var(--wood-light); }
.cat-icon {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; box-shadow: inset 0 -3px 6px rgba(0,0,0,.15);
}
.cat-card .cn { font-size: 15px; font-weight: 700; }
.cat-card .cn2 { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.hot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---------- 商品卡片 ---------- */
.prod-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; transition: all .25s; position: relative;
}
.prod-card:hover { transform: translateY(-5px); box-shadow: 0 10px 22px rgba(90,70,40,.16); }
.prod-card .pc-img { width: 100%; height: 200px; object-fit: cover; background: #f1e9db; }
.prod-tag {
  position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 10px;
  background: rgba(111,143,124,.92); color: #fff; font-size: 11px;
}
.prod-card .pc-body { padding: 12px 14px 14px; }
.prod-card .pc-name {
  font-size: 14px; font-weight: 600; line-height: 1.5; height: 42px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.prod-card .pc-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.pc-price { color: #c0562f; font-size: 17px; font-weight: 700; }
.pc-price i { font-style: normal; font-size: 13px; }
.pc-sales { color: var(--ink-soft); font-size: 12px; }
.pc-add {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--wood-light), var(--wood));
  color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(143,111,71,.4);
}
.pc-add:hover { transform: scale(1.1); }

/* ---------- 列表页 ---------- */
.list-toolbar {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 20px;
}
.list-search {
  width: 100%; max-width: 320px; padding: 9px 14px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; outline: none; background: var(--cream);
}
.list-search:focus { border-color: var(--wood); }
.list-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.cat-chip {
  padding: 6px 16px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--cream); font-size: 13px; color: var(--ink-soft); transition: all .2s;
}
.cat-chip:hover { border-color: var(--wood); }
.cat-chip.on { background: var(--wood); color: #fff; border-color: var(--wood); }
.sort-btn { font-size: 13px; color: var(--ink-soft); background: none; }
.sort-btn.on { color: var(--wood); font-weight: 700; }
.result-count { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.result-count b { color: var(--wood); }

/* ---------- 详情页 ---------- */
.d-wrap { display: grid; grid-template-columns: 420px 1fr; gap: 40px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.d-img { border-radius: 10px; overflow: hidden; }
.d-img img { width: 100%; height: 420px; object-fit: cover; }
.d-info h1 { font-size: 22px; line-height: 1.5; }
.d-price-box { display: flex; align-items: baseline; gap: 12px; margin: 18px 0; }
.d-price { color: #c0562f; font-size: 30px; font-weight: 800; }
.d-price i { font-style: normal; font-size: 18px; }
.d-orig { color: var(--ink-soft); font-size: 14px; text-decoration: line-through; }
.d-sales { color: var(--ink-soft); font-size: 13px; }
.d-block { margin: 16px 0; }
.d-block .lb { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.spec-opt {
  display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px;
  margin-right: 8px; font-size: 13px; cursor: pointer; background: var(--cream); transition: all .2s;
}
.spec-opt.on { border-color: var(--wood); background: #f3e9d8; color: var(--wood-deep); font-weight: 700; }
.qty-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty-ctrl button { width: 34px; height: 34px; background: var(--cream); font-size: 16px; }
.qty-ctrl button:hover { background: var(--wood-light); color: #fff; }
.qty-ctrl b { width: 44px; text-align: center; font-size: 14px; }
.d-actions { display: flex; gap: 14px; margin-top: 26px; }
.btn {
  padding: 12px 30px; border-radius: 24px; font-size: 15px; font-weight: 700; transition: all .2s;
}
.btn-wood { background: linear-gradient(135deg, var(--wood-light), var(--wood)); color: #fff; box-shadow: 0 4px 12px rgba(143,111,71,.35); }
.btn-wood:hover { transform: translateY(-2px); }
.btn-line { background: var(--paper); border: 1px solid var(--wood); color: var(--wood); }
.btn-line:hover { background: #f3e9d8; }

/* ---------- 购物车 ---------- */
.cart-item {
  display: grid; grid-template-columns: 110px 1fr auto auto auto; align-items: center; gap: 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.ci-img { width: 110px; height: 110px; border-radius: 8px; overflow: hidden; }
.ci-img img { width: 100%; height: 100%; object-fit: cover; }
.ci-name { font-size: 15px; font-weight: 600; }
.ci-spec { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.ci-price { color: #c0562f; font-size: 16px; font-weight: 700; }
.ci-del { color: var(--ink-soft); font-size: 13px; background: none; }
.ci-del:hover { color: #c0562f; }
.cart-sum {
  display: flex; align-items: center; justify-content: flex-end; gap: 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin-top: 16px;
}
.sum-label { color: var(--ink-soft); font-size: 14px; }
.sum-price { color: #c0562f; font-size: 24px; font-weight: 800; }
.empty { text-align: center; padding: 70px 0; color: var(--ink-soft); }
.empty .e-icon { font-size: 54px; margin-bottom: 14px; }

/* ---------- 结算 ---------- */
.co-wrap { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
.co-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.co-card h3 { font-size: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.co-card h3::before { content: ""; width: 4px; height: 16px; background: var(--wood); border-radius: 2px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.form-row input, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none; background: var(--cream); font-family: inherit;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--wood); }
.form-row textarea { height: 80px; resize: none; }
.pay-badge { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.pay-badge.on { border-color: var(--wood); background: #f6efe1; }
.pay-logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #1677ff, #0aa9ff);
  color: #fff; font-size: 22px; font-weight: 800; text-align: center; line-height: 44px;
  font-style: normal; box-shadow: 0 2px 8px rgba(22,119,255,.4);
}
.pay-name { font-size: 14px; font-weight: 700; }
.pay-desc { font-size: 12px; color: var(--ink-soft); }
.pay-choice { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); }
.pay-choice.on { background: var(--wood); border-color: var(--wood); box-shadow: inset 0 0 0 3px #fff; }
.co-sum { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; }
.co-sum .amt { color: #c0562f; font-size: 24px; font-weight: 800; }
.btn-pay {
  width: 100%; padding: 14px; border-radius: 24px; background: linear-gradient(135deg, #f0c078, #c9a063);
  color: #5d4326; font-size: 16px; font-weight: 700; box-shadow: 0 4px 12px rgba(201,160,99,.4);
}
.btn-pay:hover { transform: translateY(-2px); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 80px; transform: translateX(-50%);
  background: rgba(74,59,42,.92); color: #fff; padding: 12px 26px; border-radius: 24px;
  font-size: 14px; z-index: 999; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

/* ---------- 页脚 ---------- */
.footer {
  background: #5d4a30; color: #d8c9b2; text-align: center; padding: 26px; font-size: 13px;
}
.footer b { color: #f0c078; }

@media (max-width: 860px) {
  .cat-grid, .hot-grid { grid-template-columns: repeat(2, 1fr); }
  .d-wrap { grid-template-columns: 1fr; }
  .co-wrap { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 90px 1fr auto; }
  .ci-img { width: 90px; height: 90px; }
}
