/* Matrix · 深蓝 / 雾白 / 银灰：全站统一配色 */
:root {
  --navy: #17243b;
  --navy2: #263650;
  --ink: #23324a;
  --muted: #7c8799;
  --paper: #f4f5f8;
  --teal: #4263d8;
  --mint: #edf0fc;
  --shadow: 0 12px 32px rgba(25,38,65,.045);
  --ui-bg: #f4f5f8;
  --ui-navy: #1b2a43;
  --ui-navy-deep: #111c30;
  --ui-ink: #23324a;
  --ui-muted: #7c8799;
  --ui-line: #e4e7ef;
  --ui-accent: #4263d8;
  --ui-accent-light: #edf0fc;
  --ui-accent-soft: #cbd4f2;
  --ui-secondary: #9eafdc;
  --ui-warm: #d9ae82;
  --ui-surface: #ffffff;
}

body .app { background: var(--ui-bg); color: var(--ui-ink); }
body .app .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  align-self: flex-start;
  scrollbar-width: thin;
  scrollbar-color: rgba(153,195,241,.25) transparent;
  width: 252px;
  padding: 29px 17px 21px;
  background: linear-gradient(165deg, #111c30, #1b2a43 72%, #162239);
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 12px 0 32px rgba(27,52,87,.07);
}
body .app .sidebar .brand {
  gap: 12px;
  padding: 1px 14px 0;
  font-size: 23px;
  letter-spacing: .08em;
  line-height: 1.1;
  color: #f6faff;
}
body .app .brand-mark {
  width: 37px;
  height: 37px;
  flex: none;
  font-size: 0;
  border-radius: 8px;
  background: conic-gradient(#4263d8 0 25%,#829de7 0 50%,#3154bb 0 75%,#bcccf0 0);
  transform: rotate(-6deg);
  box-shadow: 0 8px 18px rgba(2,17,46,.28), inset 2px 2px 3px rgba(255,255,255,.26);
}
body .app .sidebar .brand small {
  color: #9bb5d3;
  font-size: 9px;
  letter-spacing: .16em;
  margin-top: 5px;
  white-space: nowrap;
}
body .app .workspace {
  padding: 25px 17px 13px;
  color: #7995b4;
  font-size: 10px;
  letter-spacing: .18em;
}
body .app .nav { gap: 6px; }
body .app .nav button {
  min-height: 47px;
  border-radius: 9px;
  padding: 0 15px;
  gap: 13px;
  color: #a7bad1;
  font-size: 13px;
  font-weight: 630;
  letter-spacing: .01em;
  transition: background .2s, color .2s, transform .2s;
}
body .app .nav button .icon { width: 18px; height: 18px; opacity: .86; }
body .app .nav button:hover { background: rgba(255,255,255,.075); color: #fff; transform: translateX(2px); }
body .app .nav button.active {
  background: linear-gradient(90deg, color-mix(in srgb,var(--ui-accent) 48%,transparent), color-mix(in srgb,var(--ui-accent) 30%,transparent));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(137,181,230,.14);
}
body .app .nav button.active:before { left: -17px; top: 9px; bottom: 9px; width: 3px; background: var(--ui-secondary); }
body .app .nav .count { background: rgba(153,195,241,.2); color: #d3e8ff; font-size: 10px; }
body .app .side-divider { background: rgba(205,223,243,.16); margin: 25px 14px 0; }
body .app .help-card { display: none; }
body .app .user { border-color: rgba(215,229,244,.18); padding: 19px 9px 1px; }
body .app .user .avatar { background: linear-gradient(145deg,#477ec4,#245489); border-radius: 10px; }
body .app .user strong { font-size: 12px; }
body .app .user small { color: #94aac3; font-size: 10px; }
body .app .account-card {
  flex-shrink: 0;
  margin: 25px 0 0;
  padding: 14px 12px;
  gap: 11px;
  border: 1px solid rgba(183,210,241,.14);
  border-radius: 12px;
  background: linear-gradient(120deg,rgba(145,187,232,.11),rgba(145,187,232,.035));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
body .app .account-card .avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: linear-gradient(145deg,var(--ui-accent),color-mix(in srgb,var(--ui-accent) 58%,var(--ui-navy-deep)));
  border: 1px solid rgba(213,233,255,.15);
}
body .app .account-card strong { font-size: 13px; letter-spacing: .02em; }
body .app .account-card small { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
body .app .account-status { width: 5px; height: 5px; border-radius: 50%; background: #68c3af; }
body .app .account-card button { width: 27px; height: 30px; padding: 5px; border-radius: 6px; color: #99b4d1; }
body .app .account-card button:hover { color: #fff; background: rgba(255,255,255,.1); }
body .app .account-card button:focus-visible { outline: 2px solid var(--ui-secondary); outline-offset: 2px; }

body .app .main { min-width: 0; }
body .app .topbar {
  height: 75px;
  padding: 0 39px;
  background: #ffffff;
  border-bottom: 1px solid var(--ui-line);
  box-shadow: 0 2px 12px rgba(36,71,111,.025);
}
body .app .crumb { gap: 11px; font-size: 12px; color: #9aabba; }
body .app .crumb strong { color: #38536e; font-weight: 750; }
body .app .top-actions { gap: 18px; }
body .app .workspace-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 31px;
  padding: 0 11px;
  border-radius: 7px;
  color: var(--ui-muted);
  background: var(--ui-accent-light);
  border: 1px solid var(--ui-line);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
body .app .workspace-tag i { width: 6px; height: 6px; background: var(--ui-accent); border-radius: 50%; box-shadow: 0 0 0 3px var(--ui-accent-soft); }
body .app .top-actions button { color: #7690a7; }
body .app .top-actions button:hover { color: var(--ui-accent); }
body .app .mini-avatar { width: 31px; height: 31px; background: var(--ui-accent-light); color: var(--ui-accent); }
body .app .content { max-width: 1510px; padding: 32px 39px 68px; }

body .app .page-head { margin-bottom: 24px; align-items: center; }
body .app .eyebrow { color: var(--ui-accent); font-size: 10px; letter-spacing: .19em; }
body .app .eyebrow::before { width: 19px; }
body .app .page-head h1 { margin: 9px 0 8px; font-size: 28px; line-height: 1.25; font-weight: 780; letter-spacing: -.035em; color: var(--ui-ink); }
body .app .page-head p { color: var(--ui-muted); font-size: 12px; }
body .app .page-actions { gap: 10px; }
body .app .ghost,
body .app .outline,
body .app .select-like {
  height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 730;
  transition: all .2s;
}
body .app .ghost { border-color: var(--ui-line); background: rgba(255,255,255,.88); color: #526c85; }
body .app .ghost:hover { border-color: var(--ui-accent-soft); color: var(--ui-accent); background: #fff; }
body .app .outline { background: var(--ui-accent); color: #fff; border-color: var(--ui-accent); box-shadow: 0 5px 12px rgba(45,105,184,.14); }
body .app .outline:hover { filter: brightness(.94); transform: translateY(-1px); }
body .app .demo-banner {
  min-height: 38px;
  margin-bottom: 19px;
  border: 1px solid var(--ui-line);
  background: color-mix(in srgb,var(--ui-accent-light) 42%,white);
  color: var(--ui-muted);
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 11px;
}
body .app .demo-banner .icon { color: var(--ui-accent); }
body .app .demo-banner b { color: var(--ui-accent); }

body .app .scenario {
  min-height: 154px;
  padding: 25px 29px;
  border-radius: 16px;
  background: linear-gradient(110deg, #1c2c48, #2b4063 72%, #354f78);
  border: 1px solid rgba(180,210,242,.16);
  box-shadow: 0 17px 36px rgba(19,51,91,.15);
}
body .app .scenario:before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/login-matrix-bg-v2.webp") right center / cover no-repeat;
  opacity: .09;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(90deg,transparent 24%,#000 88%);
  mask-image: linear-gradient(90deg,transparent 24%,#000 88%);
  pointer-events: none;
}
body .app .scenario:after { content: none; }
body .app .scenario-label { color: #b5c5e6; font-size: 10px; letter-spacing: .17em; }
body .app .scenario h2 { margin: 12px 0 9px; color: #fff; font-size: 22px; font-weight: 760; letter-spacing: -.02em; }
body .app .scenario p { color: #bdd0e7; font-size: 11px; }
body .app .scenario-controls { gap: 10px; }
body .app .dark-select {
  height: 39px;
  min-width: 150px;
  border-radius: 8px;
  color: #f6fbff;
  background: rgba(255,255,255,.075);
  border-color: rgba(215,233,255,.27);
  font-size: 11px;
}
body .app .white-btn { height: 39px; border-radius: 8px; padding: 0 16px; color: #1c548d; box-shadow: 0 4px 12px rgba(10,27,57,.13); white-space: nowrap; }
body .app .white-btn:hover { background: #edf6ff; }

body .app .metrics { gap: 17px; margin: 19px 0; }
body .app .metric,
body .app .panel,
body .app .mini-card,
body .app .list-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  box-shadow: 0 12px 29px rgba(27,58,96,.047);
}
body .app .metric {
  position: relative;
  overflow: hidden;
  min-height: 143px;
  padding: 21px 21px 19px;
  border-radius: 13px;
  transition: transform .2s, box-shadow .2s;
}
body .app .metric:hover { transform: translateY(-3px); box-shadow: 0 17px 34px rgba(27,58,96,.085); }
body .app .metric:before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg,var(--ui-accent),var(--ui-secondary)); opacity: .85; }
body .app .metric:nth-child(2):before { background: linear-gradient(90deg,#7c91c3,#cbd5eb); }
body .app .metric:nth-child(3):before { background: linear-gradient(90deg,#72a89a,#d0e2dc); }
body .app .metric:nth-child(4):before { background: linear-gradient(90deg,#c6a98a,#e8ded2); }
body .app .metric-top { color: #6e829a; font-size: 12px; font-weight: 680; }
body .app .metric-icon { width: 29px; height: 29px; border-radius: 8px; }
body .app .metric strong { margin: 13px 0 6px; color: var(--ui-ink); font-size: 29px; letter-spacing: -.05em; }
body .app .metric strong.good { color: #268674; }
body .app .metric strong .unit { color: #8193a8; font-size: 13px; }
body .app .metric small { color: #91a1b0; font-size: 10px; }
body .app .grid-main { gap: 18px; grid-template-columns: minmax(0,1.6fr) minmax(315px,.9fr); }
body .app .panel { border-radius: 14px; padding: 22px; }
body .app .panel h3,
body .app .mini-card h3,
body .app .list-card h3 { color: #28445f; font-size: 14px; font-weight: 780; }
body .app .panel-sub { color: #91a2b4; font-size: 11px; margin-top: 6px; }
body .app .chart-legend { color: #8092a4; font-size: 10px; }
body .app .bar-chart { padding-top: 27px; }
body .app .bar-group { grid-template-columns: 99px 1fr 53px; gap: 15px; margin-bottom: 20px; }
body .app .bar-name { color: #62708a; font-size: 11px; font-weight: 730; }
body .app .bar-current,
body .app .chart-legend span:nth-child(2) i { background: var(--ui-accent-soft); }
body .app .bar-new,
body .app .chart-legend span:first-child i { background: var(--ui-accent); }
body .app .bar-num { color: #526481; font-size: 11px; }
body .app .insight { margin-top: 23px; padding: 13px; border-radius: 9px; background: color-mix(in srgb,var(--ui-accent-light) 58%,white); border-color: var(--ui-line); }
body .app .insight strong { color: var(--ui-ink); font-size: 11px; }
body .app .insight p { color: #74899e; font-size: 10px; }
body .app .donut-row { gap: 20px; margin: 27px 0 19px; }
body .app .donut { width: 126px; height: 126px; background: conic-gradient(var(--ui-accent) 0 73%,var(--ui-secondary) 73% 89%,var(--ui-warm) 89% 96%,#d7e1eb 96% 100%); }
body .app .donut:before { width: 85px; height: 85px; }
body .app .donut-label strong { color: #34445e; font-size: 18px; }
body .app .legend-item { color: #7b879a; font-size: 10px; padding: 8px 0; }
body .app .legend-item b { color: #45536c; }
body .app .legend-item:nth-child(1) i { background: var(--ui-accent) !important; }
body .app .legend-item:nth-child(2) i { background: var(--ui-secondary) !important; }
body .app .legend-item:nth-child(3) i { background: var(--ui-warm) !important; }
body .app .tiny-insight { padding: 11px; background: color-mix(in srgb,var(--ui-accent-light) 67%,white); color: var(--ui-muted); border: 1px solid var(--ui-line); }
body .app .tiny-insight svg { color: var(--ui-accent); }

body .app .table-panel { padding: 0; margin-top: 18px; overflow: hidden; }
body .app .section-head { padding: 22px 22px 19px; }
body .app .segmented { background: #f4f5f8; border-color: #e2eaf4; border-radius: 8px; }
body .app .segmented button { color: #8496a7; font-size: 10px; }
body .app .segmented button.active { color: var(--ui-accent); }
body .app th { background: #f7f8fa; color: #7289a0; font-size: 11px; font-weight: 760; padding: 13px 21px; }
body .app td { color: #64738a; font-size: 11px; padding: 15px 21px; border-color: #eaf0f5; }
body .app td strong { color: #34445e; font-size: 11px; font-weight: 760; }
body .app tr:hover td { background: #f8f9fc; }
body .app .table-foot { padding: 15px 21px; color: #8a9fb1; font-size: 10px; }
body .app .table-foot button { color: var(--ui-accent); }
body .app .search-input { border-color: var(--ui-line); border-radius: 8px; height: 38px; color: var(--ui-ink); }
body .app .search-input:focus { border-color: var(--ui-accent); box-shadow: 0 0 0 3px var(--ui-accent-light); }

body .app .secondary-grid { gap: 18px; margin: 19px 0; }
body .app .mini-card { position: relative; overflow: hidden; border-radius: 14px; padding: 22px; min-height: 155px; transition: transform .2s, box-shadow .2s; }
body .app .mini-card:hover { transform: translateY(-2px); box-shadow: 0 16px 31px rgba(27,58,96,.08); }
body .app .mini-card:before { content: ""; position: absolute; right: -33px; top: -49px; width: 126px; height: 126px; border-radius: 50%; border: 16px solid var(--ui-accent-light); opacity: .58; }
body .app .mini-card .number { position: relative; color: #34445e; font-size: 24px; margin-top: 18px; }
body .app .mini-card p { position: relative; color: #8fa2b4; font-size: 11px; }
body .app .pill { background: #eaf4f0; color: #17866b; border-radius: 5px; font-size: 10px; padding: 5px 8px; }
body .app .pill.up { background: #fcf0e7; color: #c3824c; }
body .app .list-card { border-radius: 14px; padding: 23px; margin-top: 18px; }
body .app .list-card h3 { margin: 0 0 16px; }
body .app .list-row { color: #6a8097; font-size: 12px; padding: 16px 1px; border-color: #e9eef4; }
body .app .list-row b { color: #3a5674; font-size: 11px; font-weight: 730; }
body .app .swatch { background: var(--ui-accent); }
body .app #view-quotes .mini-card { min-height: 188px; }
body .app #view-quotes .mini-card:after { content: ""; position: absolute; left: 22px; bottom: 20px; height: 4px; width: calc(100% - 44px); border-radius: 4px; background: linear-gradient(90deg,var(--ui-accent) 0 var(--progress),#e8eef5 var(--progress) 100%); }
body .app #view-quotes .mini-card:nth-child(1) { --progress: 100%; }
body .app #view-quotes .mini-card:nth-child(2) { --progress: 89%; }
body .app #view-quotes .mini-card:nth-child(3) { --progress: 67%; }
body .app #view-quotes .mini-card:nth-child(2):after { background: linear-gradient(90deg,#879bd3 0 var(--progress),#e8eef5 var(--progress) 100%); }
body .app #view-quotes .mini-card:nth-child(3):after { background: linear-gradient(90deg,#d9ae82 0 var(--progress),#e8eef5 var(--progress) 100%); }

body .app .modal { border: 1px solid var(--ui-line); box-shadow: 0 28px 70px rgba(9,33,65,.25); }
body .app .upload-box { border-color: var(--ui-accent-soft); background: #f7f8fc; color: #55718f; }

@media (max-width: 1100px) {
  body .app .sidebar { width: 218px; }
  body .app .content { padding: 26px; }
  body .app .topbar { padding: 0 26px; }
  body .app .grid-main { grid-template-columns: 1fr; }
  body .app .page-head { flex-direction: column; align-items: flex-start; }
  body .app .scenario { flex-direction: column; align-items: flex-start; gap: 20px; }
  body .app .scenario:before { display: none; }
  body .app .scenario-controls { width: 100%; flex-wrap: wrap; }
  body .app .dark-select { flex: 1 1 145px; }
}
@media (max-width: 720px) {
  body .app .sidebar { width: 64px; padding: 21px 8px; }
  body .app .sidebar .brand { padding: 0 5px; }
  body .app .sidebar .brand span:not(.brand-mark) { display: none; }
  body .app .account-card { margin-top: 23px; padding: 8px 0; justify-content: center; border-radius: 9px; }
  body .app .account-card .avatar { width: 34px; height: 34px; }
  body .app .nav { margin-top: 20px; }
  body .app .nav button { padding: 0; justify-content: center; }
  body .app .nav button:hover { transform: none; }
  body .app .nav button.active:before { left: -8px; }
  body .app .topbar { height: 64px; padding: 0 16px; }
  body .app .content { padding: 22px 16px 54px; }
  body .app .workspace-tag { display: none; }
  body .app .metrics,
  body .app .secondary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body .app .scenario { align-items: stretch; }
}
@media (max-width: 520px) {
  body .app .metrics,
  body .app .secondary-grid { grid-template-columns: 1fr; }
  body .app .scenario-controls { flex-wrap: wrap; }
  body .app .page-head h1 { font-size: 23px; }
}

/* 颜色只承担品牌、费用升降和状态提示，普通容器采用中性银灰。 */
body .app .metric-icon { background: var(--ui-accent-light); color: var(--ui-accent); }
body .app .metric-icon.blue { background: #eff2f8; color: #7b8db4; }
body .app .metric-icon.green { background: #edf5f1; color: #398c79; }
body .app .metric-icon.warm { background: #f8f3ed; color: #b28f68; }
body .app .negative { color: #268674; }
body .app .positive { color: #b78754; }
body .app .pill { background: #edf5f1; color: #268674; }
body .app .pill.up { background: #f8f1e9; color: #b78754; }
body .app .insight, body .app .tiny-insight { background: #f5f7fc; }
body .app .demo-banner { background: #fafbfe; }
body .login .login-submit { background: #192b48; }
body .login .login-motto {
  position: absolute;
  left: 4.2%;
  bottom: 5.4%;
  z-index: 1;
  margin: 0;
  color: #526984;
  font-size: clamp(16px, 1.35vw, 23px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .1em;
  text-shadow: 0 1px 8px rgba(255,255,255,.65);
  pointer-events: none;
}
@media (max-width: 700px) {
  body .login .login-motto { left: 24px; bottom: 24px; font-size: 14px; letter-spacing: .04em; }
}
@media (max-height: 600px) {
  body .login .login-motto { bottom: 14px; font-size: 14px; }
}
body .app th { color: #7c8799; }
body .app .chart-legend { color: #7c8799; }
