* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: #0c1422;
  color: #edf4ff;
  overflow: hidden;
}
.hidden { display: none !important; }
.login-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0c1422;
}
.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 26px;
  border-radius: 12px;
  background: #121f33;
  border: 1px solid #2e4564;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.login-panel h1 { font-size: 24px; margin-bottom: 8px; }
.login-panel label {
  display: grid;
  gap: 7px;
  color: #b9c7da;
  font-size: 13px;
}
.login-panel .remember-login { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember-login input { width: 16px; height: 16px; margin: 0; accent-color: #2d87ce; }
.login-account-field { position: relative; }
.recent-account-list {
  position: absolute;
  z-index: 30;
  top: 64px;
  left: 0;
  right: 0;
  display: grid;
  overflow: hidden;
  border: 1px solid #3a5677;
  border-radius: 8px;
  background: #14243a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .32);
}
.recent-account-item {
  height: auto;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid #2d435f;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.recent-account-item:last-child { border-bottom: 0; }
.recent-account-item:hover { background: #203a59; }
.recent-account-item span { color: #8fb0d2; font-size: 12px; }
.login-message {
  min-height: 20px;
  color: #9fb0c7;
  font-size: 13px;
}
.icp-link {
  margin-top: -8px;
  color: #8fa2bd;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}
.icp-link:hover { color: #d7e7fa; text-decoration: underline; }
.login-help {
  margin: 0;
  color: #8fa2bd;
  font-size: 12px;
  line-height: 1.5;
}
.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 230px 1fr;
}
.app.home-mode { grid-template-columns: 1fr; }
.app.home-mode .sidebar { display: none; }
.app.home-mode main { overflow: auto; }
.app.jd-mode main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar {
  background: #08111f;
  border-right: 1px solid #22334b;
  padding: 22px 16px;
  overflow: hidden;
}
.brand {
  border-bottom: 1px solid #263852;
  padding-bottom: 18px;
  margin-bottom: 18px;
}
.brand strong { display: block; font-size: 20px; }
.brand span { color: #96a7bd; font-size: 12px; }
nav { display: grid; gap: 6px; }
nav a {
  color: #c6d3e5;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}
nav a.active, nav a:hover { background: #1e5f9a; color: white; }
main { padding: 24px; min-width: 0; }
.topbar, .query, .panel {
  background: #121f33;
  border: 1px solid #263852;
  border-radius: 10px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-function-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-function-btn {
  height: 38px;
  min-width: 96px;
  padding: 0 16px;
  background: #172842;
  border-color: #35516f;
  color: #d9ecff;
  box-shadow: none;
}
.top-function-btn:hover {
  background: #203a59;
  border-color: #4b9ee8;
}
h1, h2, h3, p { margin-top: 0; }
p { color: #9fb0c7; margin-bottom: 0; line-height: 1.6; }
button, input, select {
  height: 38px;
  border-radius: 8px;
  border: 1px solid #314762;
  background: #172842;
  color: #edf4ff;
  padding: 0 14px;
  font: inherit;
}
button {
  cursor: pointer;
  background: #246fb2;
  border-color: #347fca;
  font-weight: 700;
}
button:disabled {
  cursor: not-allowed;
  opacity: .55;
  background: #172842;
}
.query {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}
.panel { padding: 18px; margin-bottom: 16px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge {
  border-radius: 999px;
  padding: 5px 10px;
  background: #203a59;
  color: #b9d9ff;
  font-size: 13px;
  white-space: nowrap;
}
.module-center {
  min-height: calc(100vh - 150px);
  padding: 22px;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 16px;
}
.module-card {
  position: relative;
  overflow: hidden;
  min-height: 188px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: 8px;
  background: #152337;
  border: 1px solid #263852;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .16);
}
.module-card.enabled {
  background: linear-gradient(145deg, #173257, #123452 58%, #152337);
  border-color: #4d91d6;
}
.module-card.enabled::after {
  content: "";
  position: absolute;
  inset: auto -50px -70px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(77, 145, 214, .18);
}
.module-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #213a5b;
  color: #d9ecff;
  font-weight: 800;
  border: 1px solid #385779;
}
.module-card.enabled .module-mark {
  background: #2b78bd;
  border-color: #72b8ff;
  color: #ffffff;
}
.module-card h3 { margin-bottom: 8px; font-size: 18px; }
.module-card p { font-size: 13px; }
.module-card-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.warehouse-card {
  background: #182a44;
  border: 1px solid #334d70;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.warehouse-card:hover { border-color: #78b7ff; transform: translateY(-1px); }
.warehouse-card.short { border-color: #b84c58; }
.warehouse-card.ok { border-color: #2d9964; }
.warehouse-card h3 { margin-bottom: 12px; }
.warehouse-card .row {
  display: flex;
  justify-content: space-between;
  color: #b9c7da;
  margin-top: 7px;
}
.warehouse-card strong { color: #fff; }
.red { color: #ff6b6b !important; }
.green { color: #61d394 !important; }
.progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.progress-item {
  min-height: 74px;
  padding: 12px;
  border-radius: 8px;
  background: #142238;
  border: 1px solid #263852;
}
.progress-item strong {
  display: inline-flex;
  margin-bottom: 8px;
  font-size: 12px;
  border-radius: 999px;
  padding: 3px 8px;
}
.progress-item span {
  display: block;
  color: #edf4ff;
  font-weight: 700;
}
.progress-item.done strong {
  background: rgba(97, 211, 148, .14);
  color: #61d394;
}
.progress-item.next strong {
  background: rgba(142, 197, 255, .14);
  color: #8ec5ff;
}
.grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #263852;
}
.metrics div {
  min-height: 86px;
  padding: 15px;
  background: #142238;
}
.metrics span {
  display: block;
  color: #aebcd1;
  margin-bottom: 8px;
  font-size: 13px;
}
.metrics strong { font-size: 28px; }
.import-list { display: grid; gap: 12px; }
.upload-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #304762;
  background: #142238;
}
.upload-card strong { display: block; }
.upload-card span {
  color: #9fb0c7;
  font-size: 12px;
  line-height: 1.5;
}
.template-link {
  color: #8ec5ff;
  font-size: 13px;
  text-decoration: none;
  width: fit-content;
}
.template-link:hover { color: #ffffff; }
.upload-card input {
  width: 100%;
  height: auto;
  min-height: 38px;
  padding: 8px;
}
.ghost-btn {
  background: #172842;
  border-color: #334d70;
}
.import-message {
  min-height: 34px;
  color: #b9c7da;
  font-size: 13px;
  line-height: 1.5;
}
.table-wrap { overflow-x: auto; }
.jd-hidden { display: none !important; }
.grid.jd-single { grid-template-columns: 1fr; }
.app.jd-mode .topbar {
  flex: 0 0 auto;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.app.jd-mode .topbar h1 { margin-bottom: 4px; font-size: 24px; }
.app.jd-mode #jdInboundView {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}
.app.jd-page-overview #jdInboundView,
.app.jd-page-warehouses #jdInboundView {
  grid-template-rows: auto auto minmax(0, 1fr);
}
.app.jd-mode #jdInboundView > .query,
.app.jd-mode #jdInboundView > .trace-panel,
.app.jd-mode #warehouses,
.app.jd-mode #transactions,
.app.jd-mode #directVerifications,
.app.jd-mode #warehouseLines {
  grid-column: 1 / -1;
}
.app.jd-mode #jdInboundView > .query,
.app.jd-mode #jdInboundView .panel,
.app.jd-mode #jdInboundView > .grid {
  margin-bottom: 0;
}
.app.jd-mode #jdInboundView > .panel,
.app.jd-mode #jdInboundView > .grid,
.app.jd-mode #jdInboundView > .grid > .panel {
  min-height: 0;
  overflow: hidden;
}
.app.jd-mode #jdInboundView .panel {
  display: flex;
  flex-direction: column;
}
.app.jd-mode #jdInboundView .table-wrap,
.app.jd-mode #jdInboundView .import-list,
.app.jd-mode #jdInboundView .sku-list,
.app.jd-mode #jdInboundView .analysis-body {
  min-height: 0;
  overflow: auto;
}
.app.jd-mode #jdInboundView > .grid {
  grid-column: 1 / -1;
  height: 100%;
}
.app.jd-mode #imports .import-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.app.jd-mode #warehouses .warehouse-grid {
  grid-template-columns: repeat(8, minmax(110px, 1fr));
}
.app.jd-page-overview .metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.back-home-link {
  margin-bottom: 10px;
  border: 1px solid #35516f;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  border-bottom: 1px solid #253852;
  padding: 11px 10px;
  text-align: left;
  white-space: nowrap;
}
th { color: #9fb0c7; font-weight: 600; }
.num { text-align: right; }
.sku-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sku-card {
  background: #142238;
  border: 1px solid #263852;
  border-radius: 8px;
  padding: 12px;
}
.sku-card strong { display: block; margin-bottom: 6px; }
.sku-card span { color: #9fb0c7; font-size: 13px; }
.account-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.account-card {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #142238;
  border: 1px solid #2c4260;
}
.account-card > summary { list-style: none; cursor: pointer; }
.account-card > summary::-webkit-details-marker { display: none; }
.compact-account-title {
  min-height: 66px;
  padding: 14px 18px;
  border-radius: 7px;
}
.account-card[open] .compact-account-title {
  border-bottom: 1px solid #31506f;
  border-radius: 7px 7px 0 0;
}
.account-detail-body { padding: 16px 18px 18px; }
.expand-label, .account-summary-status {
  color: #8fdcff;
  font-size: 13px;
  font-weight: 600;
}
.account-card[open] .expand-label { font-size: 0; }
.account-card[open] .expand-label::after { content: "收起"; font-size: 13px; }
.account-confirm-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.account-confirm-row button {
  min-width: 150px;
  background: #168fd0;
  border-color: #57c8ff;
  color: #fff;
  font-weight: 700;
}
.audit-dialog {
  width: min(1100px, 92vw);
  max-height: 82vh;
  padding: 0;
  border: 1px solid #355779;
  border-radius: 8px;
  background: #101f33;
  color: #edf5ff;
  box-shadow: 0 22px 70px #000b;
}
.audit-dialog::backdrop { background: #020812cc; }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #29415f;
}
.dialog-head p { margin: 4px 0 0; color: #91a8c0; }
#closeAuditBtn { font-size: 24px; min-width: 42px; }
.audit-table-wrap { max-height: 62vh; overflow: auto; padding: 0 18px 18px; }
.create-account-card {
  grid-column: 1 / -1;
  background: #102d45;
  border-color: #3477ad;
}
.account-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.account-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.account-title strong { display: block; font-size: 18px; }
.account-title span, .switch-line span, .check-line span { color: #aebcd1; font-size: 13px; }
.account-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.account-controls label:not(.check-line) {
  display: grid;
  gap: 6px;
  color: #aebcd1;
  font-size: 13px;
}
.switch-line, .check-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.switch-line input, .check-line input {
  width: 16px;
  height: 16px;
}
.module-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.module-permission-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 140px;
  gap: 8px;
  align-items: center;
}
.module-permission-row select { min-width: 0; }
.brand-permission-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #31506f;
  border-radius: 7px;
  background: #10243a;
}
.account-actions {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.reset-password-input {
  min-width: 0;
}
.save-user-btn { justify-self: end; }
.module-config-section, .audit-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #263852;
}
.module-config-list {
  display: grid;
  gap: 10px;
}
.module-config-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 110px auto 120px minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #142238;
  border: 1px solid #2c4260;
}
.module-config-card strong,
.module-config-card span {
  display: block;
}
.module-config-card span {
  margin-top: 4px;
  color: #9fb0c7;
  font-size: 12px;
}
.product-query {
  margin: 0 0 14px;
  grid-template-columns: 1fr auto;
}
.product-create-panel {
  display: grid;
  grid-template-columns: 1fr 1fr 160px 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}
.product-list-toolbar,
.product-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-list-toolbar {
  justify-content: space-between;
  margin-top: 14px;
}
.product-pagination label { color: #9fb0c7; }
.product-pagination select { margin-left: 6px; }
.danger-btn { background: #9f3540; border-color: #c54b57; }
.danger-btn:hover { background: #b53d49; }
.account-delete-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid #2c4260;
}
.product-table { margin-top: 14px; }
@media (max-width: 1000px) {
  .product-create-panel { grid-template-columns: 1fr 1fr; }
  .product-list-toolbar { align-items: flex-start; flex-direction: column; }
}
.analysis-body {
  display: grid;
  gap: 14px;
}
.analysis-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: #142238;
  border: 1px solid #2c4260;
}
.analysis-summary strong { display: block; font-size: 18px; }
.analysis-summary span { color: #9fb0c7; font-size: 13px; }
.analysis-result {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.analysis-result strong { font-size: 24px; }
.analysis-conclusion {
  padding: 14px;
  border-radius: 8px;
  background: #1c324f;
  border: 1px solid #3c6b9b;
  color: #edf4ff;
  line-height: 1.6;
}
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.analysis-grid div {
  min-height: 82px;
  padding: 12px;
  border-radius: 8px;
  background: #142238;
  border: 1px solid #263852;
}
.analysis-grid span, .analysis-grid small {
  display: block;
  color: #9fb0c7;
  font-size: 12px;
}
.analysis-grid strong {
  display: block;
  margin: 7px 0;
  font-size: 20px;
}
.analysis-steps {
  padding: 14px;
  border-radius: 8px;
  background: #101d30;
  border: 1px solid #263852;
}
.analysis-steps p { margin-bottom: 8px; }
.compact-head { margin-bottom: 10px; }
.empty-state {
  padding: 18px;
  border-radius: 8px;
  background: #142238;
  color: #aebcd1;
}
@media (max-width: 1100px) {
  .module-grid, .warehouse-grid, .progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  main { padding: 14px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .query, .module-grid, .warehouse-grid, .sku-list, .progress-grid, .account-list, .module-checks { grid-template-columns: 1fr; }
}
.access-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.access-setting-create {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.access-setting-list { display: grid; gap: 8px; }
.access-setting-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.access-setting-item div { display: grid; gap: 4px; }
.access-setting-item span, .boss-readonly-note { color: var(--muted); }

@media (max-width: 800px) {
  .access-setting-create { grid-template-columns: 1fr; }
}
