/* Arise 外贸系统 · 手机版（H5 / 可添加到主屏幕） */
:root{
  --navy:#122c4a; --blue:#2f80ed; --blue2:#1c6fd8; --red:#e14b3d; --green:#0f9d58;
  --orange:#ef8f2f; --purple:#7a5cd6; --teal:#12a594; --pink:#e8557f;
  --ink:#1b2733; --sub:#79879a; --line:#e9eef5; --bg:#f3f6fa; --white:#fff;
  --sat:env(safe-area-inset-top); --sab:env(safe-area-inset-bottom);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;background:var(--bg);color:var(--ink);font:15px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}
body{overflow-x:hidden}
a{color:var(--blue);text-decoration:none}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer}
.app{max-width:560px;margin:0 auto;min-height:100vh;background:var(--bg);padding-bottom:calc(64px + var(--sab));position:relative}

/* ---------- 顶栏 ---------- */
.topbar{position:sticky;top:0;z-index:30;background:linear-gradient(180deg,#f7f9fc 70%,rgba(247,249,252,0));padding:calc(10px + var(--sat)) 18px 10px;display:flex;align-items:center;gap:12px}
.topbar h1{margin:0;font-size:26px;font-weight:800;letter-spacing:.5px;color:#132a44;flex:1}
.tb-ico{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:20px;color:#22384f}
.tb-ico:active{background:#e8eef7}
.back{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:22px;color:#22384f}
.back:active{background:#e8eef7}

/* ---------- 搜索 ---------- */
.search{padding:0 18px 12px}
.search input{width:100%;height:40px;border-radius:20px;border:0;background:#e9eef6;padding:0 16px;font-size:16px;outline:none;-webkit-appearance:none;appearance:none}
.search input::-webkit-search-cancel-button{-webkit-appearance:none}
.search input::placeholder{color:#8d9aab}

/* ---------- 卡片与分组 ---------- */
.sec{background:var(--white);border-radius:14px;margin:12px 14px;padding:16px 14px;box-shadow:0 1px 3px rgba(18,44,74,.04)}
.sec.plain{background:transparent;box-shadow:none;padding:0;margin:16px 14px}
.sec-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.sec-title b{font-size:16px;font-weight:700;color:#1c2b3a}
.sec-title span{font-size:12px;color:var(--sub)}
.sec-title .more{font-size:12.5px;color:var(--sub);display:flex;align-items:center;gap:2px}
.sec + .sec{margin-top:10px}

/* ---------- 图标网格 ---------- */
.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:18px 8px}
.grid5{display:grid;grid-template-columns:repeat(5,1fr);gap:16px 6px}
.ic-item{display:flex;flex-direction:column;align-items:center;gap:7px;cursor:pointer}
.ic-item:active .ic{transform:scale(.94)}
.ic{width:52px;height:52px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:22px;transition:.12s;box-shadow:0 4px 10px rgba(18,44,74,.10)}
.ic.sm{width:44px;height:44px;font-size:19px}
.ic-item span{font-size:12.5px;color:#33465c;text-align:center;line-height:1.25;white-space:nowrap}
.badge-dot{position:relative}
.badge-dot:after{content:attr(data-n);position:absolute;top:-4px;right:-6px;min-width:16px;height:16px;border-radius:8px;background:#e14b3d;color:#fff;font-size:10px;line-height:16px;text-align:center;padding:0 4px}

/* ---------- 财务速览 ---------- */
.kpi3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 14px}
.kpi{background:#fff;border-radius:12px;padding:12px 10px;text-align:center;box-shadow:0 1px 3px rgba(18,44,74,.04)}
.kpi .l{font-size:11px;color:var(--sub)}
.kpi .v{font-size:17px;font-weight:800;margin-top:4px;letter-spacing:-.3px}
.kpi .v.red{color:var(--red)}.kpi .v.green{color:var(--green)}.kpi .v.blue{color:var(--blue)}
.kpi .f{font-size:10px;color:#9aa8b8;margin-top:2px}

/* ---------- 列表 ---------- */
.list{background:#fff;border-radius:14px;margin:10px 14px;overflow:hidden}
.row{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line);cursor:pointer}
.row:last-child{border-bottom:0}
.row:active{background:#f6f9fd}
.row .r-main{flex:1;min-width:0}
.row .r-t{font-size:14.5px;font-weight:600;color:#1c2b3a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .r-s{font-size:11.5px;color:var(--sub);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .r-v{text-align:right;font-size:14px;font-weight:700;white-space:nowrap}
.row .r-v small{display:block;font-size:10.5px;font-weight:400;color:var(--sub);margin-top:2px}
.row .chev{color:#c3cedb;font-size:17px}
.avatar{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:15px;font-weight:700;flex:0 0 38px}

/* ---------- 标签 ---------- */
.tag{display:inline-block;font-size:10.5px;padding:2px 7px;border-radius:9px;background:#eef3f8;color:#5b6c80;white-space:nowrap;line-height:1.5}
.tag.red{background:#fdecea;color:#c2372b}.tag.green{background:#e6f6ec;color:#0b7a43}
.tag.orange{background:#fff2e2;color:#b25f14}.tag.blue{background:#e9f1ff;color:#2b5fbd}
.tag.purple{background:#f1ecfb;color:#6546b5}.tag.gray{background:#f0f3f7;color:#7b8899}

/* ---------- 分段控件 ---------- */
.seg{display:flex;background:#eaeff7;border-radius:10px;padding:3px;margin:10px 14px}
.seg button{flex:1;height:32px;border-radius:8px;font-size:13px;color:#5b6c80}
.seg button.on{background:#fff;color:#132a44;font-weight:700;box-shadow:0 1px 3px rgba(18,44,74,.10)}

/* ---------- 底部标签栏 ---------- */
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:40;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-top:1px solid var(--line);padding-bottom:var(--sab)}
.tabbar-in{max-width:560px;margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr);height:56px}
.tabbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:#98a5b6;font-size:10.5px}
.tabbar button .ti{font-size:19px;line-height:1.1}
.tabbar button.on{color:var(--blue)}
.tabbar button.on .ti{transform:translateY(-1px)}

/* ---------- 弹层 ---------- */
.sheet-mask[hidden]{display:none!important}
.sheet-mask{position:fixed;inset:0;background:rgba(16,28,44,.42);z-index:60;display:flex;align-items:flex-end}
.sheet{width:100%;max-width:560px;margin:0 auto;background:#fff;border-radius:18px 18px 0 0;max-height:88vh;overflow-y:auto;padding:8px 0 calc(16px + var(--sab));animation:up .22s ease}
@keyframes up{from{transform:translateY(30px);opacity:.6}to{transform:none;opacity:1}}
.sheet-h{display:flex;align-items:center;padding:12px 18px 6px}
.sheet-h b{flex:1;font-size:17px}
.sheet-h button{font-size:14px;color:var(--sub)}
.sheet-b{padding:6px 18px}
.field{display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}
.field:last-child{border-bottom:0}
.field label{width:92px;font-size:13px;color:var(--sub);flex:0 0 92px}
.field input,.field select,.field textarea{flex:1;border:0;background:#f5f8fc;border-radius:8px;padding:9px 11px;font-size:16px;outline:none;min-width:0;-webkit-appearance:none;appearance:none}
.field input:focus,.field select:focus{border:1px solid #b9d2f5;background:#fff}
.btn{display:flex;align-items:center;justify-content:center;height:44px;border-radius:11px;background:#eef3f9;color:#22384f;font-size:15px;font-weight:600;width:100%}
.btn.primary{background:var(--navy);color:#fff}
.btn.blue{background:var(--blue);color:#fff}
.btn.danger{background:#fdecea;color:#c2372b}
.btn.sm{height:34px;font-size:13px;border-radius:9px;width:auto;padding:0 14px}
.btn-row{display:flex;gap:10px;margin-top:14px}

/* ---------- 详情 ---------- */
.detail-hero{background:linear-gradient(125deg,#122c4a,#1f4f80);color:#fff;border-radius:0 0 18px 18px;padding:18px 18px 22px;margin:-10px -14px 12px}
.detail-hero .no{font-size:12px;color:#a8c2dc;letter-spacing:.4px}
.detail-hero .big{font-size:26px;font-weight:800;margin-top:6px}
.detail-hero .meta{font-size:12px;color:#b9cee3;margin-top:4px}
.amount-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}
.amount-grid div{background:#f6f9fd;border-radius:10px;padding:10px}
.amount-grid .k{font-size:11px;color:var(--sub)}
.amount-grid .v{font-size:15px;font-weight:700;margin-top:3px}
.divider{height:1px;background:var(--line);margin:12px 0}

/* ---------- 登录 ---------- */
.login{min-height:100vh;display:flex;flex-direction:column;justify-content:center;padding:32px 26px;max-width:520px;margin:0 auto}
.login .logo{width:74px;height:74px;border-radius:18px;margin:0 auto 18px;box-shadow:0 10px 26px rgba(18,44,74,.18);display:block}
.login h2{text-align:center;margin:0;font-size:22px;letter-spacing:.5px}
.login p{text-align:center;color:var(--sub);font-size:12.5px;margin:8px 0 26px;line-height:1.8}
.login .lfield{background:#fff;border-radius:12px;padding:4px 14px;margin-bottom:12px;display:flex;align-items:center;gap:10px;border:1px solid var(--line)}
.login .lfield input{flex:1;height:48px;border:0;outline:none;font-size:16px;background:transparent;min-width:0}
.login .tip{font-size:11.5px;color:#93a1b2;text-align:center;margin-top:14px;line-height:1.8}

/* ---------- 空状态 / 提示 ---------- */
.empty{padding:36px 12px;text-align:center;color:#9aa8b8;font-size:13px}
.mtoast{position:fixed;left:50%;bottom:calc(84px + var(--sab));transform:translate(-50%,10px);background:rgba(22,34,50,.92);color:#fff;font-size:13px;padding:9px 16px;border-radius:20px;opacity:0;pointer-events:none;transition:.2s;z-index:80;max-width:80%;text-align:center}
.mtoast.show{opacity:1;transform:translate(-50%,0)}
.mtoast.err{background:rgba(190,50,40,.94)}
.hint{font-size:11.5px;color:var(--sub);line-height:1.7}
.money-big{font-variant-numeric:tabular-nums}
.sync{font-size:10.5px;color:#93a1b2;text-align:center;padding:6px 0 0}
.pill{display:inline-flex;align-items:center;gap:4px;font-size:11px;background:#eef5ff;color:#2b5fbd;border-radius:20px;padding:3px 9px}
.risk-card{background:#fff;border-radius:12px;padding:12px 14px;margin:8px 14px;box-shadow:0 1px 3px rgba(18,44,74,.04)}
.risk-card .rt{font-size:14px;font-weight:600}
.risk-card .rd{font-size:11.5px;color:var(--sub);margin-top:3px}
.risk-card .ra{float:right;font-size:14px;font-weight:700;color:var(--red)}
.tabline{display:flex;gap:8px;overflow-x:auto;padding:8px 14px 2px;-webkit-overflow-scrolling:touch}
.tabline::-webkit-scrollbar{display:none}
.tabline button{flex:0 0 auto;height:30px;padding:0 13px;border-radius:15px;background:#fff;color:#5b6c80;font-size:12.5px;border:1px solid var(--line)}
.tabline button.on{background:var(--navy);color:#fff;border-color:var(--navy)}

/* ===== 列表新建按钮 & 明细行 ===== */
.addbar{padding:0 14px 10px}
.addbar .btn{width:100%}
.irow{display:grid;grid-template-columns:1fr 78px 78px;gap:6px;margin-bottom:6px}
.irow input{width:100%;border:1px solid var(--line);border-radius:8px;padding:9px 10px;font-size:16px;background:#f7f9fc;color:var(--ink)}

/* 车队台账：拖入导入 */
.dropzone{border:1.5px dashed #b9c9db;border-radius:12px;background:#f7fafd;padding:22px 14px;text-align:center;color:#5b6b7c;font-size:14px;line-height:1.5;transition:border-color .15s,background .15s}
.dropzone.over{border-color:#2f80ed;background:#eef4fe;color:#2f80ed}
.dropzone .dz-s{font-size:11.5px;color:#9aa8b8;margin-top:6px}

/* 粘贴识别：多行文本框 */
.sheet-b .field textarea{width:100%;min-height:160px;resize:vertical;line-height:1.55;border:0;background:#f5f8fc;border-radius:10px;padding:11px 12px;font-size:16px;outline:none}
