:root {
  --ink: #0e1a2b;
  --ink-2: #1c2c44;
  --gold: #c9a45c;
  --gold-d: #b08a3e;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e7e9ee;
  --text: #1f2733;
  --muted: #7c879a;
  --red: #d9362b;
  --green: #1f9d6b;
  --shadow: 0 8px 30px rgba(16, 26, 43, 0.08);
  --radius: 14px;
  --maxw: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.topbar {
  background: var(--ink);
  color: #cdd6e3;
  font-size: 13px;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 38px; }
.topbar a { color: #cdd6e3; }
.topbar .right span { margin-left: 16px; }

/* 头部 */
.header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header .container { display: flex; align-items: center; height: 76px; gap: 28px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo .mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--ink), var(--ink-2));
  color: var(--gold); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; border: 1px solid var(--gold);
}
.logo .name { font-size: 22px; font-weight: 800; letter-spacing: 1px; color: var(--ink); }
.logo .sub { font-size: 12px; color: var(--muted); letter-spacing: 3px; }

.search { flex: 1; max-width: 560px; position: relative; }
.search input {
  width: 100%; height: 46px; border: 2px solid var(--gold); border-radius: 26px;
  padding: 0 120px 0 20px; font-size: 15px; outline: none; background: #fff;
}
.search button {
  position: absolute; right: 4px; top: 4px; height: 38px; padding: 0 26px; border: none;
  border-radius: 22px; background: var(--gold); color: #fff; font-weight: 700;
}
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-actions .act { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); gap: 2px; }
.header-actions .act b { color: var(--ink); font-size: 13px; }
.cart-badge { position: relative; }
.cart-badge .num {
  position: absolute; top: -6px; right: -10px; background: var(--red); color: #fff;
  font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; text-align: center; line-height: 18px; padding: 0 4px;
}

/* 导航 */
.nav { background: var(--ink); }
.nav .container { display: flex; gap: 4px; height: 50px; align-items: center; }
.nav a {
  color: #d6dde8; padding: 0 20px; height: 50px; line-height: 50px; font-size: 15px;
  border-bottom: 3px solid transparent;
}
.nav a:hover, .nav a.active { color: #fff; border-bottom-color: var(--gold); }

/* 主区 */
main { min-height: 60vh; padding: 28px 0 60px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 22px; }
.section-title h2 { font-size: 24px; margin: 0; color: var(--ink); position: relative; padding-left: 14px; }
.section-title h2::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; background: var(--gold); border-radius: 2px; }
.section-title .more { color: var(--muted); font-size: 14px; }

/* 分类卡片 */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.cat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px;
  text-align: center; transition: .2s; box-shadow: var(--shadow);
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.cat-card .ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; background: linear-gradient(135deg, #f3ede0, #fff); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.cat-card h4 { margin: 0 0 6px; color: var(--ink); font-size: 16px; }
.cat-card p { margin: 0; color: var(--muted); font-size: 12px; }

/* 商品网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: .2s; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(16, 26, 43, 0.14); }
.product-card .thumb { aspect-ratio: 1/1; background: #f0f2f5; position: relative; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .tag { position: absolute; left: 10px; top: 10px; background: var(--red); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.product-card .body { padding: 14px 14px 16px; display: flex; flex-direction: column; flex: 1; }
.product-card .pname { font-size: 14px; color: var(--text); height: 42px; overflow: hidden; margin: 0 0 8px; }
.product-card .price { color: var(--red); font-weight: 800; font-size: 20px; }
.product-card .price small { font-size: 13px; font-weight: 600; }
.product-card .price .old { color: var(--muted); font-size: 13px; font-weight: 400; text-decoration: line-through; margin-left: 8px; }
.product-card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.product-card .add { margin-top: 10px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 22px; border-radius: 24px; border: 1px solid var(--gold);
  background: var(--gold); color: #fff; font-weight: 700; font-size: 15px; transition: .15s;
}
.btn:hover { background: var(--gold-d); border-color: var(--gold-d); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold-d); }
.btn.block { width: 100%; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }

/* hero */
.hero { background: linear-gradient(120deg, var(--ink) 0%, var(--ink-2) 60%, #243a5c 100%); border-radius: 20px; padding: 54px 48px; color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(201,164,92,.35), transparent 70%); }
.hero .eyebrow { color: var(--gold); letter-spacing: 4px; font-size: 13px; }
.hero h1 { font-size: 42px; margin: 10px 0 14px; line-height: 1.2; }
.hero p { color: #c5cedd; max-width: 560px; font-size: 16px; }
.hero .cta { margin-top: 26px; display: flex; gap: 14px; }

/* 承诺条 */
.promise { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 26px 0; }
.promise .item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); }
.promise .item .ic { font-size: 26px; }
.promise .item b { display: block; color: var(--ink); font-size: 15px; }
.promise .item span { color: var(--muted); font-size: 12px; }

/* 筛选条 */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 22px; }
.toolbar .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 18px; font-size: 13px; color: var(--muted); background: #fff; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar .spacer { flex: 1; }
.select { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--text); }

/* 分页 */
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.pager button { min-width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--text); }
.pager button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager button:disabled { opacity: .4; }

/* 商品详情 */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.detail .gallery .main { aspect-ratio: 1/1; border-radius: 14px; overflow: hidden; background: #f0f2f5; }
.detail .info h1 { font-size: 26px; margin: 0 0 12px; color: var(--ink); }
.detail .price-box { background: linear-gradient(120deg, #fff7e9, #fff); border: 1px solid #f0e2c4; border-radius: 12px; padding: 18px 20px; margin: 16px 0; }
.detail .price-box .now { color: var(--red); font-size: 30px; font-weight: 800; }
.detail .price-box .now small { font-size: 16px; }
.detail .price-box .was { color: var(--muted); text-decoration: line-through; margin-left: 12px; }
.detail .specs { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.detail .spec { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 13px; }
.detail .qty { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.detail .qty .ctrl { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.detail .qty .ctrl button { width: 38px; height: 38px; border: none; background: #f5f6f8; font-size: 18px; }
.detail .qty .ctrl input { width: 56px; height: 38px; border: none; text-align: center; font-size: 15px; }
.detail .actions { display: flex; gap: 14px; }
.detail .desc { margin-top: 40px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px; }

/* 购物车 */
.cart-table { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cart-row { display: grid; grid-template-columns: 80px 1fr 120px 140px 120px 60px; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cart-row.head { background: #fafbfc; font-size: 13px; color: var(--muted); }
.cart-row .thumb { width: 80px; height: 80px; border-radius: 10px; overflow: hidden; background: #f0f2f5; }
.cart-row .pname { font-size: 14px; }
.cart-row .mini-ctrl { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: max-content; }
.cart-row .mini-ctrl button { width: 30px; height: 32px; border: none; background: #f5f6f8; }
.cart-row .mini-ctrl input { width: 44px; height: 32px; border: none; text-align: center; }
.cart-row .sum { color: var(--red); font-weight: 700; }
.cart-row .del { color: var(--muted); background: none; border: none; font-size: 20px; }
.cart-foot { display: flex; justify-content: space-between; align-items: center; padding: 20px; background: #fff; border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius) var(--radius); }
.cart-foot .total b { color: var(--red); font-size: 24px; }

/* 表单 */
.form-wrap { max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.form-wrap h2 { margin: 0 0 22px; color: var(--ink); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; color: var(--text); margin-bottom: 8px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font-size: 15px; outline: none; background: #fff;
}
.field textarea { height: 110px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--gold); }
.field .err { color: var(--red); font-size: 12px; margin-top: 6px; }

/* 订单/售后列表 */
.order-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.order-card .ohead { display: flex; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.order-card .obody { padding: 16px 20px; display: flex; gap: 16px; align-items: center; }
.order-card .obody .thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #f0f2f5; flex-shrink: 0; }
.order-card .obody .info { flex: 1; }
.order-card .obody .info .nm { font-size: 14px; }
.order-card .obody .info .pr { color: var(--muted); font-size: 13px; margin-top: 4px; }
.order-card .ofoot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 14px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #fff3e0; color: #c77700; }
.badge.paid { background: #e6f0ff; color: #1c5fd6; }
.badge.shipped { background: #e8f7ee; color: var(--green); }
.badge.completed { background: #eef0f3; color: var(--muted); }
.badge.cancelled { background: #fbeaea; color: var(--red); }

/* 时间轴 */
.timeline { padding: 10px 0; }
.timeline .step { display: flex; gap: 14px; padding: 10px 0; position: relative; }
.timeline .dot { width: 14px; height: 14px; border-radius: 50%; background: #d7dde6; margin-top: 5px; flex-shrink: 0; }
.timeline .step.done .dot { background: var(--green); }
.timeline .tx b { display: block; color: var(--ink); font-size: 14px; }
.timeline .tx span { color: var(--muted); font-size: 12px; }

/* 模态 */
.modal-mask { position: fixed; inset: 0; background: rgba(10,18,30,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 30px; position: relative; }
.modal h3 { margin: 0 0 20px; color: var(--ink); }
.modal .close { position: absolute; right: 16px; top: 14px; border: none; background: none; font-size: 24px; color: var(--muted); }
.modal .tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.modal .tabs button { flex: 1; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 10px; color: var(--muted); }
.modal .tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 页脚 */
.footer { background: var(--ink); color: #aeb8c7; margin-top: 40px; }
.footer .container { padding: 40px 20px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer h4 { color: #fff; margin: 0 0 14px; font-size: 15px; }
.footer a { color: #aeb8c7; font-size: 13px; display: block; margin-bottom: 8px; }
.footer .copy { border-top: 1px solid #23344c; padding: 16px 20px; text-align: center; font-size: 13px; color: #7c879a; }

/* 空态 */
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty .big { font-size: 60px; margin-bottom: 10px; }

/* 提示 */
.toast { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 24px; z-index: 200; box-shadow: var(--shadow); font-size: 14px; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

/* 响应式 */
@media (max-width: 980px) {
  .detail { grid-template-columns: 1fr; }
  .footer .container { grid-template-columns: 1fr 1fr; }
  .promise { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .header .container { flex-wrap: wrap; height: auto; padding: 12px 20px; gap: 12px; }
  .search { order: 3; max-width: 100%; flex-basis: 100%; }
  .nav .container { overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 30px; }
  .promise { grid-template-columns: 1fr; }
  .footer .container { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 60px 1fr; }
  .cart-row .col-hide { display: none; }
  .detail { padding: 18px; }
}
