:root {
  --brand: #00b978;
  --brand-strong: #00a76b;
  --nav: #263142;
  --nav-deep: #202a39;
  --line: #dfe6ee;
  --soft-line: #edf1f5;
  --bg: #f3f6f9;
  --panel: #ffffff;
  --muted: #6f7a86;
  --text: #27313d;
  --warning: #f59e0b;
  --danger: #e55353;
  --blue: #2f8dff;
  --radius: 4px;
  --shadow: 0 8px 24px rgba(30, 44, 64, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0;
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms ease;
}

button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

.shell {
  height: 100%;
  display: grid;
  grid-template-rows: 64px 1fr;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: 224px 1fr;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}

.brand {
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  min-width: 0;
}

.brand-mark {
  width: 50px;
  height: 34px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1;
}

.brand-title strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
}

.brand-title span {
  display: block;
  font-size: 11px;
  opacity: 0.9;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  min-width: 0;
}

.module-picker {
  color: var(--brand);
  font-weight: 700;
  padding: 22px 24px;
  background: rgba(0, 185, 120, 0.08);
  height: 100%;
}

.org-bar {
  display: flex;
  align-items: center;
  gap: 34px;
  color: #3b4652;
}

.org-name {
  min-width: 360px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: #334155;
  background: transparent;
  border: 1px solid transparent;
}

.icon-btn:hover {
  border-color: var(--line);
  background: #f8fafc;
}

.layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 224px 1fr;
}

.sidebar {
  background: var(--nav);
  color: #dce4ec;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.main-nav {
  flex: 1;
  overflow: auto;
  padding: 12px 0 54px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  color: #dfe7f0;
}

.nav-item.active,
.nav-child.active {
  background: var(--nav-deep);
  color: #fff;
}

.nav-child {
  padding: 14px 20px 14px 68px;
  color: #d7dde6;
}

.nav-foot {
  height: 52px;
  display: grid;
  place-items: center start;
  padding-left: 22px;
  background: var(--nav-deep);
  font-size: 22px;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 328px minmax(760px, 1fr);
  gap: 16px;
  padding: 8px;
  overflow: hidden;
  position: relative;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 0;
  min-height: 0;
  box-shadow: 0 1px 1px rgba(28, 39, 54, 0.02);
}

.goods-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--soft-line);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.head-actions {
  display: flex;
  gap: 6px;
}

.primary {
  background: var(--brand);
  color: #fff;
  height: 34px;
  padding: 0 14px;
  font-weight: 700;
}

.primary:hover { background: var(--brand-strong); }

.secondary {
  height: 34px;
  padding: 0 14px;
  color: #344054;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 600;
}

.secondary:hover { background: #f8fafc; }

.danger {
  background: var(--danger);
  color: #fff;
}

.filters-inline {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 8px;
  padding: 12px 14px;
}

.field,
.textarea-field,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #2f3a46;
  min-height: 34px;
  padding: 0 10px;
  outline: none;
}

.textarea-field {
  min-height: 34px;
  padding: 7px 10px;
  resize: vertical;
}

.field:focus,
.textarea-field:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0, 185, 120, 0.12);
}

.tree-box {
  margin: 0 14px 14px;
  border: 1px solid #bfe7d8;
  background: #f2fbf7;
  overflow: auto;
}

.tree-title {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid #d8efe7;
}

.tree-list {
  padding: 6px 0 14px;
}

.tree-node {
  min-height: 34px;
  display: grid;
  grid-template-columns: 24px 1fr 26px;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  cursor: pointer;
}

.tree-node:hover,
.tree-node.selected {
  background: #dff5eb;
}

.tree-node .status {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--brand);
}

.tree-node.paused .status {
  background: #9aa5b1;
}

.content-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr auto;
  overflow: hidden;
  position: relative;
}

.view-title {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
}

.view-title strong {
  display: block;
  font-size: 16px;
}

.view-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--soft-line);
  font-weight: 700;
}

.tab {
  color: #4b5563;
  background: transparent;
  padding: 0;
}

.tab.active {
  color: #f08c00;
}

.search-area {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--soft-line);
}

.filter-grid {
  display: grid;
  grid-template-columns: 96px minmax(220px, 1fr) 96px minmax(220px, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.filter-grid label {
  text-align: right;
  color: #5f6b78;
  white-space: nowrap;
}

.date-range {
  display: grid;
  grid-template-columns: 1fr 30px 1fr;
  align-items: center;
  gap: 4px;
}

.date-range span {
  text-align: center;
  color: #6b7280;
}

.filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--soft-line);
}

.button-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action {
  height: 32px;
  padding: 0 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.action:hover { background: var(--brand-strong); }

.ghost-tools {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.summary {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
}

.summary-item {
  min-width: 112px;
  padding: 9px 12px;
  border-right: 1px solid var(--soft-line);
  white-space: nowrap;
}

.summary-item span {
  color: #667085;
}

.summary-item strong {
  margin-left: 5px;
}

.table-shell {
  overflow: auto;
  min-height: 0;
  background: #fff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 2140px;
  width: 100%;
}

table.aux-table {
  min-width: 980px;
}

th,
td {
  border-right: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
  height: 42px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafcff;
  color: #4b5563;
  font-weight: 700;
}

tbody tr:hover {
  background: #f8fffb;
}

tbody tr.selected {
  background: #e8f8f1;
}

.link {
  color: var(--blue);
  font-weight: 700;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 3px;
  background: #eef2f7;
  color: #4b5563;
  font-size: 12px;
}

.tag.success { background: #e7f7ef; color: #00895d; }
.tag.warning { background: #fff5dc; color: #b77900; }
.tag.danger { background: #fde9e9; color: #c84141; }
.tag.blue { background: #e8f2ff; color: #246fd6; }

.pagination {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 16px;
  border-top: 1px solid var(--soft-line);
  background: #fff;
}

.watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: repeating-linear-gradient(-25deg, transparent 0 135px, rgba(70, 79, 92, 0.1) 135px 136px, transparent 136px 270px);
}

.watermark::before {
  content: "刘秀利 9729";
  position: absolute;
  inset: 50px 20px;
  color: #67717d;
  font-size: 24px;
  transform: rotate(-22deg);
  white-space: pre;
  word-spacing: 80px;
}

.toast {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 30;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 14px;
  color: #fff;
  background: rgba(28, 39, 54, 0.92);
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  display: grid;
  place-items: center;
  z-index: 20;
}

.modal {
  width: min(820px, calc(100vw - 36px));
  max-height: calc(100vh - 80px);
  background: #fff;
  border-radius: 7px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.modal.small { width: min(480px, calc(100vw - 36px)); }
.modal.large { width: min(1060px, calc(100vw - 36px)); }

.modal-head {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  padding: 18px;
  overflow: auto;
}

.modal-foot {
  height: 56px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: 110px 1fr 110px 1fr;
  gap: 12px 14px;
  align-items: center;
}

.form-grid label {
  text-align: right;
  color: #56616d;
}

.upload-zone {
  border: 1px dashed #b8c2cc;
  min-height: 118px;
  display: grid;
  place-items: center;
  color: #667085;
  background: #fbfcfe;
  margin-bottom: 12px;
}

.proofread-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.proofread-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.formula {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfe;
  margin-top: 12px;
  line-height: 1.9;
}

.steps {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 12px;
}

.steps span {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #5f6b78;
  background: #fbfcfe;
}

.steps span.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.column-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px 14px;
}

.column-settings label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: #fbfcfe;
}

.empty {
  padding: 52px;
  text-align: center;
  color: #8b95a1;
}

@media (max-width: 1100px) {
  .topbar,
  .layout {
    grid-template-columns: 168px 1fr;
  }

  .brand-title {
    display: none;
  }

  .nav-item {
    padding: 0 14px;
    min-height: 44px;
  }

  .nav-child {
    display: block;
    padding: 10px 10px 10px 32px;
    font-size: 12px;
  }

  .workspace {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .goods-panel {
    min-height: 320px;
  }

  .filter-grid,
  .form-grid {
    grid-template-columns: 92px 1fr;
  }
}
