:root{
  --red:#c0202a; --red-d:#9a1820; --gold:#d4af37;
  --bg:#f4f5f7; --card:#fff; --text:#222; --muted:#8a8f99; --line:#ececf0;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
[hidden]{display:none !important}
body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--bg);color:var(--text);font-size:15px;line-height:1.5}
#app{max-width:980px;margin:0 auto;min-height:100vh;background:var(--bg);position:relative;
  display:flex;flex-direction:column}
button{font-family:inherit;cursor:pointer;border:none;outline:none}
input,select,textarea{font-family:inherit;font-size:15px;padding:11px 12px;border:1px solid var(--line);
  border-radius:9px;width:100%;background:#fff;color:var(--text)}
input:focus,select:focus,textarea:focus{border-color:var(--red)}
.btn{background:var(--red);color:#fff;padding:11px 16px;border-radius:9px;font-weight:600;
  display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn:active{transform:scale(.98)}
.btn.ghost{background:#fff;color:var(--red);border:1px solid var(--red)}
.btn.sm{padding:7px 11px;font-size:13px;border-radius:7px}
.btn.block{width:100%}
.btn.danger{background:#fff;color:#e23;border:1px solid #f3c2c2}
.muted{color:var(--muted)}
.card{background:var(--card);border-radius:14px;padding:16px;margin:12px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.row{display:flex;align-items:center;gap:10px}
.between{justify-content:space-between}
.wrap{flex-wrap:wrap}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.section-title{font-size:13px;color:var(--muted);margin:4px 0 8px;font-weight:600}

/* 九宫格功能导航 */
.menu-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);
  border-radius:12px;overflow:hidden;margin-top:2px}
.menu-grid .tile{background:#fff;padding:18px 6px;display:flex;flex-direction:column;
  align-items:center;gap:8px;transition:.15s}
.menu-grid .tile:active{background:#fff5f5}
.menu-grid .tile .ic{height:40px;display:flex;align-items:center;justify-content:center;color:var(--red)}
.menu-grid .tile .ic svg{width:32px;height:32px}
.menu-grid .tile .lb{font-size:13px;color:#333;font-weight:500}

/* 登录 */
#loginView{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;
  background:linear-gradient(160deg,var(--red),var(--red-d))}
.login-box{background:#fff;border-radius:18px;padding:26px 22px;width:100%;max-width:360px;box-shadow:0 10px 40px rgba(0,0,0,.2)}
.login-logo{text-align:center;margin-bottom:18px}
.login-logo .mark{width:64px;height:64px;border-radius:16px;background:var(--red);color:#fff;
  display:inline-flex;align-items:center;justify-content:center;font-size:30px;font-weight:800;margin-bottom:8px}
.login-logo h1{font-size:22px;color:var(--red)}
.login-logo p{font-size:13px;color:var(--muted);margin-top:2px}
.fld{margin-bottom:12px}
.fld label{display:block;font-size:13px;color:#555;margin-bottom:5px}
.login-tip{font-size:12px;color:var(--muted);text-align:center;margin-top:14px}

/* 主框架 */
#mainView{flex:1;display:flex;flex-direction:column;min-height:100vh}
.topbar{background:var(--red);color:#fff;padding:13px 16px;display:flex;align-items:center;
  justify-content:space-between;position:sticky;top:0;z-index:10}
.topbar .title{font-weight:700;font-size:17px;display:flex;align-items:center;gap:8px}
.topbar .title .dot{width:26px;height:26px;border-radius:7px;background:rgba(255,255,255,.22);
  display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:14px}
.topbar .who{font-size:12px;opacity:.9}
.content{flex:1;padding-bottom:16px}
.page-head{display:flex;align-items:center;justify-content:space-between;margin:14px 16px 4px}
.page-head h2{font-size:18px}

/* 底部 tab 已移除：功能导航改为首页九宫格（见 .menu-grid） */

/* 列表与表格 */
.list{margin:0 12px}
.item{background:#fff;border-radius:12px;padding:13px 14px;margin-bottom:10px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.item .main{font-weight:600}
.item .sub{font-size:12px;color:var(--muted);margin-top:3px}
.item .act{display:flex;gap:6px;flex-shrink:0}
.tag{display:inline-block;background:#fdeaea;color:var(--red);font-size:11px;padding:2px 7px;border-radius:6px;margin-left:6px}
.tag.g{background:#eafaf0;color:#1a9e4b}
.table{width:100%;border-collapse:collapse;font-size:13px}
.table th,.table td{padding:9px 8px;text-align:left;border-bottom:1px solid var(--line)}
.table th{color:var(--muted);font-weight:600;background:#fafafa}
.stat{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.stat .box{background:#fff;border-radius:12px;padding:14px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.stat .num{font-size:21px;font-weight:800;color:var(--red)}
.stat .qty{font-size:12.5px;color:var(--ink);margin-top:5px;font-weight:600}
.stat .lab{font-size:12px;color:var(--muted);margin-top:2px}
.empty{text-align:center;color:var(--muted);padding:40px 0;font-size:14px}
.search{margin:6px 16px 0}
.modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:50;display:none;align-items:flex-end;justify-content:center}
.modal-mask.show{display:flex}
.modal{background:#fff;width:100%;max-width:980px;border-radius:16px 16px 0 0;padding:18px 16px 24px;
  max-height:88vh;overflow:auto}
.modal h3{margin-bottom:14px;font-size:17px}
.form-row{margin-bottom:12px}
.form-row label{display:block;font-size:13px;color:#555;margin-bottom:5px}
@media(min-width:768px){
  .modal-mask{align-items:center}
  .modal{border-radius:16px}
  .grid2{grid-template-columns:1fr 1fr}
}
.toast{position:fixed;left:50%;top:18%;transform:translateX(-50%);background:rgba(0,0,0,.82);
  color:#fff;padding:10px 18px;border-radius:10px;font-size:14px;z-index:99;opacity:0;transition:.25s;pointer-events:none}
.toast.show{opacity:1}
