:root {
  --brand: #0abb87;
  --brand-dark: #079568;
  --brand-soft: #e8f8f2;
  --workspace: #f3f3f3;
  --surface: #ffffff;
  --line: #dcdfe6;
  --line-soft: #ebeef5;
  --text: #303133;
  --muted: #909399;
  --danger: #f56c6c;
  --danger-soft: #fff2f2;
  --warning: #e6a23c;
  --warning-soft: #fdf6ec;
  --info: #606266;
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--workspace);
}

* { box-sizing: border-box; }

html, body, #root { width: 100%; height: 100%; margin: 0; }

body { overflow: hidden; background: var(--workspace); font-size: 14px; letter-spacing: 0; }

button, input, select { font: inherit; letter-spacing: 0; }

.prototype-control {
  position: fixed;
  z-index: 100;
  top: 10px;
  right: 18px;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid #d8dde3;
  border-radius: 4px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 6px 18px rgba(31,45,61,.12);
}

.capture .prototype-control { display: none; }

.prototype-control button {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--info);
  background: #fff;
  cursor: pointer;
}

.prototype-control button.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }

.app-shell { width: 100%; height: 100%; min-width: 1180px; background: var(--workspace); }

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.brand-block {
  width: 60px;
  height: 58px;
  display: grid;
  place-items: center;
  background: #58bc8e;
  color: white;
  font-size: 15px;
  font-weight: 700;
}

.hamburger {
  width: 52px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #111;
  font-size: 25px;
  font-weight: 300;
}

.top-title { font-size: 16px; color: #4d4f52; }

.sidebar {
  position: fixed;
  z-index: 15;
  left: 0;
  top: 58px;
  bottom: 0;
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding-top: 12px;
  background: #fff;
  border-right: 1px solid #f1f1f1;
}

.nav-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  color: #62666b;
  font-size: 19px;
}

.nav-icon.active { color: var(--brand); background: #eef9f5; }

.workspace {
  position: absolute;
  left: 60px;
  top: 58px;
  right: 0;
  bottom: 0;
  padding: 14px 12px 12px;
  overflow: hidden;
}

.page-tab {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid #eee;
  color: #303133;
}

.page-tab .close { color: #aaa; font-size: 12px; }

.content {
  height: calc(100% - 44px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
}

.filter-panel, .table-panel {
  position: relative;
  background: #fff;
  border-radius: 2px;
}

.filter-panel { padding: 18px 16px 14px; }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 14px 18px;
  align-items: center;
}

.field-row { display: grid; grid-template-columns: 76px minmax(120px, 1fr); align-items: center; gap: 10px; position: relative; }
.field-row label { color: #74777b; white-space: nowrap; }

.input-like {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #c0c4cc;
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
}

.input-like.selected { color: var(--text); }
.chevron { color: #c0c4cc; font-size: 11px; }

.filter-actions { display: flex; align-items: center; gap: 10px; justify-self: end; }

.btn {
  height: 34px;
  min-width: 86px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #606266;
  background: #fff;
  cursor: pointer;
}

.btn.primary { color: #fff; border-color: var(--brand); background: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.outline { color: var(--brand-dark); border-color: var(--brand); }
.btn.danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.btn.text { min-width: 0; padding: 0 8px; color: var(--brand-dark); border-color: transparent; background: transparent; }

.table-panel { flex: 1; min-height: 0; padding: 12px 14px 8px; overflow: hidden; }
.toolbar { height: 40px; display: flex; align-items: flex-start; gap: 8px; }

.table-wrap { width: 100%; overflow: hidden; border: 1px solid var(--line-soft); }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th, .data-table td {
  height: 44px;
  padding: 0 10px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th { color: var(--muted); font-weight: 500; background: #fff; }
.data-table td { color: #606266; font-weight: 400; }
.data-table tr:nth-child(even) td { background: #fcfcfc; }
.data-table .link { color: #47af86; }
.data-table .focus-col { background: #f0fbf7 !important; }

.status { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 3px; font-size: 12px; }
.status.empty { color: #909399; background: #f4f4f5; }
.status.ok { color: #208c64; background: #e7f6f0; }
.status.warning { color: #a86b13; background: var(--warning-soft); }
.status.danger { color: #c64c4c; background: var(--danger-soft); }

.pagination {
  height: 42px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: #606266;
}

.page-num { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #eee; background: #fff; }
.page-num.active { color: #fff; border-color: var(--brand); background: var(--brand); }

.marker {
  position: absolute;
  z-index: 50;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #e55353;
  box-shadow: 0 2px 8px rgba(197,62,62,.28);
  font-size: 13px;
  font-weight: 700;
}

.marker.m1 { top: -12px; right: -12px; }
.marker.m2 { top: 54px; right: 6px; }
.marker.m3 { top: -11px; right: -10px; }

.relative { position: relative; }

.overlay {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(25, 31, 36, .42);
}

.modal {
  position: relative;
  width: min(820px, calc(100% - 80px));
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 52px rgba(21,31,42,.22);
}

.modal.wide { width: min(1040px, calc(100% - 80px)); }
.modal-header { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line-soft); font-size: 16px; font-weight: 500; }
.modal-header .x { color: #909399; font-size: 20px; }
.modal-body { padding: 20px 24px; }
.modal-footer { height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 24px; border-top: 1px solid var(--line-soft); }

.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.form-item { position: relative; display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 12px; min-height: 36px; }
.form-item label { color: #606266; text-align: right; }
.form-item.full { grid-column: 1 / -1; }

.rule-note { position: relative; margin: 122px 0 0 116px; padding: 12px 14px; border: 1px solid #d6eee4; border-radius: 3px; color: #527165; background: #f2faf7; line-height: 1.65; }
.rule-note strong { color: #207a59; }

.select-open { position: relative; }
.select-menu { position: absolute; z-index: 60; top: 38px; left: 0; right: 0; padding: 5px 0; border: 1px solid var(--line); border-radius: 3px; background: #fff; box-shadow: 0 8px 20px rgba(31,45,61,.14); }
.select-option { height: 34px; display: flex; align-items: center; padding: 0 12px; color: #606266; }
.select-option.active { color: var(--brand-dark); background: var(--brand-soft); }

.alert-head { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; padding: 16px; border: 1px solid #f4caca; border-radius: 3px; background: var(--danger-soft); }
.alert-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--danger); font-size: 24px; font-weight: 700; }
.alert-title { color: #c94c4c; font-size: 16px; font-weight: 600; }
.alert-sub { margin-top: 5px; color: #7a6060; }

.failure-table { position: relative; margin-top: 16px; border: 1px solid var(--line); }
.failure-table .data-table th { background: #fafafa; }
.reason { color: #c94c4c; }
.suggestion { color: #8c681c; }

.shipping-panel { flex: 1; padding: 16px; background: #fff; }
.shipping-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.shipping-title h2 { margin: 0; font-size: 16px; font-weight: 500; }

.export-stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 38px;
  background: #e9ecef;
}

.sheet-window {
  width: min(1360px, 100%);
  height: min(730px, 100%);
  overflow: hidden;
  border: 1px solid #cfd4da;
  background: #fff;
  box-shadow: 0 16px 44px rgba(45,55,65,.18);
}

.sheet-titlebar { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: #fff; background: #217346; }
.sheet-titlebar strong { font-size: 15px; }
.sheet-ribbon { height: 74px; display: flex; align-items: center; gap: 22px; padding: 0 18px; border-bottom: 1px solid #d8dce1; background: #f7f8f9; }
.ribbon-group { display: flex; align-items: center; gap: 8px; color: #667078; }
.sheet-grid-wrap { position: relative; height: calc(100% - 124px); overflow: hidden; }
.sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet-table th, .sheet-table td { height: 36px; padding: 0 9px; border-right: 1px solid #dfe3e6; border-bottom: 1px solid #dfe3e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-table th { color: #3e494f; font-weight: 600; background: #edf1f3; }
.sheet-table .new-export-col { position: relative; background: #dff3e8; }
.sheet-table .new-export-col .marker.m1 { top: 2px; right: 4px; }
.sheet-note { position: absolute; left: 18px; bottom: 15px; padding: 8px 12px; border: 1px solid #b9dcc9; border-radius: 3px; color: #37624b; background: #eff8f3; }

@media (max-width: 1380px) {
  .filter-grid { grid-template-columns: repeat(4, minmax(190px, 1fr)); }
}
