:root{
  --green:#0ea36e; --blue:#2e7cf6; --red:#e64545; --yellow:#f59e0b;
  --yellow-bg:#fdf3e3; --gray:#999; --text:#333333; --line:#eee; --bg:#f5f6f7;
}
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
[hidden]{display:none !important;}
body{font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text);font-size:14px;line-height:1.55;}
.topbar{height:44px;background:var(--green);color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:600;position:sticky;top:0;z-index:10;}
.ctx{padding:10px 14px;color:var(--gray);font-size:12px;}
.wrap{padding:0 14px 28px;}
.card{background:#fff;border-radius:12px;padding:16px;margin-bottom:14px;box-shadow:0 1px 3px rgba(0,0,0,.06);}
.card h3{font-size:15px;margin-bottom:12px;}
.btn{display:block;width:100%;height:48px;border:none;border-radius:10px;background:var(--green);color:#fff;font-size:16px;font-weight:600;}
.btn.ghost{background:#fff;color:var(--green);border:1px solid var(--green);}
.btn.sm{height:38px;font-size:13px;width:auto;padding:0 16px;display:inline-block;}
.field{margin-bottom:12px;}
.field label{display:block;font-size:12px;color:var(--gray);margin-bottom:6px;}
.field input,.field select,.field textarea{width:100%;height:42px;border:1px solid var(--line);border-radius:10px;padding:0 12px;font-size:14px;background:#fff;}
.field textarea{height:64px;padding:10px 12px;}
.field select:disabled,.field input:disabled{background:#f2f3f5;color:#b6bcc4;}
.field-tip{font-size:12px;color:var(--gray);margin-top:6px;}
/* 录单头部紧凑一行：日期 / 分类 / 供应商 */
.head-row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin-bottom:10px;}
.head-row .field{margin-bottom:0;}
.head-row label{margin-bottom:4px;}
.head-row select,.head-row input{height:36px;font-size:13px;padding:0 10px;width:100%;min-width:0;}
.link-btn{border:none;background:none;color:var(--green);font-size:12px;cursor:pointer;padding:0;margin-left:6px;}
.back-link{display:inline-block;margin:4px 0 12px;color:var(--green);font-size:13px;text-decoration:none;}
.req{color:#e64545;}
.check-line{display:flex;align-items:center;gap:8px;font-size:13px;margin-top:6px;}
.check-line input{width:16px;height:16px;}
@media (max-width:480px){.head-row{grid-template-columns:1fr 1fr;}}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
table{width:100%;border-collapse:collapse;font-size:13px;}
th,td{padding:10px 8px;text-align:center;border-bottom:1px solid var(--line);}
th{color:var(--gray);font-weight:500;font-size:12px;}
td.l{text-align:left;}
.tag{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;}
.tag.high{background:#fdecec;color:var(--red);}
.tag.mid{background:var(--yellow-bg);color:var(--yellow);}
.tag.low{background:#e8f6f0;color:var(--green);}
.kv{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px;}
.kv:last-child{border-bottom:none;}
.kv .k{color:var(--gray);}
.kv .v{font-weight:600;}
.nav{display:flex;gap:8px;padding:10px 14px;background:#fff;border-bottom:1px solid var(--line);overflow-x:auto;}
.nav a{flex:1 0 auto;text-align:center;padding:8px 0;border-radius:8px;font-size:13px;color:var(--gray);text-decoration:none;white-space:nowrap;}
.nav a.on{background:#e8f6f0;color:var(--green);font-weight:600;}
.empty{padding:30px 0;text-align:center;color:var(--gray);font-size:13px;}
/* 明细行 */
.row-line{display:flex;gap:8px;align-items:center;margin-bottom:10px;flex-wrap:wrap;}
.row-line select,.row-line input{height:40px;border:1px solid var(--line);border-radius:10px;padding:0 10px;font-size:14px;background:#fff;}
.row-line .r-dish{flex:1 1 40%;}
.row-line .r-name{flex:1 1 40%;}
.row-line .r-qty{flex:1 1 22%;}
.row-line .r-price{flex:1 1 22%;}
.row-line .r-amt{flex:0 0 56px;text-align:right;font-weight:600;font-size:13px;}
.row-line a{flex:0 0 30px;text-align:center;font-size:13px;}
/* 附件 */
.photo-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px;}
.photo-row .ph{position:relative;width:72px;height:72px;}
.photo-row .ph img,.ph-img{width:72px;height:72px;object-fit:cover;border-radius:8px;}
.photo-row .ph a{position:absolute;top:-6px;right:-6px;background:#fff;border-radius:999px;color:#e64545;font-size:11px;padding:0 5px;box-shadow:0 1px 3px rgba(0,0,0,.2);}
/* 弹窗 */
.mask{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:50;display:flex;align-items:center;justify-content:center;padding:20px;}
.mask-box{background:#fff;border-radius:14px;width:100%;max-width:420px;max-height:80vh;overflow:auto;padding:16px;}
.mask-head{font-size:15px;margin-bottom:12px;}
/* 工作台 */
.wb-hello{padding:18px 14px 6px;}
.wb-hello h2{font-size:18px;font-weight:600;}
.wb-hello p{color:var(--gray);font-size:13px;margin-top:4px;}
.wb-group{padding:14px 14px 4px;}
.wb-group-title{font-size:13px;color:var(--gray);margin-bottom:10px;}
.wb-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;}
@media (min-width:768px){.wb-grid{grid-template-columns:repeat(4,1fr);}}
.wb-card{display:flex;flex-direction:column;align-items:center;gap:8px;background:#fff;border-radius:14px;padding:18px 10px;text-decoration:none;box-shadow:0 1px 3px rgba(0,0,0,.06);}
.wb-card:active{background:#f2f3f5;}
.wb-card.soon{opacity:.6;}
.wb-icon{width:52px;height:52px;border-radius:16px;display:flex;align-items:center;justify-content:center;}
.wb-icon svg{width:28px;height:28px;}
.wb-label{font-size:15px;font-weight:600;color:var(--text);}
.wb-desc{font-size:12px;color:var(--gray);text-align:center;}
.wb-toast{position:fixed;left:50%;bottom:64px;transform:translateX(-50%);background:rgba(0,0,0,.78);color:#fff;font-size:13px;padding:10px 16px;border-radius:10px;opacity:0;pointer-events:none;transition:opacity .2s;z-index:80;}
.wb-toast.show{opacity:1;}
/* 供应商卡片（复刻南隆供应商中心版式） */
.sup-card{background:#fff;border-radius:14px;padding:14px 16px;margin-bottom:12px;box-shadow:0 1px 3px rgba(0,0,0,.06);}
.sup-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;}
.sup-name{font-size:15px;font-weight:600;}
.sup-tags{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:6px;}
.sup-tag{display:inline-block;background:#f2f6f5;color:var(--gray);font-size:12px;padding:3px 10px;border-radius:999px;}
.sup-note{font-size:13px;color:var(--gray);margin-bottom:8px;}
.sup-actions{display:flex;justify-content:flex-end;gap:14px;padding-top:6px;border-top:1px solid var(--line);}
.sup-del{color:var(--red);font-size:13px;text-decoration:none;}
/* WPS 风格电子表格 */
.sheet{width:100%;border-collapse:collapse;font-size:13px;background:#fff;table-layout:fixed;}
.sheet th{background:#f5f6f7;color:var(--gray);font-weight:500;font-size:12px;border:1px solid #e3e5e8;padding:8px 6px;}
.sheet td{border:1px solid #e3e5e8;padding:5px 6px;vertical-align:middle;}
.sheet td input{width:100%;height:34px;border:none;background:transparent;padding:0 4px;font-size:13px;min-width:0;}
.sheet td input:focus{outline:1px solid var(--green);border-radius:6px;background:#fff;}
.sheet .p-amt{text-align:right;font-weight:600;}
.sheet-total{display:flex;justify-content:flex-end;align-items:center;padding:10px 2px;font-size:14px;}
.sheet-total b{color:var(--green);font-size:16px;margin-left:6px;}

/* 单据图片上传 */
.upload-row{display:flex;gap:14px;margin-top:12px;}
.upload-cell{flex:1;}
.upload-cell>label{font-size:13px;color:#555;}
.upload-box{width:100%;height:84px;border:1px dashed #d9dee5;border-radius:10px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fafbfc;margin-top:6px;}
.upload-box img{width:100%;height:100%;object-fit:cover;}
.upload-ph{color:#aab1bb;font-size:12px;}
.upload-actions{margin-top:6px;display:flex;gap:12px;}
.detail-img{width:90px;height:90px;border-radius:10px;object-fit:cover;cursor:pointer;border:1px solid #eee;}
/* 报账明细表格（智能表格网格） */
.sheet-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;}
.entry-sheet{min-width:520px;}
.entry-sheet td input{width:100%;height:36px;border:none;background:transparent;padding:0 6px;font-size:14px;min-width:0;}
.entry-sheet td input:focus{outline:1px solid var(--green);border-radius:6px;background:#fff;}
.entry-sheet .p-amt{text-align:right;font-weight:600;}
.entry-sheet .p-del{color:var(--red);font-size:13px;text-decoration:none;}

/* 成本分析：收支表 + 毛利拆解 */
.card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;}
.card-head h3{margin-bottom:0;}
.sub-title{font-size:13px;color:var(--gray);margin:14px 0 8px;}
.sum-row{display:flex;justify-content:space-between;padding:10px 0;border-top:1px solid var(--line);font-size:14px;}
.sum-row b{font-size:15px;}
.balance-row{display:flex;justify-content:space-between;padding:12px 14px;background:#f5f6f7;border-radius:10px;margin-top:10px;font-size:15px;}
.flow-table th,.flow-table td{text-align:right;}
.flow-table td.l{text-align:left;}
.flow-pos{color:var(--green);}
.flow-neg{color:var(--red);}
.flow-net-pos{font-weight:700;color:var(--green);}
.flow-net-neg{font-weight:700;color:var(--red);}
.breakeven{margin-top:14px;border-top:1px solid var(--line);padding-top:12px;}
.be-row{display:flex;justify-content:space-between;padding:8px 0;font-size:14px;}
.be-row b{font-size:15px;}
.be-total{background:#f5f6f7;border-radius:10px;padding:12px 14px;margin-top:6px;}
.be-total b{font-weight:700;color:var(--green);}
.auto-tag{display:inline-block;margin-left:8px;font-size:11px;color:var(--blue);background:#eef4ff;border-radius:6px;padding:1px 7px;}
