/* Florasense Admin Console —— 样式表
 *
 * 视觉沿用官网三套主题（Stellar / Amber / Neon），后台默认 Stellar 深色高对比。
 * 配色约定（设计稿 §8.1）：环比涨红跌绿（中国习惯）。
 * 下拉浮层必须不透明（与官网 lang-menu 修复保持一致）。
 */

:root {
  --bg: #070b14;
  --bg-soft: #0d1422;
  --panel: rgba(20, 30, 48, .88);
  --panel-solid: #131c2c;
  --line: rgba(160, 190, 230, .14);
  --line-strong: rgba(160, 190, 230, .30);
  --text: #e8f0fb;
  --muted: #93a4bd;
  --accent: #dbeaff;
  --accent-dim: rgba(219, 234, 255, .13);
  --glow: 0 0 0 1px rgba(219,234,255,.20), 0 8px 24px rgba(90,140,220,.16);
  --up: #f2718f;      /* 涨 —— 红 */
  --down: #61d6a8;    /* 跌 —— 绿 */
  --warn: #e0a83c;
  --ok: #61d6a8;
  --series-1: #7aa2f7;
  --series-2: #e0a83c;
  --series-3: #61d6a8;
  --series-4: #f2718f;
  --series-5: #b48ead;
  --series-6: #7dcfff;
  --grid: rgba(160,190,230,.12);
}

html[data-theme="amber"] {
  --bg: #17181c; --bg-soft: #1e1f24; --panel: rgba(38,36,32,.90); --panel-solid: #24221e;
  --line: rgba(224,168,60,.16); --line-strong: rgba(224,168,60,.36);
  --text: #f6ecdb; --muted: #b6a68c; --accent: #e0a83c; --accent-dim: rgba(224,168,60,.14);
  --glow: 0 0 0 1px rgba(224,168,60,.26), 0 8px 24px rgba(224,168,60,.14);
  --up: #f2718f; --down: #61d6a8;
  --series-1: #e0a83c; --series-2: #7aa2f7; --series-3: #61d6a8; --series-4: #f2718f;
}
html[data-theme="neon"] {
  --bg: #120b16; --bg-soft: #1a1020; --panel: rgba(38,22,44,.90); --panel-solid: #241428;
  --line: rgba(255,92,138,.18); --line-strong: rgba(255,92,138,.36);
  --text: #ffe9f2; --muted: #c39bb2; --accent: #ff5c8a; --accent-dim: rgba(255,92,138,.14);
  --glow: 0 0 0 1px rgba(255,92,138,.26), 0 8px 24px rgba(255,92,138,.16);
  --series-1: #ff5c8a; --series-2: #7dcfff; --series-3: #61d6a8; --series-4: #e0a83c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background-image: radial-gradient(900px 500px at 50% -10%, var(--accent-dim), transparent 70%);
  background-attachment: fixed;
}
button, input, select { font: inherit; color: inherit; }
code { background: var(--panel-solid); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: .92em; }
.hidden { display: none !important; }
a { color: var(--accent); }

/* ------------------------------ 登录 ------------------------------ */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 28px; box-shadow: var(--glow); backdrop-filter: blur(10px);
}
.login-card h1 { font-size: 19px; margin: 18px 0 6px; font-weight: 600; }
.login-hint { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; line-height: 1.7; }
.login-card label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.login-card input {
  width: 100%; margin-top: 5px; padding: 9px 12px; background: var(--panel-solid);
  border: 1px solid var(--line-strong); border-radius: 9px; outline: none;
}
.login-card input:focus { border-color: var(--accent); box-shadow: var(--glow); }
.login-card .btn { width: 100%; margin-top: 6px; }
.login-msg { min-height: 20px; font-size: 12.5px; margin-bottom: 6px; color: var(--up); }
.login-msg.ok { color: var(--ok); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--accent), transparent 75%);
  border: 1px solid var(--line-strong); box-shadow: var(--glow);
}
.brand b { font-size: 15px; letter-spacing: .4px; }
.brand small { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: 1.4px; }

/* ------------------------------ 布局 ------------------------------ */
.shell { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; }
aside {
  border-right: 1px solid var(--line); background: var(--bg-soft);
  padding: 20px 13px; position: sticky; top: 0; height: 100vh; overflow: auto;
  display: flex; flex-direction: column;
}
aside .brand { padding: 0 7px 16px; }
.nav-label { color: var(--muted); font-size: 10.5px; letter-spacing: 1.6px; padding: 14px 10px 6px; }
nav button {
  display: block; width: 100%; text-align: left; padding: 8px 11px; margin: 2px 0;
  background: transparent; color: var(--muted); border: 1px solid transparent;
  border-radius: 9px; cursor: pointer; transition: .15s;
}
nav button:hover { color: var(--text); background: var(--accent-dim); }
nav button.on { color: var(--text); background: var(--accent-dim); border-color: var(--line-strong); box-shadow: var(--glow); }
.aside-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.aside-foot .row { display: flex; gap: 6px; margin-top: 9px; }
.aside-foot .who { color: var(--text); font-size: 12.5px; }
.aside-foot .who small { color: var(--muted); }

main { padding: 24px 28px 60px; max-width: 1420px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
h1 { font-size: 21px; margin: 0 0 3px; font-weight: 620; letter-spacing: .3px; }
.sub { color: var(--muted); font-size: 12.5px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel-solid); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.bad { background: var(--up); box-shadow: 0 0 8px var(--up); }

/* ------------------------------ 筛选条 ------------------------------ */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 15px; backdrop-filter: blur(8px); }
.card h2 { font-size: 13.5px; margin: 0 0 12px; font-weight: 600; letter-spacing: .3px; display: flex; align-items: baseline; gap: 9px; }
.card h2 .note { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters.second { margin-top: 11px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--panel-solid); }
.seg button { padding: 6px 12px; background: transparent; border: none; border-right: 1px solid var(--line); cursor: pointer; color: var(--muted); font-size: 12.5px; }
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--text); background: var(--accent-dim); }
.seg button.on { background: var(--accent); color: #0a1018; font-weight: 600; }
html[data-theme="amber"] .seg button.on, html[data-theme="neon"] .seg button.on { color: #14100f; }
.range-custom { display: flex; gap: 6px; align-items: center; }
.range-custom input, .filters select {
  padding: 6px 9px; background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: 8px; outline: none; font-size: 12.5px;
}
.range-custom input { width: 172px; }
input:focus, select:focus { border-color: var(--accent); box-shadow: var(--glow); }
select { cursor: pointer; }
.filters select option { background: var(--panel-solid); color: var(--text); }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.arrow { color: var(--muted); }
.wm { margin-left: auto; font-size: 12px; color: var(--muted); }
.hint { color: var(--muted); font-size: 11.5px; margin-top: 10px; line-height: 1.8; }

.btn {
  padding: 7px 15px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--accent-dim); color: var(--text); cursor: pointer; white-space: nowrap;
}
.btn:hover { box-shadow: var(--glow); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #0a1018; border-color: transparent; font-weight: 600; }
html[data-theme="amber"] .btn.primary, html[data-theme="neon"] .btn.primary { color: #14100f; }
.btn.mini { padding: 4px 10px; font-size: 12px; }

/* ------------------------------ KPI ------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 15px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; position: relative; transition: .16s; }
.kpi:hover { box-shadow: var(--glow); }
.kpi .k { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 27px; font-weight: 640; letter-spacing: .6px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi .d { color: var(--muted); font-size: 11px; margin-top: 3px; display: flex; align-items: center; gap: 7px; }
.delta { font-size: 11.5px; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--line-strong); }
.delta.up { color: var(--up); border-color: rgba(242,113,143,.42); }
.delta.down { color: var(--down); border-color: rgba(97,214,168,.42); }
.delta.flat { color: var(--muted); }
.info {
  width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-strong);
  color: var(--muted); font-size: 10px; line-height: 12px; text-align: center;
  cursor: help; flex: none; background: var(--panel-solid);
}
.info:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------ 网格与表 ------------------------------ */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 13px; }
.tabs button {
  padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 12.5px;
}
.tabs button.on { background: var(--accent-dim); color: var(--text); border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--down); border-color: rgba(97,214,168,.4); }
.tag.warn { color: var(--warn); border-color: rgba(224,168,60,.4); }
.tag.bad { color: var(--up); border-color: rgba(242,113,143,.4); }
.empty { color: var(--muted); text-align: center; padding: 26px 0; font-size: 12.5px; }
.err { color: var(--up); font-size: 12.5px; padding: 14px 0; }
.loading { color: var(--muted); font-size: 12.5px; padding: 18px 0; text-align: center; }

/* 条形排行 */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 148px 1fr 66px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bar-track { height: 9px; background: var(--accent-dim); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); opacity: .88; min-width: 2px; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; }

/* 图表容器 */
.chart { width: 100%; overflow: hidden; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.note { color: var(--muted); font-size: 12px; line-height: 1.9; }
.note ul { padding-left: 19px; margin: 8px 0; }
.note li { margin-bottom: 4px; }
.disclaimer {
  border-left: 3px solid var(--warn); background: rgba(224,168,60,.07);
  padding: 10px 13px; border-radius: 0 9px 9px 0; color: var(--muted);
  font-size: 12px; line-height: 1.85; margin-bottom: 13px;
}
.disclaimer b { color: var(--warn); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3, .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  main { padding: 18px 14px 50px; }
  .kpis { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 110px 1fr 58px; }
}
