/* 卡密库存 · 苹果风界面 */
:root {
  --bg: #f2f2f7; --bg2: #fff; --bg3: #fff;
  --fill: rgba(118, 118, 128, .12); --fill2: rgba(118, 118, 128, .08);
  --label: #000; --label2: rgba(60, 60, 67, .6); --label3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .2);
  --blue: #007aff; --green: #34c759; --red: #ff3b30; --orange: #ff9500; --purple: #af52de; --indigo: #5856d6; --teal: #30b0c7; --pink: #ff2d55;
  --bar: rgba(249, 249, 249, .82); --side: rgba(242, 242, 247, .9);
  --bubble: #e9e9eb; --sheet-bg: #f2f2f7; --sheet-bg2: #fff;
  --shadow: 0 2px 10px rgba(0, 0, 0, .04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tabbar: 50px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --bg2: #1c1c1e; --bg3: #2c2c2e;
    --fill: rgba(118, 118, 128, .24); --fill2: rgba(118, 118, 128, .16);
    --label: #fff; --label2: rgba(235, 235, 245, .6); --label3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .55);
    --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --purple: #bf5af2; --indigo: #5e5ce6; --teal: #40c8e0; --pink: #ff375f;
    --bar: rgba(22, 22, 23, .82); --side: rgba(28, 28, 30, .9);
    --bubble: #262628; --sheet-bg: #1c1c1e; --sheet-bg2: #2c2c2e;
    --shadow: none;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.35; letter-spacing: -.01em;
  background: var(--bg); color: var(--label); -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--label); }
a { color: var(--blue); text-decoration: none; }
.muted { color: var(--label2); }
.num { font-variant-numeric: tabular-nums; }
.green { color: var(--green); } .red { color: var(--red); } .orange { color: var(--orange); } .blue { color: var(--blue); }

/* 图标 */
.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 17px; height: 17px; }
.ic.lg { width: 28px; height: 28px; }

/* ---------- 布局：电脑左侧栏，手机底部标签栏 ---------- */
.app { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: 250px; padding: 22px 12px 16px; display: flex; flex-direction: column; gap: 2px;
  background: var(--side); border-right: .5px solid var(--sep); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; font-weight: 600; font-size: 17px; }
.brand .app-icon { width: 30px; height: 30px; border-radius: 7px; }
.side a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; color: var(--label);
}
.side a .ic { color: var(--blue); }
.side a:hover { background: var(--fill2); }
.side a.active { background: var(--blue); color: #fff; }
.side a.active .ic { color: #fff; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14px; color: var(--label2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--label3); flex: none; }
.dot.on { background: var(--green); }

main { margin-left: 250px; padding: 34px 40px 60px; }
.page { max-width: 880px; margin: 0 auto; }

.tabbar { display: none; }

@media (max-width: 860px) {
  .side { display: none; }
  main { margin-left: 0; padding: calc(10px + env(safe-area-inset-top)) 16px calc(var(--tabbar) + 30px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding-bottom: env(safe-area-inset-bottom);
    background: var(--bar); border-top: .5px solid var(--sep); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  .tabbar a { flex: 1; height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--label2); cursor: pointer; }
  .tabbar a .ic { width: 25px; height: 25px; }
  .tabbar a.active { color: var(--blue); }
}

/* ---------- 标题 ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.eyebrow { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: .02em; }
.title { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; }
.head-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 4px; }
.sec { margin: 26px 0 7px; padding: 0 16px; font-size: 13px; font-weight: 400; color: var(--label2); text-transform: uppercase; letter-spacing: .02em; }
.sec-row { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 8px; gap: 10px; }
.sec-row .sec { margin: 0; }
.hint { margin: 8px 16px 0; font-size: 13px; color: var(--label2); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 12px;
  font-size: 17px; font-weight: 600; white-space: nowrap; transition: opacity .15s, transform .1s;
}
.btn:active { opacity: .7; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.tinted { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.btn.gray { background: var(--fill); color: var(--label); }
.btn.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 15px; }
.btn.block { width: 100%; height: 50px; border-radius: 14px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--fill); color: var(--blue); }
.icon-btn .ic { width: 19px; height: 19px; stroke-width: 2.1; }
.link { color: var(--blue); font-size: 17px; }
.link.strong { font-weight: 600; }

/* ---------- 分段控件 ---------- */
.seg { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; }
.seg button { flex: 1; height: 30px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--label); transition: background .2s; }
.seg button.on { background: var(--bg2); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }
.seg.small { display: inline-flex; flex: none; }
.seg.small button { flex: none; height: 26px; font-size: 13px; padding: 0 12px; min-width: 48px; }

/* ---------- 分组列表（iOS 设置风格） ---------- */
.list { background: var(--bg2); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; width: 100%; text-align: left;
  background: var(--bg2); color: var(--label);
}
button.row, .row.tap { cursor: pointer; }
button.row:active, .row.tap:active { background: var(--fill); }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.row.has-icon + .row.has-icon::before { left: 60px; }
.row .main { flex: 1; min-width: 0; }
.row .t { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { display: block; margin-top: 2px; font-size: 13px; color: var(--label2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .v { color: var(--label2); font-size: 17px; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.row .chev { color: var(--label3); width: 15px; height: 15px; stroke-width: 2.4; margin-right: -4px; }
.row.center { justify-content: center; }
.row.danger { color: var(--red); }
.row.blue { color: var(--blue); }
.tile {
  width: 32px; height: 32px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 600; background: var(--blue);
}
.tile .ic { width: 19px; height: 19px; stroke-width: 2; }
.tile.round { border-radius: 50%; }
.big-num { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--label); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge.orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.badge.red { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.badge.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.badge.blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.badge.gray { background: var(--fill); color: var(--label2); }
.empty { padding: 28px 16px; text-align: center; color: var(--label2); font-size: 15px; }
.more { display: block; margin: 12px auto 0; }

/* ---------- 数字卡片 ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.kpi { background: var(--bg2); border-radius: 14px; padding: 14px 16px 15px; box-shadow: var(--shadow); min-width: 0; }
.kpi .l { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.kpi .l .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.kpi .v { margin-top: 8px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .v small { font-size: 15px; font-weight: 600; color: var(--label2); margin-left: 2px; }
.card { background: var(--bg2); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; padding: 14px 4px; }
.summary > div { text-align: center; min-width: 0; }
.summary > div + div { border-left: .5px solid var(--sep); }
.summary .l { font-size: 13px; color: var(--label2); }
.summary .v { margin-top: 4px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }

/* 柱状图 */
.chart { padding: 16px 12px 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--label2); padding: 0 4px 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.bars { display: flex; gap: 3px; height: 150px; align-items: stretch; }
.bars .day { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bars .pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bars .pair i { width: 42%; max-width: 12px; border-radius: 4px 4px 2px 2px; min-height: 2px; }
.bars .pair i.in { background: var(--green); } .bars .pair i.out { background: var(--red); }
.bars span { height: 18px; padding-top: 4px; font-size: 10px; color: var(--label2); text-align: center; white-space: nowrap; }

/* ---------- 输入框 ---------- */
.field { display: block; width: 100%; border: 0; outline: 0; background: transparent; padding: 0; font-size: 17px; min-width: 0; }
.field::placeholder, textarea::placeholder { color: var(--label3); }
.row label.k { width: 84px; flex: none; color: var(--label); }
.input {
  display: block; width: 100%; height: 44px; padding: 0 14px; border: 0; outline: 0; border-radius: 10px; background: var(--fill2); font-size: 17px;
}
textarea.input { height: auto; min-height: 150px; padding: 12px 14px; resize: vertical; font-family: var(--mono); font-size: 14px; line-height: 1.5; }
select.field { appearance: none; -webkit-appearance: none; color: var(--label2); text-align: right; text-align-last: right; cursor: pointer; }
input[type="date"].field { text-align: right; color: var(--label2); }
input[type="date"].field::-webkit-date-and-time-value { text-align: right; }
.input:focus, .code-input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 45%, transparent); }
.err { margin: 10px 0 0; color: var(--red); font-size: 14px; text-align: center; min-height: 1.2em; }

/* 开关 */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* 小标签按钮 */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 14px; border-radius: 16px; background: var(--fill); font-size: 15px; color: var(--label); white-space: nowrap; }
.chip.on { background: var(--blue); color: #fff; }

/* 数量加减 */
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 16px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.stepper button .ic { stroke-width: 2.4; }
.stepper input { width: 120px; border: 0; outline: 0; background: transparent; text-align: center; font-size: 48px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stepper input::-webkit-inner-spin-button { display: none; }
.amount { display: flex; align-items: baseline; justify-content: center; gap: 2px; margin: 18px 0 20px; }
.amount span { font-size: 28px; font-weight: 600; color: var(--label2); }
.amount input { width: 4ch; max-width: 70vw; border: 0; outline: 0; background: transparent; text-align: center; font-size: 48px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- 卡密显示 ---------- */
.codes { background: var(--bg2); border-radius: 12px; overflow: hidden; }
.codes .head2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 16px; font-size: 15px; font-weight: 600; }
.codes ul { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow: auto; }
.codes li { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 16px; border-top: .5px solid var(--sep); }
.codes li code { flex: 1; font-family: var(--mono); font-size: 14px; word-break: break-all; user-select: all; }
.codes li button { color: var(--blue); padding: 4px; }
.done-mark { width: 64px; height: 64px; margin: 6px auto 10px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.done-mark .ic { width: 34px; height: 34px; stroke-width: 2.6; }
.center-text { text-align: center; }
.center-text h3 { margin: 0; font-size: 20px; }
.center-text p { margin: 6px 0 18px; color: var(--label2); font-size: 15px; }

/* ---------- 底部弹出面板 ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s; }
.overlay.show { opacity: 1; }
.sheet {
  --bg2: var(--sheet-bg2); --bg3: var(--sheet-bg2);
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: var(--sheet-bg); border-radius: 14px 14px 0 0; transform: translateY(100%); transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .12);
}
.overlay.show .sheet { transform: none; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 6px auto 0; flex: none; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 16px 10px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .l { justify-self: start; } .sheet-head .r { justify-self: end; }
.sheet-body { overflow: auto; padding: 6px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-body .sec:first-child { margin-top: 6px; }
.sheet-body > .btn.block { margin-top: 22px; }
@media (min-width: 861px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 16px; max-height: 86vh; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .25s, opacity .25s; }
  .overlay.show .sheet { opacity: 1; }
  .sheet .grab { display: none; }
  .sheet-head { padding-top: 14px; }
}

/* 提示框（iOS Alert） */
.alert-wrap { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .3); opacity: 0; transition: opacity .2s; }
.alert-wrap.show { opacity: 1; }
.alert {
  width: 280px; border-radius: 14px; overflow: hidden; text-align: center; transform: scale(1.1); transition: transform .2s;
  background: rgba(242, 242, 242, .92); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
}
@media (prefers-color-scheme: dark) { .alert { background: rgba(37, 37, 37, .92); } }
.alert-wrap.show .alert { transform: none; }
.alert .body { padding: 19px 16px 16px; }
.alert h4 { margin: 0; font-size: 17px; font-weight: 600; }
.alert p { margin: 4px 0 0; font-size: 13px; line-height: 1.4; }
.alert input { margin-top: 14px; width: 100%; height: 32px; padding: 0 8px; border-radius: 7px; border: .5px solid var(--sep); background: var(--bg2); outline: 0; font-size: 14px; }
.alert .btns { display: flex; border-top: .5px solid var(--sep); }
.alert .btns button { flex: 1; height: 44px; font-size: 17px; color: var(--blue); }
.alert .btns button + button { border-left: .5px solid var(--sep); }
.alert .btns button.strong { font-weight: 600; }
.alert .btns button.red { color: var(--red); }

/* 提示条 */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); z-index: 300; transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 22px; font-size: 15px; font-weight: 500;
  background: var(--bg3); color: var(--label); box-shadow: 0 8px 30px rgba(0, 0, 0, .16); transition: transform .3s cubic-bezier(.32, .72, 0, 1), opacity .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .app-icon { width: 76px; height: 76px; border-radius: 18px; margin: 0 auto 18px; box-shadow: 0 8px 24px rgba(0, 122, 255, .25); }
.login-card h1 { margin: 0; font-size: 28px; font-weight: 700; }
.login-card > p { margin: 6px 0 26px; color: var(--label2); font-size: 15px; }
.login-card .list { text-align: left; margin-bottom: 18px; }
.login-card .row { min-height: 50px; }
.code-input {
  display: block; width: 100%; height: 56px; margin: 0 0 18px; border: 0; outline: 0; border-radius: 12px; background: var(--bg2);
  text-align: center; font-size: 30px; font-weight: 600; letter-spacing: .4em; padding-left: .4em; font-variant-numeric: tabular-nums;
}
.setup2fa { text-align: center; }
.setup2fa img { display: block; width: 190px; height: 190px; margin: 6px auto 10px; border-radius: 12px; background: #fff; padding: 6px; }
.setup2fa p { margin: 8px 0; font-size: 15px; color: var(--label2); line-height: 1.5; }
.setup2fa code { display: inline-block; margin-top: 4px; font-family: var(--mono); font-size: 13px; color: var(--label); word-break: break-all; user-select: all; }
.steps { text-align: left; margin: 0 0 14px; padding-left: 22px; color: var(--label2); font-size: 15px; line-height: 1.6; }
.app-icon { display: block; }

/* ---------- AI 助手 ---------- */
.chat-page { display: flex; flex-direction: column; height: calc(100vh - 94px); height: calc(100dvh - 94px); }
.chat-page .head { margin-bottom: 8px; }
.msgs { flex: 1; overflow-y: auto; padding: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; -webkit-overflow-scrolling: touch; }
.bubble { max-width: 78%; padding: 9px 14px; border-radius: 19px; font-size: 16px; line-height: 1.42; white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; background: var(--bubble); border-bottom-left-radius: 6px; }
.ai-extra { align-self: flex-start; width: min(420px, 92%); margin: 2px 0 6px; }
.ai-extra .codes { border: .5px solid var(--sep); }
.ai-extra .card { border: .5px solid var(--sep); padding: 12px 14px; font-size: 15px; }
.typing { display: inline-flex; gap: 4px; padding: 13px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--label3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.welcome { margin: auto 0; text-align: center; padding: 20px 8px; }
.welcome .orb { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #5e5ce6, #0a84ff 55%, #30b0c7); }
.welcome .orb .ic { width: 34px; height: 34px; stroke-width: 1.7; }
.welcome h2 { margin: 0 0 6px; font-size: 22px; }
.welcome p { margin: 0 0 18px; color: var(--label2); font-size: 15px; }
.welcome .chips { justify-content: center; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 0 4px; }
.composer textarea {
  flex: 1; min-height: 38px; max-height: 140px; padding: 8px 14px; border-radius: 19px; border: .5px solid var(--sep); outline: 0; resize: none;
  background: var(--bg2); font-size: 16px; line-height: 1.35;
}
.composer .send { width: 34px; height: 34px; margin-bottom: 2px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.composer .send:disabled { background: var(--fill); color: var(--label3); }
.composer .send .ic { width: 18px; height: 18px; stroke-width: 2.6; }
.mode-pill { font-size: 12px; }
@media (max-width: 860px) {
  .chat-page { height: calc(100vh - var(--tabbar) - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); height: calc(100dvh - var(--tabbar) - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .bubble { max-width: 84%; }
}

/* 个人资料 */
.profile .row { min-height: 76px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; color: #fff; background: linear-gradient(180deg, #a5abb8, #858994); }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.foot { margin: 24px 0 0; text-align: center; font-size: 12px; color: var(--label3); }

/* ---------- 手机细节 ---------- */
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .v { font-size: 22px; }
  .title { font-size: 32px; }
  .summary .v { font-size: 17px; }
}
@media (display-mode: standalone) and (max-width: 860px) {
  main { padding-top: calc(16px + env(safe-area-inset-top)); }
}

/* ---------- 概览：选日期、每人统计、统计表格 ---------- */
.date-pick { margin-top: 12px; }
.sec-tools { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.sec-tools .btn.sm { height: 26px; padding: 0 10px; font-size: 13px; }
.sec-tools .btn .ic { width: 14px; height: 14px; }
.person .s + .s { margin-top: 1px; }
.person .v small { font-size: 13px; margin-left: 1px; }
.person.idle .t { color: var(--label2); }
.person.idle .avatar { opacity: .55; }
.person.total { background: color-mix(in srgb, var(--blue) 6%, var(--bg2)); }
.person.total .t { font-weight: 600; }
.table-wrap { background: var(--bg2); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rtable { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px; white-space: nowrap; }
.rtable th, .rtable td { padding: 11px 14px; text-align: right; border-bottom: .5px solid var(--sep); }
.rtable thead th { font-size: 12px; font-weight: 600; color: var(--label2); background: var(--bg2); }
.rtable th:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--bg2); font-weight: 500; box-shadow: .5px 0 0 var(--sep); }
.rtable thead th:first-child { font-weight: 600; }
.rtable td.zero { color: var(--label3); }
.rtable tr.sum th, .rtable tr.sum td { font-weight: 700; border-bottom: 0; background: color-mix(in srgb, var(--blue) 6%, var(--bg2)); }
.rtable td.red { color: var(--red); }
.person .s { white-space: normal; }
.narrow-only { display: none; }
@media (max-width: 700px) { .narrow-only { display: inline; } }
.nw { white-space: nowrap; }
