/* iRent RU — 移动端优先设计系统 */
:root {
  --bg: #f3f4f7;
  --card: #ffffff;
  --ink: #14161c;
  --muted: #79808f;
  --line: #e7e9ef;
  --brand: #1652e8;
  --brand-ink: #0d3bb0;
  --brand-soft: #ecf1fe;
  --ok: #0e9f6e;
  --ok-soft: #e6f6f0;
  --warn: #c27803;
  --warn-soft: #fdf3e0;
  --danger: #e02424;
  --danger-soft: #fdeaea;
  --gold: #9a6b00;
  --gold-soft: #fff4d6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .05);
  --nav-h: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Noto Sans", Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
/* App 外壳：手机全屏；桌面居中成手机宽度 */
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; }
@media (min-width: 520px) {
  body { background: #e8eaef; }
  #app { box-shadow: 0 0 0 1px var(--line), 0 8px 40px rgba(16,24,40,.12); }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: rgba(243,244,247,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231,233,239,.7);
}
.logo { display: flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; cursor: pointer; }
.logo .ru { font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 6px; padding: 2px 6px; letter-spacing: .04em; transform: translateY(-2px); }
.lang-btn {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer;
  font-family: inherit;
}
.lang-btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- 主区 ---------- */
#view { flex: 1; padding: 16px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 14px; }
.sub-title { font-size: 15px; font-weight: 700; margin: 18px 0 10px; }
.back-row { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 10px; cursor: pointer; width: fit-content; }

/* ---------- 底部导航 ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(env(safe-area-inset-bottom) + 6px);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 600; padding: 4px 0;
}
.bottomnav a svg { width: 23px; height: 23px; }
.bottomnav a.active { color: var(--brand); }

/* ---------- 卡片与列表 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }
.kv.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; font-size: 16px; }
.kv.total .v { font-weight: 800; color: var(--brand); }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }

/* ---------- Hero ---------- */
.hero {
  border-radius: 20px; padding: 22px 18px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(120% 160% at 10% 0%, #3b76ff 0%, #1652e8 45%, #0e2f9e 100%);
  box-shadow: 0 10px 30px rgba(22, 82, 232, .25);
}
.hero h1 { margin: 0 0 6px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.hero p { margin: 0; font-size: 13px; opacity: .85; }
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.badge { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.14); border-radius: 10px; padding: 8px 10px; }
.badge svg { width: 15px; height: 15px; flex: none; }

/* ---------- 商品 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform .12s ease; }
.pcard:active { transform: scale(.97); }
.pcard img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #eef0f5; }
.pcard .pbody { padding: 10px 12px 13px; }
.pcard .pname { font-size: 14px; font-weight: 700; line-height: 1.25; }
.pcard .pstor { font-size: 12px; color: var(--muted); margin-top: 1px; }
.pcard .pprice { margin-top: 7px; font-size: 15px; font-weight: 800; color: var(--brand); }
.pcard .pprice .unit { font-size: 11px; color: var(--muted); font-weight: 600; }
.soldout { position: relative; }
.soldout::after { content: attr(data-soldout); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.72); font-weight: 700; color: var(--muted); font-size: 13px; }

.detail-img { width: 100%; border-radius: 20px; aspect-ratio: 3/3.4; object-fit: cover; background: #eef0f5; box-shadow: var(--shadow); }

/* ---------- 通用控件 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: none; border-radius: 14px; padding: 14px 18px; font-size: 15.5px; font-weight: 700;
  background: var(--brand); color: #fff; cursor: pointer; transition: filter .12s, transform .05s;
  font-family: inherit;
}
.btn:active { transform: scale(.985); filter: brightness(.94); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: var(--brand-soft); color: var(--brand-ink); }
.btn.plain { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { padding: 9px 14px; font-size: 13.5px; border-radius: 11px; width: auto; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.seg { display: grid; gap: 8px; }
.seg.cols2 { grid-template-columns: 1fr 1fr; }
.seg.cols4 { grid-template-columns: repeat(4, 1fr); }
.seg-item {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center;
  font-size: 13px; font-weight: 600; cursor: pointer; background: var(--card); transition: all .12s;
}
.seg-item .big { display: block; font-size: 15px; font-weight: 800; }
.seg-item .tiny { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.seg-item.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.seg-item.active .tiny { color: var(--brand-ink); opacity: .75; }

.opt {
  display: flex; align-items: flex-start; gap: 10px; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; background: var(--card); margin-bottom: 9px; transition: all .12s;
}
.opt.active { border-color: var(--brand); background: var(--brand-soft); }
.opt .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 2px; position: relative; }
.opt.active .dot { border-color: var(--brand); }
.opt.active .dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.opt .ot { font-size: 14px; font-weight: 700; }
.opt .od { font-size: 12px; color: var(--muted); margin-top: 1px; }
.opt .op { margin-left: auto; font-weight: 800; font-size: 13.5px; white-space: nowrap; }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; font-family: inherit; background: var(--card); color: var(--ink); outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,82,232,.12); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }

/* ---------- 徽章 / 状态 ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.chip.blue { background: var(--brand-soft); color: var(--brand-ink); }
.chip.green { background: var(--ok-soft); color: var(--ok); }
.chip.amber { background: var(--warn-soft); color: var(--warn); }
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.gray { background: #eef0f4; color: var(--muted); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }

.lv-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; border-radius: 10px; padding: 4px 10px; font-size: 12.5px; }
.lv-C { background: #eef0f4; color: #565d6b; }
.lv-B { background: var(--brand-soft); color: var(--brand-ink); }
.lv-A { background: linear-gradient(135deg, #ffe9b0, #ffd564); color: #6b4a00; }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 13px 14px; }
.stat .n { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.balance-card {
  border-radius: 20px; padding: 20px 18px; color: #fff; margin-bottom: 12px;
  background: radial-gradient(130% 170% at 90% -10%, #34d399 0%, #0e9f6e 40%, #065f46 100%);
}
.balance-card .bl { font-size: 12px; opacity: .8; font-weight: 600; }
.balance-card .bn { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 10px; }
.balance-card .brow { display: flex; gap: 18px; font-size: 12px; opacity: .92; }

.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1.5px dashed var(--brand); background: var(--brand-soft); border-radius: 14px; padding: 12px 14px;
}
.code-box .code { font-size: 22px; font-weight: 800; letter-spacing: .14em; color: var(--brand-ink); font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- 列表条目 ---------- */
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: none; }
.li .lmain { flex: 1; min-width: 0; }
.li .lt { font-size: 14px; font-weight: 700; }
.li .ld { font-size: 12px; color: var(--muted); margin-top: 1px; }
.li .lr { text-align: right; }
.li .lr .amount { font-weight: 800; font-size: 14.5px; }
.li .lr .amount.green { color: var(--ok); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }

.progress { height: 6px; border-radius: 99px; background: #e9ecf2; overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; background: var(--brand); transition: width .3s; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; font-size: 14px; }
.empty .eicon { font-size: 40px; margin-bottom: 10px; }

/* ---------- 弹层 ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(10,14,24,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s; }
.sheet {
  width: 100%; max-width: 480px; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom) + 18px); animation: slideup .22s cubic-bezier(.2,.9,.3,1);
  max-height: 82dvh; overflow: auto;
}
.sheet .grab { width: 38px; height: 4.5px; border-radius: 99px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { margin: 2px 0 14px; font-size: 17px; }
@keyframes slideup { from { transform: translateY(40%); opacity: .4; } }
@keyframes fadein { from { opacity: 0; } }

#toast {
  position: fixed; top: calc(env(safe-area-inset-top) + 14px); left: 50%; transform: translateX(-50%);
  z-index: 99; background: rgba(20,22,28,.92); color: #fff; font-size: 13.5px; font-weight: 600;
  border-radius: 12px; padding: 11px 18px; max-width: 86vw; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(4px); }
#toast.ok { background: rgba(14,128,93,.95); }
#toast.err { background: rgba(190,32,32,.95); }

.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #eceef3 25%, #f5f6f9 50%, #eceef3 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 步骤说明 */
.steps { counter-reset: st; }
.steps .stp { display: flex; gap: 12px; padding: 9px 0; align-items: flex-start; }
.steps .stp::before {
  counter-increment: st; content: counter(st);
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 1px;
}
.steps .stp p { margin: 2px 0 0; font-size: 13.5px; }

/* 级别介绍卡 */
.lv-card { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; background: var(--card); }
.lv-card.hl { border-color: #f0c649; background: linear-gradient(180deg, #fffdf4, #fff); }
.lv-card .lvh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.lv-card .rate { font-size: 20px; font-weight: 800; color: var(--brand); }
.lv-card p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* 表格化明细（管理端也用） */
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
a { color: var(--brand); }
