:root {
  --top: #24375f;
  --left: #24375f;
  --left-dark: #1c2d4d;
  --line: #d9dfe5;
  --muted: #6f7883;
  --text: #333;
  --bg: #062639;
  --white: #fff;
  --danger: #d9534f;
  --ok: #138a6a;
  color: var(--text);
  background: var(--bg);
  font-family:
    Microsoft YaHei,
    Segoe UI,
    Arial,
    sans-serif;
  font-size: 14px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type='number'] {
  -moz-appearance: textfield;
}
body {
  background: #f6f6f6;
  min-width: 1100px;
  min-height: 100vh;
  margin: 0;
  font-family: Microsoft YaHei, Segoe UI, Arial, sans-serif;
  font-size: 14px;
}
button,
input,
select,
textarea,
table,
th,
td {
  font: inherit;
}
button {
  cursor: pointer;
  background: 0 0;
  border: 0;
}
code {
  color: #1777aa;
  background: #eef7ff;
  border-radius: 3px;
  padding: 2px 6px;
}
.shell {
  background: #fff;
  grid-template-rows: 56px 32px auto 1fr;
  grid-template-columns: 126px 1fr;
  grid-template-areas:
    "topbar topbar"
    "tabbar tabbar"
    "notice notice"
    "sidebar main";
  height: 100vh;
  overflow: hidden;
  display: grid;
}
.topbar {
  color: #fff;
  background: var(--top);
  grid-area: topbar;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  display: flex;
}
.top-brand {
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 800;
  display: flex;
}
.logo-orb {
  width: 42px;
  height: 42px;
  color: var(--top);
  background: #fff;
  border-radius: 50%;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  display: grid;
  box-shadow: inset 0 0 0 4px #e8f7f3;
}
.top-actions {
  align-items: center;
  gap: 8px;
  font-size: 14px;
  display: flex;
}
.top-logout {
  color: #fff;
  background: #ffffff1f;
  border: 1px solid #ffffff73;
  height: 28px;
  padding: 0 10px;
}
.top-logout:hover {
  background: #ffffff38;
}
.qr,
.mail {
  background: #ffffff2e;
  border-radius: 3px;
  place-items: center;
  width: 22px;
  height: 22px;
  display: grid;
}
.badge {
  color: #fff;
  background: #ffb431;
  border-radius: 6px;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-weight: 700;
  display: inline-grid;
}
.tabbar {
  background: #fafafa;
  border-bottom: 1px solid #dcdcdc;
  grid-area: tabbar;
  align-items: flex-end;
  height: 32px;
  padding-left: 22px;
  display: flex;
  overflow-x: auto;
}
.notice-bar {
  grid-area: notice;
  padding: 12px 18px 0;
  background: #fff;
}
.notice-bar-inner {
  display: flex;
  align-items: center;
  gap: 4px;
}
.notice-scroll-btn {
  flex: 0 0 28px;
  height: 99px;
  border: none;
  background: #f0f0f0;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.notice-scroll-btn:hover {
  background: #e0e0e0;
  color: #333;
}
.work-tab {
  color: #4d565f;
  white-space: nowrap;
  background: #f7f7f7;
  border: 1px solid #dcdcdc;
  border-bottom: 0;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  max-width: 150px;
  height: 30px;
  padding: 0 8px 0 12px;
  display: inline-flex;
}
.work-tab.active {
  color: #08715f;
  border-top: 2px solid var(--top);
  background: #fff;
}
.work-tab span {
  text-overflow: ellipsis;
  overflow: hidden;
}
.work-tab i {
  color: #7a828a;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 16px;
  height: 16px;
  font-style: normal;
  line-height: 1;
  display: inline-flex;
}
.work-tab i:hover {
  color: #fff;
  background: #ff5b75;
}
.sidebar {
  background: #fff;
  border-right: 1px solid #d8d8d8;
  grid-area: sidebar;
  padding: 14px 12px;
  overflow-y: auto;
  min-height: 0;
}
.module-nav {
  gap: 13px;
  display: grid;
}
.module-nav button {
  color: #fff;
  background: var(--left);
  width: 88px;
  height: 40px;
  font-size: 17px;
  font-weight: 700;
}
.module-nav button:hover {
  background: var(--left-dark);
}
.main {
  background: #fff;
  grid-area: main;
  overflow-y: auto;
  min-height: 0;
  padding: 12px 18px 34px;
  position: relative;
}
.copyright {
  color: #777;
  font-size: 12px;
  position: fixed;
  bottom: 8px;
  right: 12px;
}
.erp-workbench {
  max-width: 1280px;
}
.notice-cards {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  overflow: hidden;
  flex-wrap: nowrap;
  scroll-behavior: smooth;
  flex: 1;
}
.notice-card {
  color: #fff;
  height: 88px;
  flex: 0 0 calc((100% - 50px) / 6);
  min-width: 0;
  padding: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.notice-card strong {
  font-size: 20px;
  font-weight: 600;
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-card:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}
.notice-card em {
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
  position: absolute;
  bottom: 10px;
  left: 14px;
}
.notice-icon {
  opacity: 0.25;
  font-size: 48px;
  position: absolute;
  bottom: -6px;
  right: 6px;
  line-height: 1;
  pointer-events: none;
}
.orange {
  background: #ff734a;
}
.pink {
  background: #d84f7e;
}
.green {
  background: #0baa8c;
}
.blue {
  background: #5eb2f0;
}
.cyan {
  background: #19a8c6;
}
.red {
  background: #e53935;
}
.yellow {
  background: #f9a825;
}
.purple {
  background: #8e44ad;
}
.workspace-panel {
  background: #fff;
  border: 1px solid #ddd;
  min-height: 510px;
  padding: 18px 24px;
}
.tenant-strip {
  border-bottom: 1px solid #ececec;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  display: flex;
}
.tenant-strip h2 {
  color: #08715f;
  margin: 0 0 6px;
  font-size: 20px;
}
.tenant-strip p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.tenant-actions {
  gap: 8px;
  display: flex;
}
.line-btn {
  color: #168fc8;
  background: #fff;
  border: 1px solid #cfd9df;
  min-width: 64px;
  height: 30px;
}
.danger-line {
  color: var(--danger);
}
.month-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 12px 19px 18px 19px;
}
.month-stat-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.2s;
}
.month-stat-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.month-stat-card .stat-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  border-radius: 8px;
}
.month-stat-card .stat-info {
  flex: 1;
  min-width: 0;
}
.month-stat-card .stat-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 4px;
}
.month-stat-card .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}
.month-stat-card .stat-unit {
  font-size: 12px;
  font-weight: 400;
  color: #999;
  margin-left: 4px;
}
.quick-grid {
  grid-template-columns: repeat(5, calc((100% - 50px) / 5.6));
  justify-content: start;
  gap: 15px 10px;
  margin: 10px 0 26px 19px;
  display: grid;
}
.quick-card {
  color: #6b6f75;
  background: #fff;
  border: 1px solid #d4d4d4;
  place-items: center;
  gap: 4px;
  height: 76px;
  display: grid;
}
.quick-card span {
  font-size: 24px;
  line-height: 1;
}
.quick-card em {
  font-size: 16px;
  font-style: normal;
}
.quick-card:hover {
  border-color: var(--left);
  color: var(--left-dark);
  box-shadow: 0 0 0 2px #26a8df14;
}
.info-grid {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 860px;
  display: grid;
}
.info-grid article {
  background: #fbfbfb;
  border: 1px solid #e0e0e0;
}
.info-grid h3 {
  color: #08715f;
  background: #f4fbf9;
  border-bottom: 1px solid #e0e0e0;
  margin: 0;
  padding: 10px 12px;
  font-size: 15px;
}
.info-grid ul {
  margin: 0;
  padding: 8px 12px 12px;
  list-style: none;
}
.info-grid li {
  border-bottom: 1px dashed #ddd;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  display: flex;
}
.info-grid li span {
  color: var(--muted);
}
.login-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f4f8 0%, #d6e4f0 30%, var(--top) 100%);
}
.login-shell::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -5%;
  width: 60%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36,55,95,0.06), transparent 70%);
  pointer-events: none;
}
.login-shell::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 70%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36,55,95,0.08), transparent 70%);
  pointer-events: none;
}
.login-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  z-index: 0;
}
.login-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.login-brand {
  color: #fff;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-right: 80px;
  max-width: 420px;
  text-align: center;
}
.login-brand-text h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 2px;
  color: #fff;
}
.login-brand-text p {
  font-size: 16px;
  opacity: 0.85;
  margin: 8px 0 0;
  color: #fff;
}
.login-logo {
  width: 76px;
  height: 76px;
  color: var(--top);
  background: #fff;
  border-radius: 50%;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
  display: grid;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.login-card {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 16px;
  width: 400px;
  padding: 40px 36px 32px;
  box-shadow: 0 12px 40px rgba(36,55,95,0.12);
}
.register-card {
  width: 560px;
}
.login-card-logo {
  width: 56px;
  height: 56px;
  color: var(--top);
  background: #fff;
  border-radius: 50%;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  display: grid;
  margin: 0 auto 8px;
  box-shadow: 0 4px 16px rgba(36,55,95,0.12);
}
.login-card h2 {
  color: var(--top);
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
}
.login-card-sub {
  text-align: center;
  color: #8a9bb0;
  font-size: 14px;
  margin: 0 0 28px;
}
.login-card p {
  color: #8a9bb0;
  margin: 0 0 20px;
  line-height: 1.7;
}
.login-form {
  gap: 16px;
  display: grid;
}
.register-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.register-form input {
  padding-left: 12px;
}
.login-field {
  position: relative;
  display: flex;
  align-items: center;
}
.login-field-icon {
  position: absolute;
  left: 12px;
  color: #b0c4de;
  font-size: 16px;
  pointer-events: none;
}
.login-form input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px 0 40px;
  box-sizing: border-box;
  border: 1.5px solid #e0e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 14px;
  color: var(--top);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--top);
  box-shadow: 0 0 0 3px rgba(36,55,95,0.08);
  background: #fff;
}
.login-form input::placeholder {
  color: #b0c4de;
}
.login-pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #b0c4de;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  display: flex;
  align-items: center;
}
.login-pw-toggle:hover {
  color: var(--top);
}
.login-captcha-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.login-captcha-row input {
  flex: 1;
  padding-left: 12px;
}
.login-captcha-img {
  cursor: pointer;
  height: 44px;
  border: 1.5px solid #e0e8f0;
  border-radius: 8px;
  background: #f5f5f5;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #6a7d92;
}
.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--top);
}
.login-submit {
  width: 100%;
  margin-top: 8px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--top), #2d4a7a);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.login-submit:hover {
  opacity: 0.9;
}
.login-submit:active {
  transform: scale(0.98);
}
.register-form .login-submit {
  grid-column: 1/-1;
}
.login-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 14px;
}
.login-link {
  color: var(--top);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.login-link:hover {
  text-decoration: underline;
}
.sms-code-row {
  grid-column: 1/-1;
}
.sms-code-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sms-code-wrap input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1.5px solid #e0e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.sms-send-btn {
  white-space: nowrap;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--top);
  border-radius: 8px;
  background: #fff;
  color: var(--top);
  cursor: pointer;
  font-size: 14px;
}
.sms-send-btn:disabled {
  border-color: #ccc;
  color: #999;
  cursor: not-allowed;
}
.system-page {
  padding: 8px 12px;
}
.system-module-grid {
  grid-template-columns: repeat(5, calc((100% - 140px) / 5.5));
  justify-content: start;
  align-items: start;
  gap: 18px 28px;
  padding: 8px 0 0 19px;
  display: grid;
}
.system-card {
  color: #5f6870;
  background: #fff;
  border: 1px solid #d8d8d8;
  place-items: center;
  gap: 4px;
  width: auto;
  height: 65px;
  display: grid;
}
.system-card span {
  color: #7a7f84;
  font-size: 19px;
  line-height: 1;
  display: block;
}
.system-card em {
  font-size: 16px;
  font-style: normal;
}
.system-card:hover {
  border-color: #ff5b75;
  box-shadow: inset 0 0 0 3px #ff5b751f;
}
.system-card.disabled-card {
  cursor: default;
  opacity: 1;
}
.system-card.disabled-card:hover {
  box-shadow: none;
  border-color: #d8d8d8;
}
.page-head {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  display: flex;
}
.page-head h2 {
  margin: 0 0 6px;
}
.page-head p {
  color: #6d747b;
  margin: 0;
}
.settings-card {
  background: #fff;
  border: 1px solid #d8e1e6;
  max-width: 760px;
  padding: 18px;
}
.setting-row {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  display: flex;
}
.setting-row span {
  gap: 6px;
  display: grid;
}
.setting-row em {
  color: #6d747b;
  font-style: normal;
}
.setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.product-page {
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 8px;
  height: calc(100vh - 169px);
  font-size: 14px;
  display: grid;
  overflow: hidden;
}
body.direct-add-mode .product-query,
body.direct-add-mode .product-toolbar,
body.direct-add-mode .product-table-wrap,
body.direct-add-mode .pagination,
body.direct-add-mode .message {
  display: none !important;
}
.product-category-panel {
  background: #fff;
  border: 1px solid #d9dfe5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.category-title {
  color: #333;
  background: #f5f7f8;
  border-bottom: 1px solid #d9dfe5;
  justify-content: space-between;
  align-items: center;
  height: 30px;
  padding: 0 8px;
  font-weight: 700;
  display: flex;
}
.category-title:after {
  content: "◀";
  color: #555;
}
.category-toolbar {
  border-bottom: 1px solid #d9dfe5;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 5px;
  display: grid;
}
.category-toolbar button {
  color: #08715f;
  background: #fff;
  border: 1px solid #c9d3da;
  min-height: 24px;
  padding: 0;
  font-size: 12px;
  border-radius: 6px;
}
.product-categories {
  gap: 2px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.category-readonly-tip {
  color: #6d747b;
  background: #fafafa;
  border-bottom: 1px solid #d9dfe5;
  padding: 6px 8px;
  font-size: 12px;
}
.product-category {
  text-align: left;
  color: #08715f;
  background: #fff;
  min-height: 23px;
  font-size: 14px;
}
.product-category.active,
.product-category:hover {
  color: #fff;
  background: #0baa8c;
}
.product-workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.batch-category-panel {
  width: 140px;
  min-width: 140px;
  background: #fafbfc;
  border-right: 1px solid #d9dfe5;
  overflow-y: auto;
  flex-shrink: 0;
}
.batch-category-panel .product-category {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef1f4;
  cursor: pointer;
}
.full-workspace {
  grid-column: 1/-1;
  overflow-y: auto;
}
.product-query {
  background: #fff;
  border: 1px solid #d9dfe5;
}
.product-query strong {
  color: #333;
  display: block;
}
.query-title {
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px 4px;
  display: flex;
}
.query-title-left {
  align-items: center;
  gap: 12px;
  display: flex;
  flex: 1;
  min-width: 0;
}
.message-inline {
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-inline.ok {
  color: var(--ok);
}
.message-inline.error {
  color: var(--danger);
}
.link-btn {
  color: #168fc8;
  background: 0 0;
  min-height: 24px;
  padding: 0 8px;
  font-size: 14px;
}
.product-search-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px 12px;
  padding: 6px 10px 10px;
  display: grid;
}
.product-search-fields {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px 12px;
}
.product-search-fields label {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-align: left;
  justify-content: flex-start;
}
.product-search-fields input,
.product-search-fields select {
  width: 140px;
  min-width: 0;
  height: 26px;
  text-align: left;
}
/* 日期区间（内嵌搜索栏） */
.doc-date-inline {
  grid-column: span 2;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-align: left;
  justify-content: flex-start;
}
.doc-date-inline .doc-date-label {
  color: #555;
  white-space: nowrap;
}
.doc-date-inline .doc-date-start,
.doc-date-inline .doc-date-end {
  width: 140px;
  min-width: 0;
  height: 26px;
  border: 1px solid #cfd6dc;
  border-radius: 3px;
  font-size: 13px;
  padding: 0 4px;
  text-align: left;
}
.doc-date-inline .doc-date-sep {
  color: #999;
  font-size: 13px;
}
.product-search-actions {
  align-items: center;
  gap: 8px;
  display: flex;
  flex-shrink: 0;
}
.batch-search-grid {
  grid-template-columns: minmax(0, 1fr) 142px;
}
.batch-search-grid .product-search-actions {
  grid-template-columns: repeat(2, 1fr);
  align-self: start;
  gap: 8px;
  display: grid;
  position: sticky;
  top: 0;
}
.batch-search-grid .product-search-fields {
  max-height: none;
  overflow-y: visible;
  grid-template-columns: repeat(3, 1fr);
}
.batch-search-grid .product-search-fields label {
  width: auto;
}
.product-search-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 14px;
}
.product-toolbar {
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  display: flex;
}
.hide-locked {
  color: #444;
  order: 99;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 0;
  padding: 0 6px;
  font-size: 14px;
  display: inline-flex;
}
.product-page input[type="checkbox"] {
  width: 16px;
  min-width: auto;
  height: 16px;
  padding: 0;
}
.product-toolbar button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 14px;
  border-radius: 6px;
}
.product-table-wrap {
  background: #fff;
  border: 1px solid #d9dfe5;
  width: 100%;
  overflow: auto;
  flex: 1;
  min-height: 0;
  margin-bottom: 8px;
}
.product-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  font-size: 14px;
}
.data-table {
  table-layout: fixed;
  width: 100%;
}
.data-table th,
.data-table td {
  max-width: none;
  white-space: nowrap;
  height: 32px;
  padding: 5px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid #d9dfe5;
}
.inventory-table {
  min-width: 0;
}
.product-table th,
.product-table td {
  max-width: none;
  white-space: nowrap;
  height: 32px;
  padding: 5px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid #d9dfe5;
}
.data-table th,
.data-table td {
  max-width: none;
}
/* 含按钮/输入框等控件的单元格不截断 */
.product-table td:has(button),
.product-table td:has(input),
.product-table td:has(select),
.product-table td:has(label),
.product-table td:has(.checkbox) {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.product-table th:last-child,
.product-table td:last-child {
  border-right: none;
}
/* 弹窗批量选择商品行勾选高亮 */
.batch-row-selected {
  background: #e6f4fd !important;
}
.batch-row-selected td {
  border-bottom-color: #b3d9f7;
}
.product-table.table-fixed-layout,
.product-table.table-fixed-layout th,
.product-table.table-fixed-layout td {
  table-layout: fixed;
  max-width: none;
}
.product-table td input,
.product-table td select,
.product-table td textarea,
.product-table td button {
  max-width: none;
}
.product-table th {
  color: #606870;
  background: #f5f7f8;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 3;
}
.product-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #f0f2f5;
  font-weight: 600;
  border-top: 2px solid #d9dfe5;
}
.product-modal-card {
  width: min(1480px, 100vw - 18px);
  height: min(800px, 100vh - 18px);
  overflow: auto;
}
.resize-handle {
  z-index: 100;
  opacity: 0;
  transition: opacity 0.15s;
  position: absolute;
}
.modal-card:hover > .resize-handle {
  opacity: 1;
}
.resize-handle:hover {
  background: #008b8b80;
}
.resize-handle-n,
.resize-handle-s {
  cursor: ns-resize;
}
.resize-handle-w,
.resize-handle-e {
  cursor: ew-resize;
}
.resize-handle-nw {
  cursor: nwse-resize;
}
.resize-handle-ne,
.resize-handle-sw {
  cursor: nesw-resize;
}
.resize-handle-se {
  cursor: nwse-resize;
}
.modal-card.sub-modal-card {
  width: min(860px, 100vw - 48px);
  height: min(560px, 100vh - 48px);
  margin-left: auto;
  margin-right: 24px;
}
/* 批量选择商品弹窗：表头和搜索栏固定，仅表格区域滚动 */
.modal-card.sub-modal-card .product-form {
  overflow: hidden !important;
  align-items: stretch !important;
}
.modal-card.sub-modal-card .batch-category-panel {
  overflow-y: auto;
}
.product-form {
  background: #fff;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  align-items: start;
  gap: 0;
  min-height: 0;
  padding: 14px 14px 0;
  display: grid;
  position: relative;
  overflow: auto;
}
.product-form-with-image {
  grid-template-columns: minmax(0, 1fr) 340px;
}
.product-image-panel {
  background: #f7f7f7;
  border: 1px solid #d9d9d9;
  border-left: 0;
  flex-direction: column;
  grid-row: 1/-1;
  grid-column: 2;
  display: flex;
}
.product-image-box {
  color: #fff;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  background: linear-gradient(135deg, #2eb6e8, #0f73c8);
  border-radius: 10px;
  flex: none;
  place-items: center;
  height: 200px;
  margin: 8px;
  display: grid;
  position: relative;
  overflow: hidden;
}
.product-image-box:hover {
  opacity: 0.85;
}
.product-image-box img {
  object-fit: contain;
  z-index: 2;
  border-radius: 10px;
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  inset: 0;
}
.product-form-fields {
  border-top: 1px solid #d9d9d9;
  border-left: 1px solid #d9d9d9;
  flex-wrap: wrap;
  grid-area: 1/1;
  gap: 0;
  display: flex;
}
.product-form label {
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 0;
  font-size: 13px;
  display: grid;
}
.product-form-cell {
  box-sizing: border-box;
  background: #fff;
  border-bottom: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  flex: 33.333%;
  min-width: 150px;
  max-width: 33.333%;
  min-height: 40px;
}
.product-form-cell > span {
  color: #333;
  background: #f5f5f5;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  display: flex;
}
.product-form input,
.product-form select {
  width: calc(100% - 14px);
  min-width: 0;
  height: 30px;
  margin: 0 7px;
}
.combo-cell {
  width: 100%;
  position: relative;
}
.product-form .combo-cell input,
.product-price-table .combo-cell input {
  width: calc(100% - 14px);
  min-width: 0;
  height: 30px;
  margin: 0 7px;
}
.combo-options {
  z-index: 9999;
  background: #fff;
  border: 1px solid #b8c7d1;
  min-width: 200px;
  max-height: 240px;
  position: fixed;
  overflow: auto;
  box-shadow: 0 8px 20px #0000001f;
}
.combo-options button {
  text-align: left;
  color: #233;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eef1f4;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
}
.combo-options button:hover,
.combo-options button.active {
  background: #eef9fe;
}
.combo-options .combo-option {
  text-align: left;
  color: #233;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eef1f4;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  cursor: pointer;
  display: block;
}
.combo-options .combo-option:hover {
  background: #eef9fe;
}
.combo-options small {
  color: #7b8790;
  margin-top: 2px;
  display: block;
}
.target-info-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #e0e4e7;
  border-radius: 4px;
  margin: 4px 7px;
  font-size: 13px;
  align-items: center;
}
.target-info-panel > span {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.target-info-panel label {
  color: #6f7883;
  font-weight: 600;
}
.target-info-panel input[readonly] {
  width: 80px;
  height: 26px;
  border: 1px solid #cfd9df;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 13px;
  background: #f8f9fa;
  color: #333;
}
.target-info-panel select {
  height: 26px;
  border: 1px solid #cfd9df;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 13px;
}
.product-form textarea {
  resize: vertical;
  width: calc(100% - 14px);
  min-height: 70px;
  margin: 7px;
}
.product-form-wide {
  width: 100%;
}
.product-form-cell-wide {
  flex-basis: 100%;
  grid-template-columns: 116px minmax(0, 1fr);
}
.purchase-inbound-form {
  gap: 0;
  flex-direction: column !important;
  display: flex !important;
}
.purchase-inbound-form > .product-form-fields,
.purchase-inbound-form > .product-stock-panel:not(.settlement-panel),
.purchase-inbound-form > .modal-error {
  grid-column: unset;
  grid-row: unset;
}
.purchase-inbound-form > .product-form-fields:first-child {
  flex-shrink: 0;
}
.purchase-inbound-form .product-form-fields {
  border-top: 1px solid #d9d9d9;
  border-left: 1px solid #d9d9d9;
  flex-wrap: wrap;
  gap: 0;
  display: flex;
}
.purchase-inbound-form .product-form-fields > .product-form-cell {
  border-bottom: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  min-width: 120px;
  flex: 25% !important;
  max-width: 25% !important;
}
.purchase-inbound-form .product-form-fields > .product-form-cell-wide {
  flex: 50% !important;
  max-width: 50% !important;
}
.purchase-inbound-form > .product-stock-panel:not(.settlement-panel) {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.purchase-inbound-form > .settlement-panel {
  grid-column: unset;
  grid-row: unset;
  border-top: 2px solid #0d9488;
  flex: none;
  min-height: auto;
  margin-top: 0;
  overflow: hidden;
}
.product-price-panel,
.product-stock-panel {
  background: #fff;
  border: none;
  grid-column: 1;
  margin-top: 8px;
  position: relative;
}
.product-stock-panel table {
  border-collapse: collapse;
  width: 100%;
}
.product-stock-panel td {
  vertical-align: middle;
  box-sizing: border-box;
  padding: 2px;
  position: relative;
  overflow: hidden;
}
.price-toolbar {
  border-bottom: 1px solid #d9d9d9;
  gap: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
}
.scan-input {
  margin-left: auto;
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  flex: 0 0 140px;
  height: 10px;
  padding: 0 3px;
  border: 1px solid #007a65;
  border-radius: 2px;
  font-size: 10px;
  line-height: 10px;
  outline: none;
  background: #f0faf7;
}
.scan-input:focus {
  border-color: #005a4a;
  background: #fff;
  box-shadow: 0 0 4px rgba(0,122,101,0.3);
}
.scan-input::placeholder {
  color: #999;
}
.product-price-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.product-price-table th,
.product-price-table td {
  text-align: center;
  border-bottom: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  border-top: 1px solid #d9d9d9;
  height: 34px;
  padding: 4px 6px;
}
.product-price-table td:first-child,
.product-price-table th:first-child {
  border-left: 1px solid #d9d9d9;
}
.product-stock-panel > .price-toolbar {
  z-index: 11;
  background: #fff;
  position: sticky;
  top: 0;
}
.product-price-table thead {
  z-index: 10;
  position: sticky;
  top: 37px;
}
.product-price-table th {
  background: #f5f5f5;
  font-weight: 500;
}
.product-price-table input,
.product-price-table select {
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0;
}
.changelog-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.changelog-table th,
.changelog-table td {
  text-align: left;
  border: 1px solid #d9d9d9;
  height: 34px;
  padding: 4px 8px;
  vertical-align: middle;
}
.changelog-table th {
  background: #f5f5f5;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 1;
}
.changelog-card {
  max-width: 900px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.changelog-card .modal-head {
  flex-shrink: 0;
}
.changelog-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
}
.changelog-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid #d9d9d9;
}
.changelog-pagination {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 8px;
}
.changelog-pagination .page-info {
  font-size: 12px;
  color: #666;
  margin-right: 8px;
}
.changelog-pagination .page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: var(--left);
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}
.changelog-pagination .page-btn:hover:not(:disabled) {
  background: var(--left);
  color: #fff;
}
.changelog-pagination .page-btn.active {
  background: var(--left);
  color: #fff;
  border-color: var(--left);
}
.changelog-pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.changelog-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px;
  border-top: 1px solid #e8e8e8;
}
.product-form > .modal-error,
.product-form > .modal-actions {
  grid-column: 1/-1;
}
.product-form > .modal-actions {
  z-index: 3;
  background: #fff;
  border-top: 1px solid #d9d9d9;
  justify-content: flex-end;
  margin: 16px -14px 0;
  padding: 12px 18px;
  position: sticky;
  bottom: 0;
}
.modal-card.product-modal-card > .product-form {
  flex: 1;
  height: auto;
  min-height: 0;
  overflow: auto;
}
.modal-card.product-modal-card > .modal-actions {
  background: #fff;
  border-top: 1px solid #d9d9d9;
  flex: none;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  display: flex;
}
@media (width<=900px) {
  .product-form {
    grid-template-columns: 1fr;
  }
  .product-image-box {
    height: 140px;
  }
}
.field-config-card {
  flex-direction: column;
  width: min(1120px, 100vw - 48px);
  height: min(760px, 100vh - 48px);
  display: flex;
  overflow: hidden;
}
.field-config-tip {
  color: #666;
  border-bottom: 1px solid #eef1f4;
  padding: 10px 16px;
  font-size: 14px;
}
.field-config-table-wrap {
  flex: 1;
  min-height: 0;
  padding: 10px 16px;
  overflow: auto;
}
.field-config-table {
  table-layout: fixed;
  width: 100%;
  font-size: 14px;
}
.field-config-table th,
.field-config-table td {
  text-align: left;
  white-space: normal;
  border-bottom: 1px solid #edf0f2;
  padding: 7px 8px;
}
.field-config-table th {
  z-index: 1;
  background: #f5f7f8;
  position: sticky;
  top: 0;
}
.field-config-table th:first-child,
.field-config-table td:first-child {
  width: 140px;
}
.field-config-table th:nth-child(2),
.field-config-table td:nth-child(2) {
  width: 250px;
}
.field-config-table th:nth-child(3),
.field-config-table td:nth-child(3),
.field-config-table th:nth-child(4),
.field-config-table td:nth-child(4) {
  text-align: center;
  width: 110px;
}
.field-config-table th:nth-child(5),
.field-config-table td:nth-child(5),
.field-config-table th:nth-child(6),
.field-config-table td:nth-child(6) {
  text-align: center;
  width: 100px;
}
.field-config-table input[type="text"],
.field-config-table .field-label-input {
  width: 100%;
  min-width: 0;
  height: 32px;
}
.field-config-table .field-order-input,
.field-config-table .field-width-input {
  text-align: center;
  width: 68px;
  min-width: 0;
  height: 30px;
}
.field-config-table input[type="checkbox"] {
  width: 16px;
  min-width: auto;
  height: 16px;
}
.panel {
  background: #fff;
  border: 1px solid #ddd;
  max-width: 900px;
  margin: 18px auto;
  padding: 22px;
}
.hero-panel {
  color: #fff;
  background: var(--top);
  max-width: none;
  margin-top: 0;
}
.hero-panel h1 {
  margin: 0 0 8px;
  font-size: 24px;
}
.hero-panel p {
  margin: 0;
}
.eyebrow {
  text-transform: uppercase;
  opacity: 0.82;
  margin: 0 0 6px;
  font-size: 12px;
}
.narrow {
  max-width: 640px;
}
.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  display: grid;
}
.form-grid label {
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  display: grid;
  text-align: left;
}
.inline-form {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  display: flex;
}
label {
  color: #555;
  gap: 6px;
  font-size: 14px;
  display: grid;
}
#pod-config-fields, #recon-item-fields, #recon-coll-fields,
#pr-item-fields, #pr-coll-fields, #sod-config-fields,
#pd-config-fields, #sd-config-fields {
  justify-content: flex-start !important;
}
#pod-config-fields label, #recon-item-fields label, #recon-coll-fields label,
#pr-item-fields label, #pr-coll-fields label, #sod-config-fields label,
#pd-config-fields label, #sd-config-fields label {
  display: inline-flex !important;
  margin: 0 !important;
}
#pod-config-fields input[type="checkbox"],
#recon-item-fields input[type="checkbox"],
#recon-coll-fields input[type="checkbox"],
#pr-item-fields input[type="checkbox"],
#pr-coll-fields input[type="checkbox"],
#sod-config-fields input[type="checkbox"],
#pd-config-fields input[type="checkbox"],
#sd-config-fields input[type="checkbox"] {
  margin: 0 !important;
  min-width: auto !important;
  width: 15px !important;
  height: 15px !important;
}
input {
  border: 1px solid #cfd6dc;
  outline: none;
  min-width: 240px;
  height: 27px;
  padding: 0 10px;
}
input:focus {
  border-color: var(--left);
}
select {
  background: #fff;
  border: 1px solid #cfd6dc;
  outline: none;
  min-width: 240px;
  height: 34px;
  padding: 0 10px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.primary,
.secondary,
.danger,
.mini {
  color: var(--left);
  background: #fff;
  min-height: 34px;
  padding: 0 16px;
  font-weight: 700;
  border-radius: 3px;
  border: 1px solid var(--left);
}
.secondary {
  color: var(--left);
  background: #fff;
  border: 1px solid var(--left);
}
.danger {
  color: var(--danger);
  background: #fff;
  border: 1px solid var(--danger);
}
.mini {
  color: var(--left);
  background: #fff;
  min-height: 28px;
  margin-right: 6px;
  padding: 0 10px;
  border: 1px solid var(--left);
}
.mini.danger {
  color: var(--danger);
  background: #fff;
  border: 1px solid var(--danger);
}
.message {
  min-height: 22px;
  color: var(--muted);
  margin-top: 10px;
}
.message.compact {
  margin: 0 0 8px;
  font-size: 12px;
}
.message.ok {
  color: var(--ok);
}
.message.error {
  color: var(--danger);
}
.toolbar {
  gap: 10px;
  margin-bottom: 12px;
  display: flex;
}
.cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  display: grid;
}
.card {
  background: #fff;
  border: 1px solid #ddd;
  padding: 16px;
}
.card.wide {
  grid-column: 1/-1;
}
.card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.card li {
  border-bottom: 1px solid #eee;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  display: flex;
}
.table-wrap {
  border: 1px solid #ddd;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 820px;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid #e6e6e6;
  border-right: 1px solid #e6e6e6;
  padding: 10px 12px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 列宽拖拽把手样式 */
.g-col-resize-handle {
  background: transparent;
  transition: background 0.15s;
}
.g-col-resize-handle:hover {
  background: #1890ff;
  opacity: 0.5;
}
/* 含按钮/输入框等控件的单元格不截断，确保可操作 */
td:has(button),
td:has(input),
td:has(select),
td:has(label),
td:has(.checkbox) {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
th:last-child,
td:last-child {
  border-right: none;
}
table.table-fixed-layout,
table.table-fixed-layout th,
table.table-fixed-layout td {
  table-layout: fixed;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 含按钮/输入框等控件的单元格不截断，确保可操作（更高优先级） */
table.table-fixed-layout td:has(button),
table.table-fixed-layout td:has(input),
table.table-fixed-layout td:has(select),
table.table-fixed-layout td:has(label),
table.table-fixed-layout td:has(.checkbox),
table.table-fixed-layout th:has(input),
table.table-fixed-layout th:has(.checkbox) {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
td input,
td select,
td textarea,
td button {
  max-width: none;
  white-space: normal;
}
th {
  background: #f2f6f8;
  position: sticky;
  top: 0;
  z-index: 3;
}
td:has(input[class*="-product-search"]) {
  padding: 5px 6px;
}
td:has(input[class*="-product-search"]) input {
  height: 26px;
}
.status {
  color: var(--ok);
  background: #eaf8f3;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}
.status.disabled {
  color: var(--danger);
  background: #fbecea;
}
.dict-page {
  max-width: none;
}
.system-subpage {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 122px);
}
.header-actions {
  gap: 8px;
  display: flex;
}
.dict-header {
  background: #fff;
  border: 1px solid #ddd;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px 16px;
  display: flex;
}
.dict-header h1 {
  color: #08715f;
  margin: 0 0 6px;
  font-size: 20px;
}
.dict-header p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.dict-layout {
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  min-height: 560px;
  display: grid;
}
.dict-types {
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px;
}
.dict-type {
  text-align: left;
  background: #f7f7f7;
  border-left: 4px solid #0000;
  width: 100%;
  min-height: 46px;
  margin-bottom: 8px;
  padding: 7px 10px;
}
.dict-type span,
.dict-type em {
  display: block;
}
.dict-type span {
  color: #333;
  font-weight: 700;
}
.dict-type em {
  color: #8a8f94;
  margin-top: 3px;
  font-size: 11px;
  font-style: normal;
}
.dict-type.active,
.dict-type:hover {
  border-left-color: var(--left);
  background: #eef9fe;
}
.dict-content {
  background: #fff;
  border: 1px solid #ddd;
}
.dict-content-head {
  background: #f7fbfd;
  border-bottom: 1px solid #e5e5e5;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  display: flex;
}
.dict-content-head h2 {
  color: #08715f;
  margin: 0;
  font-size: 18px;
}
.dict-content-head span {
  color: #8a8f94;
  font-size: 12px;
}
.dict-toolbar {
  border-bottom: 1px solid #e5e5e5;
  gap: 10px;
  padding: 12px 14px;
  display: flex;
}
.system-tabs {
  gap: 8px;
  margin-bottom: 10px;
  display: flex;
}
.system-tabs button {
  color: #168fc8;
  background: #fff;
  border: 1px solid #cfd9df;
  min-width: 92px;
  height: 32px;
  border-radius: 6px;
}
.system-tabs button.active {
  color: #fff;
  border-color: var(--top);
  background: var(--top);
}
.dict-table-wrap {
  overflow: auto;
}
.empty-cell {
  color: #8a8f94;
  text-align: center;
}
.dict-items tr {
  cursor: pointer;
}
.dict-items tr.selected {
  background: #e6f4fd;
}
.dict-items tr.selected td {
  border-bottom-color: #b3d9f7;
}
.hidden {
  display: none !important;
}
.modal-mask {
  z-index: 100;
  background: #00000047;
  align-content: flex-start;
  justify-items: center;
  padding: 20px 0;
  display: grid;
  position: fixed;
  inset: 0;
}
.modal-card {
  background: #fff;
  border: 1px solid #cfd9df;
  width: 420px;
  box-shadow: 0 12px 34px #0000002e;
  position: relative;
  overflow: hidden;
}
.modal-card.product-modal-card {
  flex-direction: column;
  width: min(1480px, 100vw - 18px);
  height: min(800px, 100vh - 18px);
  max-height: calc(100vh - 18px);
  display: flex;
  position: relative;
  overflow: hidden;
}
.modal-card.field-config-card {
  grid-template-rows: 36px auto minmax(0, 1fr) auto;
  width: min(600px, 100vw - 48px);
  height: min(620px, 100vh - 48px);
  display: grid;
  overflow: hidden;
}
.modal-card.field-config-card .modal-head {
  height: 36px;
  padding: 0 10px;
}
.modal-card.field-config-card .field-config-tip {
  padding: 6px 10px;
  font-size: 12px;
}
.modal-card.field-config-card .modal-actions {
  background: #fff;
  border-top: 1px solid #e1e7eb;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  display: flex;
}
.modal-card.field-config-card [id="bom-body-config"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.modal-card.field-config-card .field-config-table-wrap {
  box-sizing: border-box;
  scrollbar-gutter: stable;
  flex: 1;
  min-height: 0;
  padding: 6px 10px;
  overflow: hidden scroll;
}
.modal-card.field-config-card > .field-config-table-wrap,
.modal-card.field-config-card [id$="-header-config"],
.modal-card.field-config-card [id$="-column-config"] {
  min-height: 0;
}
.modal-card.field-config-card [id$="-header-config"],
.modal-card.field-config-card [id$="-column-config"] {
  flex-direction: column;
  height: 100%;
  display: flex;
  overflow: hidden;
}
.modal-card.field-config-card [id$="-header-config"] > .field-config-table-wrap,
.modal-card.field-config-card [id$="-column-config"] > .field-config-table-wrap {
  box-sizing: border-box;
  flex: auto;
  width: 100%;
  min-height: 0;
}
.modal-card.field-config-card .field-config-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  font-size: 15px;
}
.modal-card.field-config-card .field-config-table thead th {
  z-index: 1;
  background: #f3f7f8;
  position: sticky;
  top: -6px;
}
.modal-card.field-config-card .field-config-table-wrap::-webkit-scrollbar {
  width: 12px;
}
.modal-card.field-config-card
  .field-config-table-wrap::-webkit-scrollbar-thumb {
  background: #9aa7ad;
  border: 3px solid #f5f7f8;
  border-radius: 8px;
}
.modal-card.field-config-card .field-config-table th,
.modal-card.field-config-card .field-config-table td {
  padding: 3px 4px;
}
.modal-card.field-config-card .field-config-table th:first-child,
.modal-card.field-config-card .field-config-table td:first-child {
  width: 66px;
}
.modal-card.field-config-card .field-config-table th:nth-child(2),
.modal-card.field-config-card .field-config-table td:nth-child(2) {
  width: 70px;
}
.modal-card.field-config-card .field-config-table th:nth-child(3),
.modal-card.field-config-card .field-config-table td:nth-child(3) {
  width: 40px;
}
.modal-card.field-config-card .field-config-table th:nth-child(4),
.modal-card.field-config-card .field-config-table td:nth-child(4) {
  width: 90px;
}
.modal-card.field-config-card .field-config-table th:nth-child(5),
.modal-card.field-config-card .field-config-table td:nth-child(5) {
  width: 100px;
}
:is(
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    th:first-child,
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    td:first-child
) {
  width: 80px;
}
:is(
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    th:nth-child(2),
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    td:nth-child(2)
) {
  width: 100px;
}
:is(
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    th:nth-child(3),
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    td:nth-child(3)
) {
  width: 70px;
}
:is(
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    th:nth-child(4),
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    td:nth-child(4)
) {
  width: 60px;
}
:is(
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    th:nth-child(5),
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    td:nth-child(5)
) {
  width: 70px;
}
:is(
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    th:nth-child(6),
  .modal-card.field-config-card
    .field-config-table:has(th:nth-child(6))
    td:nth-child(6)
) {
  width: 100px;
}
.modal-card.field-config-card .field-config-table .field-label-input {
  height: 24px;
  font-size: 15px;
}
.modal-card.field-config-card .field-config-table .field-order-input,
.modal-card.field-config-card .field-config-table .field-width-input {
  width: 60px;
  height: 24px;
  font-size: 15px;
}
.modal-card.field-config-card
  .field-config-table:has(th:nth-child(6))
  .field-width-input {
  width: 72px;
}
.modal-card.field-config-card .field-config-table .field-order-input,
.modal-card.field-config-card .field-config-table .field-width-input {
  appearance: textfield;
}
.modal-card.field-config-card
  .field-config-table
  .field-order-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.modal-card.field-config-card
  .field-config-table
  .field-order-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.modal-card.field-config-card
  .field-config-table
  .field-width-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.modal-card.field-config-card
  .field-config-table
  .field-width-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.modal-card.field-config-card .field-config-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
@media (width<=700px) {
  .modal-card.field-config-card {
    width: calc(100vw - 16px);
  }
  .modal-card.field-config-card .field-config-table {
    font-size: 14px;
  }
  .modal-card.field-config-card .field-config-table th,
  .modal-card.field-config-card .field-config-table td {
    padding: 3px 2px;
  }
  :is(
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      th:first-child,
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      td:first-child
  ) {
    width: 58px;
  }
  :is(
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      th:nth-child(2),
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      td:nth-child(2)
  ) {
    width: 84px;
  }
  :is(
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      th:nth-child(3),
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      td:nth-child(3)
  ) {
    width: 62px;
  }
  :is(
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      th:nth-child(4),
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      td:nth-child(4)
  ) {
    width: 54px;
  }
  :is(
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      th:nth-child(5),
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      td:nth-child(5)
  ) {
    width: 58px;
  }
  :is(
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      th:nth-child(6),
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      td:nth-child(6)
  ) {
    width: 78px;
  }
  .modal-card.field-config-card .field-config-table .field-label-input {
    font-size: 14px;
  }
  .modal-card.field-config-card .field-config-table .field-order-input {
    width: 44px;
    font-size: 14px;
  }
  :is(
    .modal-card.field-config-card .field-config-table .field-width-input,
    .modal-card.field-config-card
      .field-config-table:has(th:nth-child(6))
      .field-width-input
  ) {
    width: 58px;
    font-size: 14px;
  }
}
.modal-card.print-designer-card {
  width: min(1380px, 100vw - 18px);
  height: min(900px, 100vh - 18px);
  overflow: hidden;
}
.print-designer-card .product-form {
  flex-direction: column;
  height: calc(100% - 42px);
  padding: 0;
  display: flex;
  overflow: hidden;
}
.print-designer-card .product-form > .modal-actions {
  flex: none;
  margin: 0;
  padding: 10px 14px;
  position: static;
}
.print-designer-layout {
  background: #eef2f5;
  flex: 1;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  padding: 12px;
  display: grid;
  overflow: hidden;
}
.print-designer-panel,
.print-preview-wrap {
  background: #fff;
  border: 1px solid #d6dee4;
  min-width: 0;
  min-height: 0;
  overflow: hidden auto;
}
.print-designer-panel {
  padding: 12px;
}
.print-section {
  background: #fbfcfd;
  border: 1px solid #e2e8ef;
  border-radius: 10px;
  margin-bottom: 12px;
  padding: 10px;
}
.print-section .price-toolbar {
  margin: -2px 0 10px;
}
.print-designer-panel label,
.print-column-list label {
  color: #334;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  display: flex;
  white-space: nowrap;
}
.print-designer-panel label input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
}
.print-designer-panel label select {
  width: auto;
  min-width: 0;
}
:is(
  .print-designer-panel label:has(input:not([type="checkbox"])),
  .print-designer-panel label:has(select)
) {
  gap: 5px;
  display: grid;
}
.print-number-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  display: grid;
}
.print-number-grid label {
  margin-bottom: 0;
}
.print-column-row {
  grid-template-columns: minmax(150px, 1fr) 86px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  display: grid;
}
.print-column-row label {
  margin-bottom: 0;
}
.print-column-row input[type="number"] {
  width: 100%;
  min-width: 0;
}
.print-preview-wrap {
  background: #dfe6ec;
  flex-direction: column;
  padding: 0;
  display: flex;
  overflow: hidden auto;
}
.print-preview-wrap > .price-toolbar {
  background: #fff;
  flex: none;
}
.print-preview-wrap > .price-toolbar span {
  color: #7c8790;
  font-size: 12px;
}
.print-preview-paper {
  box-sizing: border-box;
  aspect-ratio: 210/297;
  color: #111;
  background: #fff;
  border: 1px solid #cfd6dc;
  flex: none;
  width: min(720px, 100% - 32px);
  min-height: 0;
  margin: 16px auto 24px;
  padding: 28px;
  font-size: 13px;
  box-shadow: 0 10px 30px #1c2d3c2e;
}
.print-preview-paper.landscape {
  aspect-ratio: 297/210;
  width: min(960px, 100% - 32px);
  min-height: 0;
}
.print-preview-paper.continuous {
  width: min(880px, 100% - 32px);
  min-height: 0;
}
.print-preview-paper.ticket {
  width: 260px;
  min-height: 520px;
  padding: 14px;
  font-size: 11px;
}
.print-preview-paper h2,
.preview-company {
  text-align: center;
}
.preview-company {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 700;
}
.preview-meta {
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
  margin: 10px 0;
  display: grid;
}
.print-preview-paper.ticket .preview-meta {
  grid-template-columns: 1fr;
}
.preview-meta.muted {
  color: #666;
  border-top: 1px dashed #ccc;
  padding-top: 8px;
}
.print-preview-paper table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  margin-top: 8px;
}
.print-preview-paper th,
.print-preview-paper td {
  text-align: center;
  text-overflow: ellipsis;
  border: 1px solid #888;
  padding: 5px;
  overflow: hidden;
}
.preview-summary {
  text-align: right;
  margin-top: 10px;
  font-weight: 700;
}
.preview-sign {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
  display: grid;
}
.wide-modal {
  width: 720px;
}
.modal-head {
  color: #fff;
  cursor: move;
  -webkit-user-select: none;
  user-select: none;
  background: var(--top);
  flex: none;
  justify-content: space-between;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  display: flex;
}
.modal-dragging {
  z-index: 30;
}
.modal-close {
  color: #fff;
  width: 28px;
  height: 28px;
  font-size: 22px;
  line-height: 1;
}
.modal-head-btn {
  color: #fff;
  text-align: center;
  cursor: pointer;
  opacity: 0.8;
  background: 0 0;
  border: none;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 28px;
}
.modal-head-btn:hover {
  opacity: 1;
}
.modal-form {
  gap: 12px;
  padding: 16px;
  display: grid;
  position: relative;
}
.modal-form > label {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
  text-align: left;
}
.modal-form > label.product-form-cell-wide {
  display: grid;
  align-items: unset;
}
.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.permission-grid {
  background: #fbfdfe;
  border: 1px solid #dbe3e8;
  grid-template-columns: 1fr 3fr;
  gap: 8px;
  max-height: 260px;
  padding: 10px;
  display: grid;
  overflow: auto;
}
.check-row {
  background: #fff;
  border: 1px solid #e4e8eb;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 13px;
  display: grid;
}
.check-row input {
  width: 16px;
  min-width: 0;
  height: 16px;
  padding: 0;
}
.check-row span {
  color: #8a8f94;
  grid-column: 2;
  font-size: 11px;
}
/* 权限树样式 */
.permission-grid {
  max-height: 480px;
}
.perm-tree-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid #dbe3e8;
}
.perm-tree-toolbar .small {
  font-size: 12px;
  padding: 2px 8px;
  height: 22px;
  line-height: 18px;
}
.perm-tree {
  padding: 10px;
  overflow: auto;
  max-height: 420px;
}
.perm-tree-node {
  margin-bottom: 4px;
}
.perm-module {
  border: 1px solid #d0d8e0;
  border-radius: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}
.perm-module-row {
  background: #e8f0fe;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.perm-module-row .perm-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.perm-module-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a3a5c;
}
.perm-submenu {
  margin-left: 16px;
  margin-bottom: 4px;
}
.perm-submenu-row {
  background: #f5f7fa;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 4px;
}
.perm-submenu-row .perm-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.perm-submenu-name {
  font-weight: 500;
  font-size: 13px;
  color: #333;
}
.perm-children {
  margin-left: 16px;
  padding: 6px 0 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.perm-children.collapsed {
  display: none;
}
.perm-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  padding: 3px 8px;
  border: 1px solid #e0e4e8;
  border-radius: 4px;
  background: #fff;
  white-space: nowrap;
}
.perm-btn-label:hover {
  background: #f0f5ff;
  border-color: #b0c4de;
}
.perm-btn-label input {
  width: 14px;
  height: 14px;
  margin: 0;
}
.perm-toggle {
  font-size: 11px;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid #c0c8d0;
  border-radius: 3px;
  cursor: pointer;
  color: #666;
}
.perm-toggle:hover {
  background: #e8f0fe;
  border-color: #4a90d9;
  color: #1a3a5c;
}
.perm-check-label input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.modal-error {
  color: #b33128;
  background: #fff3f1;
  border: 1px solid #efb1aa;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  padding: 9px 10px;
  font-size: 14px;
  display: flex;
}
.modal-error button {
  color: #b33128;
  width: 22px;
  height: 22px;
  font-size: 18px;
  line-height: 1;
}
.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
  display: flex;
}
@media (width<=1180px) {
  body {
    min-width: 980px;
  }
  .notice-cards {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
  .quick-grid {
    grid-template-columns: repeat(4, 160px);
  }
}
.full-page .notice-bar,
.full-page .sidebar {
  display: none;
}

.full-page .main {
  grid-column: 1 / -1;
  grid-row: 3 / -1;
}

/* ===== 统一导入弹窗样式 ===== */
.modal-card.import-modal-card {
  width: min(500px, 100vw - 48px);
  display: flex;
  flex-direction: column;
}
.import-modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.import-modal-body label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}
.import-modal-body select {
  flex: 1;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 14px;
}
.import-file-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.import-file-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.import-file-input {
  flex: 1;
  font-size: 14px;
  height: 40px;
  padding: 4px 8px;
}
.import-progress-wrap {
  margin: 12px 0;
}
.import-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}
.import-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #007a65, #0baa8c);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.import-progress-text {
  margin-top: 6px;
  font-size: 13px;
  color: #6f7883;
}
.import-result-wrap {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
}
.import-result-success {
  background: #d4edda;
  color: #155724;
}
.import-result-error {
  background: #f8d7da;
  color: #721c24;
}
.import-result-warn {
  background: #fff3cd;
  color: #856404;
}

/* Pagination */
.pagination {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  font-size: 12px;
}

.pagination .page-size-select {
  padding: 3px 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 12px;
  margin-right: 6px;
  cursor: pointer;
}


  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.2s;
  background: #138a6a;
  color: #fff;
  border: 1px solid #138a6a;
}

.pagination .page-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.pagination .page-btn:disabled {
  background: #c8c8c8;
  border-color: #c8c8c8;
  color: #fff;
  cursor: not-allowed;
}

.pagination .page-info {
  padding: 4px 8px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

/* 批次预警样式 */
.purchase-batch-no.batch-warning {
  border-color: #ff4d4f !important;
  background-color: #fff2f0 !important;
}

.batch-warning-tooltip {
  position: absolute;
  z-index: 9999;
  background: #ff4d4f;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.batch-warning-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 12px;
  border: 5px solid transparent;
  border-top-color: transparent;
  border-bottom-color: #ff4d4f;
}

/* ============================================================
   全局强制：表格固定布局 + 列宽可调可截断
   !important 覆盖所有 inline style，确保列宽拖拽生效
   ============================================================ */
.product-table,
.data-table,
.inventory-table,
.product-price-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
}
.product-table th,
.product-table td,
.data-table th,
.data-table td,
.inventory-table th,
.inventory-table td,
.product-price-table th,
.product-price-table td {
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
/* 含交互控件的单元格不截断 */
.product-table td:has(button),
.product-table td:has(input),
.product-table td:has(select),
.product-table td:has(label),
.product-table td:has(.checkbox),
.data-table td:has(button),
.data-table td:has(input),
.data-table td:has(select),
.data-table td:has(label),
.data-table td:has(.checkbox),
.inventory-table td:has(button),
.inventory-table td:has(input),
.inventory-table td:has(select),
.inventory-table td:has(label),
.inventory-table td:has(.checkbox),
.product-price-table td:has(button),
.product-price-table td:has(input),
.product-price-table td:has(select),
.product-table th:has(input),
.product-table th:has(.checkbox),
.data-table th:has(input),
.data-table th:has(.checkbox) {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}
/* main 区域和弹窗内的所有表格也强制固定布局 */
.main table,
.product-modal-card table,
.modal-content table,
.popup-content table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
}
.main table th,
.main table td,
.product-modal-card table th,
.product-modal-card table td,
.modal-content table th,
.modal-content table td,
.popup-content table th,
.popup-content table td {
  min-width: 0 !important;
  max-width: none !important;
}

/* ===== 表格勾选框列样式 ===== */
.data-table th:first-child,
.data-table td:first-child {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
.data-table th:first-child input[type="checkbox"],
.data-table td:first-child input[type="checkbox"] {
  margin-right: 4px;
  vertical-align: middle;
  cursor: pointer;
}
/* product-table / product-price-table 勾选框列：th 内仅含 checkbox 无文本时固定宽度，不可拖拽 */
.product-table th:has(> input[type="checkbox"]:only-child),
.product-price-table th:has(> input[type="checkbox"]:only-child) {
  width: 40px !important;
  min-width: 40px !important;
  text-align: center;
}
.product-table td:has(> input[type="checkbox"]:only-child),
.product-price-table td:has(> input[type="checkbox"]:only-child) {
  text-align: center;
}

/* ===== 修复：无数据时表头列宽坍塌 ===== */
/* table-layout:fixed 下 tbody 仅一行 colspan=99 时浏览器无法推断列宽导致表头坍塌 */
.product-table:has(tbody > tr:only-child > td[colspan="99"]) thead th:not(:has(> input[type="checkbox"]:only-child)),
.data-table:has(tbody > tr:only-child > td[colspan="99"]) thead th:not(:has(> input[type="checkbox"]:only-child)),
.inventory-table:has(tbody > tr:only-child > td[colspan="99"]) thead th:not(:has(> input[type="checkbox"]:only-child)) {
  width: 100px !important;
}

/* ===== 部门树形选择器 ===== */
.dept-tree-select {
  position: relative;
  display: block;
  width: 100%;
}
.dept-tree-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  min-height: 26px;
}
.dept-tree-display:hover {
  border-color: var(--left);
}
.dept-tree-display .dept-placeholder {
  color: var(--muted);
}
.dept-tree-display .dept-selected-label {
  color: var(--text);
}
.dept-tree-display .dept-arrow {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
  margin-left: 4px;
}
.dept-tree-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
}
.dept-tree-dropdown.hidden {
  display: none;
}
.dept-tree-node {
  display: flex;
  align-items: center;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 22px;
  white-space: nowrap;
}
.dept-tree-node:hover {
  background: #f0f7ff;
}
.dept-tree-node.dept-tree-company {
  font-weight: 600;
  color: var(--text);
}
.dept-tree-node.dept-tree-dept {
  color: var(--text);
}
.dept-tree-node.dept-tree-dept:hover {
  color: var(--left);
}
.dept-tree-toggle {
  display: inline-block;
  width: 16px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  cursor: pointer;
}
.dept-tree-toggle-spacer {
  display: inline-block;
  width: 16px;
  flex-shrink: 0;
}
.dept-tree-icon {
  margin-right: 4px;
  font-size: 13px;
  flex-shrink: 0;
}
.dept-tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dept-tree-children {
  padding-left: 20px;
}
.dept-tree-children.hidden {
  display: none;
}
.dept-tree-empty {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

/* 全局：勾选行保持高亮 */
tr:has(.row-checkbox:checked) {
  background: #e6f4fd !important;
}
tr:has(.row-checkbox:checked) td {
  border-bottom-color: #b3d9f7;
}
/* 全局：JS同步高亮（:has()不可用时的回退） */
tr.selected {
  background: #e6f4fd;
}
tr.selected td {
  border-bottom-color: #b3d9f7;
}
/* 批量选择弹窗：勾选行保持高亮 */
.modal-card.sub-modal-card tr:has(input[type="checkbox"]:checked) {
  background: #e6f4fd !important;
}
.modal-card.sub-modal-card tr:has(input[type="checkbox"]:checked) td {
  border-bottom-color: #b3d9f7;
}
/* 弹窗内勾选行高亮（CSS兜底，覆盖所有弹窗） */
.modal-mask tr:has(input[type="checkbox"]:checked) {
  background: #e6f4fd !important;
}
.modal-mask tr:has(input[type="checkbox"]:checked) td {
  border-bottom-color: #b3d9f7;
}
/* 全局 row-checkbox 统一样式（与单据列表一致） */
.row-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  vertical-align: middle;
  accent-color: #1890ff;
}
/* 源订单选择弹窗：勾选框列固定窄宽度，无留白，不可调宽 */
#sales-source-quotation-modal .sq-cb-col {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  text-align: left !important;
  padding: 0 !important;
  overflow: visible !important;
}
#sales-source-quotation-modal input[type="checkbox"] {
  margin: 0 !important;
  padding: 0 !important;
  min-width: auto !important;
  width: 16px !important;
  height: 16px !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}
#sales-source-quotation-modal .resize-handle { display: none !important; }
#sales-source-quotation-modal .sq-item-qty {
  min-width: auto !important;
  width: 100% !important;
  height: 24px !important;
  border: 1px solid #d9d9d9 !important;
  padding: 2px 4px !important;
}
#sales-source-quotation-modal .modal-card {
  resize: both !important;
  overflow: hidden !important;
  min-width: 600px !important;
  min-height: 400px !important;
}
/* 采购入库源订单选择弹窗：勾选框列固定窄宽度，无留白 */
#purchase-source-order-modal .sq-cb-col {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  text-align: left !important;
  padding: 0 !important;
  overflow: visible !important;
}
#purchase-source-order-modal input[type="checkbox"] {
  margin: 0 !important;
  padding: 0 !important;
  min-width: auto !important;
  width: 16px !important;
  height: 16px !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}
#purchase-source-order-modal .resize-handle { display: none !important; }
#purchase-source-order-modal .po-item-qty {
  min-width: auto !important;
  width: 100% !important;
  height: 24px !important;
  border: 1px solid #d9d9d9 !important;
  padding: 2px 4px !important;
}
#purchase-source-order-modal .modal-card {
  resize: both !important;
  overflow: hidden !important;
  min-width: 600px !important;
  min-height: 400px !important;
}
/* 采购订单引用销售订单弹窗 */
#po-source-order-modal .sq-cb-col {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  text-align: left !important;
  padding: 0 !important;
  overflow: visible !important;
}
#po-source-order-modal input[type="checkbox"] {
  margin: 0 !important;
  padding: 0 !important;
  min-width: auto !important;
  width: 16px !important;
  height: 16px !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}
#po-source-order-modal .resize-handle { display: none !important; }
#po-source-order-modal .po-so-item-qty {
  min-width: auto !important;
  width: 100% !important;
  height: 24px !important;
  border: 1px solid #d9d9d9 !important;
  padding: 2px 4px !important;
}
#po-source-order-modal .modal-card {
  resize: both !important;
  overflow: hidden !important;
  min-width: 600px !important;
  min-height: 400px !important;
}
/* 生产排单引用销售订单弹窗 */
#po-sales-modal .sq-cb-col {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  text-align: left !important;
  padding: 0 !important;
  overflow: visible !important;
}
#po-sales-modal input[type="radio"] {
  margin: 0 !important;
  padding: 0 !important;
  min-width: auto !important;
  width: 16px !important;
  height: 16px !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 2px solid #bbb !important;
  border-radius: 2px !important;
  background: #fff !important;
  cursor: pointer !important;
}
#po-sales-modal input[type="radio"]:checked {
  border-color: #1890ff !important;
  background: #1890ff !important;
}
#po-sales-modal input[type="radio"]:checked::after {
  content: "" !important;
  position: absolute !important;
  top: 2px !important;
  left: 5px !important;
  width: 4px !important;
  height: 8px !important;
  border: solid #fff !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
}
#po-sales-modal .resize-handle { display: none !important; }
#po-sales-modal .modal-card {
  resize: both !important;
  overflow: hidden !important;
  min-width: 600px !important;
  min-height: 400px !important;
}
/* 主内容文本统一14px */
.logo-orb,
.tenant-strip p,
.info-grid li,
.product-form label,
.product-price-table,
.changelog-table,
.dict-header p,
.check-row,
.perm-submenu-name,
.dept-tree-display,
.dept-tree-icon,
.dept-tree-node,
.import-progress-text,
.import-result-wrap,
.doc-date-inline .doc-date-start,
.doc-date-inline .doc-date-end,
.doc-date-inline .doc-date-sep,
.print-preview-paper {
  font-size: 14px;
}
/* 辅助/次要文本统一12px */
.dict-type em,
.check-row span,
.perm-toggle,
.scan-input,
.dept-tree-toggle {
  font-size: 12px;
}
/* 字段配置表格统一14px */
.modal-card.field-config-card .field-config-table,
.modal-card.field-config-card .field-config-table .field-label-input,
.modal-card.field-config-card .field-config-table .field-order-input,
.modal-card.field-config-card .field-config-table .field-width-input {
  font-size: 14px;
}
/* ===== 条码打印样式 ===== */
.barcode-label canvas, .barcode-label img { display: block; margin: 0 auto; max-width: 100%; }
/* 打印时只显示条码预览区域内容 */
@media print {
  body * { visibility: hidden !important; }
  #barcode-print-preview, #barcode-print-preview * { visibility: visible !important; }
  #barcode-print-preview {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    background: #fff !important;
    z-index: 99999 !important;
  }
  #barcode-print-preview .barcode-label { border: 1px solid #ccc !important; page-break-inside: avoid; display: inline-block !important; width: 33% !important; box-sizing: border-box !important; vertical-align: top !important; }
  #barcode-print-preview .print-barcode-img { display: block !important; max-width: 90% !important; }
  /* 隐藏弹窗遮罩 */
  #barcode-print-modal, .modal-mask, .modal-card, .modal-head { display: none !important; }
  @page { margin: 5mm; }
}
/* 表格内容统一14px */
table,
th,
td {
  font-size: 14px;
}
/* 标签/输入框统一14px */
label,
input,
select,
textarea {
  font-size: 14px;
}

/* 预警明细弹框 */
.notice-detail-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.notice-detail-modal {
  background: #fff;
  border-radius: 8px;
  width: 80%; max-width: 900px;
  max-height: 75vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.notice-detail-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}
.notice-detail-close {
  border: none; background: none; font-size: 22px;
  cursor: pointer; color: #999; padding: 0 4px;
  line-height: 1;
}
.notice-detail-close:hover { color: #333; }
.notice-detail-body {
  flex: 1; overflow: auto;
  padding: 0;
}
.notice-detail-loading {
  text-align: center; padding: 40px; color: #999; font-size: 14px;
}
.notice-detail-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.notice-detail-table th {
  background: #f5f7fa; color: #333; font-weight: 600;
  padding: 8px 12px; text-align: left;
  border-bottom: 2px solid #e8e8e8;
  position: sticky; top: 0; z-index: 1;
}
.notice-detail-table td {
  padding: 7px 12px; border-bottom: 1px solid #f0f0f0;
  color: #555;
}
.notice-detail-table tbody tr:hover { background: #f9fafc; }
.notice-detail-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px;
  border-top: 1px solid #eee;
}
.notice-detail-count { color: #999; font-size: 13px; }
.notice-detail-close-btn {
  padding: 5px 18px; border: 1px solid #ddd; border-radius: 4px;
  background: #fff; color: #666; cursor: pointer; font-size: 13px;
}
.notice-detail-close-btn:hover { background: #f5f5f5; }

/* ===== 主题设置页 ===== */
.theme-page {
  padding: 20px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.theme-card {
  position: relative;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.theme-card:hover {
  border-color: var(--top);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.theme-card.selected {
  border-color: var(--ok);
  box-shadow: 0 4px 12px rgba(19,138,106,0.2);
}
.theme-preview {
  width: 100%;
  height: 120px;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #eee;
}
.theme-preview-top {
  height: 24px;
  flex-shrink: 0;
}
.theme-preview-body {
  flex: 1;
  display: flex;
  min-height: 0;
}
.theme-preview-side {
  width: 40px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
}
.theme-preview-side-item {
  height: 12px;
  border-radius: 3px;
  opacity: 0.7;
}
.theme-preview-content {
  flex: 1;
  background: #f5f7fa;
  padding: 4px;
}
.theme-preview-content::before {
  content: '';
  display: block;
  height: 8px;
  background: #e8eaed;
  border-radius: 2px;
  margin-bottom: 4px;
}
.theme-preview-content::after {
  content: '';
  display: block;
  height: 8px;
  background: #e8eaed;
  border-radius: 2px;
  width: 60%;
}
.theme-card-name {
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}
.theme-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 14px;
  display: none;
  align-items: center;
  justify-content: center;
}
.theme-card.selected .theme-card-check {
  display: flex;
}
