/* 黑白极简风 · 呼应品牌 logo */
:root {
  --ink: #1a1a1a;
  --ink-2: #444;
  --ink-3: #888;
  --ink-4: #b5b5b5;
  --line: #e6e6e6;
  --line-2: #f0f0f0;
  --bg: #f4f4f4;
  --fill: #f7f7f7;
  --danger: #d43f3f;
  --ok: #3f9d63;
  --warn: #b8860b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 水印 ---------- */
.watermark {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 60px 20px;
  padding: 30px 12px;
  opacity: 0.06;
  transform: rotate(-18deg) scale(1.4);
}
.watermark span {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--ink);
  white-space: nowrap;
  user-select: none;
}

/* ---------- 顶部栏 ---------- */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
}
.app-header .row {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.app-header .hd-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-header .hd-brand img { width: 34px; height: 34px; display: block; }
.app-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.app-header p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.link-btn {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.link-btn:hover { background: var(--line-2); color: var(--ink); }

/* 顶栏右侧：状态 + 开关 */
.hd-right { display: flex; align-items: center; gap: 10px; }
.hd-status { font-size: 12.5px; color: var(--ok); white-space: nowrap; }
.hd-status.closed { color: var(--danger); }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: #cfcfcf;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.switch input:checked + .slider { background: var(--ink); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.container { max-width: 1120px; margin: 0 auto; padding: 18px 14px 44px; }

/* ---------- 卡片 ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  padding: 0 0 12px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line-2);
}

/* ---------- 登录（全屏居中） ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
  background:
    linear-gradient(135deg, rgba(26,26,26,0.035) 0%, rgba(26,26,26,0) 46%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.18);
  padding: 44px 40px 30px;
  text-align: center;
}
.login-card .logo {
  width: 76px;
  height: 76px;
  display: block;
  margin: 0 auto 18px;
}
.login-card .ttl {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 2px;
  margin: 0 0 8px;
}
.login-card .sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 28px;
}
.login-card .field { text-align: left; }
.login-card .tips {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-4);
  line-height: 1.9;
}
.login-foot {
  margin-top: 22px;
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 1px;
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.field input, .field select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #dcdcdc;
  border-radius: 5px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-4) 50%), linear-gradient(135deg, var(--ink-4) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.field input::placeholder { color: var(--ink-4); }
.field input:hover, .field select:hover { border-color: var(--ink-4); }
.field input:focus, .field select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08); }

/* ---------- 按钮 ---------- */
.btn-primary {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  letter-spacing: 6px;
  text-indent: 6px;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover:not(:disabled) { background: #000; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: var(--ink-4); cursor: not-allowed; }

.btn {
  height: 36px;
  padding: 0 22px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #d5d5d5;
  background: #fff;
  color: var(--ink-2);
  transition: 0.2s;
}
.btn:hover { color: var(--ink); border-color: var(--ink-4); background: var(--fill); }
.btn-q { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-q:hover { background: #000; border-color: #000; color: #fff; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }

/* 可搜索下拉 */
.combo { position: relative; }
.combo .combo-clear {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-4);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  z-index: 21;
}
.combo .combo-clear:hover { color: var(--ink); }
.combo-menu {
  display: none;
  position: absolute;
  top: 44px; left: 0; right: 0;
  max-height: 268px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.16);
  z-index: 20;
  padding: 6px 0;
}
.combo-group {
  padding: 6px 15px;
  font-size: 12px;
  color: var(--ink-3);
  background: #fff;
}
.combo-item {
  padding: 8px 15px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-item:hover { background: var(--fill); color: var(--ink); }
.combo-item-all { color: var(--ink-3); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.combo-empty { padding: 12px 15px; font-size: 13px; color: var(--ink-4); text-align: center; }

/* 两行布局：城市+业态 / 起始+截止 */
.filter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.filter-grid .field:nth-child(3) { grid-column: 1; }
.filter-grid .field { margin-bottom: 0; }
.filter-actions { display: flex; gap: 12px; margin-top: 20px; }

/* ---------- 提示条 ---------- */
.notice {
  background: #faf6ec;
  color: var(--warn);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

.msg {
  display: none;
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  background: #fbeeee;
  color: var(--danger);
}
.msg.ok { background: #eaf4ee; color: var(--ok); }

/* ---------- 统计 ---------- */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  flex: 1; min-width: 158px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
}
.stat .k { font-size: 13px; color: var(--ink-3); }
.stat .v { font-size: 24px; font-weight: 700; color: var(--ink); margin-top: 6px; }
/* 总业绩单独一行，门店数量与均价次要一行 */
.stat-lg .v { font-size: 30px; letter-spacing: -0.5px; }
.stat-row-sub { margin-top: -4px; }
.stat-sm { flex: 0 0 34%; min-width: 0; }
.stat-sm .v { font-size: 18px; color: var(--ink-2); }
.stat-row-sub .stat:not(.stat-sm) .v { font-size: 20px; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
/* 查询页数据表：固定列宽（店名/业绩/均价 100，城市/开拍日期 80，业态 40，合计 500） */
#data-table { min-width: 500px; table-layout: fixed; }
thead th, tbody td, tfoot td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
thead th {
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  padding: 12px;
  text-align: left;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.25);
}
thead th:last-child { border-right: none; }
tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
tbody td:last-child { border-right: none; }
tfoot td {
  padding: 12px;
  background: var(--fill);
  font-weight: 700;
  color: var(--ink);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
tfoot td:last-child { border-right: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 店名列固定较窄宽度，超出截断省略（数据已脱敏，无需展示全） */
.ell { display: block; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--ink-4); padding: 40px 0; font-size: 13px; }

/* 表头冻结克隆层（页面滚到表头位置时出现，固定在屏幕顶部） */
.thead-clone {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  display: none;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.thead-clone table { min-width: 0; border-collapse: collapse; }
.thead-clone thead th { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.25); }

.closed-box {
  max-width: 440px;
  margin: 100px auto;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 44px 30px;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.18);
}
.closed-box .icon { font-size: 34px; }
.closed-box h2 { margin: 12px 0 8px; font-size: 17px; font-weight: 700; color: var(--ink); }
.closed-box p { color: var(--ink-3); font-size: 13px; margin: 0; }

@media (max-width: 760px) {
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .app-header .row { align-items: flex-start; }
  .app-header p { display: none; }
  .app-header h1 { font-size: 16px; }
}
@media (max-width: 420px) {
  .login-card { padding: 34px 24px 24px; }
  /* 手机上压缩表格字号与内边距，表格在卡片内横向滑动查看 */
  .ell { max-width: 84px; }
  table { font-size: 12px; }
  thead th, tbody td, tfoot td { padding: 9px 6px; }
}

/* ---------- 自定义确认弹窗 ---------- */
.c-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.c-box {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.35);
}
.c-msg {
  padding: 30px 24px 26px;
  text-align: center;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
}
.c-btns { display: flex; border-top: 1px solid var(--line); }
.c-btn {
  flex: 1;
  height: 46px;
  border: none;
  background: #fff;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
}
.c-btn + .c-btn { border-left: 1px solid var(--line); }
.c-btn:active { background: var(--fill); }
.c-btn-ok { background: var(--ink); color: #fff; font-weight: 600; }
.c-btn-ok:active { background: #000; }
