/* 开店参谋 共享样式 */
:root {
  --brand: #16a34a;
  --brand-dark: #15803d;
  --brand-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --yellow: #d97706;
  --yellow-light: #fef3c7;
  --green: #16a34a;
  --green-light: #dcfce7;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f7f6;
  --card: #ffffff;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 720px; margin: 0 auto; padding: 16px; }

/* 顶部 */
.header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 28px 16px 36px;
  border-radius: 0 0 24px 24px;
}
.header h1 { font-size: 22px; font-weight: 700; }
.header p { font-size: 13px; opacity: .9; margin-top: 4px; }
.header .slogan { font-size: 15px; margin-top: 10px; font-weight: 600; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  margin-top: -20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.card + .card { margin-top: 14px; }
.card h2 { font-size: 16px; margin-bottom: 12px; }
.card h3 { font-size: 14px; margin-bottom: 8px; color: var(--text); }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input[type=text], .field input[type=number], .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 15px; outline: none; background: #fff;
  transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 999px;
  font-size: 14px; cursor: pointer; background: #fff; transition: all .15s; user-select: none;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.btn {
  display: inline-block; width: 100%; padding: 14px; border: 0; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; text-align: center; transition: opacity .2s;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.small { width: auto; padding: 8px 20px; font-size: 14px; border-radius: 8px; }

/* 红绿灯 */
.light {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 15px;
}
.light.green { background: var(--green-light); color: var(--green); }
.light.yellow { background: var(--yellow-light); color: var(--yellow); }
.light.red { background: var(--red-light); color: var(--red); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.light.green .dot { background: var(--green); }
.light.yellow .dot { background: var(--yellow); }
.light.red .dot { background: var(--red); }

.score-big { font-size: 44px; font-weight: 800; line-height: 1; }
.score-big.green { color: var(--green); }
.score-big.yellow { color: var(--yellow); }
.score-big.red { color: var(--red); }

/* 指标行 */
.metric-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px dashed var(--border); font-size: 14px;
}
.metric-row:last-child { border-bottom: 0; }
.metric-row .k { color: var(--muted); }
.metric-row .v { font-weight: 700; }

/* 列表 */
.viol { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 8px; }
.viol.red { background: var(--red-light); color: #7f1d1d; }
.viol.yellow { background: var(--yellow-light); color: #78350f; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; }

/* 维度条 */
.dimbar { margin-bottom: 12px; }
.dimbar .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.dimbar .bar { height: 8px; background: #eef2f0; border-radius: 99px; overflow: hidden; }
.dimbar .bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* 徽标与提示 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12px; background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
.note { font-size: 12px; color: var(--muted); padding: 10px 12px; background: #f8faf9; border-radius: 10px; margin-top: 4px; }
.note ul { padding-left: 16px; }
.loading { text-align: center; padding: 30px; color: var(--muted); font-size: 14px; }
.err { background: var(--red-light); color: #7f1d1d; padding: 12px; border-radius: 10px; font-size: 14px; }

/* 雷达图容器 */
#radar { width: 100%; height: 280px; }

/* 对比表格 */
.best-tag { background: var(--brand); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 6px; margin-left: 6px; }

/* 结果快扫卡片 */
.quick-result { text-align: center; padding: 22px 16px; }
.quick-metrics { margin-top: 16px; text-align: left; }

/* 链接行 */
.links { display: flex; gap: 10px; margin-top: 14px; }
.links a { flex: 1; }

/* 历史记录 */
.hist-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.hist-item:last-child { border-bottom: 0; }
.hist-item a { color: var(--text); text-decoration: none; flex: 1; }
.hist-item .meta { color: var(--muted); font-size: 12px; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 32px; }
.footer a { color: var(--brand); text-decoration: none; }

.hidden { display: none !important; }

/* 地图容器 */
.map-wrap { position: relative; border-radius: 12px; overflow: hidden; height: 380px; background: #e8efe9; }
#map { width: 100%; height: 100%; }
.map-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
