/* ==========================================================
   安防进销存 - 移动端样式
   设计: 手机优先, 大按钮, 高对比度(适合仓库/工地环境)
   ========================================================== */

:root {
    --primary: #1a5fb4;
    --primary-dark: #14498c;
    --primary-light: #e8f0fb;
    --success: #1a7f37;
    --success-light: #e6f4ea;
    --danger: #c01c28;
    --danger-light: #fdeced;
    --warning: #b86e00;
    --warning-light: #fff3e0;
    --text: #1c1c1e;
    --text-2: #5f6368;
    --text-3: #9aa0a6;
    --border: #e3e5e8;
    --bg: #f5f6f8;
    --card: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-h: 52px;
    --tabbar-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
    /* 关键1: 锁定文字不随手机系统字体缩放放大 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    /* 关键2: 绝不能给 html/body 设 height:100%。
       height:100% + 全局 border-box 会把 body 钉死一屏高,
       底部 padding 被挤占, 溢出内容直接延伸到 fixed 底栏下面 —— 页面最后的内容永远被菜单栏盖住(实测踩坑)。 */
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
    padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
}

body.no-tabbar { padding-bottom: 0; }

/* ---------- 顶部栏 ---------- */
.header {
    position: sticky; top: 0; z-index: 100;
    height: var(--header-h);
    display: flex; align-items: center; gap: 8px;
    padding: 0 12px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.header h1 { flex: 1; font-size: 17px; font-weight: 600; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header .hbtn {
    min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: #fff; font-size: 15px; border-radius: 8px;
    cursor: pointer;
}
.header .hbtn:active { background: rgba(255,255,255,.15); }
.header .hbtn.icon { font-size: 20px; }

/* ---------- 底部导航 ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--border);
}
.tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; text-decoration: none; color: var(--text-3); font-size: 11px;
    line-height: 1.2;
    transition: color .15s;
}
.tabbar a .ic { width: 22px; height: 22px; flex-shrink: 0; }
.tabbar a .ic svg { width: 100%; height: 100%; display: block; }
.tabbar a.active { color: var(--primary); font-weight: 600; }

/* ---------- 通用容器 ---------- */
.page { padding: 12px; }
.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 12px;
    /* 不设 overflow:hidden: 防止个别内核布局偏差时裁掉卡片底部内容(踩过坑) */
}
.card-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    font-size: 15px; font-weight: 600;
}
.card-bd { padding: 12px 14px; }
.card-bd.flush { padding: 0; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label {
    display: block; margin-bottom: 6px;
    font-size: 13px; color: var(--text-2); font-weight: 500;
}
.field > label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
    width: 100%; min-height: 46px; padding: 11px 12px;
    font-size: 16px; /* >=16px 防 iOS/鸿蒙 自动放大 */
    font-family: inherit; color: var(--text);
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
    outline: none; transition: border-color .15s, box-shadow .15s;
    appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,95,180,.1);
}
.input:disabled, .input[readonly] { background: #f2f3f5; color: var(--text-2); }
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.select {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235f6368' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .input { flex: 1; }

/* 扫码输入框 */
.scan-row { position: relative; }
.scan-row .input { padding-right: 48px; }
.scan-btn {
    position: absolute; right: 4px; top: 4px; bottom: 4px;
    width: 40px; border: none; border-radius: 6px;
    background: var(--primary-light); color: var(--primary); font-size: 19px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.scan-btn:active { background: #d5e3f8; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 46px; padding: 11px 18px;
    font-size: 16px; font-family: inherit; font-weight: 600;
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    background: var(--primary); color: #fff;
    transition: opacity .15s, transform .1s;
}
.btn:active { opacity: .85; transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.soft { background: var(--primary-light); color: var(--primary); }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }
.btn.warn { background: var(--warning); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.xs { min-height: 30px; padding: 4px 10px; font-size: 13px; font-weight: 500; border-radius: 6px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- 列表 ---------- */
.list { background: var(--card); }
.list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    text-decoration: none; color: inherit; cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f6f7f9; }
.li-thumb {
    width: 52px; height: 52px; flex-shrink: 0;
    border-radius: var(--radius-sm); object-fit: cover;
    background: #eef0f2; display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 20px;
}
.li-main { flex: 1; min-width: 0; }
.li-title {
    font-size: 15px; font-weight: 600; margin-bottom: 3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li-sub {
    font-size: 12.5px; color: var(--text-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li-sub .sep { margin: 0 5px; color: var(--text-3); }
.li-right { text-align: right; flex-shrink: 0; }
.li-amount { font-size: 15.5px; font-weight: 700; color: var(--danger); }
.li-amount.income { color: var(--success); }
.li-amount.plain { color: var(--text); }
.li-note { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- 标签 ---------- */
.tag {
    display: inline-block; padding: 2px 8px; border-radius: 5px;
    font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.tag.blue    { background: var(--primary-light); color: var(--primary); }
.tag.green   { background: var(--success-light); color: var(--success); }
.tag.orange  { background: var(--warning-light); color: var(--warning); }
.tag.red     { background: var(--danger-light); color: var(--danger); }
.tag.gray    { background: #eef0f2; color: var(--text-2); }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.stat {
    background: var(--card); border-radius: var(--radius); padding: 13px 14px;
    box-shadow: var(--shadow);
}
.stat .k { font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.stat .v { font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat .d { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.stat.accent .v { color: var(--primary); }
.stat.danger .v { color: var(--danger); }
.stat.success .v { color: var(--success); }

/* ---------- 快捷入口 ---------- */
/* 用 flex 两行结构, 不用 grid: 部分安卓内核 grid 行高计算异常会压扁第二行。
   item 用 <a> 不用 <button>: 规避个别内核对 button 内 flex 的怪癖。 */
.quick-grid { }
.quick-row { display: flex; }
.quick-row + .quick-row { margin-top: 2px; }
.quick-item {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 2px; border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text); font-size: 13px; cursor: pointer;
    background: transparent; border: none; font-family: inherit;
    line-height: 1.35; overflow: visible;
}
.quick-item > span:last-child { line-height: 1.35; white-space: nowrap; }
.quick-item:active { background: #f2f4f7; }
.quick-item .qi {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 21px;
    line-height: 1; overflow: hidden; flex-shrink: 0;
}

/* ---------- 搜索栏 ---------- */
.searchbar { display: flex; gap: 8px; padding: 10px 12px; background: var(--card);
    border-bottom: 1px solid var(--border); position: sticky; top: var(--header-h); z-index: 90; }
.searchbar .input { min-height: 40px; font-size: 15px; }

/* ---------- 筛选标签行 ---------- */
.filter-row {
    display: flex; gap: 7px; padding: 9px 12px; overflow-x: auto;
    background: var(--card); border-bottom: 1px solid var(--border);
    scrollbar-width: none; position: sticky; top: var(--header-h); z-index: 90;
}
.filter-row::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0; padding: 6px 13px; border-radius: 16px;
    font-size: 13px; background: #f0f2f5; color: var(--text-2);
    border: none; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 明细行(开单) ---------- */
.item-row {
    display: flex; gap: 10px; padding: 11px 12px;
    border-bottom: 1px solid var(--border); align-items: flex-start;
}
.item-row .thumb {
    width: 44px; height: 44px; border-radius: 7px; object-fit: cover;
    background: #eef0f2; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: var(--text-3);
}
.item-row .body { flex: 1; min-width: 0; }
.item-row .nm { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.item-row .ctl { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.item-row .ctl .input { min-height: 34px; padding: 5px 8px; font-size: 14px; width: 74px; text-align: center; }
.item-row .ctl .price { width: 92px; text-align: right; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.stepper button {
    width: 34px; height: 34px; border: none; background: #f6f7f9;
    font-size: 17px; color: var(--text); cursor: pointer; font-family: inherit;
}
.stepper button:active { background: #e8eaee; }
.stepper input {
    width: 52px; height: 34px; border: none; border-left: 1px solid var(--border);
    border-right: 1px solid var(--border); text-align: center; font-size: 14px;
    font-family: inherit; outline: none;
}

/* ---------- 合计栏 ---------- */
.summary {
    padding: 12px 14px; background: var(--card);
    border-top: 1px solid var(--border);
}
.summary .line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.summary .line .lbl { color: var(--text-2); }
.summary .line.total {
    border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 9px;
    font-size: 17px; font-weight: 700;
}
.summary .line.total .val { color: var(--danger); }

/* 底部固定操作条 */
.actionbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    display: flex; gap: 10px; align-items: center;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: var(--card); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0,0,0,.05);
}
.actionbar .amt { flex: 1; }
.actionbar .amt .k { font-size: 12px; color: var(--text-2); }
.actionbar .amt .v { font-size: 20px; font-weight: 700; color: var(--danger); }
body.has-actionbar { padding-bottom: calc(74px + var(--safe-bottom) + 16px); }

/* ---------- 图片上传 ---------- */
.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.img-cell {
    position: relative; aspect-ratio: 1; border-radius: var(--radius-sm);
    overflow: hidden; background: #eef0f2;
    border: 1px dashed var(--border);
}
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-cell.add {
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 3px;
    color: var(--text-3); font-size: 12px; cursor: pointer;
    border: 1px dashed #c8ccd2; background: #fafbfc;
}
.img-cell.add .plus { font-size: 25px; line-height: 1; }
.img-cell .del {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0,0,0,.6); color: #fff; border: none;
    font-size: 14px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.img-cell .main-flag {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(26,95,180,.88); color: #fff;
    font-size: 10.5px; text-align: center; padding: 2px;
}

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--text-3); }
.empty .ic { font-size: 46px; margin-bottom: 12px; opacity: .35; }
.empty .tip { font-size: 14px; }

/* ---------- 提示条 ---------- */
.toast {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(16px);
    background: rgba(28,28,30,.92); color: #fff; padding: 11px 20px;
    border-radius: 22px; font-size: 14.5px; z-index: 3000;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
    max-width: 84%; text-align: center; line-height: 1.45;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(192,28,40,.95); }
.toast.ok { background: rgba(26,127,55,.95); }

/* ---------- 弹层 ---------- */
.modal-mask {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,.45); display: flex; align-items: flex-end;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
    width: 100%; max-height: 88vh; background: #fff;
    border-radius: 16px 16px 0 0; overflow: hidden;
    display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform .24s ease-out;
}
.modal-mask.show .modal { transform: translateY(0); }
.modal-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 16px; border-bottom: 1px solid var(--border);
    font-size: 16px; font-weight: 600; flex-shrink: 0;
}
.modal-bd { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.modal-ft { padding: 12px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--border);
    display: flex; gap: 10px; flex-shrink: 0; }
.modal-ft .btn { flex: 1; }
.modal.center { border-radius: 14px; max-width: 92%; margin: auto; transform: scale(.94); }
.modal-mask.center-mask { align-items: center; padding: 20px; }
.modal-mask.show .modal.center { transform: scale(1); }

/* ---------- 扫码覆盖层 ---------- */
#scanOverlay {
    position: fixed; inset: 0; z-index: 4000; background: #000;
    display: none; flex-direction: column;
}
#scanOverlay.show { display: flex; }
#scanOverlay video { flex: 1; width: 100%; object-fit: cover; }
/* 识别到的码 → 实时定位框 (叠在摄像头画面上) */
#scanBox {
    display: none; position: fixed; z-index: 4100;
    pointer-events: none; left: 0; top: 0;
}
.scan-frame {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 68%; max-width: 300px; aspect-ratio: 1.35;
    border: 2px solid rgba(255,255,255,.9); border-radius: 12px;
    box-shadow: 0 0 0 2000px rgba(0,0,0,.5);
}
.scan-frame::after {
    content: ''; position: absolute; left: 8%; right: 8%; height: 2px;
    background: #4ade80; box-shadow: 0 0 8px #4ade80;
    animation: scanmove 2s ease-in-out infinite;
}
@keyframes scanmove { 0%,100% { top: 10%; } 50% { top: 88%; } }
.scan-tip {
    position: absolute; bottom: 96px; left: 0; right: 0; text-align: center;
    color: #fff; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,.7);
}
.scan-actions {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 14px 16px calc(18px + var(--safe-bottom));
    display: flex; gap: 12px; justify-content: center;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.scan-actions button {
    min-height: 44px; padding: 0 22px; border-radius: 22px;
    border: none; font-size: 15px; font-family: inherit; font-weight: 600; cursor: pointer;
}
.scan-actions .cancel { background: rgba(255,255,255,.2); color: #fff; }
.scan-actions .manual { background: #fff; color: #1c1c1e; }

/* 连扫模式: 顶部"已扫 N 个"计数器 + 完成按钮 */
.scan-cont {
    position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
    z-index: 4200; display: flex; align-items: center; gap: 12px;
    padding: 7px 8px 7px 16px; border-radius: 22px;
    background: rgba(0,0,0,.62); color: #fff;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.scan-cont #scanContN { font-size: 14px; font-weight: 600; white-space: nowrap; }
.scan-cont .btn { min-height: 34px; padding: 0 16px; border-radius: 17px; font-size: 13.5px; }

/* ---------- 多码候选选择面板 ---------- */
#scanPickWrap {
    position: fixed; inset: 0; z-index: 4500; display: none;
    align-items: flex-end; justify-content: center;
    background: rgba(0, 0, 0, .45);
}
#scanPickWrap.show { display: flex; }
.scan-pick {
    width: 100%; max-width: 540px; background: var(--card);
    border-radius: 16px 16px 0 0;
    padding: 16px 14px calc(16px + var(--safe-bottom));
    animation: pickUp .18s ease-out;
}
@keyframes pickUp { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.scan-pick-hd { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.scan-pick-note { display: block; font-size: 12px; font-weight: 400; color: var(--text-3); margin-top: 4px; }
.scan-pick-list { max-height: 46vh; overflow-y: auto; }
.scan-pick-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 12px 10px; margin-bottom: 8px; text-align: left;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    font-family: inherit; font-size: 15px; color: var(--text); cursor: pointer;
}
.scan-pick-item:active { background: var(--primary-light); border-color: var(--primary); }
.scan-pick-item .sp-tag {
    flex-shrink: 0; padding: 3px 8px; border-radius: 6px;
    background: var(--primary-light); color: var(--primary);
    font-size: 11px; font-weight: 600;
}
.scan-pick-item .sp-tag.ean { background: #e6f4ea; color: #1e7e34; }
.scan-pick-item .sp-tag.gray { background: #eceff1; color: var(--text-3); }
.scan-pick-item .sp-text { flex: 1; word-break: break-all; font-weight: 500; }
.scan-pick-item .sp-sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-3); margin-top: 3px; }
.scan-pick-item .sp-arr { flex-shrink: 0; color: var(--text-3); font-size: 18px; }
.scan-pick-item.promo { opacity: .62; }
.scan-pick-ft { display: flex; gap: 10px; margin-top: 4px; }
.scan-pick-ft .btn { flex: 1; }

/* ---------- 扫条码自动补全提示块 (商品建档) ---------- */
.ai-fill {
    margin-top: 2px; padding: 11px 12px; border-radius: 10px;
    background: #eef7ee; border: 1px solid #cfe8d4;
}
.ai-fill.warn { background: #fff8e6; border-color: #f0e0b0; }
.ai-fill-hd { font-size: 13.5px; font-weight: 600; color: #1e7e34; margin-bottom: 6px; }
.ai-fill.warn .ai-fill-hd { color: #8a6100; }
.ai-fill-tip { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.ai-fill-bd { font-size: 12.5px; color: var(--text-2); line-height: 1.75; word-break: break-all; }
.ai-fill .ai-row { display: flex; gap: 8px; }
.ai-fill .ai-row .k { flex-shrink: 0; width: 64px; color: var(--text-3); }
.ai-fill .ai-row .v { flex: 1; color: var(--text); }
.ai-fill-ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ai-fill-src { font-size: 11.5px; color: var(--text-3); }

/* ---------- 登录页 ---------- */
.login-wrap {
    min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; padding: 28px 24px;
    background: linear-gradient(165deg, #1a5fb4 0%, #14498c 55%, #0d3466 100%);
}
.login-logo { text-align: center; margin-bottom: 34px; color: #fff; }
.login-logo .ic { font-size: 56px; line-height: 1; }
.login-logo h1 { font-size: 23px; font-weight: 700; margin-top: 14px; letter-spacing: 1px; }
.login-logo p { font-size: 13px; opacity: .78; margin-top: 7px; }
.login-card { background: #fff; border-radius: 16px; padding: 24px 20px; box-shadow: 0 10px 34px rgba(0,0,0,.2); }
.login-card .field > label { font-size: 13.5px; }
.login-card .btn { margin-top: 6px; }
.login-foot { text-align: center; color: rgba(255,255,255,.7); font-size: 12px; margin-top: 26px; line-height: 1.7; }

/* ---------- 详情表 ---------- */
.kv { display: flex; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 92px; flex-shrink: 0; color: var(--text-2); }
.kv .v { flex: 1; text-align: right; word-break: break-all; }

/* ---------- 分段控件 ---------- */
.segment {
    display: flex; background: #eef0f2; border-radius: 9px; padding: 3px; gap: 3px;
}
.segment button {
    flex: 1; min-height: 34px; border: none; background: transparent;
    border-radius: 7px; font-size: 14px; font-family: inherit; color: var(--text-2);
    cursor: pointer; transition: all .15s;
}
.segment button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---------- 骨架屏 ---------- */
.skeleton { background: linear-gradient(90deg, #eef0f2 25%, #f6f7f9 50%, #eef0f2 75%);
    background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Tab ---------- */
.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--border);
    overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--header-h); z-index: 90; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
    flex-shrink: 0; padding: 12px 16px; border: none; background: transparent;
    font-size: 14.5px; font-family: inherit; color: var(--text-2); cursor: pointer;
    border-bottom: 2.5px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

/* ---------- 加载更多 ---------- */
.loadmore { text-align: center; padding: 16px; color: var(--text-3); font-size: 13.5px; }

/* ---------- 安全区适配 ---------- */
@supports (padding: env(safe-area-inset-top)) {
    .header { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
}
