* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:"PingFang SC","Microsoft YaHei",sans-serif; background:#f4f5f7; color:#1c2128; font-size:14px; }
.hidden { display:none !important; }
button { font-family:inherit; cursor:pointer; border:none; outline:none; }
input,select,textarea { font-family:inherit; font-size:14px; }

/* 登录 */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:#1c2128; }
.login-box { background:#fff; border-radius:14px; padding:42px 40px; width:330px; text-align:center; }
.login-logo { font-size:24px; font-weight:700; letter-spacing:2px; }
.login-sub { font-size:13px; color:#8a919e; margin:6px 0 26px; letter-spacing:3px; }
.login-box input { width:100%; padding:11px 14px; margin-bottom:12px; border:1px solid #e0e3e7; border-radius:8px; }
.login-box input:focus { border-color:#2d6a45; }
.login-err { color:#b4472e; font-size:13px; min-height:20px; margin-top:8px; }
.login-tip { font-size:11px; color:#a8aeba; margin-top:14px; }

/* 顶栏 */
.topbar { background:#1c2128; color:#fff; padding:0 22px; height:56px; display:flex; align-items:center; gap:22px; position:sticky; top:0; z-index:50; }
.brand { font-size:16px; font-weight:700; white-space:nowrap; }
.brand i { font-style:normal; font-size:11px; color:#8a919e; margin-left:8px; font-weight:400; }
.nav { display:flex; gap:2px; flex:1; flex-wrap:wrap; }
.nav button { background:transparent; color:#b9c0ca; padding:8px 16px; border-radius:8px; font-size:14px; }
.nav button:hover { color:#fff; background:rgba(255,255,255,.08); }
.nav button.on { background:#fff; color:#1c2128; font-weight:600; }
.user { display:flex; align-items:center; gap:10px; font-size:13px; color:#b9c0ca; white-space:nowrap; }
.badge { background:#2d6a45; color:#fff; font-size:11px; padding:2px 9px; border-radius:10px; }
.badge.staff { background:#5c6470; }

/* 按钮 */
.btn-primary { background:#2d6a45; color:#fff; padding:9px 22px; border-radius:8px; font-size:14px; font-weight:600; width:100%; }
.btn-primary:hover { background:#255a3a; }
.btn-ghost { background:transparent; color:#b9c0ca; border:1px solid #4a525d; padding:7px 16px; border-radius:8px; font-size:13px; }
.btn-ghost:hover { border-color:#8a919e; color:#fff; }
.btn-sm { background:#2d6a45; color:#fff; padding:5px 12px; border-radius:6px; font-size:12px; }
.btn-sm:hover { background:#255a3a; }
.btn-line { background:#fff; color:#3c434d; border:1px solid #d8dce1; padding:5px 12px; border-radius:6px; font-size:12px; }
.btn-line:hover { border-color:#2d6a45; color:#2d6a45; }
.btn-line.danger:hover { border-color:#b4472e; color:#b4472e; }
.btn-line.ok { border-color:#2d6a45; color:#2d6a45; font-weight:600; }
.btn-line.ok:hover { background:#2d6a45; color:#fff; }

/* 注册入口 */
.login-link { font-size:12.5px; color:#8a919e; }
.login-link a { color:#2d6a45; text-decoration:none; font-weight:600; }
.login-link a:hover { text-decoration:underline; }

/* 键值网格 / 说明列表 */
.kv-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:14px; }
.kv-grid > div { background:#f7f8fa; border-radius:9px; padding:13px 15px; display:flex; flex-direction:column; gap:5px; }
.kv-grid span { font-size:12px; color:#8a919e; }
.kv-grid b { font-size:19px; font-weight:700; }
.tips { margin-left:18px; font-size:13px; color:#3c434d; line-height:2; }

/* 主区 */
main { max-width:1180px; margin:0 auto; padding:24px 20px 60px; }
.page-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; flex-wrap:wrap; gap:12px; }
.page-head h2 { font-size:19px; }
.page-head .sub { font-size:12.5px; color:#8a919e; margin-top:3px; }
.card { background:#fff; border-radius:12px; padding:20px 22px; margin-bottom:18px; }
.card h3 { font-size:15px; margin-bottom:14px; display:flex; align-items:center; gap:8px; }
.card h3::before { content:''; width:3px; height:14px; background:#2d6a45; border-radius:2px; }
.muted { color:#8a919e; font-size:12.5px; }

/* 指标卡 */
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:18px; }
.kpi { background:#fff; border-radius:12px; padding:16px 18px; }
.kpi .t { font-size:12px; color:#8a919e; }
.kpi .v { font-size:22px; font-weight:700; margin-top:6px; letter-spacing:-.5px; }
.kpi .s { font-size:11.5px; color:#a8aeba; margin-top:4px; }
.kpi.g .v { color:#2d6a45; }
.kpi.a .v { color:#9a6b1a; }
.kpi.r .v { color:#b4472e; }

/* 表 */
table { width:100%; border-collapse:collapse; font-size:13px; }
th { background:#f7f8fa; text-align:left; padding:9px 10px; font-size:12px; color:#5c6470; font-weight:600; white-space:nowrap; position:sticky; top:0; }
td { padding:9px 10px; border-bottom:1px solid #f0f1f3; }
tr:hover td { background:#fafbfc; }
.num { text-align:right; font-variant-numeric:tabular-nums; }
.tag { display:inline-block; font-size:11px; padding:1px 8px; border-radius:9px; }
.tag.ok { background:#e5f1e9; color:#2d6a45; }
.tag.warn { background:#fbf5e6; color:#9a6b1a; }
.tag.bad { background:#fde8e0; color:#b4472e; }
.tag.gray { background:#eef0f3; color:#5c6470; }
.table-wrap { overflow-x:auto; }
.empty { text-align:center; color:#a8aeba; padding:34px 0; font-size:13px; }

/* 表单 */
.form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:14px; }
.fld { display:flex; flex-direction:column; gap:5px; }
.fld label { font-size:12.5px; color:#5c6470; }
.fld input,.fld select,.fld textarea { padding:9px 11px; border:1px solid #e0e3e7; border-radius:8px; width:100%; }
.fld input:focus,.fld select:focus,.fld textarea:focus { border-color:#2d6a45; outline:none; }
.fld.full { grid-column:1/-1; }
.fld textarea { resize:vertical; min-height:56px; }
.hint { font-size:11.5px; color:#a8aeba; }
.divider { grid-column:1/-1; border-top:1px dashed #e3e6ea; margin:4px 0; }
.admin-only { background:#fbf8f0; border-left:3px solid #c98a2e; padding-left:10px; margin-left:-10px; }

/* 筛选 */
.filters { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.filters input,.filters select { padding:8px 11px; border:1px solid #e0e3e7; border-radius:8px; }
.filters input { min-width:190px; }

/* 弹层 */
.modal { position:fixed; inset:0; background:rgba(20,24,30,.45); display:flex; align-items:center; justify-content:center; z-index:100; padding:20px; }
.modal-box { background:#fff; border-radius:14px; width:100%; max-width:760px; max-height:88vh; display:flex; flex-direction:column; }
.modal-head { padding:16px 22px; border-bottom:1px solid #f0f1f3; display:flex; justify-content:space-between; align-items:center; font-weight:700; }
.btn-x { background:none; font-size:24px; color:#8a919e; line-height:1; }
.modal-body { padding:20px 22px; overflow-y:auto; }
.modal-foot { padding:14px 22px; border-top:1px solid #f0f1f3; display:flex; justify-content:flex-end; gap:10px; }
.modal-foot .btn-primary { width:auto; }
.modal-foot .btn-ghost { color:#5c6470; border-color:#d8dce1; }

/* 提示 */
.toast { position:fixed; bottom:28px; left:50%; transform:translateX(-50%); background:#1c2128; color:#fff; padding:11px 24px; border-radius:10px; font-size:13.5px; z-index:200; }

/* 条形图 */
.bar-row { display:flex; align-items:center; gap:12px; margin-bottom:9px; font-size:12.5px; }
.bar-row .lb { width:78px; flex-shrink:0; color:#3c434d; }
.bar-track { flex:1; background:#f0f1f3; border-radius:5px; height:20px; position:relative; overflow:hidden; }
.bar-fill { height:100%; border-radius:5px; background:#2d6a45; }
.bar-note { width:190px; flex-shrink:0; color:#8a919e; text-align:right; }

/* 打印 */
.print-area { display:none; }
@media print {
  body { background:#fff; }
  .topbar,.nav,.no-print,.filters { display:none !important; }
  .print-area { display:block; }
  .print-doc { padding:0; }
  .print-doc h1 { font-size:20px; text-align:center; margin-bottom:4px; }
  .print-doc .p-sub { text-align:center; color:#666; font-size:12px; margin-bottom:16px; }
  .print-doc table { width:100%; border-collapse:collapse; font-size:13px; }
  .print-doc td { border:1px solid #333; padding:8px 10px; }
  .print-doc td.lb { background:#f4f4f4; width:88px; font-weight:600; }
  .print-doc .p-foot { margin-top:26px; display:flex; justify-content:space-between; font-size:12px; color:#555; }
}

/* ===== 移动端：现场用手机开单 ===== */
@media (max-width: 720px) {
  .topbar { height:auto; padding:8px 12px; flex-wrap:wrap; gap:8px; }
  .brand { font-size:14px; width:100%; }
  .brand i { font-size:10px; }
  /* 菜单横向滚动，不换行占位；隐藏滚动条 */
  .nav { width:100%; flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .nav::-webkit-scrollbar { display:none; }
  .nav button { padding:8px 13px; font-size:13px; white-space:nowrap; }
  .user { margin-left:auto; font-size:12px; gap:8px; }
  .user #who { max-width:90px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

  main { padding:16px 12px 80px; }
  .page-head { margin-bottom:14px; }
  .page-head h2 { font-size:17px; }
  .card { padding:16px 14px; border-radius:10px; margin-bottom:14px; }
  .card h3 { font-size:14px; margin-bottom:12px; }

  /* iOS 上字号小于 16px 会触发自动缩放，输入框统一 16px */
  .fld input, .fld select, .fld textarea { font-size:16px; padding:11px 12px; }
  .filters input, .filters select { font-size:16px; }
  .filters input { min-width:0; flex:1; }
  .form-grid { grid-template-columns:1fr; gap:12px; }

  /* 触摸友好：按钮加大点击区 */
  .btn-line { padding:8px 14px; font-size:13px; }
  .btn-primary { padding:12px 22px; }
  .btn-ghost { padding:8px 14px; }

  /* 开单页主按钮全宽 */
  #btnSubmit { width:100%; }

  table { font-size:12.5px; }
  th { padding:8px 8px; }
  td { padding:8px 8px; }
  .bar-note { width:auto; flex:0 0 auto; }
  .bar-row { gap:8px; flex-wrap:wrap; }

  .kpis { grid-template-columns:repeat(2,1fr); gap:10px; }
  .kpi { padding:13px 14px; }
  .kpi .v { font-size:19px; }

  .kv-grid { grid-template-columns:repeat(2,1fr); gap:10px; }
  .kv-grid b { font-size:16px; }

  .modal { padding:10px; }
  .modal-box { max-height:94vh; border-radius:12px; }
  .modal-head { padding:13px 14px; }
  .modal-body { padding:14px; }
  .modal-foot { padding:11px 14px; }
  .modal-foot .btn-primary, .modal-foot .btn-ghost { padding:11px 20px; }

  .login-box { width:calc(100% - 28px); padding:30px 20px; }
  .login-box input { font-size:16px; }
  .login-logo { font-size:21px; }

  .toast { left:12px; right:12px; transform:none; text-align:center; }
}
