/* 四川电价预测 · 界面样式（无外部依赖，离线可用） */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #16202d;
  --muted: #68738a;
  --line: #e2e8f2;
  --brand: #2f6fed;
  --brand-d: #1f56c8;
  --ok: #1fa971;
  --warn: #c77700;
  --err: #d93a3a;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 22px; height: 58px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.brand .logo { color: var(--brand); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 14px;
}
.nav a:hover { background: #f0f4fe; text-decoration: none; color: var(--brand); }
.nav a.on { background: var(--brand); color: #fff; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who { color: var(--muted); }
.linkbtn {
  background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 13px;
  padding: 4px 8px;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 18px 40px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(20, 40, 80, .04);
}
.card h1, .card h2 { margin: 0 0 12px; font-size: 17px; }
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 16px; }
.stat {
  flex: 1 1 150px; min-width: 130px;
  background: #f8fafd; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .v i { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 3px; font-weight: 400; }
.stat .v.accent { color: var(--brand); }

.chart {
  margin: 8px 0 4px; padding: 8px 0;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.chart svg { display: block; width: 100%; height: auto; }

/* ---- 图表悬停提示 ---- */
.chart.chart-live { position: relative; overflow: hidden; }
.chart .ctt {
  position: absolute; z-index: 6; pointer-events: none;
  min-width: 132px; max-width: 240px;
  background: rgba(22, 32, 45, .94); color: #fff;
  border-radius: 8px; padding: 8px 10px;
  font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 6px 18px rgba(16, 28, 48, .22);
  backdrop-filter: blur(2px);
}
.chart .ctt-h {
  font-weight: 600; font-size: 12.5px; margin-bottom: 4px;
  padding-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .18);
  font-variant-numeric: tabular-nums;
}
.chart .ctt-r { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart .ctt-r .sw {
  width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto;
  background: #8ab4ff;
}
.chart .ctt-r .sw.band { background: rgba(47, 111, 237, .35); border: 1px solid #9db9ef; }
.chart .ctt-r .nm { color: rgba(255, 255, 255, .72); font-size: 12px; }
.chart .ctt-r b {
  margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600;
}
.chart .ctt-r b i { font-style: normal; font-weight: 400; opacity: .6; font-size: 11px; }

/* 导出按钮条 */
.exbar { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.exbar .btn { font-size: 13px; padding: 6px 14px; }

/* ---- 宽表格：横向可滚 + 关键列不折行 ---- */
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl.dense th, .tbl.dense td { white-space: nowrap; padding: 7px 10px; }
.tbl.dense td.sum { white-space: normal; min-width: 200px; max-width: 340px; }
.tbl.dense td.ops { white-space: nowrap; flex-wrap: nowrap; }
.tbl.dense td.ops .btn { margin-right: 4px; }
.tbl.dense td.ops .btn:last-child { margin-right: 0; }
.tbl.dense .tag { white-space: nowrap; }


.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; background: #fafbfd; font-size: 12.5px; }
.tbl tbody tr:hover { background: #f9fbff; }
.num { font-variant-numeric: tabular-nums; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; background: #eef1f6; color: var(--muted);
}
.tag.ok { background: #e6f7ef; color: var(--ok); }
.tag.err { background: #fdeaea; color: var(--err); }
.tag.warn { background: #fdf3e2; color: var(--warn); }
.tag.admin { background: #eae6fd; color: #5b46d4; }
.tag.user { background: #e7f0fe; color: var(--brand); }
.tag.viewer { background: #eef1f6; color: var(--muted); }

.btn {
  display: inline-block; padding: 8px 16px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: #cfd9ea; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.primary:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.danger { color: var(--err); border-color: #f3cfcf; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

.form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.form input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 15px; color: var(--ink); background: #fff;
}
.form input:focus { outline: 2px solid #d6e2fd; border-color: var(--brand); }

.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.grid-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.grid-form input, .grid-form select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; color: var(--ink); background: #fff;
}
.grid-form label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.formbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 4px; }

.kv { display: flex; flex-direction: column; gap: 0; }
.kvrow { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kvrow span { color: var(--muted); min-width: 220px; }
.kvrow b { font-weight: 500; }

.alert { padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px; }
.alert.err { background: #fdeaea; color: #a92626; }
.alert.ok { background: #e6f7ef; color: #157a53; }
.alert.warn { background: #fdf3e2; color: #8a5300; }

.keybox, .codebox {
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; font-size: 13px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.keybox { font-size: 15px; color: var(--brand); letter-spacing: .3px; }
.ops { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-pw { display: flex; gap: 6px; }
.inline-pw input {
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; width: 110px; font-size: 12.5px;
}
.login-card { max-width: 460px; margin: 6vh auto 0; }
.empty { text-align: center; padding: 46px 22px; }

/* ---- SSO 登录按钮与分隔线 ---- */
.btn.sso { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.sso-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
.or {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 14px; color: var(--muted); font-size: 12.5px;
}
.or::before, .or::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.muted.small { font-size: 12px; margin-top: 6px; }


.foot {
  max-width: 1180px; margin: 0 auto; padding: 0 18px 30px;
  display: flex; justify-content: space-between; gap: 12px;
  color: var(--muted); font-size: 12.5px; flex-wrap: wrap;
}

@media (max-width: 720px) {
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; }
  .kvrow { flex-direction: column; gap: 2px; }
  .kvrow span { min-width: 0; }
}

/* ================= 登录页（独立布局，无 Casdoor 痕迹） ================= */
.auth-body { margin: 0; background: #eef2f9; }
.auth-wrap {
  display: grid; grid-template-columns: 1.05fr .95fr;
  min-height: 100vh;
}

/* 左侧品牌区 */
.auth-hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 10% 0%, #22408c 0%, #16234a 45%, #0d1428 100%);
  padding: 56px 56px 32px; display: flex; flex-direction: column;
}
.hero-glow {
  position: absolute; width: 460px; height: 460px; left: -120px; top: -140px;
  background: radial-gradient(circle, rgba(96,140,255,.42) 0%, rgba(96,140,255,0) 68%);
  filter: blur(6px); pointer-events: none;
}
.hero-line {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42%;
  opacity: .55; pointer-events: none;
}
.hero-body { position: relative; margin-top: auto; }
.hero-badge {
  display: inline-block; font-size: 12.5px; letter-spacing: .4px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  margin-bottom: 18px;
}
.auth-hero h1 {
  font-size: 34px; line-height: 1.28; margin: 0 0 14px; font-weight: 700;
  letter-spacing: .5px;
}
.hero-sub {
  color: rgba(255,255,255,.72); font-size: 14.5px; line-height: 1.8;
  max-width: 30em; margin: 0 0 22px;
}
.hero-list { list-style: none; margin: 0; padding: 0; }
.hero-list li {
  position: relative; padding-left: 18px; margin-bottom: 9px;
  font-size: 13.5px; color: rgba(255,255,255,.80);
}
.hero-list li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #7ea6ff; box-shadow: 0 0 0 3px rgba(126,166,255,.18);
}
.hero-list b { color: #fff; font-weight: 600; }
.hero-foot {
  position: relative; margin-top: 34px; font-size: 12px;
  color: rgba(255,255,255,.42); letter-spacing: .3px;
}

/* 右侧表单区 */
.auth-panel {
  display: flex; flex-direction: column; justify-content: center;
  align-items: center; padding: 40px 28px; background: #fff;
}
.auth-card { width: 100%; max-width: 372px; }
.auth-card h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: .5px; }
.auth-tip { color: var(--muted); font-size: 13px; margin: 0 0 22px; line-height: 1.7; }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px;
}
.field input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; font-size: 15px; color: var(--ink);
  background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input:focus {
  outline: none; background: #fff; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,237,.14);
}
.pw { position: relative; }
.pw input { padding-right: 58px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--brand);
  font-size: 12.5px; padding: 6px 10px; cursor: pointer; border-radius: 8px;
}
.pw-toggle:hover { background: #eef3ff; }

.auth-submit {
  width: 100%; padding: 12px 16px; font-size: 15.5px; margin-top: 6px;
  border-radius: 10px; letter-spacing: 2px;
}
.auth-links {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 16px; font-size: 12.5px; flex-wrap: wrap;
}
.auth-links a { color: var(--brand); }

.auth-legal {
  margin-top: 34px; font-size: 12px; color: var(--muted);
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.auth-legal a { color: var(--muted); }
.auth-legal a:hover { color: var(--brand); }

/* 站点底部备案信息（工信部要求） */
.beian {
  max-width: 1180px; margin: 0 auto; padding: 0 18px 26px;
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  font-size: 12px; color: var(--muted);
}
.beian a { color: var(--muted); }
.beian a:hover { color: var(--brand); }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; min-height: auto; }
  .auth-hero { padding: 30px 24px 26px; }
  .auth-hero h1 { font-size: 24px; }
  .hero-list, .hero-sub { display: none; }
  .hero-foot { display: none; }
  .hero-body { margin-top: 0; }
  .auth-panel { padding: 30px 22px 40px; }
}

/* 登录页微调：装饰线不压文字、移动端不留大片空白 */
.auth-hero .hero-line { height: 34%; opacity: .42; }
@media (max-width: 900px) {
  .auth-wrap { grid-template-rows: auto 1fr; min-height: 100vh; }
  .auth-hero { padding: 24px 22px 20px; min-height: auto; }
  .auth-hero h1 { font-size: 22px; margin-bottom: 6px; }
  .hero-badge { margin-bottom: 12px; }
  .auth-hero .hero-line { height: 56px; opacity: .38; }
  .auth-panel { flex: 1; justify-content: flex-start; padding: 26px 22px 40px; }
  .auth-legal { margin-top: auto; padding-top: 24px; }
}

/* ================= 404 / 错误页 ================= */
.err-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 20px;
  background: radial-gradient(120% 90% at 50% 0%, #eef3fc 0%, #f7f9fd 55%, #ffffff 100%);
}
.err-card {
  width: 100%; max-width: 560px; background: #fff; border-radius: 16px;
  padding: 40px 36px 32px; box-shadow: 0 10px 40px rgba(23,42,84,.08);
  border: 1px solid var(--line); text-align: center;
}
.err-code {
  font-size: 64px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, #2f6fed, #173a8f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 2px; margin-bottom: 14px;
}
.err-card h1 { font-size: 22px; margin: 0 0 12px; }
.err-desc { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0 0 24px; }
.err-tips {
  text-align: left; background: #f7f9fd; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 26px;
}
.tip-row { display: flex; gap: 14px; font-size: 13px; line-height: 1.9; }
.tip-row + .tip-row { margin-top: 8px; }
.tip-k { color: var(--muted); flex: 0 0 76px; }
.tip-v { color: var(--ink); }
.tip-v code {
  background: #eef3ff; color: #2f6fed; padding: 1px 6px;
  border-radius: 5px; font-size: 12.5px;
}
.err-actions { display: flex; gap: 12px; justify-content: center; }
.err-foot { margin-top: 22px; }
@media (max-width: 560px) {
  .err-card { padding: 30px 20px 24px; }
  .err-code { font-size: 52px; }
  .err-actions { flex-direction: column; }
}
