/* ==========================================================
   用户中心 / 工作台 / 下单页
   ========================================================== */

/* ---------- 通用页面容器 ---------- */
.page-body { padding: 8px 0 20px; }
.layout {
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; align-items: start;
}

/* ---------- 侧边栏 ---------- */
.sidebar { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 14px; }
.side-user { padding: 20px; text-align: center; }
.side-avatar {
  width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 21px; font-weight: 700;
  background: linear-gradient(135deg, #2f80ff, #7aa8ff);
  box-shadow: 0 8px 18px rgba(47, 128, 255, .28);
}
.side-name { font-size: 15px; font-weight: 700; }
.side-uid { margin-top: 2px; color: var(--muted); font-size: 12px; }
.side-level {
  display: inline-flex; margin-top: 8px; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 209, 102, .22); color: #a06f00; font-size: 11.5px; font-weight: 600;
}
.side-wallet {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--soft);
}
.side-wallet .label { color: var(--muted); font-size: 12px; }
.side-wallet .val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.side-nav { padding: 10px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  height: 44px; padding: 0 12px; border-radius: 9px;
  color: var(--ink-2); font-size: 14px; transition: background .16s, color .16s;
}
.side-nav a svg { width: 17px; height: 17px; fill: currentColor; opacity: .55; flex: none; }
.side-nav a:hover { background: var(--soft); color: var(--blue); }
.side-nav a:hover svg { opacity: 1; }
.side-nav a.active { background: rgba(32, 107, 231, .09); color: var(--blue); font-weight: 600; }
.side-nav a.active svg { opacity: 1; }
.side-nav a .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #ff604c; color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center;
}
.side-nav .sep { height: 1px; margin: 8px 6px; background: var(--line); }

/* ---------- 内容区 ---------- */
.content { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }

/* ---------- 概览统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  position: relative; overflow: hidden; padding: 20px; border-radius: var(--radius); background: #fff;
  border: 1px solid var(--line);
}
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { margin-top: 8px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat .d { margin-top: 6px; font-size: 12px; color: var(--muted); }
.stat .d i { font-style: normal; color: var(--success); }
.stat::after {
  content: ""; position: absolute; right: -22px; bottom: -30px; width: 84px; height: 84px;
  border-radius: 50%; background: rgba(32, 107, 231, .06);
}
.stat.primary { background: linear-gradient(135deg, #1f6be0, #3f8bff); border-color: transparent; color: #fff; }
.stat.primary .k, .stat.primary .d { color: rgba(255, 255, 255, .78); }
.stat.primary .d i { color: #fff; font-weight: 600; }
.stat.primary::after { background: rgba(255, 255, 255, .12); }

/* ---------- 快捷入口 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 20px; }
.quick {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 10px;
  background: var(--soft); transition: background .16s, transform .16s;
}
.quick:hover { background: rgba(32, 107, 231, .08); transform: translateY(-2px); }
.quick .qi { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.quick .qi svg { width: 18px; height: 18px; fill: var(--blue); }
.quick b { font-size: 13.5px; font-weight: 600; }
.quick span { color: var(--muted); font-size: 12px; }

/* ---------- 表格工具条 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs-pill { display: flex; gap: 4px; padding: 3px; border-radius: 8px; background: var(--soft); }
.tabs-pill a { padding: 6px 14px; border-radius: 6px; color: #5d6b80; font-size: 13px; font-weight: 500; }
.tabs-pill a.active { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 2px 6px rgba(35, 55, 80, .08); }
.search-inline { position: relative; margin-left: auto; }
.search-inline input {
  width: 220px; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line-strong);
  border-radius: 8px; outline: 0; font-size: 13px; transition: border-color .16s, box-shadow .16s;
}
.search-inline input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(32, 107, 231, .1); }
.search-inline svg { position: absolute; left: 11px; top: 10px; width: 15px; height: 15px; fill: var(--muted); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px; }
.pager a, .pager span {
  display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink-2); font-size: 13px;
}
.pager a:hover { border-color: var(--blue); color: var(--blue); }
.pager .current { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.pager .disabled { color: #c0c9d6; }

/* ==========================================================
   下单页
   ========================================================== */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 20px; align-items: start; }

.goods-head { display: flex; gap: 18px; padding: 24px; border-bottom: 1px solid var(--line); }
.goods-cover {
  position: relative; flex: none; width: 104px; height: 104px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1f6be0, #54a0ff);
  box-shadow: 0 10px 22px rgba(32, 107, 231, .22);
}
.goods-cover svg { width: 46px; height: 46px; fill: rgba(255, 255, 255, .92); }
.goods-cover .tag-corner {
  position: absolute; left: 0; top: 0; padding: 2px 8px; border-bottom-right-radius: 8px;
  background: var(--gold); color: #6b4b00; font-size: 10.5px; font-weight: 700;
}
.goods-info { min-width: 0; flex: 1; }
.goods-info h1 { font-size: 20px; font-weight: 700; line-height: 1.45; }
.goods-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 5px;
  background: rgba(32, 107, 231, .08); color: var(--blue); font-size: 11.5px; font-weight: 500;
}
.tag.gold { background: rgba(255, 209, 102, .25); color: #8a5e00; }
.tag.grey { background: #eff2f7; color: #64748b; }
.goods-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 22px; margin-top: 14px; }
.goods-price { color: #e5484d; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.goods-price small { font-size: 14px; font-weight: 600; margin-right: 1px; }
.goods-price .unit { color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.goods-meta .m { color: var(--muted); font-size: 12.5px; }
.goods-meta .m b { color: var(--ink-2); font-weight: 600; }

/* 表单区块 */
.block { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14.5px; font-weight: 700; }
.block-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--blue); }
.block-title .note { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }

.form-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
.form-row + .form-row { margin-top: 18px; }
.form-row > .lbl { padding-top: 11px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.form-row > .lbl .req { color: var(--danger); }
.ctrl { max-width: 520px; }
.ctrl .help { margin-top: 7px; }
.ctrl .input, .ctrl .select { height: 44px; }

/* 支付方式 */
.pay-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 560px; }
.pay-opt { position: relative; }
.pay-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pay-opt label {
  display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 14px;
  border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.pay-opt label:hover { border-color: #b9cdea; }
.pay-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none; }
.pay-ico svg { width: 18px; height: 18px; }
.pay-alipay { background: rgba(22, 119, 255, .1); }
.pay-alipay svg { fill: #1677ff; }
.pay-wx { background: rgba(9, 187, 7, .1); }
.pay-wx svg { fill: #09bb07; }
.pay-balance { background: rgba(255, 153, 0, .12); }
.pay-balance svg { fill: #f59e0b; }
.pay-opt .pt { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.pay-opt .ps { color: var(--muted); font-size: 11.5px; }
.pay-opt input:checked + label {
  border-color: var(--blue); background: rgba(32, 107, 231, .045);
  box-shadow: 0 0 0 3px rgba(32, 107, 231, .1);
}
.pay-opt input:checked + label::after {
  content: ""; position: absolute; right: 10px; top: 10px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--blue)
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9.6 16.2 4.8 11.4l1.4-1.4 3.4 3.4 8-8L19 6.8z'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* 购买须知 */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-list li { position: relative; padding-left: 20px; color: #5c6a80; font-size: 13px; line-height: 1.8; }
.notice-list li::before {
  content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px;
  border-radius: 50%; background: rgba(32, 107, 231, .45);
}

/* 右侧结算卡 */
.summary { position: sticky; top: calc(var(--header-h) + 16px); overflow: hidden; }
.summary-head { padding: 18px 22px; border-bottom: 1px dashed var(--line-strong); }
.summary-head h3 { font-size: 15px; font-weight: 700; }
.summary-body { padding: 18px 22px; }
.sum-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13.5px; color: #5c6a80; }
.sum-row .val { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-row .val.discount { color: #e5484d; }
.sum-total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-strong);
}
.sum-total .k { font-size: 14px; font-weight: 600; }
.sum-total .v { color: #e5484d; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.6px; }
.sum-total .v small { font-size: 15px; font-weight: 600; margin-right: 1px; }
.summary-foot { padding: 0 22px 22px; }
.summary-foot .btn { height: 48px; font-size: 16px; border-radius: 9px; }
.summary-foot .tip { margin-top: 12px; color: var(--muted); font-size: 11.5px; text-align: center; }
.summary-foot .tip a { color: var(--blue); }

.guarantee { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.guarantee div { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.guarantee svg { width: 14px; height: 14px; fill: var(--success); flex: none; }

/* 优惠码输入 */
.coupon-inline { display: flex; gap: 8px; max-width: 420px; }
.coupon-inline .input { height: 40px; }
.coupon-inline .btn { height: 40px; }

/* 订单号复制 */
.mono { font-family: SFMono-Regular, Consolas, Menlo, monospace; font-size: 12.5px; letter-spacing: .2px; }
.link { color: var(--blue); }
.link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* 空状态 */
.empty { padding: 64px 20px; text-align: center; }
.empty .ico { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--soft); }
.empty .ico svg { width: 32px; height: 32px; fill: #b9c6d8; }
.empty h4 { font-size: 15px; font-weight: 600; }
.empty p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.empty .btn { margin-top: 18px; }

/* 充值 */
.recharge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.amount-opt { position: relative; }
.amount-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.amount-opt label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 76px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff;
  cursor: pointer; transition: border-color .16s, background .16s, box-shadow .16s;
}
.amount-opt label:hover { border-color: #b9cdea; }
.amount-opt .a { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.amount-opt .b { color: var(--muted); font-size: 11.5px; }
.amount-opt input:checked + label {
  border-color: var(--blue); background: rgba(32, 107, 231, .05); box-shadow: 0 0 0 3px rgba(32, 107, 231, .1);
}
.amount-opt input:checked + label .a { color: var(--blue); }

/* 账户设置 */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
.setting-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .k { width: 96px; flex: none; color: var(--muted); font-size: 13px; }
.setting-row .v { flex: 1; font-size: 13.5px; font-weight: 500; }
.badge-verified { background: rgba(23, 178, 106, .1); color: #0e8f56; }

/* 侧栏提示卡 */
.tip-card { padding: 20px; background: linear-gradient(160deg, #fff, #f7faff); }
.tip-card h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.tip-card p { color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.tip-card .btn { margin-top: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .order-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; overflow-x: auto; gap: 10px; padding-bottom: 2px; }
  .side-user { display: none; }
  .side-nav { display: flex; gap: 4px; padding: 8px; min-width: max-content; }
  .side-nav a { height: 40px; padding: 0 12px; white-space: nowrap; }
  .side-nav .sep { display: none; }
  .order-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .goods-head { flex-direction: column; padding: 18px; }
  .goods-cover { width: 100%; height: 132px; }
  .goods-info h1 { font-size: 17px; }
  .block { padding: 18px; }
  .form-row { grid-template-columns: 1fr; gap: 8px; }
  .form-row > .lbl { padding-top: 0; }
  .pay-grid { grid-template-columns: 1fr; }
  .recharge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 22px; }
  .toolbar { padding: 12px 14px; }
  .search-inline { margin-left: 0; width: 100%; }
  .search-inline input { width: 100%; }
}
