:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f0f3f7;
  --text: #1c2430;
  --muted: #667085;
  --line: #d8dee8;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #c2410c;
  --ok: #15803d;
  --warn: #b45309;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  padding: 9px 14px;
  cursor: pointer;
}

button:hover {
  background: var(--brand-dark);
}

button.secondary {
  background: #e5eaf1;
  color: var(--text);
}

button.secondary:hover {
  background: #d6dde8;
}

button.danger {
  background: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.sidebar {
  background: #17202c;
  color: #e7edf5;
  padding: 20px 14px;
}

.brand {
  padding: 0 8px 18px;
  font-size: 18px;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 10px 12px;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.main {
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  background: var(--panel-soft);
  border-radius: 8px;
  padding: 12px;
}

.stat b {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap.fixed-scroll {
  max-height: calc(100vh - 330px);
  min-height: 260px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 840px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475467;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e5eaf1;
  color: #344054;
  white-space: nowrap;
}

.badge.success {
  background: #dcfce7;
  color: var(--ok);
}

.badge.failed {
  background: #ffedd5;
  color: var(--danger);
}

.badge.processing,
.badge.pending {
  background: #fef3c7;
  color: var(--warn);
}

.thumb {
  width: 76px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.muted {
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.page-size-select {
  width: auto;
  min-width: 104px;
}

.result-table {
  min-width: 1900px;
  table-layout: fixed;
}

.result-table th,
.result-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.result-table .col-image {
  width: 96px;
}

.result-table .col-exhibition {
  width: 120px;
}

.result-table .col-companyName {
  width: 160px;
}

.result-table .col-companyShortName {
  width: 110px;
}

.result-table .col-businessScope {
  width: 140px;
}

.result-table .col-name {
  width: 110px;
}

.result-table .col-title {
  width: 150px;
}

.result-table .col-mobile,
.result-table .col-phone {
  width: 145px;
}

.result-table .col-province,
.result-table .col-city,
.result-table .col-district {
  width: 95px;
}

.result-table .col-address {
  width: 210px;
}

.result-table .col-qq {
  width: 90px;
}

.result-table .col-website,
.result-table .col-email {
  width: 190px;
}

.result-table .col-slogan,
.result-table .col-other {
  width: 180px;
}

.result-table .col-actions {
  width: 110px;
}

.hidden {
  display: none !important;
}

.login-page,
.upload-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-box,
.upload-box {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-box h1,
.upload-box h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.upload-drop {
  border: 1px dashed #9aa8bb;
  background: #f8fafc;
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.upload-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  margin-top: 14px;
}

.upload-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.upload-item img {
  width: 52px;
  height: 38px;
  border-radius: 5px;
  object-fit: cover;
}

.upload-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-body {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 18px;
}

.modal-body img.preview {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: zoom-in;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav button {
    text-align: center;
    padding: 9px 6px;
  }

  .main {
    padding: 16px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .stats {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
