:root {
  --bg: #0f0f10;
  --panel: #1a1a1d;
  --panel-2: #222226;
  --line: #2c2c31;
  --gold: #c9a063;
  --gold-2: #d4af37;
  --text: #e8e6e1;
  --dim: #8a867e;
  --danger: #e05252;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.container { width: 1200px; margin: 0 auto; flex: 1; padding: 20px 0 40px; }

.btn { padding: 8px 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--gold); }
.btn-gold { background: linear-gradient(135deg, #b8863f, var(--gold-2)); border: none; color: #17130a; font-weight: 600; }
.btn-gold:hover { filter: brightness(1.08); }
.btn-outline { background: transparent; border: 1px solid var(--line); }
.btn-lg { padding: 12px 48px; font-size: 16px; border-radius: 8px; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-danger { color: var(--danger); border-color: rgba(224,82,82,.4); }
input, select, textarea { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 8px 12px; outline: none; }
input:focus, select:focus { border-color: var(--gold); }

/* 顶栏 */
.topbar { background: #141416; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.top-inner { width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { font-size: 22px; letter-spacing: 4px; color: var(--gold-2); font-weight: 700; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--dim); font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: var(--gold-2); border-bottom-color: var(--gold-2); }
.search { flex: 1; display: flex; gap: 8px; max-width: 420px; }
.search input { flex: 1; }
.user-area { display: flex; align-items: center; gap: 16px; }
.cart-link { font-size: 22px; position: relative; }
.cart-badge { position: absolute; top: -6px; right: -14px; background: var(--danger); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; }
.user-name { color: var(--gold); font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 首页轮播 */
.banner-wrap { position: relative; height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 26px; }
.banner-track { display: flex; height: 100%; transition: transform .5s ease; }
.banner-item { min-width: 100%; height: 100%; position: relative; }
.banner-item img { width: 100%; height: 100%; object-fit: cover; }
.banner-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.banner-dots i { width: 22px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); cursor: pointer; }
.banner-dots i.on { background: var(--gold-2); }
.banner-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.4); color: #fff; border: none; cursor: pointer; font-size: 18px; }
.banner-arrow.prev { left: 12px; }
.banner-arrow.next { right: 12px; }

/* 商品网格 */
.section-title { text-align: center; color: var(--gold-2); font-size: 20px; letter-spacing: 6px; margin: 34px 0 22px; position: relative; }
.section-title::before, .section-title::after { content: ''; position: absolute; top: 50%; width: 90px; height: 1px; background: var(--line); }
.section-title::before { left: calc(50% - 220px); }
.section-title::after { right: calc(50% - 220px); }

.goods-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.g-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s; }
.g-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.g-cover { width: 100%; height: 240px; object-fit: cover; display: block; background: var(--panel-2); }
.g-info { padding: 14px 16px 16px; }
.g-title { font-size: 14px; line-height: 1.5; height: 42px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.g-sub { color: var(--dim); font-size: 12px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bottom { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; }
.g-price { color: var(--gold-2); font-size: 20px; font-weight: 700; }
.g-price .rmb { font-size: 13px; }
.g-origin { color: #5c5a55; font-size: 12px; text-decoration: line-through; margin-left: 6px; font-weight: 400; }
.g-sales { color: var(--dim); font-size: 12px; }

/* 列表页工具条 */
.toolbar { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .btn-gold { margin-left: auto; }
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 26px; align-items: center; color: var(--dim); }

/* 详情页 */
.detail-wrap { display: flex; gap: 36px; }
.gallery { width: 460px; flex-shrink: 0; }
.gallery-main { width: 460px; height: 460px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; background: var(--panel-2); }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery-thumbs img { width: 76px; height: 76px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; object-fit: cover; }
.gallery-thumbs img.on { border-color: var(--gold-2); }
.detail-info { flex: 1; }
.d-title { font-size: 26px; font-weight: 600; line-height: 1.5; }
.d-sub { color: var(--dim); margin: 10px 0 18px; }
.d-price-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin-bottom: 20px; }
.d-price { color: var(--gold-2); font-size: 34px; font-weight: 700; }
.d-price .rmb { font-size: 18px; }
.d-origin { color: #5c5a55; text-decoration: line-through; margin-left: 12px; font-size: 14px; }
.d-meta { color: var(--dim); font-size: 13px; margin-top: 8px; }
.spec-block { margin-bottom: 22px; }
.spec-label { color: var(--dim); margin-bottom: 10px; font-size: 13px; }
.spec-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.spec-opt { padding: 8px 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); cursor: pointer; font-size: 13px; color: var(--dim); }
.spec-opt.on { border-color: var(--gold-2); color: var(--gold-2); }
.qty-box { display: flex; align-items: center; gap: 10px; }
.qty-box input { width: 80px; text-align: center; }
.qty-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--panel-2); color: var(--gold-2); cursor: pointer; font-size: 16px; border-radius: 6px; }
.d-actions { display: flex; gap: 14px; margin-top: 26px; }
.d-detail { margin-top: 40px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px 28px; }
.d-detail h3 { color: var(--gold-2); margin-bottom: 14px; font-size: 16px; }
.d-detail p { color: #c9c6bf; line-height: 1.9; margin-bottom: 8px; white-space: pre-wrap; word-break: break-all; }
.d-detail .d-empty { color: #5c5a55; }
.d-detail .d-img { width: 100%; display: block; border-radius: 8px; margin: 10px 0; }

/* 购物车 */
.cart-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cart-table th { background: var(--panel-2); color: var(--gold); text-align: left; padding: 14px 16px; font-size: 13px; }
.cart-table td { padding: 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.cart-goods { display: flex; gap: 12px; align-items: center; }
.cart-goods img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.cart-spec { color: var(--dim); font-size: 12px; }
.cart-sum { display: flex; justify-content: flex-end; align-items: center; gap: 24px; margin-top: 20px; }
.cart-total { font-size: 18px; }
.cart-total b { color: var(--gold-2); font-size: 26px; }

/* 下单确认 */
.checkout-wrap { display: flex; gap: 24px; }
.checkout-left { flex: 1; }
.checkout-right { width: 360px; }
.addr-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; cursor: pointer; margin-bottom: 20px; }
.addr-box:hover { border-color: var(--gold); }
.addr-name { font-size: 16px; font-weight: 600; }
.addr-phone { color: var(--dim); margin-left: 14px; }
.addr-default { font-size: 11px; background: linear-gradient(135deg, #b8863f, var(--gold-2)); color: #17130a; border-radius: 4px; padding: 1px 8px; margin-left: 10px; }
.addr-detail { color: var(--dim); margin-top: 8px; }
.order-goods { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 24px; margin-bottom: 20px; }
.order-goods .og { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.order-goods .og:last-child { border-bottom: none; }
.order-goods img { width: 56px; height: 56px; border-radius: 8px; }
.og-info { flex: 1; }
.og-price { color: var(--gold-2); font-weight: 600; }
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; }
.summary-row { display: flex; justify-content: space-between; color: var(--dim); padding: 8px 0; }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 16px; color: var(--text); font-size: 16px; }
.summary-row.total b { color: var(--gold-2); font-size: 24px; }

/* 订单列表 */
.order-tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.order-tabs span { padding: 12px 4px; cursor: pointer; color: var(--dim); border-bottom: 2px solid transparent; }
.order-tabs span.on { color: var(--gold-2); border-bottom-color: var(--gold-2); font-weight: 600; }
.order-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 24px; margin-bottom: 16px; }
.order-head { display: flex; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.order-no { color: var(--dim); font-size: 13px; }
.order-status { color: var(--gold-2); font-weight: 600; }
.order-body { display: flex; align-items: center; gap: 14px; padding: 16px 0; flex-wrap: wrap; }
.order-body img { width: 60px; height: 60px; border-radius: 8px; border: 1px solid var(--line); }
.order-foot { display: flex; justify-content: space-between; align-items: center; }
.order-amount { color: var(--dim); }
.order-amount b { color: var(--gold-2); font-size: 18px; margin-left: 8px; }
.order-actions { display: flex; gap: 10px; }

/* 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; }
.modal-box { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 30px; z-index: 201; width: 520px; max-width: 92vw; max-height: 80vh; overflow-y: auto; }
.modal-box h3 { color: var(--gold-2); margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { font-size: 13px; color: var(--dim); display: block; }
.form-grid label input, .form-grid label select { margin-top: 6px; width: 100%; }
.form-grid .full { grid-column: 1 / -1; }
.addr-option { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; cursor: pointer; }
.addr-option.on { border-color: var(--gold-2); background: rgba(212,175,55,.05); }
.addr-option b { font-size: 14px; }
.addr-option .opt-info { font-size: 12px; color: var(--dim); margin-top: 4px; }

/* 空状态 / toast */
.empty { text-align: center; color: var(--dim); padding: 100px 0; }
.empty .big { font-size: 60px; margin-bottom: 16px; }
.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); background: rgba(20,20,22,.95); border: 1px solid var(--gold); color: var(--gold-2); padding: 10px 28px; border-radius: 30px; z-index: 300; font-size: 14px; }
.footer { text-align: center; color: #5c5a55; font-size: 12px; padding: 24px 0; border-top: 1px solid var(--line); }
.footer a { color: var(--gold); }

/* 表格横向滚动（购物车） */
.table-scroll { overflow-x: auto; }
.table-scroll .cart-table { min-width: 640px; }

/* ===== 移动端适配 ===== */
@media (max-width: 900px) {
  .container { width: auto; padding: 14px 12px 30px; }

  .top-inner { width: auto; height: auto; flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .logo { font-size: 18px; letter-spacing: 3px; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .nav { order: 4; flex: 1 1 100%; gap: 18px; justify-content: space-between; }
  .nav a { font-size: 14px; }
  .user-area { gap: 12px; }
  .user-name { max-width: 90px; }

  .banner-wrap { height: 170px; border-radius: 8px; margin-bottom: 18px; }
  .banner-arrow { display: none; }

  .section-title { font-size: 16px; letter-spacing: 4px; margin: 24px 0 16px; }
  .section-title::before, .section-title::after { width: 40px; }
  .section-title::before { left: calc(50% - 130px); }
  .section-title::after { right: calc(50% - 130px); }

  .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .g-cover { height: 44vw; max-height: 240px; }
  .g-info { padding: 10px 10px 12px; }
  .g-title { font-size: 13px; height: 38px; }
  .g-price { font-size: 17px; }
  .g-sales { display: none; }

  .toolbar { gap: 8px; }
  .toolbar .btn-gold { margin-left: 0; }

  .detail-wrap { flex-direction: column; gap: 20px; }
  .gallery, .gallery-main { width: 100%; }
  .gallery-main { height: auto; aspect-ratio: 1; }
  .gallery-thumbs img { width: 60px; height: 60px; }
  .d-title { font-size: 19px; }
  .d-price-box { padding: 14px 16px; }
  .d-price { font-size: 26px; }
  .d-actions { flex-direction: column; gap: 10px; }
  .d-actions .btn-lg { width: 100%; padding: 12px 0; }
  .d-detail { padding: 16px; }

  .cart-sum { flex-wrap: wrap; gap: 12px; }
  .cart-total { font-size: 15px; }
  .cart-total b { font-size: 20px; }

  .checkout-wrap { flex-direction: column; }
  .checkout-right { width: 100%; }
  .addr-box { padding: 14px 16px; }

  .order-tabs { gap: 18px; overflow-x: auto; white-space: nowrap; }
  .order-card { padding: 14px; }
  .order-body img { width: 52px; height: 52px; }
  .order-foot { flex-wrap: wrap; gap: 10px; }
  .order-actions { margin-left: auto; }

  .modal-box { width: 92vw; max-width: none; padding: 20px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }

  .empty { padding: 60px 0; }
  .empty .big { font-size: 44px; }
}