/* ===== 进销存系统样式表（浅色主题） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #f0f3f7; color: #2b3a4a; font-size: 14px;
}
a { color: #2f7ce0; text-decoration: none; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 176px; background: #22364f; color: #cfdbe8; flex-shrink: 0;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto;
}
.side .logo { padding: 16px 14px; font-size: 16px; font-weight: bold; color: #fff; letter-spacing: 1px; border-bottom: 1px solid #2e435c; }
.side .logo small { display: block; font-size: 11px; font-weight: normal; color: #8ba3bd; margin-top: 4px; letter-spacing: 0; }
.side .grp { padding: 12px 14px 4px; font-size: 11px; color: #7a90a8; }
.side a.menu {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #cfdbe8; font-size: 14px;
}
.side a.menu:hover { background: #2b4563; color: #fff; }
.side a.menu.on { background: #2f7ce0; color: #fff; font-weight: bold; }
.side .side-foot { margin-top: auto; padding: 12px 14px; font-size: 12px; color: #7a90a8; border-top: 1px solid #2e435c; }

.main { flex: 1; margin-left: 176px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 50px; background: #fff; border-bottom: 1px solid #e3e9f0; display: flex; align-items: center;
  padding: 0 16px; gap: 12px; position: sticky; top: 0; z-index: 20;
}
.topbar .burger { display: none; font-size: 20px; cursor: pointer; color: #5b6b7a; }
.topbar h2 { font-size: 16px; font-weight: bold; }
.topbar .who { margin-left: auto; font-size: 13px; color: #68788c; display: flex; align-items: center; gap: 14px; }
.content { padding: 14px; }

/* ---------- 多任务标签栏 ---------- */
.taskbar {
  display: flex; align-items: flex-end; gap: 4px; padding: 8px 16px 0;
  background: #f2f5f9; border-bottom: 1px solid #e3e9f0;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none; min-height: 38px;
}
.taskbar::-webkit-scrollbar { display: none; }
.taskbar .tb {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid #e0e7ef; border-bottom: none; border-radius: 8px 8px 0 0;
  background: #e8eef5; color: #4a5a6c; font-size: 13px; cursor: pointer; max-width: 168px; flex: 0 0 auto;
}
.taskbar .tb:hover { background: #f0f5fa; }
.taskbar .tb.on { background: #fff; color: #2f7ce0; font-weight: bold; border-color: #d3dde8; }
.taskbar .tb .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskbar .tb .x { color: #9aa9b8; font-size: 12px; line-height: 1; padding: 2px 3px; border-radius: 4px; font-weight: normal; }
.taskbar .tb .x:hover { color: #d6333f; background: #fdeaea; }
.taskbar .tbadd { position: relative; flex: 0 0 auto; }
.taskbar .tbadd > button {
  border: 1px dashed #b9c8d8; background: none; color: #5b87c0; font-size: 15px;
  border-radius: 8px 8px 0 0; padding: 6px 11px 5px; cursor: pointer;
}
.taskbar .tbadd > button:hover { background: #eaf2fb; }
.taskbar .addmenu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 90;
  background: #fff; border: 1px solid #cdd9e5; border-radius: 10px; box-shadow: 0 10px 28px rgba(20,50,90,.16);
  min-width: 168px; padding: 5px; max-height: 320px; overflow-y: auto; white-space: normal;
}
.taskbar .addmenu a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; color: #44566b; text-decoration: none; border-radius: 7px; }
.taskbar .addmenu a:hover { background: #f0f6fd; color: #2f7ce0; }

/* ---------- 卡片 / 面板 ---------- */
.panel { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05); padding: 14px; margin-bottom: 14px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-h h3 { font-size: 15px; }
.panel-h .sub { font-size: 12px; color: #8a97a6; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05); padding: 14px 16px; }
.stat .v { font-size: 24px; font-weight: bold; color: #22364f; }
.stat .l { font-size: 12px; color: #8a97a6; margin-top: 6px; }
.stat .y { font-size: 12px; color: #b6c1cd; margin-top: 2px; }
.stat.red .v { color: #d6333f; }
.stat.green .v { color: #2e9e5b; }
.stat.blue .v { color: #2f7ce0; }
.stat.orange .v { color: #e6762a; }

/* ---------- 表格 ---------- */
table.data { width: 100%; border-collapse: collapse; background: #fff; }
table.data th {
  background: #f5f8fb; color: #68788c; font-size: 12px; font-weight: normal; text-align: left;
  padding: 9px 8px; border-bottom: 1px solid #e6ecf2; white-space: nowrap;
}
table.data td { padding: 8px; border-bottom: 1px solid #f0f3f7; font-size: 13px; vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #f9fbfd; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .money { color: #d6333f; font-weight: bold; }
table.data .money-green { color: #2e9e5b; font-weight: bold; }
.empty { text-align: center; color: #a3b0bd; padding: 34px 10px; font-size: 13px; }
.table-wrap { overflow-x: auto; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 7px 16px; border-radius: 6px; border: 1px solid transparent;
  font-size: 13px; cursor: pointer; background: #eef1f5; color: #4a5b6b; text-align: center; line-height: 1.4;
}
.btn:hover { opacity: .9; }
.btn-primary { background: #2f7ce0; color: #fff; }
.btn-success { background: #2e9e5b; color: #fff; }
.btn-warn { background: #e6762a; color: #fff; }
.btn-danger { background: #fff; color: #d6333f; border-color: #f0b6b6; }
.btn-plain { background: #fff; color: #4a5b6b; border-color: #d5dde6; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 11px 26px; font-size: 15px; }
.btn-block { display: block; width: 100%; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: #68788c; }
input.txt, select.txt, textarea.txt {
  width: 100%; padding: 7px 9px; border: 1px solid #d5dde6; border-radius: 6px; font-size: 13px;
  font-family: inherit; background: #fff; color: #2b3a4a;
}
input.txt:focus, select.txt:focus, textarea.txt:focus { outline: none; border-color: #4d9df1; box-shadow: 0 0 0 2px rgba(77,157,241,.12); }
input[type=file] { font-size: 12px; }
.form-grid { display: grid; gap: 12px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.hint { font-size: 12px; color: #94a2b1; line-height: 1.7; margin-top: 8px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }

/* ---------- 提示 ---------- */
.msg { background: #e6f7e9; border: 1px solid #b7e4c0; color: #217a3c; border-radius: 8px; padding: 9px 14px; margin-bottom: 12px; font-size: 13px; }
.errmsg { background: #fdeaea; border: 1px solid #f5c2c2; color: #c0392b; border-radius: 8px; padding: 9px 14px; margin-bottom: 12px; font-size: 13px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: #eef1f5; color: #68788c; }
.badge-blue { background: #e8f2fe; color: #2f7ce0; }
.badge-green { background: #e6f7e9; color: #217a3c; }
.badge-red { background: #fdeaea; color: #c0392b; }
.badge-orange { background: #fff3e6; color: #ad6800; }

/* ---------- 分组入口（工作台） ---------- */
.entries { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #eef1f5; border-radius: 10px; overflow: hidden; }
.entry { background: #fff; padding: 18px 10px; text-align: center; color: #2b3a4a; }
.entry .ic { font-size: 22px; }
.entry .t { margin-top: 8px; font-size: 14px; }
.entry small { display: block; color: #a3b0bd; font-size: 11px; margin-top: 3px; }
.entry:hover { background: #f7fbff; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs a { background: #fff; border: 1px solid #dbe3ec; padding: 6px 14px; border-radius: 6px; color: #4a5b6b; font-size: 13px; }
.tabs a.on { background: #2f7ce0; border-color: #2f7ce0; color: #fff; font-weight: bold; }

/* ---------- 单据表格输入 ---------- */
table.items input.txt { padding: 5px 6px; font-size: 13px; }
table.items td { padding: 5px 4px; }
.big-total { font-size: 20px; font-weight: bold; color: #d6333f; }
.thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid #e3e9f0; }

/* ---------- 登录页 ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #dbe8f7, #f0f3f7); padding: 20px; }
.login-card { background: #fff; border-radius: 14px; box-shadow: 0 6px 24px rgba(34,54,79,.12); padding: 34px 30px; width: 340px; }
.login-card h1 { font-size: 19px; text-align: center; margin-bottom: 6px; }
.login-card .site { text-align: center; color: #8a97a6; font-size: 12px; margin-bottom: 22px; }

/* ---------- 分享页 ---------- */
.share-body { background: #eef1f5; }
.share-wrap { max-width: 900px; margin: 0 auto; padding: 12px; }
.share-head { background: linear-gradient(135deg, #1c5fc4, #2f7ce0); color: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 3px 10px rgba(31,92,196,.25); }
.share-head h1 { font-size: 20px; }
.share-head .c { margin-top: 8px; font-size: 14px; opacity: .95; line-height: 1.6; }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.pcard { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 5px rgba(0,0,0,.06); display: flex; flex-direction: column; }
.pcard .img { width: 100%; aspect-ratio: 4 / 3; background: #f0f3f7 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #b6c1cd; font-size: 12px; }
.pcard .body { padding: 10px 12px 12px; }
.pcard .n { font-size: 14px; font-weight: bold; line-height: 1.4; }
.pcard .meta { color: #8a97a6; font-size: 12px; margin-top: 4px; }
.pcard .price { color: #d6333f; font-weight: bold; font-size: 19px; margin-top: 8px; }
.pcard .price small { font-size: 12px; font-weight: normal; color: #8a97a6; margin-left: 4px; }
.pcard .note { color: #8a97a6; font-size: 12px; margin-top: 4px; }
.share-foot { text-align: center; color: #94a2b1; font-size: 12px; padding: 22px 0 30px; line-height: 1.8; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px 0; flex-wrap: wrap; }
.pager a { background: #fff; border: 1px solid #dbe3ec; padding: 5px 11px; border-radius: 6px; font-size: 13px; color: #4a5b6b; }
.pager a.on { background: #2f7ce0; border-color: #2f7ce0; color: #fff; font-weight: bold; }

/* ---------- 遮罩（移动端菜单） ---------- */
.mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }

/* ---------- 列表底部批量操作条 ---------- */
.bulkbar { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bulk-count { font-weight: bold; }

/* ---------- 手机适配 ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .entries { grid-template-columns: repeat(4, 1fr); }
  .row-4 { grid-template-columns: repeat(2, 1fr); }
  .row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .side { transform: translateX(-100%); transition: transform .22s; z-index: 40; }
  body.nav-open .side { transform: none; }
  body.nav-open .mask { display: block; }
  .main { margin-left: 0; }
  .topbar .burger { display: block; }
  .content { padding: 10px; }
  .panel { padding: 11px; }
  .stat .v { font-size: 19px; }
  .entries { grid-template-columns: repeat(3, 1fr); }
  .row-2, .row-3, .row-4 { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pcard .price { font-size: 16px; }
  table.data th, table.data td { padding: 7px 6px; font-size: 12px; }

  /* 批量操作条固定在屏幕底部，手机上大拇指够得到 */
  .bulkbar {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 12px;
    background: #fff; border-top: 1px solid #e6ecf2; box-shadow: 0 -2px 12px rgba(20,40,80,.10);
    z-index: 25; flex-wrap: nowrap;
  }
  .bulkbar .btn { flex: 1; padding: 10px 6px; font-size: 13px; }
  .bulkbar .hint { display: none; }
  body.has-bulkbar { padding-bottom: 78px; }
}
