:root {
  --blue: #1d73f8;
  --navy: #06294a;
  --navy-2: #083862;
  --text: #12213a;
  --muted: #748198;
  --line: #e6edf5;
  --bg: #f4f7fb;
  --green: #28bd7b;
  --orange: #f59e0b;
  --red: #ef4444;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--text);
  background: var(--bg);
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(220, 235, 255, 0.88), rgba(244, 248, 255, 0.92)),
    radial-gradient(circle at 15% 65%, #7bb4ff 0, transparent 28%),
    radial-gradient(circle at 85% 50%, #bfd7ff 0, transparent 24%);
}

.login-card {
  width: 420px;
  padding: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 60px rgba(31, 80, 140, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand-icon,
.mini-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: #fff;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f86ff, #1554d1);
  font-size: 28px;
}

.brand h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.brand p,
.muted {
  margin: 0;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  font-size: 14px;
  color: #34435b;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  height: 42px;
  border: 1px solid #d8e2ef;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

.primary,
.ghost,
.success,
.danger,
.warning {
  height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 18px;
  cursor: pointer;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, #2e86ff, #1765e8);
}

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

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

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

.ghost {
  color: #2563eb;
  background: #fff;
  border-color: #cfe0f6;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.app-shell.fullscreen {
  display: block;
  width: 100%;
  min-width: 1180px;
}

.app-shell.fullscreen main {
  display: block;
  width: 100%;
  min-width: 1180px;
}

.app-shell.fullscreen .content {
  display: block;
  width: 100%;
  min-width: 1180px;
  padding: 20px 28px 34px;
}

.app-shell.fullscreen .panel {
  width: 100%;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  color: #fff;
  background: linear-gradient(180deg, #062946, #05375e);
}

.sidebar-title {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-toggle {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.app-shell.collapsed .sidebar-title {
  justify-content: center;
  padding: 0 10px;
}

.app-shell.collapsed .sidebar-title .title-text,
.app-shell.collapsed .mini-icon {
  display: none;
}

.app-shell.collapsed .sidebar-toggle {
  margin-left: 0;
}

.mini-icon {
  width: 30px;
  height: 30px;
  font-size: 16px;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
}

.nav {
  padding: 12px 10px;
}

.nav button {
  width: 100%;
  height: 46px;
  margin: 4px 0;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
}

.app-shell.collapsed .nav {
  padding: 12px 8px;
}

.app-shell.collapsed .nav button {
  text-align: center;
  padding: 0;
  font-size: 14px;
}

.nav button.active {
  color: #fff;
  background: linear-gradient(135deg, #2e86ff, #1765e8);
  box-shadow: 0 8px 18px rgba(23, 101, 232, 0.28);
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.content {
  padding: 22px 26px 32px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 65, 110, 0.06);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 118px;
  padding: 22px;
}

.stat-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf5ff;
  color: var(--blue);
  font-size: 26px;
}

.stat-value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 800;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.batchbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin-bottom: 12px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.row-actions button {
  min-width: 54px;
  height: 36px;
  padding: 0 10px;
}

.check-cell {
  width: 44px;
  text-align: center;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table:has(colgroup) {
  min-width: 1232px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

td:last-child,
th:last-child {
  overflow: visible;
}

.archive-table th,
.archive-table td {
  text-align: center;
}

.panel:has(table colgroup) {
  overflow-x: auto;
}

th {
  color: #44536a;
  background: #f7faff;
  font-weight: 700;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pager button {
  height: 34px;
  border: 1px solid #cfe0f6;
  border-radius: 6px;
  color: #2563eb;
  background: #fff;
  padding: 0 10px;
  cursor: pointer;
}

.pager button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.pager button:disabled,
.page-size select:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  background: #f8fafc;
}

.pager input {
  width: 58px;
  height: 34px;
  border: 1px solid #d8e2ef;
  border-radius: 6px;
  text-align: center;
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.page-size select {
  height: 34px;
  border: 1px solid #d8e2ef;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}

.status {
  display: inline-flex;
  align-items: center;
  min-width: 56px;
  justify-content: center;
  height: 26px;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
}

.status.ok {
  color: #07945e;
  background: #e8f8f1;
}

.status.warn {
  color: #b76d00;
  background: #fff3dc;
}

.status.bad {
  color: #dc2626;
  background: #feecec;
}

.status.gray {
  color: #64748b;
  background: #f1f5f9;
}

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

.form-grid .wide {
  grid-column: span 2;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.tabs {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--line);
  margin: -20px -20px 18px;
  padding: 0 16px;
}

.tabs button {
  height: 52px;
  min-width: 128px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: #43516a;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.tabs button.active {
  color: var(--blue);
  border-color: var(--blue);
}

.detail-head {
  display: grid;
  grid-template-columns: 110px minmax(520px, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 190px;
}

.avatar {
  width: 88px;
  height: 108px;
  border-radius: 6px;
  background: linear-gradient(180deg, #e9f2ff, #d6e7ff);
  display: grid;
  place-items: center;
  font-size: 42px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  width: 100%;
  align-items: stretch;
}

.detail-table {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1fr) 120px minmax(220px, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.detail-label,
.detail-value {
  min-height: 58px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  color: #253957;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  background: #f1f5fb;
}

.detail-value {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #061735;
  font-size: 17px;
  line-height: 1.5;
  word-break: break-word;
  background: #fff;
}

.detail-label.full-row,
.detail-label.image-row {
  grid-column: 1;
}

.detail-value.full-row,
.detail-value.image-row {
  grid-column: 2 / -1;
}

.detail-value.tail-fill {
  grid-column: 2 / -1;
}

.detail-label.full-row,
.detail-value.full-row {
  min-height: 92px;
}

.detail-label.image-row,
.detail-value.image-row {
  min-height: 280px;
}

.detail-value.image-row {
  align-items: center;
}

.kv.wide,
.kv.image-card,
.kv.full {
  grid-column: span 1;
}

.kv {
  min-height: 58px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
}

.detail-table .kv {
  display: contents;
}

.kv.image-card {
  grid-column: span 2;
  min-height: 300px;
  grid-template-columns: 112px minmax(0, 1fr);
}

.detail-table .kv.full {
  grid-column: 1 / -1;
}

.detail-table .kv.full .kv-label {
  grid-column: 1;
}

.detail-table .kv.full .kv-value {
  grid-column: 2 / -1;
}

.kv.image-card .kv-label,
.kv.image-card .kv-value {
  align-items: flex-start;
  padding-top: 14px;
}

.kv-label {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
  padding: 0 14px;
}

.detail-table .kv-label {
  justify-content: center;
  min-height: 56px;
  color: #253957;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #f2f6fc;
  padding: 10px 12px;
}

.kv-value {
  display: flex;
  align-items: center;
  color: #061735;
  font-size: 17px;
  line-height: 1.5;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px 14px;
  min-height: 58px;
}

.detail-table .kv-value {
  min-height: 56px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 12px 16px;
}

.detail-table .kv.full .kv-label,
.detail-table .kv.full .kv-value {
  min-height: 88px;
}

.detail-table .kv.image-card .kv-label,
.detail-table .kv.image-card .kv-value {
  min-height: 260px;
}

.detail-table .kv.image-card .kv-label,
.detail-table .kv.image-card .kv-value {
  align-items: center;
}

.kv-image {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  align-self: flex-start;
  border: 1px solid #e6edf5;
  border-radius: 6px;
  background: #fff;
}

.detail-table .kv-image {
  max-height: 240px;
  align-self: center;
}

.import-box {
  border: 1px dashed #b9cae2;
  border-radius: 8px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  background: #fbfdff;
}

.empty {
  padding: 42px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  top: 20px;
  padding: 12px 16px;
  color: #fff;
  background: #10233f;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  z-index: 10;
}

.hidden {
  display: none;
}
