/* ==========================================================================
   怀天商城 · 设计系统 v2
   ========================================================================== */
:root {
  --brand: #0aa06e;
  --brand-2: #12b76a;
  --brand-dark: #047857;
  --brand-ink: #064e3b;
  --brand-soft: #ecfdf5;
  --brand-tint: #f0fdf7;

  --accent: #ff5a1f;
  --accent-2: #ff7a45;
  --accent-soft: #fff4ee;

  --ink: #0f172a;
  --sub: #475569;
  --muted: #94a3b8;
  --line: #e8edf3;
  --line-strong: #dbe3ec;
  --bg: #f5f7fa;
  --white: #fff;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --sh-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --sh-sm: 0 2px 8px rgba(15, 23, 42, .05), 0 1px 2px rgba(15, 23, 42, .04);
  --sh-md: 0 10px 28px rgba(15, 23, 42, .08), 0 2px 8px rgba(15, 23, 42, .04);
  --sh-lg: 0 24px 48px rgba(15, 23, 42, .12);
  --sh-brand: 0 10px 24px rgba(10, 160, 110, .22);

  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 15% -140px, #e7fbf2 0%, transparent 60%),
    radial-gradient(900px 320px at 85% -120px, #fff1e8 0%, transparent 55%),
    var(--bg);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #bbf7d0; color: var(--brand-ink); }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部公告 ---------- */
.topbar {
  background: linear-gradient(90deg, #064e3b 0%, #0a7f5a 45%, #0f9b6c 100%);
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  letter-spacing: .2px;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar .left { display: flex; align-items: center; gap: 8px; }
.topbar .dot {
  width: 5px; height: 5px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .22);
}
.topbar .right { display: flex; gap: 20px; align-items: center; }
.topbar a { transition: color .15s; }
.topbar a:hover { color: #fff; }

/* ---------- 头部 ---------- */
.header {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}
.header .wrap { display: flex; align-items: center; gap: 28px; height: 82px; }

.logo { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.logo .mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand-dark));
  color: #fff; display: grid; place-items: center; font-size: 21px; font-weight: 700;
  box-shadow: var(--sh-brand);
  position: relative; overflow: hidden;
}
.logo .mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, .35), transparent 55%);
}
.logo .txt { font-size: 21px; font-weight: 800; letter-spacing: .5px; line-height: 1.15; }
.logo small {
  display: block; font-size: 9.5px; font-weight: 600; color: var(--muted);
  letter-spacing: 3px; margin-top: 1px;
}

.searchbox { flex: 1; max-width: 640px; }
.searchbox form {
  display: flex; align-items: center; background: #fff;
  border: 2px solid var(--brand); border-radius: 999px; overflow: hidden;
  box-shadow: 0 0 0 4px rgba(10, 160, 110, .07);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.searchbox form:focus-within {
  box-shadow: 0 0 0 6px rgba(10, 160, 110, .12);
  transform: translateY(-1px);
}
.searchbox input {
  flex: 1; border: 0; outline: none; padding: 11px 20px; font-size: 14px;
  background: transparent;
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox button {
  border: 0; cursor: pointer; padding: 0 28px; align-self: stretch;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; font-weight: 700; letter-spacing: 1px;
  transition: filter .15s;
}
.searchbox button:hover { filter: brightness(1.06); }
.searchbox .hot { margin-top: 7px; font-size: 12px; color: var(--muted); display: flex; gap: 14px; }
.searchbox .hot a { transition: color .15s; }
.searchbox .hot a:hover { color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-ghost {
  border: 1px solid var(--line-strong); padding: 9px 18px; border-radius: 999px;
  background: #fff; font-weight: 600; font-size: 13px;
  transition: all .18s var(--ease);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); box-shadow: var(--sh-sm); }

.btn-cart {
  display: flex; align-items: center; gap: 9px; padding: 10px 18px;
  border-radius: 999px; background: var(--brand-tint);
  border: 1px solid #c7f0dd; color: var(--brand-ink); font-weight: 700; font-size: 13px;
  transition: all .18s var(--ease);
}
.btn-cart:hover { background: #e3fbef; box-shadow: var(--sh-sm); transform: translateY(-1px); }
.btn-cart .count {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; border-radius: 999px; min-width: 20px; height: 20px;
  display: grid; place-items: center; font-size: 11px; padding: 0 6px;
  box-shadow: 0 3px 8px rgba(255, 90, 31, .35);
}

/* ---------- 导航 ---------- */
.nav { background: #fff; border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; gap: 4px; height: 48px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.nav .wrap::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 15px; border-radius: 999px; color: var(--sub);
  white-space: nowrap; font-size: 13.5px; transition: all .16s var(--ease);
}
.nav a:hover { background: #f1f5f9; color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }

/* ---------- 主体 ---------- */
main { padding: 24px 0 70px; min-height: 62vh; }
main > .wrap > * { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid rgba(232, 237, 243, .9);
  box-shadow: var(--sh-sm);
}
.section-title {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 36px 0 16px; gap: 12px;
}
.section-title h2 {
  font-size: 21px; margin: 0; letter-spacing: -.3px; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.section-title h2::before {
  content: ""; width: 4px; height: 20px; border-radius: 4px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand-dark));
}
.section-title .more { font-size: 12.5px; color: var(--muted); transition: all .15s; }
.section-title .more:hover { color: var(--brand); transform: translateX(2px); }

.flash { margin: 16px 0; padding: 12px 18px; border-radius: 12px; font-size: 13px; border: 1px solid transparent; }
.flash.ok { background: var(--brand-soft); color: var(--brand-ink); border-color: #b7f0d8; }
.flash.err { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 12px; padding: 11px 22px; cursor: pointer;
  font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: var(--sh-brand);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 14px 28px rgba(10, 160, 110, .26); }
.btn:active { transform: translateY(0) scale(.99); }
.btn.cta { background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 10px 24px rgba(255, 90, 31, .28); }
.btn.cta:hover { box-shadow: 0 16px 32px rgba(255, 90, 31, .32); }
.btn.line { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--sh-xs); }
.btn.line:hover { border-color: var(--brand); color: var(--brand-dark); box-shadow: var(--sh-sm); }
.btn.sm { padding: 7px 14px; font-size: 12.5px; border-radius: 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; filter: none; }

.price { color: var(--accent); font-weight: 800; letter-spacing: -.4px; }
.price small { font-size: 12px; font-weight: 700; margin-right: 1px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 12px; margin-left: 7px; }

/* ---------- 首页 hero ---------- */
.hero { display: grid; grid-template-columns: 1.62fr 1fr; gap: 16px; }
.banner {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  min-height: 300px; padding: 44px 46px; color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: 0 22px 48px rgba(6, 78, 59, .22);
}
.banner::before {
  content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -160px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 62%);
}
.banner::after {
  content: ""; position: absolute; width: 260px; height: 260px; left: -80px; bottom: -140px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .13), transparent 65%);
}
.banner .eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25);
  padding: 5px 12px; border-radius: 999px; width: fit-content; margin-bottom: 16px;
  backdrop-filter: blur(4px);
}
.banner h1 { font-size: 40px; line-height: 1.18; margin: 0 0 12px; letter-spacing: -1px; font-weight: 800; }
.banner p { margin: 0 0 26px; opacity: .9; font-size: 15px; max-width: 400px; }
.banner .btn { align-self: flex-start; background: #fff; color: var(--brand-dark); box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.banner .btn:hover { background: #fff; color: var(--brand-ink); }
.banner .ghost {
  position: absolute; right: 38px; bottom: -18px; font-size: 168px;
  opacity: .16; transform: rotate(-8deg); pointer-events: none;
}

.hero-mini { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.mini {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  padding: 22px 24px; display: flex; flex-direction: column; justify-content: center;
  color: #fff; box-shadow: var(--sh-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.mini:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.mini h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.3px; }
.mini p { margin: 0; font-size: 12.5px; opacity: .88; }
.mini .em { position: absolute; right: 16px; bottom: -8px; font-size: 74px; opacity: .22; }
.mini .tagline {
  display: inline-block; font-size: 11px; margin-top: 10px;
  background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 4px 10px; width: fit-content;
}

/* ---------- 秒杀条 ---------- */
.deal { margin-top: 18px; overflow: hidden; }
.deal-head {
  display: flex; align-items: center; gap: 14px; padding: 16px 22px;
  background: linear-gradient(90deg, #fff1ec, #fff8f4 55%, #fff);
  border-bottom: 1px solid #ffe6da;
}
.deal-head h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; color: #9a3412; }
.deal-head .sub { font-size: 12px; color: #c2410c; opacity: .8; }
.countdown { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9a3412; }
.countdown b {
  background: #7c2d12; color: #fff; border-radius: 6px; padding: 3px 7px;
  font-variant-numeric: tabular-nums; font-size: 13px;
}
.deal-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.deal-item {
  display: flex; gap: 12px; padding: 16px 18px; align-items: center;
  border-right: 1px solid #f3f4f6; transition: background .15s;
}
.deal-item:last-child { border-right: 0; }
.deal-item:hover { background: #fffaf7; }
.deal-thumb {
  width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center;
  font-size: 28px; flex: none;
}
.deal-item .nm { font-size: 12.5px; font-weight: 600; line-height: 1.35; height: 34px; overflow: hidden; }
.deal-item .pr { font-size: 15px; color: var(--accent); font-weight: 800; margin-top: 2px; }

/* ---------- 分类 ---------- */
.catgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.catitem {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 10px 15px; text-align: center; box-shadow: var(--sh-xs);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.catitem:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: #d1fae5; }
.catitem .ico {
  width: 50px; height: 50px; margin: 0 auto 9px; border-radius: 16px;
  display: grid; place-items: center; font-size: 25px;
  background: linear-gradient(145deg, #f0fdf7, #dcfce7);
}
.catitem:nth-child(2) .ico { background: linear-gradient(145deg, #eff6ff, #dbeafe); }
.catitem:nth-child(3) .ico { background: linear-gradient(145deg, #fdf2f8, #fce7f3); }
.catitem:nth-child(4) .ico { background: linear-gradient(145deg, #fffbeb, #fef3c7); }
.catitem:nth-child(5) .ico { background: linear-gradient(145deg, #f5f3ff, #ede9fe); }
.catitem:nth-child(6) .ico { background: linear-gradient(145deg, #ecfeff, #cffafe); }
.catitem:nth-child(7) .ico { background: linear-gradient(145deg, #fff7ed, #ffedd5); }
.catitem:nth-child(8) .ico { background: linear-gradient(145deg, #f8fafc, #e2e8f0); }
.catitem .nm { font-size: 13px; font-weight: 600; }

/* ---------- 商品卡 ---------- */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.pcard {
  position: relative; background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--line); overflow: hidden;
  box-shadow: var(--sh-xs); display: flex; flex-direction: column;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
}
.pcard:hover { transform: translateY(-5px); box-shadow: var(--sh-md); border-color: #d1fae5; }
.pcover {
  height: 186px; display: grid; place-items: center; font-size: 66px;
  position: relative; overflow: hidden;
}
.pcover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .55), transparent 60%);
  opacity: .7;
}
.pcard:hover .pcover { transform: none; }
.pcover span { transition: transform .35s var(--ease); }
.pcard:hover .pcover span { transform: scale(1.12) rotate(-4deg); }
.pbadge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(255, 90, 31, .3);
}
.pbadge.new { background: linear-gradient(135deg, #34d399, var(--brand)); box-shadow: var(--sh-brand); }
.pbody { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pname { font-size: 13.5px; font-weight: 600; line-height: 1.45; height: 39px; overflow: hidden; }
.psub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.prow .price { font-size: 18px; }
.psold { font-size: 11.5px; color: var(--muted); }

/* ---------- 列表页 ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 14px; flex-wrap: wrap; }
.sorts { display: flex; gap: 4px; }
.sorts a {
  padding: 7px 15px; border-radius: 999px; font-size: 13px; color: var(--sub);
  border: 1px solid transparent; transition: all .15s;
}
.sorts a:hover { background: #f1f5f9; color: var(--ink); }
.sorts a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; border-color: #c7f0dd; }

.empty { padding: 90px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 52px; display: block; margin-bottom: 12px; opacity: .85; }

.pager { display: flex; gap: 7px; justify-content: center; margin: 34px 0 0; }
.pager a, .pager span {
  min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); font-size: 13px; padding: 0 11px;
  transition: all .15s;
}
.pager a:hover { border-color: var(--brand); color: var(--brand-dark); box-shadow: var(--sh-sm); }
.pager .on { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; box-shadow: var(--sh-brand); }

/* ---------- 商品详情 ---------- */
.pdp { display: grid; grid-template-columns: 468px 1fr; gap: 32px; padding: 28px; }
.pdp-cover {
  border-radius: var(--radius-lg); height: 430px; display: grid; place-items: center;
  font-size: 180px; position: relative; overflow: hidden;
}
.pdp-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 32% 22%, rgba(255, 255, 255, .6), transparent 62%);
}
.pdp h1 { font-size: 25px; margin: 0 0 8px; line-height: 1.38; letter-spacing: -.4px; font-weight: 800; }
.pdp .sub { color: var(--muted); margin-bottom: 20px; font-size: 13.5px; }
.pricebox {
  background: linear-gradient(100deg, #fff6f0, #fffbf7 60%, #fff);
  border: 1px solid #ffe4d5; border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px;
}
.pricebox .big { font-size: 38px; color: var(--accent); font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.pricebox .meta { display: flex; gap: 26px; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.specs { display: flex; gap: 9px; flex-wrap: wrap; margin: 10px 0 22px; }
.specs .sp {
  border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 8px 16px;
  font-size: 13px; cursor: pointer; background: #fff; transition: all .15s;
}
.specs .sp:hover { border-color: var(--brand); color: var(--brand-dark); }
.specs .sp.on { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); font-weight: 700; }

.buyrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qty { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 11px; overflow: hidden; background: #fff; }
.qty button { width: 36px; height: 40px; border: 0; background: #fff; cursor: pointer; font-size: 16px; color: var(--sub); transition: background .15s; }
.qty button:hover { background: var(--brand-soft); color: var(--brand-dark); }
.qty input { width: 52px; height: 40px; border: 0; text-align: center; outline: none; font-weight: 600; }
.assurance { display: flex; gap: 22px; margin-top: 22px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 26px; }
.tabs a { padding: 15px 20px; font-size: 14px; color: var(--sub); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 700; }
.detail-body { padding: 26px; font-size: 14px; color: var(--sub); white-space: pre-wrap; line-height: 1.9; }

.comment { padding: 18px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 13px; }
.comment:last-child { border-bottom: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: linear-gradient(145deg, #d1fae5, #a7f3d0); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.comment .who { font-size: 13px; font-weight: 700; }
.comment .when { font-size: 11.5px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.comment .body { margin-top: 5px; color: var(--sub); font-size: 13.5px; }

/* ---------- 购物车 ---------- */
.cart-row {
  display: grid; grid-template-columns: 88px 1fr 110px 130px 110px 66px;
  gap: 16px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.cart-row:last-child { border-bottom: 0; }
.cart-thumb { width: 88px; height: 88px; border-radius: 14px; display: grid; place-items: center; font-size: 40px; }
.cart-sum {
  display: flex; align-items: center; justify-content: flex-end; gap: 26px;
  padding: 22px; background: #fafcfb; border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.cart-sum .amount { font-size: 14px; color: var(--sub); }
.cart-sum .amount b { font-size: 28px; color: var(--accent); letter-spacing: -.8px; }

/* ---------- 结算 ---------- */
.summary { padding: 24px; position: sticky; top: 106px; }
.summary .line { display: flex; justify-content: space-between; padding: 9px 0; color: var(--sub); font-size: 13.5px; }
.summary .line.total {
  border-top: 1px solid var(--line); margin-top: 12px; padding-top: 18px;
  font-size: 15px; color: var(--ink); font-weight: 700;
}
.summary .line.total b { color: var(--accent); font-size: 28px; letter-spacing: -.8px; }

.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 7px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: 11px;
  padding: 11px 15px; outline: none; background: #fff; transition: all .16s var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: #cbd5e1; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 160, 110, .1);
}
.textarea { min-height: 100px; resize: vertical; }

/* ---------- 订单 ---------- */
.order-card { margin-bottom: 16px; overflow: hidden; transition: box-shadow .2s; }
.order-card:hover { box-shadow: var(--sh-md); }
.order-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px; background: #fafbfc; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); flex-wrap: wrap;
}
.order-head .no { font-weight: 700; color: var(--ink); margin-right: 14px; font-variant-numeric: tabular-nums; }
.status { padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.pending { background: #fff7ed; color: #c2410c; }
.status.paid { background: #eff6ff; color: #1d4ed8; }
.status.shipped { background: #f0f9ff; color: #0369a1; }
.status.done { background: #ecfdf5; color: #047857; }
.status.canceled { background: #f3f4f6; color: #6b7280; }
.order-item { display: flex; gap: 14px; padding: 15px 20px; border-bottom: 1px solid #f6f8fa; }
.order-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 16px 20px; }

/* ---------- 登录注册 ---------- */
.auth-wrap { max-width: 430px; margin: 56px auto; }
.auth-card { padding: 38px 36px; border-radius: var(--radius-xl); box-shadow: var(--sh-md); }
.auth-card h1 { margin: 0 0 7px; font-size: 24px; letter-spacing: -.5px; font-weight: 800; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; font-size: 13px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--brand-dark); font-weight: 700; }

/* ---------- 个人中心 ---------- */
.with-side { display: grid; grid-template-columns: 224px 1fr; gap: 20px; align-items: start; }
.side-nav { padding: 14px; position: sticky; top: 106px; }
.side-nav a {
  display: block; padding: 11px 15px; border-radius: 10px; color: var(--sub);
  font-size: 13.5px; transition: all .15s;
}
.side-nav a:hover { background: #f8fafc; color: var(--ink); }
.side-nav a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.panel { padding: 26px; }
.panel h2 { margin: 0 0 20px; font-size: 17px; letter-spacing: -.2px; }
.kv { display: grid; grid-template-columns: 108px 1fr; gap: 11px 16px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.balance-big { font-size: 34px; font-weight: 800; color: var(--accent); letter-spacing: -1px; }

/* ---------- 留言板 ---------- */
.msg { display: flex; gap: 13px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.msg:last-child { border-bottom: 0; }
.msg .body { flex: 1; }
.msg .meta { font-size: 12px; color: var(--muted); }
.msg .content { margin-top: 7px; font-size: 13.5px; }

/* ---------- 后台 ---------- */
.admin-shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; background: var(--bg); }
.admin-side {
  background: linear-gradient(180deg, #0b1220, #111827 45%, #0f172a);
  color: #cbd5e1; padding: 22px 14px; position: sticky; top: 0; height: 100vh;
}
.admin-side .brand {
  color: #fff; font-weight: 800; padding: 8px 14px 24px; font-size: 16px; letter-spacing: .3px;
  display: flex; align-items: center; gap: 9px;
}
.admin-side .brand::before {
  content: "怀"; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-2), var(--brand-dark)); font-size: 15px;
}
.admin-side a {
  display: block; padding: 11px 14px; border-radius: 10px; color: #94a3b8;
  font-size: 13.5px; transition: all .15s; margin-bottom: 2px;
}
.admin-side a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-side a.on { background: rgba(16, 185, 129, .16); color: #6ee7b7; font-weight: 700; }
.admin-main { padding: 28px 32px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--line); box-shadow: var(--sh-xs);
}
.stat .n { font-size: 27px; font-weight: 800; letter-spacing: -.8px; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }

table.tb {
  width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--sh-xs);
}
table.tb th, table.tb td { padding: 13px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid #f4f7fa; }
table.tb th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .3px; }
table.tb tr:last-child td { border-bottom: 0; }
table.tb tbody tr:hover, table.tb tr:hover { background: #fcfdfe; }

/* ---------- 页脚 ---------- */
footer { background: #0b1220; color: #94a3b8; padding: 44px 0 26px; margin-top: 20px; }
footer .cols { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 30px; }
footer h4 { color: #e2e8f0; font-size: 13px; margin: 0 0 12px; letter-spacing: .5px; }
footer a { display: block; padding: 4px 0; font-size: 12.5px; transition: color .15s; }
footer a:hover { color: #6ee7b7; }
footer .bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .08); text-align: center; font-size: 12px; color: #64748b; }
footer .logo .txt { color: #fff; }
footer .logo small { color: #64748b; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .catgrid { grid-template-columns: repeat(4, 1fr); }
  .deal-list { grid-template-columns: repeat(3, 1fr); }
  .deal-item:nth-child(3n) { border-right: 0; }
  .pdp { grid-template-columns: 1fr; }
  .pdp-cover { height: 340px; font-size: 140px; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mini { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .banner { min-height: 240px; padding: 32px; }
  .banner h1 { font-size: 30px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: flex; gap: 6px; overflow-x: auto; }
  .admin-side .brand { display: none; }
}
@media (max-width: 760px) {
  .header .wrap { height: auto; padding: 12px 20px; flex-wrap: wrap; gap: 12px; }
  .searchbox { order: 3; flex-basis: 100%; max-width: none; }
  .searchbox .hot { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .catgrid { grid-template-columns: repeat(4, 1fr); }
  .deal-list { grid-template-columns: repeat(2, 1fr); }
  .hero-mini { grid-template-columns: 1fr; }
  .with-side { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .side-nav a { white-space: nowrap; }
  .cart-row { grid-template-columns: 68px 1fr 96px; }
  .cart-row > *:nth-child(4), .cart-row > *:nth-child(5) { display: none; }
  .summary { position: static; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  .pdp { padding: 16px; gap: 18px; }
  .pdp-cover { height: 260px; font-size: 110px; }
  main { padding: 16px 0 50px; }
}

/* ---------- 详情页补充 ---------- */
.pdp-gallery { display: flex; flex-direction: column; gap: 12px; }
.pdp-thumbs { display: flex; gap: 10px; }
.pdp-thumb {
  width: 74px; height: 74px; border-radius: 12px; display: grid; place-items: center;
  font-size: 32px; cursor: pointer; border: 2px solid transparent;
  transition: border-color .15s, transform .15s;
}
.pdp-thumb:hover { transform: translateY(-2px); }
.pdp-thumb.on { border-color: var(--brand); }
.promo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  font-size: 11.5px; padding: 4px 10px; border-radius: 7px;
  background: #fff; border: 1px solid #ffd9c7; color: #c2410c;
}
.chip.hot { background: linear-gradient(135deg, #fff1e8, #ffe4d5); font-weight: 700; border-color: #ffc9ad; }
.deliver {
  display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted);
  padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
  margin-bottom: 20px;
}
.deliver .sep { width: 1px; height: 12px; background: var(--line-strong); }

/* ---------- 参数表 ---------- */
.spec-table {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  margin: 0 26px 24px; background: #fcfdfe;
}
.spec-table > div {
  display: flex; gap: 10px; padding: 12px 16px; font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}
.spec-table > div:nth-last-child(-n+2) { border-bottom: 0; }
.spec-table span { width: 84px; color: var(--muted); flex: none; }
.spec-table b { font-weight: 600; }
@media (max-width: 760px) {
  .spec-table { grid-template-columns: 1fr; }
  .spec-table > div:nth-last-child(2) { border-bottom: 1px solid #f1f5f9; }
}

/* ---------- 商品图 / 骨架屏 ---------- */
.pcover, .cart-thumb, .deal-thumb, .pdp-cover { position: relative; overflow: hidden; }

.pcover img.pimg,
.cart-thumb img.pimg,
.deal-thumb img.pimg,
.pdp-cover img.pimg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; opacity: 0;
  transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.pcover img.pimg.ready,
.cart-thumb img.pimg.ready,
.deal-thumb img.pimg.ready,
.pdp-cover img.pimg.ready { opacity: 1; }
.pcard:hover .pcover img.pimg.ready { transform: scale(1.06); }

/* 加载中的扫光 */
.pcover::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.7) 50%, rgba(255,255,255,0) 80%);
  transform: translateX(-100%);
  animation: sweep 1.5s var(--ease) infinite;
}
.pcover:has(img.ready)::before { display: none; }
@keyframes sweep { to { transform: translateX(100%); } }

/* 详情页主图 */
.pdp-cover { background: #fff; }
.pdp-cover img.pimg { object-fit: contain; padding: 8px; }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.pdp-thumb img.f-warm { filter: saturate(1.12) sepia(.1); }
.pdp-thumb img.f-cool { filter: saturate(1.06) hue-rotate(-10deg); }

/* 首页大图 */
.banner-photo {
  position: absolute; right: 0; top: 0; height: 100%; width: 46%;
  object-fit: cover; z-index: 0; opacity: .92;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 42%);
  mask-image: linear-gradient(to right, transparent 0%, #000 42%);
}
.banner > * { position: relative; z-index: 1; }
.banner .banner-photo { z-index: 0; }

/* 页面切换 */
#qh-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 9999;
  background: linear-gradient(90deg, var(--brand-2), var(--accent));
  opacity: 0; transition: width .35s ease, opacity .3s ease;
}
#qh-bar.on { opacity: 1; width: 72%; }
body { animation: pageIn .32s var(--ease); }
body.leaving { opacity: .35; transition: opacity .16s ease; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  body, .pcover::before { animation: none !important; }
  .pcover img.pimg { transition: none; }
}
@media (max-width: 760px) {
  .banner-photo { width: 100%; opacity: .3; mask-image: none; -webkit-mask-image: none; }
}

/* ---------- 漏洞提示 ---------- */
.flagbanner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0; padding: 12px 18px; border-radius: 12px;
  background: linear-gradient(90deg, #ecfdf5, #f7fefb);
  border: 1px solid #a7f3d0; color: #065f46; font-weight: 600; font-size: 13px;
  animation: flagIn .4s var(--ease) both;
}
.flagbanner .fb-ico { font-size: 18px; }
.flagbanner code {
  background: #064e3b; color: #d1fae5; padding: 4px 10px; border-radius: 6px;
  font-size: 12.5px; letter-spacing: .3px; font-family: ui-monospace, Consolas, monospace;
}
@keyframes flagIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.sqlbox {
  background: #0b1220; color: #fca5a5; padding: 12px 16px; border-radius: 10px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  overflow: auto; white-space: pre-wrap;
}

/* ---------- 公告与教师端 ---------- */
.notice-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 20px; margin-bottom: 18px; border-radius: 12px;
  background: linear-gradient(90deg, #fff7ed, #fffbf5);
  border: 1px solid #fed7aa; color: #9a3412; font-size: 13.5px;
}
.notice-bar .nb-ico { font-size: 18px; }
.notice-bar .nb-more {
  margin-left: auto; font-size: 12.5px; font-weight: 700; color: #c2410c; white-space: nowrap;
}

.fb-copy {
  margin-left: auto; border: 1px solid #6ee7b7; background: #fff; color: var(--brand-dark);
  border-radius: 8px; padding: 5px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.fb-copy:hover { background: var(--brand-soft); }

.score-bar { height: 6px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.score-bar > i { display: block; height: 100%; background: linear-gradient(90deg,#34d399,#059669); }

/* ---------- 满 99 包邮进度条 ---------- */
.ship-bar {
  margin: 18px 0 6px; padding: 14px 18px 16px;
  background: linear-gradient(90deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0; border-radius: 12px;
}
.ship-bar .sb-top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: #166534;
}
.ship-bar .sb-top b { color: #15803d; font-size: 15px; }
.ship-bar .sb-ico { font-size: 17px; }
.ship-bar .sb-right { margin-left: auto; font-size: 12px; color: #4d7c5f; }
.sb-track {
  margin-top: 10px; height: 8px; background: #dcfce7;
  border-radius: 999px; overflow: hidden;
}
.sb-track > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #059669);
  transition: width .35s var(--ease);
}
@media (max-width: 720px) {
  .ship-bar .sb-right { margin-left: 0; width: 100%; }
  .cart-sum { flex-wrap: wrap; gap: 10px; }
}

/* ---------- 物流时间线 ---------- */
.steps {
  display: flex; gap: 0; margin-top: 6px;
  overflow-x: auto; padding-bottom: 4px;
}
.step {
  flex: 1; min-width: 128px; position: relative;
  padding: 0 8px 0 0;
}
.step .dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: #e2e8f0; border: 2px solid #cbd5e1;
  position: relative; z-index: 2;
}
.step.done .dot {
  background: #059669; border-color: #059669;
  box-shadow: 0 0 0 4px #d1fae5;
}
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 13px; top: 5px;
  width: calc(100% - 13px); height: 3px; background: #e2e8f0; z-index: 1;
}
.step.done:not(:last-child)::after { background: #34d399; }
.step .body { margin-top: 10px; padding-right: 10px; }
.step .t { font-size: 13px; font-weight: 600; color: var(--muted); }
.step.done .t { color: var(--ink); }
.step .time { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ---------- 收藏按钮 ---------- */
.fav-btn.on {
  border-color: #fda4af; color: #e11d48;
  background: #fff1f2;
}
.fav-btn { min-width: 104px; }

@media (max-width: 720px) {
  .step { min-width: 104px; }
  .step .t { font-size: 12px; }
}

/* ---------- 评价晒图 ---------- */
.review-imgs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.review-imgs a { width: 88px; height: 88px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.review-imgs img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 购物车失效商品 ---------- */
.cart-row.off { opacity: .48; filter: grayscale(.65); }
.cart-row.off .price { text-decoration: line-through; }
