:root {
  --page-bg: #f5f7fb;
  --card-bg: #ffffff;
  --text-main: #172033;
  --text-muted: #667085;
  --border-color: #e4e7ec;
  --primary: #175cd3;
  --banner-bg: #123c69;
  --safe-bottom: env(safe-area-inset-bottom);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text-main);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  padding-bottom: calc(24px + var(--safe-bottom));
}

/* KV banner：恢复成主视觉区域 */
.kv-banner {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background: var(--banner-bg);
  color: #ffffff;
}

.kv-banner.compact {
  min-height: 220px;
}

.kv-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
}

.kv-image.show {
  display: block;
}

.kv-mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.12) 0%,
      rgba(0, 0, 0, 0.46) 100%
    );
}

.kv-content {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 20px 26px;
}

.kv-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.kv-eyebrow:empty {
  display: none;
}

.kv-content h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 800;
}

.kv-content p {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.5;
  opacity: 0.94;
}

.content {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 26px 16px 0;
}

.section-title {
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
}

.section-title p {
  margin-top: 4px;
  color: #98a2b3;
  font-size: 13px;
  line-height: 1.3;
}

.market-list {
  display: grid;
  gap: 18px;
}

.market-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.05);
}

.market-card:active {
  transform: scale(0.99);
}

.market-info {
  min-width: 0;
}

.market-name {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  word-break: break-word;
}

.market-arrow {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 24px;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}

.search-box {
  margin-bottom: 18px;
}

.search-box input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.search-box input::placeholder {
  color: #777;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.12);
}

.table-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.05);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/*
  详情页表格：
  一屏优先完整显示：桌号 / 大区 / 市场 / 姓名
  公司列在右侧，通过横向滑动查看。
*/
table {
  width: 100%;
  min-width: 600px;
  table-layout: fixed;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 8px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 14px;
  line-height: 1.45;
  vertical-align: middle;
  color: var(--text-main);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: #344054;
  font-weight: 800;
  white-space: nowrap;
}

td {
  font-weight: 500;
}

/* 桌号 */
th:nth-child(1),
td:nth-child(1) {
  width: 58px;
  padding-left: 14px;
}

/* 大区 */
th:nth-child(2),
td:nth-child(2) {
  width: 102px;
}

/* 市场 */
th:nth-child(3),
td:nth-child(3) {
  width: 86px;
}

/* 姓名 */
th:nth-child(4),
td:nth-child(4) {
  width: 86px;
}

/* 公司：滑动后显示 */
th:nth-child(5),
td:nth-child(5) {
  width: 268px;
  padding-right: 14px;
}

tbody tr:last-child td {
  border-bottom: none;
}

.state-message {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.empty-box {
  padding: 28px 18px;
  color: var(--text-muted);
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 390px) {
  .kv-banner {
    min-height: 200px;
  }

  .kv-banner.compact {
    min-height: 155px;
  }

  .kv-content h1 {
    font-size: 27px;
  }

  .kv-content p {
    font-size: 15px;
  }

  .content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .section-title h2 {
    font-size: 16px;
  }

  .section-title p {
    font-size: 16px;
  }

  .market-name {
    font-size: 16px;
  }

  table {
    min-width: 570px;
  }

  th,
  td {
    font-size: 15px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 54px;
    padding-left: 12px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 96px;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 80px;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 78px;
  }

  th:nth-child(5),
  td:nth-child(5) {
    width: 262px;
    padding-right: 12px;
  }
}

@media (min-width: 768px) {
  .kv-banner {
    border-radius: 0 0 28px 28px;
  }

  .content {
    padding-top: 28px;
  }

  .market-card {
    padding: 22px 20px;
  }
}

.site-footer {
  margin-top: 32px;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  text-align: center;

  color: #98a2b3;

  font-size: 12px;
  line-height: 1.5;

  border-top: 1px solid #eaecf0;
}