body {
  margin: 0;
  background: #f5f7fb;
  color: #162033;
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #162033;
  cursor: pointer;
}

button:disabled {
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.65;
}

button.primary,
.primary {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}

input,
textarea,
select {
  box-sizing: border-box;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

label {
  display: block;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(360px, 480px);
  justify-content: center;
  align-items: center;
  gap: 52px;
  padding: 40px;
}

.login-copy h1 {
  margin: 0 0 16px;
  font-size: 44px;
  line-height: 1.12;
}

.login-copy p {
  color: #5b6474;
  line-height: 1.8;
  font-size: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #ef4444;
  font-weight: 700;
}

.auth-card {
  padding: 30px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(20, 35, 55, 0.08);
}

.auth-card h2 {
  margin-top: 0;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.tab.active {
  border-bottom-color: #ef4444;
  color: #ef4444;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.hidden {
  display: none;
}

.message {
  min-height: 20px;
  color: #ef4444;
}

.full-button {
  width: 100%;
}

.layout {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  background: #111827;
  color: #fff;
  padding: 18px 12px;
}

.brand {
  padding: 8px 4px 18px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 22px;
}

.brand span {
  margin-top: 6px;
  color: #aeb8c8;
  font-size: 13px;
}

.main {
  flex: 1;
  padding: 28px;
}

.topbar {
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
}

.page {
  display: grid;
  gap: 18px;
}

.menu {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fff;
}

.menu button {
  justify-content: flex-start;
  width: 100%;
  border: 0;
  border-radius: 0;
  text-align: left;
}

.menu button.active {
  color: #2563eb;
}

.notice {
  padding: 12px 14px;
  border-radius: 6px;
  background: #e8f1ff;
  color: #075985;
}

.notice.success {
  background: #ecfdf5;
  color: #047857;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.workflow-card {
  padding: 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.metric span,
.workflow-card small,
.module-header p {
  color: #64748b;
}

.metric strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 24px;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.selector-form {
  padding: 18px;
  background: #fff;
  border-radius: 8px;
}

.filter-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.mode-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff7f7;
}

.mode-strip strong {
  color: #dc2626;
}

.mode-strip span {
  color: #64748b;
}

.filter-top select {
  width: 220px;
  margin-top: 0;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.filter-panel section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
}

.filter-panel h3 {
  margin: 0;
  font-size: 15px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.range-field > span {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.range-inputs,
.input-with-unit {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 6px;
}

.input-with-unit {
  grid-template-columns: 1fr auto;
}

.range-inputs input,
.input-with-unit input {
  margin-top: 0;
}

.range-inputs em,
.input-with-unit span {
  color: #64748b;
  font-style: normal;
}

.flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-picker {
  position: relative;
}

.category-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.category-column {
  max-height: 260px;
  overflow-y: auto;
  border-right: 1px solid #e2e8f0;
}

.category-column:last-child {
  border-right: 0;
}

.category-row,
.category-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: #fff;
  text-align: left;
  font-weight: 500;
  box-sizing: border-box;
  cursor: pointer;
}

.category-row.active {
  background: #faf5ff;
  color: #a21caf;
  font-weight: 700;
}

.category-row span {
  flex: 1;
}

.category-row b {
  color: #8b5cf6;
  font-weight: 700;
}

.category-check {
  justify-content: flex-start;
  gap: 8px;
  color: #334155;
}

.category-check input,
.category-row input {
  width: auto;
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.confirm-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 16px;
  padding: 12px;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff7f7;
}

.confirm-button {
  min-width: 132px;
  font-weight: 700;
}


.empty {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.workflow-card h3 {
  margin: 8px 0;
}

.workflow-card p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.module-header {
  padding: 18px;
  background: #fff;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
}

.module-header h2 {
  margin: 0 0 6px;
}

.module-header p {
  margin: 0;
}

.admin-form,
.action-form {
  max-width: 520px;
  padding: 18px;
  background: #fff;
  border-radius: 8px;
}

.el-alert,
.el-descriptions,
.el-table,
pre {
  margin-top: 12px;
}

pre {
  padding: 14px;
  background: #0f172a;
  color: #dbeafe;
  border-radius: 8px;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .login-page,
  .metric-grid,
  .form-grid,
  .filter-panel,
  .category-panel,
  .workflow {
    grid-template-columns: 1fr;
  }
}
