@font-face {
  font-family: Montserrat;
  src: url(assets/montserrat-medium.woff2);
}
* {
  box-sizing: border-box;
}
/* 奇树智投 配色令牌：撞色 = 品牌深蓝(结构) + 品牌橙(强调)，取自 Logo #045cac / #2c9cfd / #fca42c */
body {
  --bg: #0b1424;
  --panel: #12233d;
  --recess: #0f1d33;
  --well: #1a3050;
  --line: rgba(255, 255, 255, 0.09);
  --fg: #eef4fb;
  --muted: #aebdd3;
  --sub: #8e9eb6;
  --accent: #5db3ff;
  --accent-fill: #1a74d6;
  --on-accent: #fff;
  --accent-soft: #1a3050;
  --sky: #2c9cfd;
  --ink: #0e2035;
  --strike: #fca42c;
  --strike-text: #fdb64f;
  --positive: #4ccb8f;
  --positive-soft: #173a2e;
  --negative: #ff7a66;
  --negative-soft: #43201d;
  --chart-fill: rgba(44, 156, 253, 0.3);
  --rail: #0e2035;
  --rail-fg: #eaf0f8;
  --rail-muted: #9fb0c8;
  --rail-line: rgba(255, 255, 255, 0.08);
  --rail-well: rgba(255, 255, 255, 0.07);
  --shadow: inset 0 1px 0 #ffffff08, 0 4px 16px #00000040;
  color-scheme: dark;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    14px/1.45 Inter,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}
body.light {
  --bg: #f3f6fa;
  --panel: #fff;
  --recess: #f7f9fc;
  --well: #eaf0f7;
  --line: #d8e0ea;
  --fg: #0e2035;
  --muted: #5b6778;
  --sub: #606c7d;
  --accent: #045cac;
  --accent-fill: #045cac;
  --on-accent: #fff;
  --accent-soft: #e6f0fb;
  --sky: #2c9cfd;
  --ink: #0e2035;
  --strike: #fca42c;
  --strike-text: #955400;
  --positive: #12714c;
  --positive-soft: #e2f3ea;
  --negative: #c8402f;
  --negative-soft: #fbe9e6;
  --chart-fill: rgba(4, 92, 172, 0.16);
  --shadow: 0 1px 2px #0e20350a, 0 8px 24px #0e203512;
  color-scheme: light;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--well);
  padding: 7px 12px;
}
button:hover,
select:hover {
  border-color: var(--sub);
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:active {
  transform: translateY(1px);
}
.icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
  fill-rule: evenodd;
  vertical-align: middle;
  flex: none;
}
button,
.row,
.brand,
.workspace,
.profile,
.head-actions,
.crumb,
.cardhead,
.titlebar,
.tag,
.valueline,
.ai,
.navbtn {
  display: flex;
  align-items: center;
  gap: 9px;
}
#rail {
  width: 198px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--rail-line);
  background: var(--rail);
  color: var(--rail-fg);
  z-index: 5;
  display: flex;
  flex-direction: column;
}
.brand {
  height: 72px;
  padding: 0 23px;
  gap: 12px;
  color: var(--rail-fg);
}
.brand strong {
  font-size: 21px;
  letter-spacing: -0.8px;
  white-space: nowrap;
}
.mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
}
.railinner {
  padding: 12px;
}
.workspace {
  margin: 0 2px 32px;
  padding: 10px;
  background: var(--rail-well);
  border: 1px solid var(--rail-line);
  border-radius: 10px;
  color: var(--rail-fg);
}
.workspace-icon,
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--fg);
}
.workspace-icon {
  background: rgba(255, 255, 255, 0.12);
  color: var(--rail-fg);
}
small,
.navlabel {
  font-size: 12px;
  color: var(--muted);
}
.workspace small,
.profile small {
  display: block;
  font-size: 11px;
  margin-top: 2px;
  color: var(--rail-muted);
}
.navlabel {
  margin: 28px 12px 9px;
  color: var(--rail-muted);
}
.navbtn {
  width: 100%;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--rail-muted);
  gap: 12px;
  margin: 2px 0;
  position: relative;
  text-align: left;
}
.navbtn:hover {
  background: var(--rail-well);
  color: var(--rail-fg);
}
.navbtn.active {
  background: var(--strike);
  color: var(--ink);
  font-weight: 600;
}
.navbtn.active:after {
  content: "";
  margin-left: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}
.profile {
  margin-top: auto;
  padding: 18px;
  border-top: 1px solid var(--rail-line);
  color: var(--rail-fg);
}
.avatar {
  border-radius: 50%;
  background: var(--strike);
  color: var(--ink);
  font:
    700 17px Montserrat,
    sans-serif;
}
.app {
  margin-left: 198px;
}
header {
  height: 60px;
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(18px, 2.5vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.crumb {
  font-size: 12px;
  color: var(--muted);
  gap: 13px;
}
.crumb i {
  font-style: normal;
  color: var(--sub);
}
.crumb b {
  color: var(--fg);
  font-weight: 500;
}
.head-actions {
  gap: 12px;
}
.iconbutton,
#mobileMenu,
.close {
  background: transparent;
  padding: 6px;
  border-color: transparent;
  color: var(--muted);
}
#mobileMenu {
  display: none;
}
.ai {
  background: var(--strike);
  border-color: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.ai:hover {
  border-color: transparent;
  background: var(--strike);
  filter: brightness(1.05);
}
.ai svg {
  color: var(--ink);
}
.sample {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.sample i,
.tag i {
  background: var(--sub);
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
main {
  max-width: 1680px;
  margin: auto;
  padding: 24px clamp(18px, 2.5vw, 42px) 44px;
}
.titlebar,
.cardhead,
.valueline {
  justify-content: space-between;
}
.titlebar {
  margin-bottom: 22px;
  align-items: flex-end;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 2.5vw, 36px);
  line-height: 1.35;
  letter-spacing: -1.6px;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 14px;
}
.subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.date {
  font-size: 12px;
  color: var(--muted);
}
.date select {
  background: var(--panel);
}
.btn-prime {
  background: var(--accent-fill);
  border-color: transparent;
  color: var(--on-accent);
  font-weight: 600;
  font-size: 13px;
}
.btn-prime:hover {
  border-color: transparent;
  filter: brightness(1.1);
}
.card,
.kpi {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.kpi {
  padding: 18px clamp(14px, 1.7vw, 24px) 16px;
  position: relative;
}
/* 首个指标卡：深蓝实色 + 右上角天蓝光晕，文字全部落在深蓝区（白字 6.7:1） */
.kpi.hero {
  border-color: transparent;
  color: #fff;
  background:
    radial-gradient(
      110% 120% at 100% 0%,
      var(--sky) 0%,
      rgba(44, 156, 253, 0) 58%
    ),
    #045cac;
  --muted: rgba(255, 255, 255, 0.82);
  --sub: rgba(255, 255, 255, 0.72);
  --positive: var(--strike);
}
.kpi-label {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.kpi-label svg {
  width: 15px;
}
.number,
.metric,
.rate,
td.num,
.tick,
.chart-note {
  font-family: Montserrat, "PingFang SC", sans-serif;
  font-variant-numeric: tabular-nums;
}
.number {
  font-size: clamp(21px, 2.25vw, 37px);
  line-height: 1.5;
  letter-spacing: -1.35px;
  white-space: nowrap;
}
.unit {
  color: var(--sub);
  font-size: 0.58em;
  margin-right: 2px;
}
.kpi-foot {
  color: var(--sub);
  font-size: 11px;
}
.rate {
  color: var(--positive);
  font-size: 11px;
  margin-right: 4px;
}
.rate.down {
  color: var(--negative);
}
.spark {
  height: 22px;
  width: 53px;
  opacity: 0.9;
}
.mid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(248px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.card {
  min-width: 0;
  overflow: hidden;
}
.pad,
.cardhead {
  padding: 18px 20px;
}
.cardhead {
  padding-bottom: 12px;
  gap: 8px;
}
.cardhead .subtitle {
  font-size: 11px;
  margin-top: 2px;
}
.link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 0;
  white-space: nowrap;
}
.link:hover {
  color: var(--accent);
}
a.link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.link svg {
  width: 14px;
}
.switch {
  display: flex;
  padding: 3px;
  gap: 2px;
  background: var(--recess);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.switch button {
  padding: 3px 8px;
  background: transparent;
  border: 0;
  font-size: 11px;
  color: var(--muted);
  border-radius: 4px;
}
.switch .on {
  background: var(--well);
  color: var(--fg);
}
.legend {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  padding: 2px 20px 0;
}
.dash,
.solid {
  width: 14px;
  border-top: 2px solid var(--accent);
}
.dash {
  border: 0;
  border-top: 2px dashed var(--sub);
  margin-left: 8px;
}
.plot {
  position: relative;
  margin: 2px 16px 9px;
  height: 192px;
}
.plot canvas {
  width: 100%;
  height: 100%;
}
.tip {
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--fg);
  padding: 5px 9px;
  font-size: 11px;
  box-shadow: var(--shadow);
}
.ranking {
  padding: 0 16px 9px;
}
.rank {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}
.rank:last-child {
  border: 0;
}
.rank:hover,
.tablewrap tbody tr:hover {
  background: var(--accent-soft);
}
.rankno {
  font: 11px Montserrat;
  color: var(--sub);
}
.rankno.top {
  color: var(--strike-text);
  font-weight: 700;
}
.rank img,
.mini {
  width: 44px;
  height: 37px;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 5px;
}
.rank .desc {
  flex: 1;
  min-width: 0;
}
.desc b,
.desc small {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.desc b {
  font-size: 13px;
  font-weight: 500;
}
.desc small {
  font-size: 10px;
  margin-top: 2px;
  color: var(--sub);
}
.rank .metric {
  font-size: 13px;
}
.tablewrap {
  overflow: auto;
}
.tablewrap table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  white-space: nowrap;
}
.tablewrap th {
  text-align: left;
  background: var(--recess);
  color: var(--sub);
  font-size: 11px;
  font-weight: 500;
}
.tablewrap th,
.tablewrap td {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
td.num {
  text-align: right;
}
.tablewrap th.num {
  text-align: right;
}
.tablewrap tr td:first-child,
.tablewrap tr th:first-child {
  padding-left: 20px;
}
.plan-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-name img {
  width: 33px;
  height: 33px;
}
.tag {
  display: inline-flex;
  color: var(--positive);
  font-size: 11px;
  gap: 6px;
}
.tag i {
  background: currentColor;
}
.tag.paused {
  color: var(--sub);
}
.tabletools {
  display: flex;
  gap: 8px;
  align-items: center;
}
.searchbox {
  border: 1px solid var(--line);
  background: var(--recess);
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: var(--sub);
}
.searchbox input {
  width: 110px;
  background: transparent;
  border: 0;
  font-size: 12px;
  outline: 0;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.tile {
  display: block;
  text-align: left;
  background: var(--panel);
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}
.tile .cover {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s;
}
.tile:hover img {
  transform: scale(1.035);
}
.cover span {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #0009;
  color: white;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
}
.tile .desc {
  padding: 12px;
}
.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}
dialog {
  width: min(460px, 92vw);
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 100px #0008;
  padding: 0;
}
dialog::backdrop {
  background: #0008;
  backdrop-filter: blur(4px);
}
dialog .cardhead {
  border-bottom: 1px solid var(--line);
}
dialog video {
  display: block;
  width: 100%;
  max-height: 50vh;
  background: #080909;
}
dialog form,
.dialogbody {
  padding: 20px;
}
form label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}
form input,
form select,
.chatinput {
  width: 100%;
  padding: 10px;
  background: var(--recess);
  border-radius: 7px;
  border: 1px solid var(--line);
}
.facts {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.facts span {
  color: var(--muted);
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.chatlog {
  padding: 16px;
  max-height: 40vh;
  overflow: auto;
}
.bubble {
  border-radius: 8px;
  background: var(--well);
  padding: 10px;
  margin: 7px 0;
  white-space: pre-line;
}
.chatlog .user {
  margin-left: 25px;
  background: var(--accent-soft);
  color: var(--fg);
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 12;
  background: var(--panel);
  color: var(--fg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  padding: 9px 16px;
  border: 1px solid var(--line);
}
.pagein {
  animation: enter 0.24s ease-out;
}
@keyframes enter {
  from {
    opacity: 0.2;
    transform: translateY(4px);
  }
}
@media (min-width: 1450px) {
  .plot {
    height: 228px;
  }
  .rank {
    padding: 12px 2px;
  }
}
@media (max-width: 1100px) {
  #rail {
    width: 166px;
  }
  .brand {
    padding: 0 16px;
    gap: 10px;
  }
  .brand strong {
    font-size: 18px;
  }
  .app {
    margin-left: 166px;
  }
  .kpi {
    padding: 14px;
  }
  .spark {
    display: none;
  }
  .mid {
    grid-template-columns: minmax(0, 1.35fr) minmax(230px, 1fr);
  }
}
@media (max-width: 800px) {
  #rail {
    transform: translateX(-101%);
    transition: transform 0.2s;
    box-shadow: 0 0 40px #0004;
  }
  .app {
    margin: 0;
  }
  .menuopen #rail {
    transform: none;
  }
  .menuopen .app header {
    padding-left: 178px;
  }
  #mobileMenu {
    display: flex;
  }
  .mid {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
    row-gap: 14px;
  }
  .titlebar {
    align-items: flex-start;
    gap: 12px;
  }
  .tabletools {
    flex-wrap: wrap;
  }
  .cardhead {
    flex-wrap: wrap;
  }
  .date {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .sample {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(250px, 1fr);
  gap: 16px;
  align-items: start;
}
.stage {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: repeating-conic-gradient(var(--well) 0% 25%, var(--recess) 0% 50%)
    50% / 24px 24px;
  display: grid;
  place-items: center;
}
.stage video {
  display: block;
  max-width: 100%;
  height: min(54vh, 560px);
  min-height: 260px;
  box-shadow: 0 4px 20px #0004;
}
.studio-layout .rank {
  padding: 12px 2px;
}
.studio-layout .rank img {
  height: 52px;
  width: 42px;
}
@media (max-width: 800px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
}

[hidden] { display: none !important; }
