/* 胜世铝业再生资源基地管理系统样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }
.hidden { display: none !important; }

/* ===== 登录 ===== */
.overlay {
  position: fixed; inset: 0; background: linear-gradient(135deg, #1e3c2f, #2d6a4f);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.login-box {
  background: #fff; padding: 36px 40px; border-radius: 12px; width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  background: linear-gradient(135deg, #2d6a4f, #40916c); color: #fff;
  font-size: 32px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.login-box h2 { text-align: center; color: #2d6a4f; margin-bottom: 20px; font-size: 19px; }
.login-box label { display: block; margin: 10px 0 4px; font-size: 13px; color: #666; }
.login-box input {
  width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.login-box .btn { width: 100%; margin-top: 20px; }

/* ===== 顶栏 ===== */
.topbar {
  background: #1e3c2f; color: #fff; padding: 12px 20px;
  display: flex; justify-content: space-between; align-items: center; height: 52px;
}
.app-title { font-size: 18px; font-weight: 600; }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; }

/* ===== 整体布局 ===== */
.layout { display: flex; height: calc(100vh - 52px); }
.sidebar {
  width: 200px; background: #243b31; color: #cfe3d8; padding: 12px 0; flex-shrink: 0;
  overflow-y: auto;
}
.nav-item {
  padding: 13px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  transition: background .15s; font-size: 14px; border-left: 3px solid transparent;
}
.nav-item:hover { background: #2f4a3e; }
.nav-item.active { background: #2d6a4f; color: #fff; border-left-color: #7ed6a5; }
.nav-ico { width: 20px; text-align: center; }
.main-area { flex: 1; padding: 18px; overflow-y: auto; }

/* ===== 页面面板 ===== */
.page-panel { display: none; }
.page-panel.active { display: block; }
.page-title { font-size: 19px; color: #1e3c2f; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid #e2e8e4; }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border-left: 4px solid #2d6a4f;
}
.stat-label { font-size: 13px; color: #888; }
.stat-value { font-size: 26px; font-weight: 700; color: #1e3c2f; margin: 6px 0; font-family: "Consolas", monospace; }
.stat-sub { font-size: 12px; color: #999; }

/* ===== 卡片/表单 ===== */
.card {
  background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card h3 { font-size: 15px; color: #2d6a4f; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.form-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.form-row label { font-size: 13px; color: #666; width: 72px; flex-shrink: 0; }
.form-row select, .form-row input {
  padding: 7px 8px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; flex: 1; min-width: 0;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
/* 刷卡识别 */
.card-swipe-row { display: flex; gap: 8px; flex: 1; min-width: 0; }
.card-swipe-row input { flex: 1; }
.card-swipe-msg { font-size: 12px; margin-top: 4px; width: 100%; }
.card-swipe-msg.ok { color: #2d6a4f; }
.card-swipe-msg.warn { color: #c0392b; }
.card-tag { display: inline-block; background: #fff7e6; color: #b8860b; border: 1px solid #f0d9a8; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.gray { color: #aaa; }

/* ===== 刷卡两次过磅 ===== */
.swipe-status-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; background: linear-gradient(135deg, #f0f9f4, #e6f4ea); border: 1px solid #cde8d6; margin-bottom: 14px; flex-wrap: wrap; }
.swipe-status-left { display: flex; align-items: center; gap: 14px; min-width: 260px; flex: 1; }
.swipe-icon { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 2px 6px rgba(0,0,0,.08); flex-shrink: 0; }
.swipe-icon.ok { background: #2d6a4f; }
.swipe-title { font-size: 18px; font-weight: 700; color: #1d3d33; }
.swipe-desc { font-size: 13px; color: #5a7a6f; margin-top: 3px; }
.swipe-status-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swipe-status-right input { padding: 9px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; width: 130px; }
.swipe-status-right input:focus { border-color: #2d6a4f; outline: none; }
.swipe-result { margin-bottom: 14px; background: #fbfdfc; border-left: 4px solid #2d6a4f; }
.swipe-result-text { font-size: 15px; color: #224; }
.swipe-result-meta { display: flex; gap: 24px; margin-top: 10px; font-size: 13px; color: #667; flex-wrap: wrap; }
.swipe-result-meta b { color: #2d6a4f; }
.status { font-size: 13px; margin-top: 4px; color: #999; }
.status.on { color: #2d6a4f; font-weight: 600; }
.status.off { color: #c0392b; }

/* ===== 磅房布局 ===== */
.weigh-layout { display: flex; gap: 16px; align-items: flex-start; }
.scale-panel { width: 330px; flex-shrink: 0; }
.weigh-form { flex: 1; }

/* ===== 多品类明细行 ===== */
.po-item { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.po-item select { flex: 2 1 120px; padding: 6px 8px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; }
.po-item input { flex: 1 1 70px; padding: 6px 8px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; }
.po-net { flex: 0 0 76px; text-align: right; font-weight: 700; color: #ff6b4a; font-size: 13px; }
#poItems, #soItems { margin-bottom: 8px; }

/* ===== 版本标签 ===== */
.version-tag { padding: 3px 10px; background: #eef4ff; color: #3b6fd4; border: 1px solid #d5e3ff; border-radius: 12px; font-size: 12px; margin-right: 8px; }

/* ===== 网页版提示 ===== */
.web-hint { background: #fff7e6; border: 1px solid #ffd591; color: #d46b08; padding: 8px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 12px; line-height: 1.6; }

/* ===== Q版单据打印样式（80mm 热敏适配） ===== */
.qdoc {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  max-width: 72mm; margin: 0 auto; padding: 12px 10px;
  background: #fffaf3; border: 2px solid #ffd9a0; border-radius: 14px;
  color: #5b4a3f; box-sizing: border-box;
}
.qdoc-head { text-align: center; margin-bottom: 10px; }
.qdoc-logo { font-size: 28px; line-height: 1.2; }
.qdoc-title { font-size: 20px; font-weight: 900; color: #ff6b81; letter-spacing: 4px; margin-top: 1px; }
.qdoc-sub { font-size: 12px; color: #ff9a9e; margin-top: 2px; letter-spacing: 2px; }
.qdoc-badge { text-align: center; font-size: 11px; color: #c98a5a; background: #fff1e0; border-radius: 999px; padding: 4px 10px; display: block; width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.qdoc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; font-size: 11px; background: #fff; border: 1.5px dashed #ffd9a0; border-radius: 10px; padding: 7px 9px; margin-bottom: 8px; color: #7a6a5c; }
.qdoc-grid span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qdoc-sum { display: flex; justify-content: space-between; font-weight: 800; font-size: 12px; color: #e8562a; background: #ffe9dd; border-radius: 8px; padding: 6px 9px; margin: 2px 0 4px; }
.qdoc-meta { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11px; background: #fff; border: 1.5px dashed #ffd9a0; border-radius: 10px; padding: 7px 9px; margin-bottom: 8px; color: #7a6a5c; }
.qdoc-meta span { white-space: nowrap; }
.qdoc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(255,150,130,0.15); }
.qdoc-table th { background: linear-gradient(135deg, #ffb36b, #ff8a5c); color: #fff; padding: 6px 3px; font-weight: 700; }
.qdoc-table td { border-bottom: 1px solid #ffe8dc; padding: 5px 3px; text-align: left; background: #fff; }
.qdoc-table tbody tr:nth-child(even) td { background: #fff6ee; }
.qdoc-table tbody tr:last-child td { border-bottom: none; }
.qdoc-table tfoot td { font-weight: 800; background: #ffe9dd; color: #ff6b4a; text-align: right; font-size: 12px; }
.qdoc-kv { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(255,150,130,0.15); }
.qdoc-kv td { padding: 5px 8px; border-bottom: 1px dashed #ffead9; }
.qdoc-kv td:first-child { width: 64px; color: #c98a5a; font-weight: 600; background: #fff8f0; }
.qdoc-kv tr:last-child td { border-bottom: none; }
.qdoc-remark { margin: 8px 0 2px; font-size: 11px; color: #8a7a6c; }
.qdoc-items { margin-bottom: 8px; }
.qdoc-item { border-bottom: 1px dashed #ffd9a0; padding: 5px 2px; }
.qdoc-item:last-child { border-bottom: none; }
.qi-name { font-weight: 700; font-size: 12px; color: #5b4a3f; }
.qi-line { font-size: 10px; color: #7a6a5c; margin-top: 2px; }
.qi-remark { font-size: 9px; color: #b4693a; margin-top: 2px; word-break: break-all; background: #fff5e8; border-radius: 5px; padding: 2px 4px; }
.qdoc-total { text-align: right; font-weight: 800; color: #ff6b4a; font-size: 13px; background: #ffe9dd; border-radius: 8px; padding: 6px 9px; margin-bottom: 2px; }
.qdoc-footer { display: flex; justify-content: space-between; font-size: 11px; margin-top: 12px; color: #7a6a5c; }
.qdoc-deco { text-align: center; margin-top: 8px; color: #ffb3a0; font-size: 11px; letter-spacing: 3px; }
.qdoc-ticket { max-width: 72mm; }
.scale-readout { text-align: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; }
.scale-label { font-size: 13px; color: #666; }
.live-weight {
  font-size: 56px; font-weight: 700; color: #2d6a4f; font-family: "Consolas", monospace; margin: 8px 0;
}
.stable-tag { font-size: 13px; padding: 4px 12px; border-radius: 12px; display: inline-block; }
.stable-tag.ready { background: #2d6a4f; color: #fff; }
.stable-tag.wait { background: #f39c12; color: #fff; }
.weight-inputs { display: flex; gap: 12px; margin: 16px 0; }
.weight-box { flex: 1; border: 2px solid #ddd; border-radius: 8px; padding: 12px; text-align: center; }
.weight-box input {
  width: 100%; font-size: 28px; font-weight: 700; text-align: center; border: none;
  outline: none; font-family: "Consolas", monospace; margin: 6px 0;
}
.box-title { font-size: 13px; color: #666; }
.weight-box.net { background: #f0f9f4; border-color: #2d6a4f; }
.net-value { font-size: 32px; font-weight: 700; color: #2d6a4f; font-family: "Consolas", monospace; padding: 12px 0; }
.amount-value { font-size: 24px; font-weight: 700; color: #c0392b; font-family: "Consolas", monospace; padding: 4px 0; }
.actions { display: flex; gap: 12px; margin-top: 16px; }
.msg { margin-top: 10px; font-size: 13px; color: #c0392b; min-height: 18px; }
.msg.ok { color: #2d6a4f; }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px; border: 1px solid #ccc; background: #fff; border-radius: 6px;
  cursor: pointer; font-size: 14px;
}
.btn:hover { background: #f5f5f5; }
.btn.primary { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }
.btn.primary:hover { background: #245c43; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.large { padding: 12px 32px; font-size: 16px; }
.btn.danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn.danger:hover { background: #a93226; }
.btn.active { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }

/* ===== 工具栏 ===== */
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.tb-input { padding: 6px 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; }

/* ===== 数据表格 ===== */
.grid-table { width: 100%; border-collapse: collapse; }
.grid-table th {
  background: #f5f8f6; text-align: left; padding: 9px 10px; font-size: 13px; color: #555;
  border-bottom: 2px solid #e2e8e4; font-weight: 600; white-space: nowrap;
}
.grid-table td { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.grid-table tr:hover td { background: #fafdfb; }
.grid-table .tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px;
}
.tag.done { background: #d4efdf; color: #1b5e3b; }
.tag.wait { background: #fef3cd; color: #8a6d1a; }
.tag.void { background: #f5dcdc; color: #a93226; }
.tag.warn { background: #ffe8cc; color: #b3560b; }

/* ===== 分页 ===== */
.pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; justify-content: center; }
.pager span { font-size: 13px; color: #666; }

/* ===== 弹窗 ===== */
.modal-box {
  background: #fff; border-radius: 12px; padding: 24px; width: 480px; max-width: 92vw;
  max-height: 86vh; overflow-y: auto;
}
.modal-box h3 { font-size: 16px; color: #2d6a4f; margin-bottom: 16px; }
.modal-box label { display: block; font-size: 13px; color: #666; margin: 8px 0 4px; }
.modal-box input, .modal-box select {
  width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ===== 系统管理 ===== */
.sys-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sys-panel { display: none; }
.sys-panel.active { display: block; }

/* ===== 报表 ===== */
.report-box { min-height: 120px; line-height: 1.9; }

.empty-text { color: #aaa; text-align: center; padding: 20px 0; }

/* ===== 80mm 热敏打印纸张 ===== */
@page { size: 80mm auto; margin: 3mm; }
@media print {
  .qdoc { max-width: 72mm; box-shadow: none; border: 2px solid #ffd9a0; }
}


/* ===== 采购单表格表单（新建/编辑弹窗） ===== */
.modal-box.po-modal { width: 880px; max-width: 96vw; }
.po-basic { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.pb-field { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; }
.pb-field label { font-size: 12px; color: #6b7c72; }
.pb-field input, .pb-field select { padding: 8px 10px; border: 1px solid #d6e0da; border-radius: 8px; font-size: 14px; }
.pb-field span { padding: 8px 2px; font-size: 14px; color: #2d3a33; }
.po-sec { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; font-weight: 700; color: #2d6a4f; }
.po-tblwrap { overflow-x: auto; border: 1px solid #e3e9e5; border-radius: 10px; }

.po-table { width: 100%; border-collapse: collapse; min-width: 820px; }
/* 抗翻译插件破坏表格布局 */
.po-table thead { display: table-header-group !important; }
.po-table tbody { display: table-row-group !important; }
.po-table tr { display: table-row !important; }
.po-table th, .po-table td { display: table-cell !important; vertical-align: middle !important; }
.po-table th { background: #f0f7f3; color: #2d6a4f; font-size: 12px; padding: 8px 6px; text-align: center; white-space: nowrap; }
.po-table td { padding: 5px 4px; border-top: 1px solid #eef2ef; vertical-align: middle; text-align: center; }
.po-table .td-mat { text-align: left; min-width: 200px; }
.po-table .td-mat select { width: 100%; padding: 6px 6px; border: 1px solid #d6e0da; border-radius: 6px; font-size: 13px; }
.po-table .td-mat textarea.po-remark, .po-table .td-mat input { width: 100%; margin-top: 4px; padding: 5px 6px; border: 1px solid #e0e6e2; border-radius: 6px; font-size: 12px; font-family: inherit; line-height: 1.4; }
.po-table .td-mat textarea.po-remark { resize: vertical; min-height: 30px; }
.po-table td input[type=number] { width: 72px; padding: 6px 4px; border: 1px solid #d6e0da; border-radius: 6px; font-size: 13px; text-align: center; }
.po-net, .po-amt { font-weight: 700; color: #ff6b4a; font-size: 13px; white-space: nowrap; }
.po-del { color: #e05b4a; background: none; border: none; font-size: 18px; cursor: pointer; line-height: 1; }
.po-del:hover { color: #c0392b; }
.po-total { display: flex; justify-content: space-between; margin: 10px 0; padding: 10px 12px; background: #fff7ef; border-radius: 10px; font-size: 14px; color: #5b4a3f; }
.po-total b { color: #ff6b4a; font-size: 16px; }
#poRemark, #poRemark2 { width: 100%; padding: 8px 10px; border: 1px solid #d6e0da; border-radius: 8px; font-size: 14px; resize: vertical; box-sizing: border-box; }
.po-photos { margin-top: 12px; }
.po-photos label { font-size: 12px; color: #6b7c72; }
#poPhotoList { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; min-height: 40px; }
.po-photo { position: relative; width: 72px; height: 72px; }
.po-photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid #e0e6e2; }
.po-photo .po-photo-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #e05b4a; color: #fff; border: none; font-size: 12px; cursor: pointer; line-height: 20px; }
.po-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.po-photo-actions { margin-bottom: 4px; }
@media (max-width: 900px) { .modal-box.po-modal { width: 96vw; } }


/* ===== 采购单表单窄屏适配（≤760px） ===== */
@media (max-width: 900px) {
  .po-basic { flex-direction: column; gap: 10px; }
  .pb-field { flex: 1 1 auto; width: 100%; }
  .pb-field input, .pb-field select { width: 100%; box-sizing: border-box; }
  .po-tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .po-total { flex-direction: column; gap: 6px; }
  .po-table .td-mat select { max-width: none; width: 100%; }
  .po-table .td-mat textarea.po-remark, .po-table .td-mat input { max-width: none; width: 100%; }
}
.po-tblwrap::-webkit-scrollbar { height: 8px; }
.po-tblwrap::-webkit-scrollbar-thumb { background: #c9d6cf; border-radius: 4px; }

.sub-text { font-size: 11px; color: #8a9b92; margin-top: 2px; }
