/* JR 站点通用样式（登录页 / 列表页 / 详情页） */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e3e6eb;
  --text: #1f2329;
  --muted: #6b7280;
  --brand: #c62828;
  --up: #d32f2f;
  --down: #2e7d32;
  --safe: #2e7d32;
  --mid: #9ccc65;
  --warn: #f57c00;
  --danger: #c62828;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶部免责声明条 */
.riskbar {
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  color: #8d6e00;
  padding: 6px 12px;
  font-size: 12px;
  text-align: center;
}
.riskbar strong { color: #c62828; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}
.topbar h1 { font-size: 16px; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px; margin-bottom: 16px;
}
.card h2 { font-size: 14px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.err { color: var(--danger); min-height: 20px; font-size: 13px; }
.ok { color: var(--safe); }

/* 表单 */
input[type=text], input[type=password], select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 14px; background: #fff;
}
button {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 14px;
}
button:hover { background: #f0f2f5; }
button.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
button.primary:hover { filter: brightness(1.08); }
button:disabled { opacity: .6; cursor: not-allowed; }

/* 登录页 */
.login-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: 360px; }
.login-box .row { margin-bottom: 12px; }
.login-box label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.captcha-row { display: flex; gap: 8px; }
.captcha-row input { flex: 1; }
.captcha-row img {
  height: 40px; width: 110px; border: 1px solid var(--line);
  border-radius: 6px; cursor: pointer; object-fit: cover;
}

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { position: sticky; top: 0; background: #fafbfc; cursor: pointer; user-select: none; z-index: 1; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
tbody tr:hover { background: #f7f9fc; }
.tbl-scroll { max-height: 68vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }

/* 安全指数面板 */
.isi-total { display: flex; align-items: baseline; gap: 10px; }
.isi-total .num { font-size: 34px; font-weight: 700; }
.isi-blocks { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 14px; }
.isi-block {
  flex: 1 1 220px; border: 1px solid var(--line); border-radius: 8px; padding: 10px;
}
.isi-block .head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.isi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.isi-item { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.isi-item .line1 { display: flex; justify-content: space-between; align-items: center; }
.isi-item .name { font-weight: 600; }
.isi-item .score { font-variant-numeric: tabular-nums; font-weight: 700; }
.bar { height: 6px; background: #eceff3; border-radius: 3px; margin: 6px 0 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; }
.isi-item .val { font-size: 12px; color: var(--muted); }
.isi-item details { margin-top: 4px; }
.isi-item summary { font-size: 12px; color: #1a73e8; cursor: pointer; }
.isi-item .formula { font-size: 12px; color: #37474f; background: #f7f9fc; padding: 6px; border-radius: 4px; margin-top: 4px; }

/* 周期按钮 */
.periods { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.periods button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 详情基础信息 */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; font-size: 13px; }
.kv div { overflow: hidden; text-overflow: ellipsis; }
.kv b { color: var(--muted); font-weight: 400; }
#chart { width: 100%; height: 420px; }
