/* ============================================================
   宠物健康分析 API · 浅色主题
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e8eaee;
  --line-strong: #d9dce1;
  --fg: #1f2329;
  --fg-sub: #646a73;
  --fg-dim: #8f959e;
  --brand: #2b6cf6;
  --brand-hover: #1f5be0;
  --brand-soft: #eef4ff;
  --ok: #22a06b;
  --err: #d83931;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(31, 35, 41, .06);
  --fs: 15px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--fg);
  font: var(--fs)/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------------- 布局 ---------------- */

.layout { display: flex; min-height: 100vh; }

.side {
  width: 228px; flex: 0 0 228px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}

.brand {
  padding: 22px 20px 18px;
  font-size: 17px; font-weight: 600;
  line-height: 1.4;
  display: flex; flex-direction: column; gap: 4px;
}
.brand small { font-size: 12.5px; font-weight: 400; color: var(--fg-dim); }

.navgroup { padding: 8px 10px 18px; }
.navhead {
  padding: 10px 10px 8px;
  font-size: 13px; color: var(--fg-dim);
}
.navitem {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 8px; color: var(--fg-sub);
  font-size: 15px;
}
.navitem:hover { background: #f4f5f7; color: var(--fg); }
.navitem.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.navitem .nico { flex: 0 0 17px; width: 17px; height: 17px; opacity: .85; }
.navitem.active .nico { opacity: 1; }

/* 左栏最底下：当前账号 + 退出登录（由 renderNav 统一挂） */
.navfoot {
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid var(--line);
}
.nfuser { display: flex; align-items: center; gap: 9px; padding: 4px 4px 10px; min-width: 0; }
.avatar {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600;
}
.nfname {
  font-size: 14px; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nfout {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border: 0; border-radius: 8px;
  background: none; color: var(--fg-sub);
  font-size: 14px; text-align: left;
}
.nfout:hover { background: #f4f5f7; color: var(--err); }
.nfout svg { width: 16px; height: 16px; flex: 0 0 16px; }

.main { flex: 1; min-width: 0; padding: 28px 34px 52px; }

/* ---------------- 通用元件 ---------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff; color: var(--fg);
  font-size: 14.5px; white-space: nowrap;
  transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:disabled, .btn.disabled {
  background: #f2f3f5; border-color: var(--line); color: var(--fg-dim);
  cursor: not-allowed;
}
.btn:disabled:hover, .btn.disabled:hover { border-color: var(--line); color: var(--fg-dim); }
.btn.sm { padding: 7px 14px; font-size: 13.5px; }
.btn.dark { background: #1f2733; border-color: #1f2733; color: #fff; }
.btn.dark:hover { background: #2c3644; border-color: #2c3644; color: #fff; }
.btn.light { background: rgba(255, 255, 255, .9); border-color: transparent; color: var(--fg); }
.btn.light:hover { background: #fff; border-color: transparent; color: var(--fg); }
.btn.dark svg { width: 15px; height: 15px; }

input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--fg); font: inherit; font-size: 15px;
  outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
select { appearance: none; background-image: none; cursor: pointer; }

.muted { color: var(--fg-sub); }
.dim { color: var(--fg-dim); }
.tiny { font-size: 13px; }

/* ---------------- 产品列表 ---------------- */

.catbar {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 15px 22px; margin-bottom: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.catbar .lbl { color: var(--fg-sub); font-size: 14.5px; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14.5px; }
.radio input { display: none; }
.radio .mk {
  width: 17px; height: 17px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); position: relative; transition: .15s;
}
.radio input:checked + .mk { border-color: var(--brand); }
.radio input:checked + .mk::after {
  content: ''; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--brand);
}
.radio input:checked ~ span { color: var(--brand); }

.grid { display: grid; gap: 18px; }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1500px) { .grid.c5 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .grid.c4, .grid.c5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 18px 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 11px;
  transition: .15s;
}
.card:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(43,108,246,.12); }
.card .chead { display: flex; gap: 12px; align-items: center; }
.card .thumb {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 8px; background: #f2f4f7;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--fg-dim); overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .title { font-size: 15.5px; font-weight: 500; line-height: 1.4; }
.card .desc { font-size: 13.5px; color: var(--fg-sub); line-height: 1.65; min-height: 44px; }
.card .acts { display: flex; gap: 9px; margin-top: auto; }
.card .acts .btn { flex: 1; }

/* 灰置卡片：内容与按钮都变淡，但**按钮照样能点**（需求 R-02） */
.card.gray .thumb,
.card.gray .title,
.card.gray .desc { opacity: .42; filter: grayscale(1); }
.card.gray { background: #fbfbfc; }

/* 灰置卡片的两个按钮也做成灰色 —— 只是视觉灰，功能完全正常 */
.card.gray .btn,
.card.gray .btn.primary {
  background: #f2f3f5;
  border-color: var(--line);
  color: var(--fg-dim);
  font-weight: 400;
  cursor: pointer;
}
.card.gray .btn:hover,
.card.gray .btn.primary:hover {
  background: #e9ebef;
  border-color: var(--line-strong);
  color: var(--fg-sub);
}

/* ---------------- 产品体验 ---------------- */

.trywrap { display: flex; gap: 20px; align-items: stretch; min-height: calc(100vh - 86px); }

.tree {
  width: 228px; flex: 0 0 228px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  max-height: calc(100vh - 86px); overflow: auto;
  align-self: flex-start;
}
.tree .grp { border-bottom: 1px solid var(--line); }
.tree .grp:last-child { border-bottom: 0; }
.tree .ghead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; cursor: pointer; font-size: 15px; font-weight: 500;
  user-select: none;
}
.tree .ghead:hover { background: #fafbfc; }
.tree .ghead .cv { color: var(--fg-dim); font-size: 12px; transition: transform .18s; }
.tree .grp.open .ghead .cv { transform: rotate(180deg); }
.tree .gbody { display: none; padding: 0 10px 10px; }
.tree .grp.open .gbody { display: block; }
.tree .titem {
  padding: 9px 12px; border-radius: 8px;
  font-size: 14px; color: var(--fg-sub); cursor: pointer;
}
.tree .titem:hover { background: #f4f5f7; color: var(--fg); }
.tree .titem.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.tree .titem.dis { color: var(--fg-dim); }

.trymain { flex: 1; min-width: 0; display: flex; gap: 20px; align-items: stretch; }
.trymid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tryright { width: 400px; flex: 0 0 400px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 1400px) { .tryright { width: 360px; flex-basis: 360px; } }

/* 宽屏：让中栏与右栏向下延伸，填满可视高度 */
@media (min-width: 1141px) {
  .tryright .resbox { flex: 1 1 0; display: flex; flex-direction: column; margin-bottom: 0; min-height: 0; }
  .tryright .resbox h3 { flex: 0 0 auto; }
  .tryright .resbody { flex: 1 1 auto; max-height: none; min-height: 0; }
  .drop { flex: 1 1 auto; }
  .samplerow { flex: 0 0 auto; }
  .topbar { flex: 0 0 auto; }
  .notice { flex: 0 0 auto; }
}

@media (max-width: 1140px) {
  .trywrap { flex-direction: column; min-height: 0; }
  .tree { width: 100%; flex-basis: auto; max-height: 280px; align-self: auto; }
  .trymain { flex-direction: column; width: 100%; min-height: 0; }
  .trymid { min-height: 0; }
  .tryright { width: 100%; flex-basis: auto; min-height: 0; }
  .trywrap .typlaceholder { min-height: 300px; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; margin-bottom: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 58px;
}
.topbar .capname { font-size: 16px; font-weight: 500; }

.drop {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--panel); min-height: 420px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; cursor: pointer; position: relative; overflow: hidden;
  transition: .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: #fafcff; }
.drop .upic { font-size: 32px; color: var(--fg-dim); line-height: 1; }
.drop .ubtn {
  padding: 8px 20px; border-radius: 8px;
  background: #f2f3f5; color: var(--fg-sub); font-size: 14.5px;
}
.drop .imgwrap { position: absolute; inset: 0; display: none; }
.drop.has .imgwrap { display: block; }
.drop.has .placeholder { display: none; }
.drop.has { border-style: solid; border-color: var(--line); cursor: default; }
.drop .imgwrap img, .drop .imgwrap video {
  width: 100%; height: 100%; object-fit: contain; background: #000;
}
.drop .mask {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .38);      /* 需求 R-07：悬停时加变暗遮罩 */
}
.drop.has .imgwrap:hover .mask { display: flex; }
.drop .mask .btn { background: #fff; border-color: #fff; color: var(--fg); }
.drop .mask .btn:hover { background: #fff; border-color: var(--brand); color: var(--brand); }

.samplerow { margin-top: 17px; }
.samplerow .slbl { font-size: 13.5px; color: var(--fg-sub); margin-bottom: 9px; }
.samples { display: flex; gap: 12px; flex-wrap: wrap; }
.sample {
  width: 106px; height: 78px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line-strong); cursor: pointer; background: #f2f4f7;
  position: relative; transition: .15s;
}
.sample:hover { border-color: var(--brand); }
.sample.sel { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,108,246,.18); }
.sample img, .sample video { width: 100%; height: 100%; object-fit: cover; }
.sample .pl {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--fg-dim); font-size: 22px;
}

.resbox {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px; margin-bottom: 18px;
}
.resbox h3 { margin: 0 0 12px; font-size: 15px; font-weight: 500; }
.resbody {
  background: #f7f8fa; border-radius: 8px; min-height: 190px;
  padding: 14px; font-size: 13.5px; line-height: 1.8; color: var(--fg-sub);
  overflow: auto; max-height: 460px;
}
.resbody.empty { display: flex; align-items: center; justify-content: center; color: var(--fg-dim); }
.resbody pre { margin: 0; white-space: pre-wrap; word-break: break-all; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; }

.empty-state {
  min-height: 380px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  color: var(--fg-dim); font-size: 15px;
}
.empty-state .pic { font-size: 48px; opacity: .35; }
/* 未研发占位面板：撑满中栏 */
.typlaceholder { flex: 1 1 auto; min-height: 420px; }
.typlaceholder .empty-state { flex: 1; min-height: 0; width: 100%; }

.notice {
  padding: 11px 14px; border-radius: 8px; font-size: 13.5px;
  margin-bottom: 14px; display: none;
}
.notice.show { display: block; }
.notice.err { background: #fef1f0; color: var(--err); }
.notice.info { background: var(--brand-soft); color: var(--brand); }
.notice.ok { background: #e9f7f1; color: var(--ok); }
.notice.warn { background: #fff8e6; color: #a8741a; }

/* 结果渲染 */
.rsec { margin-bottom: 17px; }
.rsec:last-child { margin-bottom: 0; }
.rsec .rt { font-size: 13px; color: var(--fg-dim); margin-bottom: 7px; }
.rsec .rv { font-size: 14px; color: var(--fg); line-height: 1.8; }
.badges { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 15px; }
.badge {
  padding: 5px 13px; border-radius: 20px; font-size: 13px;
  background: #f2f3f5; color: var(--fg-sub);
}
.badge.ok { background: #e9f7f1; color: var(--ok); }
.badge.err { background: #fef1f0; color: var(--err); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

.kv { display: grid; grid-template-columns: 108px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv .k { color: var(--fg-dim); }
.kv .v { color: var(--fg); }

.risks { display: flex; flex-direction: column; gap: 11px; }
.risk { font-size: 13.5px; }
.risk .rt2 { display: flex; justify-content: space-between; margin-bottom: 5px; }
.risk .bar { height: 7px; border-radius: 4px; background: #eceef1; overflow: hidden; }
.risk .bar > i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

.dcard { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 11px; }
.dcard:last-child { margin-bottom: 0; }
.dcard .dt { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.dcard .dd { font-size: 13.5px; color: var(--fg-sub); line-height: 1.75; }
.dcard .dd + .dt { margin-top: 11px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.li {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13.5px;
}
.li .lt { font-weight: 500; margin-bottom: 4px; }
.li .ld { color: var(--fg-sub); line-height: 1.75; }

/* ---------------- 问卷类能力（猫狗健康评估） ---------------- */

.formpanel {
  padding: 22px 24px;
  max-height: calc(100vh - 150px);
  overflow: auto;
}
.formintro { color: var(--fg-dim); font-size: 14px; text-align: center; padding: 60px 0; }

.formhead { margin-bottom: 18px; }
.formtitle { font-size: 17px; font-weight: 500; }
.formsub { font-size: 13px; color: var(--fg-dim); margin-top: 4px; }

.formcat {
  margin: 22px 0 10px;
  font-size: 13px; font-weight: 500; color: var(--brand);
  padding-left: 10px; border-left: 3px solid var(--brand);
}
.formcat:first-of-type { margin-top: 6px; }

.qcard {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 13px 15px; margin-bottom: 10px;
  transition: .15s;
}
.qcard:hover { border-color: var(--line-strong); }
.qhead { display: flex; gap: 9px; align-items: baseline; margin-bottom: 10px; }
.qidx {
  flex: 0 0 22px; height: 22px; border-radius: 50%;
  background: #f2f3f5; color: var(--fg-sub);
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}
.qtxt { font-size: 14px; line-height: 1.6; }

.qopts { display: flex; flex-direction: column; gap: 7px; padding-left: 31px; }
.qopt {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--fg-sub); cursor: pointer;
  padding: 7px 10px; border-radius: 6px; transition: .12s;
}
.qopt:hover { background: #f7f8fa; color: var(--fg); }
.qopt input { display: none; }
.qmk {
  flex: 0 0 15px; width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); position: relative; transition: .15s;
}
.qopt input:checked + .qmk { border-color: var(--brand); }
.qopt input:checked + .qmk::after {
  content: ''; position: absolute; inset: 2.5px;
  border-radius: 50%; background: var(--brand);
}
.qopt input:checked ~ span:last-child { color: var(--brand); font-weight: 500; }

.formbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--line);
  position: sticky; bottom: -22px;
  background: var(--panel);
}
.formstate { font-size: 13px; color: var(--fg-dim); }

@media (max-width: 1140px) {
  .formpanel { max-height: none; }
  .formbar { position: static; }
}

/* ---------------- 问答类能力（养宠百科） ---------------- */

.chatpanel {
  display: flex; flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 420px;
  overflow: hidden;
}
.chatmsgs {
  flex: 1 1 auto; overflow-y: auto;
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.chatrow { display: flex; }
.chatrow.me { justify-content: flex-end; }
.bubble {
  max-width: 82%;
  padding: 11px 15px; border-radius: 12px;
  font-size: 14px; line-height: 1.75;
  word-break: break-word;
}
.chatrow.bot .bubble { background: #f4f5f7; color: var(--fg); border-top-left-radius: 4px; }
.chatrow.me .bubble { background: var(--brand); color: #fff; border-top-right-radius: 4px; }
.bubble .errtext { color: var(--err); }
.bubble .md h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.bubble .md h4:not(:first-child) { margin-top: 14px; }
.bubble .md p { margin: 0 0 8px; }
.bubble .md p:last-child { margin-bottom: 0; }
.bubble .md ol { margin: 0 0 8px; padding-left: 20px; }
.bubble .md li { margin-bottom: 6px; }
.bubble .md code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.chatbar {
  flex: 0 0 auto;
  display: flex; gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.chatbar input { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 2px; }
.chip {
  padding: 7px 13px; border-radius: 18px;
  border: 1px solid var(--line-strong); background: #fff;
  color: var(--fg-sub); font-size: 13px; text-align: left;
  transition: .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }

@media (max-width: 1140px) {
  .chatpanel { height: auto; min-height: 460px; }
}

/* 品种识别 + 医疗检测：只列「名称 + 可能性」 */
.breedlist { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.breedrow { }
.breedhead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.breedname { font-size: 14.5px; color: var(--fg); font-weight: 500; }
.breedpct { font-size: 14px; color: var(--brand); font-variant-numeric: tabular-nums; }
.breedrow .bar { height: 7px; border-radius: 4px; background: #eceef1; overflow: hidden; }
.breedrow .bar > i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

/* 医疗检测：结论那一句话，比正文重一点，和下面的风险列表拉开层次 */
.conclusion {
  font-size: 15px; line-height: 1.8; color: var(--fg); font-weight: 500;
  margin: 4px 0 18px;
}

/* ---------------- API KEY 管理 ---------------- */

.field { margin-bottom: 22px; }
.field > label { display: block; font-size: 14px; color: var(--fg-sub); margin-bottom: 9px; }
.keyrow { display: flex; gap: 10px; }
.keyrow input { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.btn.eye { padding: 9px 15px; flex: 0 0 auto; }
.btnrow { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.testmsg { margin-top: 15px; font-size: 13.5px; min-height: 22px; }
.testmsg.ok { color: var(--ok); }
.testmsg.err { color: var(--err); }
.testmsg.run { color: var(--fg-dim); }

/* ============================================================
   数据总览
   ============================================================ */

.dash { display: flex; flex-direction: column; gap: 20px; }

.dash-top { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.dash-mid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }

/* ---- 账户余额卡（蓝色渐变） ---- */

.balancecard {
  padding: 22px 24px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2f6bd8 0%, #3f8bf0 55%, #5aa7ff 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(47, 107, 216, .22);
  display: flex; flex-direction: column;
}
.bc-label { font-size: 13px; opacity: .82; }
.bc-num { font-size: 30px; font-weight: 600; line-height: 1.25; margin-top: 2px; }
.bc-gap { margin-top: 16px; }
.bc-acts { display: flex; gap: 10px; margin-top: auto; padding-top: 18px; }
.bc-acts .btn { flex: 1; padding: 8px 14px; font-size: 14px; }

/* ---- 数据总览：两个数字块 ---- */

.statpanel { padding: 18px 20px 20px; display: flex; flex-direction: column; }

.panel-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 500; color: var(--fg);
  margin-bottom: 14px;
}
.panel-title .morelink {
  margin-left: auto; font-size: 13.5px; font-weight: 400; color: var(--brand);
}

.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; }

.statcard {
  position: relative;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.stat-head { display: flex; align-items: flex-start; gap: 12px; }
.stat-ico {
  flex: 0 0 38px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.stat-ico svg { width: 20px; height: 20px; }
.stat-ico.amber { background: #fff4e2; color: #e79a2b; }
.stat-ico.violet { background: #efe9ff; color: #7c5cff; }

.stat-text { min-width: 0; }
.stat-label { font-size: 13.5px; color: var(--fg-sub); }
.stat-value { display: flex; align-items: baseline; gap: 3px; margin-top: 4px; }
.stat-value .n { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat-value .u { font-size: 13.5px; color: var(--fg-sub); }
.stat-sub { font-size: 12.5px; color: var(--fg-dim); margin-top: 6px; }

.delta {
  position: absolute; right: 16px; bottom: 14px;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.delta.up { color: #d64545; }
.delta.down { color: #2f9e63; }
.delta.flat { color: #d64545; }

/* ---- 产品推荐 ---- */

.recopanel { padding: 18px 20px 20px; }
.recogrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.recocard {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  transition: .15s;
}
.recocard:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(31, 39, 51, .06); }

.recothumb {
  flex: 0 0 40px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; overflow: hidden;
  background: #f2f4f7; font-size: 20px;
}
.recothumb img { width: 100%; height: 100%; object-fit: cover; }

.recomain { min-width: 0; flex: 1; }
.recotitle { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recotags { display: flex; gap: 6px; margin-top: 6px; }
.recotag {
  padding: 1px 7px; border-radius: 4px;
  font-size: 11.5px; color: var(--fg-dim);
  background: #f2f4f7;
}

.recogo { font-size: 12.5px; color: var(--brand); white-space: nowrap; }

/* ---- 开发者工具 ---- */

.devpanel { padding: 18px 20px 20px; }
.devgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.devitem {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff; color: var(--fg-sub);
  transition: .15s;
}
.devitem:hover { border-color: var(--brand); color: var(--brand); }
.devico {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; background: #f4f5f7; color: var(--fg-sub);
}
.devitem:hover .devico { background: var(--brand-soft); color: var(--brand); }
.devico svg { width: 19px; height: 19px; }
.devlabel { font-size: 12.5px; }

/* 还没做的入口：样子照常，但不给点 —— 没有跳转，也没有 hover 反馈 */
.devitem.off { cursor: default; }
.devitem.off:hover { border-color: var(--line); color: var(--fg-sub); }
.devitem.off:hover .devico { background: #f4f5f7; color: var(--fg-sub); }

/* ---- 用量监控 ---- */

/* 这块原来忘了给 panel 加内边距，标题贴着边框 —— 补上 */
.usagepanel { padding: 18px 20px 22px; }

.seg {
  display: inline-flex; padding: 2px;
  background: #f2f4f7; border-radius: 8px;
}
.segbtn {
  border: 0; background: none; cursor: pointer;
  padding: 5px 16px; border-radius: 6px;
  font: inherit; font-size: 13.5px; color: var(--fg-sub);
}
.segbtn.active { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(31, 39, 51, .1); }

/* ---- 日期区间选择器 ---- */

.rangewrap { position: relative; }

.rangebtn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff; color: var(--fg);
  font: inherit; font-size: 13.5px;
  cursor: pointer;
}
.rangebtn:hover { border-color: var(--brand); }
.rangebtn #rangeText.placeholder { color: var(--fg-dim); }
.calico { width: 16px; height: 16px; color: var(--fg-dim); }

.picker {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  padding: 14px 16px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(31, 39, 51, .13);
}
.picker[hidden] { display: none; }

.pmonths { display: flex; gap: 22px; }
.pmonth { width: 224px; }

.phead {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.ptitle { font-size: 14px; font-weight: 500; }
.pnav {
  border: 0; background: none; cursor: pointer;
  width: 22px; height: 22px; border-radius: 5px;
  color: var(--fg-dim); font-size: 13px; line-height: 1;
}
.pnav:hover { background: #f2f4f7; color: var(--brand); }

.pweek, .pdays { display: grid; grid-template-columns: repeat(7, 1fr); }
.pweek span {
  text-align: center; font-size: 12px; color: var(--fg-dim);
  padding: 4px 0 6px;
}

.pday {
  border: 0; background: none; cursor: pointer;
  height: 30px; margin: 1px 0;
  border-radius: 6px;
  font: inherit; font-size: 13px; color: var(--fg);
}
.pday:hover { background: #f2f4f7; }
.pday.out { color: #c8ced7; cursor: default; }
.pday.out:hover { background: none; }
.pday.today { color: var(--brand); font-weight: 600; }
.pday.inrange { background: var(--brand-soft); border-radius: 0; }
.pday.edge { background: var(--brand); color: #fff; border-radius: 6px; }
.pday.edge.today { color: #fff; }

.pfoot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.ptip { font-size: 12.5px; color: var(--fg-dim); }
.pclear {
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--brand);
}

/* ---- 柱状图 ---- */

.chart { min-height: 200px; display: flex; flex-direction: column; }
.chart-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; color: var(--fg-dim);
}

.bars {
  flex: 1;
  display: flex; align-items: flex-end; gap: 6px;
  height: 176px;
  border-bottom: 1px solid var(--line);
}
.barcol {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.barnum { font-size: 11px; color: var(--fg-dim); margin-bottom: 4px; }
.barbar {
  width: 68%; max-width: 30px;
  flex: 0 0 auto;              /* 柱子高度由 JS 按像素给，别让 flex 压缩它 */
  background: var(--brand);
  border-radius: 3px 3px 0 0;
  transition: height .2s;
}
.barbar.zero { background: #e3e7ec; }

.barlabels { display: flex; gap: 6px; padding-top: 8px; }
.barlabel {
  flex: 1 1 0; min-width: 0;
  text-align: center; font-size: 11px; color: var(--fg-dim);
  white-space: nowrap; overflow: hidden;
}

/* ---- 占位页 ---- */
.soonwrap {
  min-height: 60vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.soontitle { font-size: 19px; font-weight: 500; }
.soonsub { font-size: 14px; color: var(--fg-dim); }

/* ---- 轻提示（点「充值」这类还没开通的东西时浮一条） ---- */

.toast {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.96);
  padding: 13px 26px;
  background: rgba(31, 39, 51, .9);
  color: #fff;
  font-size: 14.5px; white-space: nowrap;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31, 39, 51, .22);
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ============================================================
   用量分析
   ============================================================ */

.usage { display: flex; flex-direction: column; gap: 18px; }

/* ---- 筛选栏 ---- */

.filterbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 16px 20px;
}
.flabel { font-size: 14px; color: var(--fg-sub); }
.finput { width: 200px; padding: 8px 12px; font-size: 14px; }
.filterbar .btn { padding: 8px 20px; font-size: 14px; }
.tilde { font-size: 13.5px; color: var(--fg-dim); }

.datebtn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff; color: var(--fg);
  font: inherit; font-size: 14px;
  cursor: pointer;
}
.datebtn:hover { border-color: var(--brand); }
.datebtn .ph { color: var(--fg-dim); }

/* ---- 四个统计卡 ---- */

.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.statcard2 {
  padding: 16px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.s2head { display: flex; align-items: center; gap: 8px; }
.s2ico {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
}
.s2ico svg { width: 18px; height: 18px; }
.s2ico.blue { color: #3f8bf0; }
.s2ico.green { color: #2f9e63; }
.s2ico.red { color: #d64545; }
.s2label { font-size: 13.5px; color: var(--fg-sub); }
.s2value { font-size: 26px; font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; }

/* ---- 明细表 / 空状态 ---- */

.tablepanel { padding: 0; overflow: hidden; }

.emptystate {
  min-height: 300px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.emptyart svg { width: 168px; height: 132px; display: block; }
.emptytext { font-size: 14px; color: var(--fg-dim); }

.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th {
  text-align: left; font-weight: 400;
  padding: 14px 20px;
  color: var(--fg-sub); font-size: 13.5px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
}
.dtable td { padding: 13px 20px; border-bottom: 1px solid var(--line); }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover td { background: #fafbfc; }
.dtable td.name { color: var(--fg); }
.dtable th.num, .dtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable td.num.bad { color: #d64545; }
.dtable tr.sumrow td { font-weight: 500; background: #fafbfc; border-top: 1px solid var(--line); }

/* ============================================================
   基本信息
   ============================================================ */

.profile { display: flex; flex-direction: column; gap: 18px; }

/* ---- 查看态 ---- */

.profilecard { padding: 0; overflow: hidden; }

.band {
  height: 52px;
  background: linear-gradient(100deg, #cfe0ff 0%, #e9f2ff 42%, #dde8fa 100%);
  position: relative;
}
.settings {
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  padding: 6px 16px; font-size: 13.5px;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(31, 39, 51, .08);
}
.settings svg { width: 15px; height: 15px; }

.pbody { display: flex; gap: 46px; padding: 22px 40px 34px; }

.pident {
  flex: 0 0 190px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.plogo {
  width: 80px; height: 80px;
  border-radius: 16px;
  background: linear-gradient(140deg, #4b93f5, #3f7fe8);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(63, 139, 240, .26);
}
.plogo svg { width: 46px; height: 46px; display: block; }
.plogo img { width: 100%; height: 100%; object-fit: cover; }

.pname {
  font-size: 15px; font-weight: 500; line-height: 1.55;
  text-align: center; word-break: break-all;
}

.pgrid {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 26px 30px; align-content: start;
}
.pcell .k { font-size: 12.5px; color: var(--fg-dim); }
.pcell .v { font-size: 14px; margin-top: 6px; word-break: break-all; }

/* ---- 设置态 ---- */

.editcard { display: flex; gap: 42px; padding: 26px 40px 30px; }

.eident {
  flex: 0 0 150px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.uplink {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--brand);
  padding: 2px 4px;
}
.uplink svg { width: 15px; height: 15px; }
.uplink:hover { text-decoration: underline; }

.egrid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.erow { display: flex; align-items: baseline; gap: 16px; }
.ek { flex: 0 0 76px; font-size: 13.5px; color: var(--fg-sub); }
.ev { font-size: 14px; }

.basecard { padding: 20px 40px 26px; }
.formrows { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.frow { display: flex; align-items: center; gap: 16px; }
/* 隐藏的行必须显式 display:none —— 上面的 display:flex 会盖掉 [hidden] 的默认样式 */
.frow[hidden] { display: none; }
.fk { flex: 0 0 90px; font-size: 13.5px; color: var(--fg-sub); }
.fv { font-size: 14px; color: var(--fg); }
.fv input { width: 200px; padding: 8px 12px; font-size: 14px; }
.fv input.wide { width: 420px; }
/* 主体类型那个下拉；和输入框一样宽，右边补个箭头（全局 select 是 appearance:none） */
.fv select {
  width: 200px; padding: 8px 30px 8px 12px; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%238f959e' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px 6px;
}
/* 只读的（登录账号、国家地区）：灰底，一眼看出改不了 */
.fv input[readonly] {
  background: #f7f8fa; color: var(--fg-sub); cursor: default;
}
.fv input[readonly]:focus { border-color: var(--line-strong); }

.editacts { display: flex; gap: 12px; }

/* ---- 消耗管理（静态页） ---- */

.consume { display: flex; flex-direction: column; gap: 18px; }

.fselect {
  width: 200px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--fg-sub);
  font: inherit; font-size: 14px;
}
.linkbtn {
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--brand);
  padding: 6px 8px;
}
.linkbtn:hover { text-decoration: underline; }
.exportbtn { margin-left: auto; }
.exportbtn svg { width: 15px; height: 15px; }

/* ---- 充值管理（静态页，带页签 + 分页） ---- */

.recharge { display: flex; flex-direction: column; gap: 18px; }
/* 最上面那行「充值服务暂未开通」是常驻的，不占额外的下边距（间距交给 gap） */
.recharge .notice { margin-bottom: 0; }

.tabs {
  display: flex; align-items: flex-end; gap: 28px;
  padding: 0 2px;
  border-bottom: 1px solid var(--line);
}
.tab {
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 15px; color: var(--fg-sub);
  padding: 8px 2px 12px;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); font-weight: 500; }

/* 空表：表体里那一格不留内边距、不留分隔线，交给下面的分页条画线 */
.dtable td.emptytd { padding: 0; border-bottom: 0; }
.dtable tbody tr:hover td.emptytd { background: transparent; }

.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--fg-sub);
}
.pgselect, .pginput {
  padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: #fff; color: var(--fg-sub);
  font: inherit; font-size: 13px;
}
.pgbtn {
  min-width: 28px; height: 28px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: #fff; color: var(--fg-sub);
  font: inherit; font-size: 13px;
  cursor: pointer;
}
.pgbtn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pgbtn.on {
  background: var(--brand); border-color: var(--brand); color: #fff;
  cursor: default;
}
.pgbtn:disabled { color: var(--fg-dim); cursor: default; }
.pggoto { display: inline-flex; align-items: center; gap: 6px; }
.pginput { width: 44px; text-align: center; }

/* ============================================================
   登录页（死的登录流程，独立整屏，不带左侧导航）
   ============================================================ */

.loginbody { background: #fff; }

.login { display: flex; min-height: 100vh; }

/* ---- 左：品牌块 ---- */

.loginbrand {
  position: relative; overflow: hidden;
  flex: 0 0 46%; max-width: 640px;
  padding: 44px 52px;
  display: flex; flex-direction: column;
  background: linear-gradient(155deg, #e9f1ff 0%, #f5f9ff 48%, #edf4ff 100%);
  border-right: 1px solid var(--line);
}
/* 两个淡淡的圆斑当装饰 */
.loginbrand::before,
.loginbrand::after { content: ''; position: absolute; border-radius: 50%; }
.loginbrand::before {
  width: 460px; height: 460px; right: -170px; top: -160px;
  background: radial-gradient(circle at 35% 35%, rgba(43, 108, 246, .18), rgba(43, 108, 246, 0) 70%);
}
.loginbrand::after {
  width: 380px; height: 380px; left: -130px; bottom: -160px;
  background: radial-gradient(circle at 40% 40%, rgba(34, 160, 107, .14), rgba(34, 160, 107, 0) 70%);
}

.lgbrand { position: relative; display: flex; align-items: center; gap: 12px; }
.lgmark {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 12px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(43, 108, 246, .28);
}
.lgmark svg { width: 23px; height: 23px; }
.lgname { font-size: 17px; font-weight: 600; letter-spacing: .2px; }

.lgmid { position: relative; margin: auto 0; padding: 40px 0; }
.lgtitle { font-size: 31px; font-weight: 600; line-height: 1.42; letter-spacing: .5px; }
.lgtitle em { font-style: normal; color: var(--brand); }
.lgsub { margin-top: 15px; font-size: 15px; line-height: 1.75; color: var(--fg-sub); max-width: 380px; }

.lglist { margin-top: 32px; display: flex; flex-direction: column; gap: 14px; }
.lgitem { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--fg-sub); }
.lgitem svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--brand); }

.lgfoot { position: relative; font-size: 13px; color: var(--fg-dim); }

/* ---- 右：表单 ---- */

.loginmain {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 44px 24px;
}
.lcard { width: 100%; max-width: 356px; }

.lwelcome { font-size: 25px; font-weight: 600; letter-spacing: .3px; }
.lwsub { margin-top: 9px; font-size: 14px; color: var(--fg-sub); }

.lcard .notice { margin: 18px 0 0; }

.lform { margin-top: 26px; display: flex; flex-direction: column; gap: 18px; }

.lfield { display: flex; flex-direction: column; gap: 8px; }
.llabel { font-size: 13.5px; color: var(--fg-sub); }

.linput { position: relative; display: flex; align-items: center; }
.linput .lico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--fg-dim); pointer-events: none;
}
.linput input { height: 44px; padding-left: 40px; }
.linput input.has-eye { padding-right: 44px; }

.leye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px;
  background: none; color: var(--fg-dim);
}
.leye:hover { background: #f4f6fa; color: var(--brand); }
.leye svg { width: 17px; height: 17px; }

.lrow { display: flex; align-items: center; justify-content: space-between; }
.lcheck {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--fg-sub); cursor: pointer;
}
.lcheck input { display: none; }
.lcheck .mk {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--line-strong);
  position: relative; transition: .15s;
}
.lcheck input:checked + .mk { background: var(--brand); border-color: var(--brand); }
.lcheck input:checked + .mk::after {
  content: ''; position: absolute; left: 4.6px; top: 1.2px;
  width: 4px; height: 8px;
  border: solid #fff; border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

.lforgot {
  border: 0; background: none; padding: 0;
  font-size: 13.5px; color: var(--brand);
}
.lforgot:hover { text-decoration: underline; }

.lsubmit { width: 100%; height: 44px; font-size: 15.5px; letter-spacing: 2px; }

.lfoot { margin-top: 26px; text-align: center; font-size: 12.5px; color: var(--fg-dim); }

@media (max-width: 900px) {
  .loginbrand { display: none; }
  .loginmain { padding: 32px 20px; }
  .lwelcome { font-size: 23px; }
}
