:root {
  --brand: #FFC300;
  --brand-dark: #F5A600;
  --bg: #F6F7F9;
  --card: #fff;
  --text: #1F2126;
  --muted: #8A8F99;
  --line: #EBEDF0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  padding-bottom: 40px;
}

/* 顶栏 */
.topbar {
  background: linear-gradient(135deg, #FFD54A, #FFB300);
  padding: 14px 16px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
}
.logo { font-size: 17px; font-weight: 700; }
.sid-box { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sid-box label { color: #6b4c00; }
.sid-box input {
  width: 130px; padding: 5px 8px; border: 1px solid rgba(0,0,0,.12);
  border-radius: 6px; font-size: 12px; background: rgba(255,255,255,.92);
}
.sid-box button {
  border: none; background: rgba(255,255,255,.9); border-radius: 6px;
  padding: 5px 8px; cursor: pointer; font-size: 13px;
}

/* 主体 */
main { max-width: 720px; margin: 0 auto; padding: 16px; }
.hero { margin-bottom: 14px; }
.hero h1 { font-size: 21px; margin-bottom: 6px; }
.hero p { font-size: 13px; color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 8px; margin: 14px 0; }
.tab {
  flex: 1; padding: 9px 0; border: none; border-radius: 20px;
  background: #fff; color: var(--muted); font-size: 14px; cursor: pointer;
  border: 1px solid var(--line);
}
.tab.active { background: var(--text); color: #FFD54A; border-color: var(--text); font-weight: 600; }
.pane { display: none; }
.pane.active { display: block; }

/* 搜索栏 */
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; background: #fff;
}
.searchbar select {
  padding: 9px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 13px;
}

/* 卡片 */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: 12px; padding: 12px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: transform .12s;
}
.card:active { transform: scale(.985); }
.card-icon {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px;
  background: #FFF6DA; display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 22px;
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-size: 15px; font-weight: 600; }
.card-desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 11px; color: #B0B4BC; margin-top: 2px; }
.go {
  flex: 0 0 auto; border: none; background: var(--brand); color: #4a3500;
  font-weight: 700; font-size: 13px; padding: 7px 15px; border-radius: 18px; cursor: pointer;
}
.go:hover { background: var(--brand-dark); }

.loading, .empty {
  text-align: center; padding: 30px 0; color: var(--muted); font-size: 14px;
}

/* 自动查询 */
.auto-hero { margin-bottom: 12px; }
.auto-hero h1 { font-size: 19px; margin-bottom: 5px; }
.auto-hero p { font-size: 12.5px; color: var(--muted); }
.autobar { display: flex; gap: 8px; }
.autobar input {
  flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; outline: none;
}
.autobar input:focus { border-color: var(--brand-dark); }
.hotwords { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 14px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 12.5px; padding: 5px 12px; border-radius: 15px; cursor: pointer;
}
.chip:hover { background: #FFF6DA; color: #7a5600; border-color: var(--brand); }
.placeholder { text-align: center; padding: 34px 0; color: #B0B4BC; font-size: 13.5px; }
.meta-line { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.btn-inline {
  flex: 0 0 auto; padding: 10px 18px; border: none; border-radius: 10px;
  background: var(--text); color: #FFD54A; font-size: 14px; font-weight: 600; cursor: pointer;
}
#syncActs.btn-inline, #syncOrders.btn-inline { background: #fff; color: var(--text); border: 1px solid var(--line); }
.result .card-title { font-size: 15px; }

/* 统计 */
.stats-box { display: flex; gap: 10px; margin-bottom: 10px; }
.stat {
  flex: 1; background: #fff; border-radius: 12px; padding: 14px 10px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.stat span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat b { font-size: 20px; }
.stat b.money { color: #E53935; }
.stat-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tip-inline { font-size: 12px; color: var(--muted); }

.tip { font-size: 12px; color: #C07A00; background: #FFF8E1; padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; }
.primary {
  width: 100%; padding: 11px; border: none; border-radius: 10px;
  background: var(--text); color: #FFD54A; font-size: 15px; font-weight: 600; cursor: pointer;
}
.sum { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; font-size: 14px; }
.sum b { color: #E53935; font-size: 17px; }
.otable { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: 12px; }
.otable th { background: #FAFAFB; padding: 9px 6px; text-align: left; color: var(--muted); font-weight: 500; }
.otable td { padding: 9px 6px; border-top: 1px solid var(--line); }

/* 弹层 */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal.show { display: flex; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 400px; overflow: hidden; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px;
}
.modal-head button { border: none; background: none; font-size: 17px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 14px; }
.qr { display: flex; justify-content: center; margin-bottom: 12px; }
.qr img { width: 180px; height: 180px; }
.link-text {
  font-size: 11px; color: var(--muted); background: #F6F7F9; padding: 8px 10px;
  border-radius: 8px; word-break: break-all; max-height: 76px; overflow: auto; margin-bottom: 12px;
}
.modal-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.modal-actions button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 14px; cursor: pointer; }
.modal-actions .primary { color: #4a3500; background: var(--brand); border: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.82); color: #fff; padding: 9px 16px; border-radius: 20px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 错误提示框：上游出错时醒目显示原因和排查步骤，而不是静默空列表 */
.errbox {
  background: #FFF1F0; border: 1px solid #FFCCC7; border-radius: 10px;
  padding: 14px; margin: 8px 0;
}
.errbox-t { font-weight: 700; color: #CF1322; margin-bottom: 6px; }
.errbox-m {
  font-size: 13px; color: #5C0011; word-break: break-all;
  background: rgba(255,255,255,.7); padding: 8px 10px; border-radius: 6px; margin-bottom: 10px;
}
.errbox-h {
  font-size: 12px; color: #8C3A45; line-height: 1.7;
  border-top: 1px dashed #FFCCC7; padding-top: 8px;
}
.errbox-h code {
  background: #fff; padding: 1px 5px; border-radius: 4px;
  border: 1px solid #FFCCC7; font-size: 11px;
}

/* 被跳过的活动提示（灰色，不喧宾夺主） */
.skipped {
  margin-top: 10px; padding: 8px 10px; font-size: 12px; color: var(--muted);
  background: #F6F7F9; border-radius: 8px; line-height: 1.6;
}
.empty-sub { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 活动体检结果 */
.probebox {
  background: #F0F9F0; border: 1px solid #B7EBB7; border-radius: 10px;
  padding: 12px; margin: 8px 0 12px; font-size: 13px;
}
.probe-sum { font-weight: 700; color: #237804; margin-bottom: 8px; }
.probe-detail { margin-top: 6px; }
.probe-detail summary { cursor: pointer; color: #555; font-size: 13px; padding: 4px 0; }
.probe-list { max-height: 200px; overflow: auto; padding: 6px 0; }
.probe-item {
  padding: 5px 8px; font-size: 12px; color: #333;
  border-bottom: 1px dashed #D9ECD9; word-break: break-all;
}
.probe-item.bad { color: #A8071A; }

@media (max-width: 480px) {
  .otable { font-size: 11px; }
  .otable th:nth-child(2), .otable td:nth-child(2) { display: none; }
}
