/*! grad：应用自身样式（布局/表格/画布尺寸等），来自原版 taez/tools/grad/index.html 的 <style>。
 * metro.css 负责外层外观（面板、按钮、页头），本文件只补应用结构与几何，勿随意删减。 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f7f7f7; color: #222; padding: 24px 16px;
}
.wrap { max-width: 1100px; margin: 0 auto; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.sub { color: #888; font-size: 13px; margin: 0 0 20px; }
.panel {
  background: #fff; border: 1px solid #ddd; border-radius: 2px;
  padding: 16px; margin-bottom: 16px;
}
.hidden { display: none !important; }
.btn {
  padding: 7px 16px; border: 1px solid #bbb; border-radius: 2px;
  background: #fff; color: #222; font-size: 13px; cursor: pointer; font-family: inherit;
  text-decoration: none; display: inline-block;
}
.btn:hover { background: #f0f0f0; }
.btn.primary { background: #2c5fa8; border-color: #2c5fa8; color: #fff; }
.btn.primary:hover { background: #244d8a; border-color: #244d8a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { font-size: 13px; margin-top: 8px; min-height: 18px; }
.status.err { color: #c62828; white-space: pre-wrap; }
.status.ok { color: #2e7d32; }
.drop {
  border: 2px dashed #ccc; border-radius: 2px; padding: 32px 16px;
  text-align: center; color: #666; font-size: 14px;
  background: #fff; cursor: pointer; margin-bottom: 16px;
}
.drop.over { border-color: #2c5fa8; background: #eef3fb; color: #2c5fa8; }
.linkbtn { color: #2c5fa8; text-decoration: underline; }
.hint { font-size: 12px; color: #888; }

/* 列映射表 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  padding: 8px 10px; border: 1px solid #e5e5e5;
  text-align: left; vertical-align: middle;
}
th { background: #fafafa; font-weight: 600; color: #444; font-size: 12px; }
td select, td input[type="number"], td input[type="text"] {
  padding: 4px 6px; border: 1px solid #ccc; border-radius: 2px;
  font-size: 12px; font-family: inherit; width: 100%;
}
.sample { font-size: 11px; color: #999; margin-top: 2px; }

/* 概览卡片 */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.card {
  background: #fff; border: 1px solid #ddd; border-radius: 2px;
  padding: 12px;
}
.card .c-title {
  font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #333;
  padding-bottom: 6px; border-bottom: 1px solid #eee;
}
.card .c-row {
  display: flex; justify-content: space-between; font-size: 12px;
  padding: 3px 0; color: #666;
}
.card .c-row strong { color: #222; font-weight: 600; }
.card .c-row.big { font-size: 14px; padding: 5px 0; }
.card .c-row.big strong { font-size: 16px; color: #2c5fa8; }

/* 图表切换 */
.tabs { display: flex; border-bottom: 1px solid #ddd; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; cursor: pointer; font-size: 13px; color: #666;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 2px 2px 0 0; margin-bottom: -1px; background: transparent;
  font-family: inherit;
}
.tab.active { background: #fff; border-color: #ddd; color: #222; font-weight: 600; }
.chart-wrap {
  position: relative; height: 380px; width: 100%;
}
.chart-toolbar {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.chart-toolbar select {
  padding: 4px 8px; border: 1px solid #ccc; border-radius: 2px;
  font-size: 12px; font-family: inherit;
}

/* 排名表 */
.rank-wrap { overflow-x: auto; max-height: 500px; overflow-y: auto; }
.rank-wrap table { font-size: 12px; }
.rank-wrap th { position: sticky; top: 0; z-index: 1; }
.rank-wrap td.num { text-align: right; font-family: ui-monospace, monospace; }
.rank-wrap tr.top1 td { background: #fffbe6; }
.rank-wrap tr.top2 td { background: #f5f5f5; }
.rank-wrap tr.top3 td { background: #fdf3e7; }
