:root {
  font-family: Inter, "SF Pro Display", "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: #172033;
  background: #f4f6f9;
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
  --brand: #2764eb;
  --brand-dark: #1e4fc0;
  --brand-soft: #edf3ff;
  --nav: #0b1220;
  --nav-panel: #141d2d;
  --text: #172033;
  --text-secondary: #56637a;
  --muted: #8994a7;
  --line: #e3e8f0;
  --line-strong: #d8dee8;
  --panel: #ffffff;
  --canvas: #f4f6f9;
  --success: #15845a;
  --success-soft: #eaf8f2;
  --danger: #ca4453;
  --danger-soft: #fff0f1;
  --violet: #7259dc;
  --violet-soft: #f1edff;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, 0.03), 0 5px 16px rgba(16, 30, 54, 0.035);
  --shadow-md: 0 18px 50px rgba(12, 26, 50, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(39, 100, 235, 0.16);
  outline-offset: 1px;
}

svg {
  display: block;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: #70809a;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-kicker {
  color: #8090a8;
}

.muted {
  color: var(--muted);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 9px 25px rgba(39, 100, 235, 0.26);
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: none;
}

.brand-logo {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-logo.small {
  width: 38px;
  height: 38px;
}

/* 登录页 */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(560px, 1.05fr) minmax(440px, 0.95fr);
  background: #fff;
}

.auth-aside {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(38px, 5vw, 72px) clamp(46px, 7vw, 108px);
  background: #0b1322;
  color: #fff;
}

.auth-aside::before,
.auth-aside::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.auth-aside::before {
  top: -140px;
  right: -180px;
  width: 530px;
  height: 530px;
  border: 1px solid rgba(86, 137, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(72, 126, 255, 0.035), 0 0 0 160px rgba(72, 126, 255, 0.02);
}

.auth-aside::after {
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.auth-brand .brand-mark {
  background: #fff;
  color: var(--brand);
  box-shadow: none;
}

.auth-brand strong,
.auth-brand small,
.mobile-brand strong,
.mobile-brand small {
  display: block;
}

.auth-brand strong {
  font-size: 18px;
  letter-spacing: 0.02em;
}

.auth-brand small {
  margin-top: 2px;
  color: #75839b;
  font-size: 11px;
}

.auth-story {
  max-width: 660px;
  margin: 48px 0;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #94a6c4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.auth-badge i {
  width: 21px;
  height: 2px;
  background: #4b80f4;
}

.auth-story h1 {
  margin: 22px 0 20px;
  color: #f8faff;
  font-size: clamp(34px, 4vw, 53px);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.045em;
}

.auth-story > p {
  max-width: 590px;
  margin: 0;
  color: #8d9bb1;
  font-size: 15px;
  line-height: 1.85;
}

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 48px;
}

.auth-feature-grid > div {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 73px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: #111b2b;
}

.auth-feature-grid svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: #6f9cff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-feature-grid strong,
.auth-feature-grid small {
  display: block;
}

.auth-feature-grid strong {
  color: #e8edf7;
  font-size: 13px;
  font-weight: 650;
}

.auth-feature-grid small {
  margin-top: 3px;
  color: #6f7d93;
  font-size: 11px;
}

.auth-copyright {
  margin: 0;
  color: #536077;
  font-size: 11px;
}

.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px;
  background: #fff;
}

.auth-card {
  width: min(400px, 100%);
}

.mobile-brand {
  display: none;
  margin-bottom: 56px;
}

.mobile-brand strong {
  font-size: 16px;
}

.mobile-brand small {
  color: var(--muted);
  font-size: 10px;
}

.auth-heading h2 {
  margin: 9px 0 8px;
  color: #111a2b;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.auth-heading .muted {
  margin: 0;
  font-size: 13px;
}

.auth-card form {
  margin-top: 34px;
}

.auth-card label,
.settings-form label,
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  color: #445169;
  font-size: 12px;
  font-weight: 650;
}

.auth-card input,
.settings-form input,
.modal-card input,
.modal-card textarea,
.modal-card select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-card input::placeholder,
.settings-form input::placeholder,
.modal-card input::placeholder,
.modal-card textarea::placeholder {
  color: #adb5c2;
}

.auth-card input:hover,
.settings-form input:hover,
.modal-card input:hover,
.modal-card textarea:hover,
.modal-card select:hover {
  border-color: #c3cbd8;
}

.auth-card input:focus,
.settings-form input:focus,
.modal-card input:focus,
.modal-card textarea:focus,
.modal-card select:focus {
  border-color: #6f96f3;
  box-shadow: 0 0 0 3px rgba(39, 100, 235, 0.1);
}

.primary,
.secondary,
.link-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border-radius: 7px;
  padding: 8px 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.primary svg,
.secondary svg,
.link-button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 5px 13px rgba(39, 100, 235, 0.16);
}

.primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 7px 17px rgba(39, 100, 235, 0.22);
}

.primary:active,
.secondary:active {
  transform: translateY(1px);
}

.secondary {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #4a5870;
  box-shadow: 0 1px 2px rgba(16, 30, 54, 0.02);
}

.secondary:hover {
  border-color: #b9c6db;
  background: #f9fbfe;
  color: var(--brand);
}

.full {
  width: 100%;
}

.auth-submit {
  height: 45px;
  margin-top: 6px;
}

.auth-submit svg {
  margin-left: auto;
}

.form-error {
  min-height: 21px;
  margin: 9px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.auth-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 28px;
  color: #9ba5b4;
  font-size: 10px;
}

.auth-security svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #8a96a9;
  stroke-width: 1.7;
}

/* 主框架 */
.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 252px;
  display: flex;
  flex-direction: column;
  padding: 0 13px 14px;
  background: var(--nav);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 78px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.brand .brand-mark {
  background: var(--brand);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #f5f7fb;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 2px;
  color: #647087;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 17px 0;
}

.nav-group-label {
  margin: 17px 12px 7px;
  color: #58647a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav-item {
  position: relative;
  width: 100%;
  height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 0 11px;
  border-radius: 7px;
  background: transparent;
  color: #8995aa;
  text-align: left;
  font-size: 13px;
  font-weight: 520;
}

.nav-item > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: #778399;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item > i {
  display: none;
  margin-left: auto;
}

.nav-item > i svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #dce3ef;
}

.nav-item:hover > svg {
  stroke: #b5c0d2;
}

.nav-item.active {
  background: #17243a;
  color: #fff;
  font-weight: 620;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #5f8df5;
}

.nav-item.active > svg {
  stroke: #6f9cff;
}

.nav-item.active > i {
  display: block;
  color: #66748d;
}

.sidebar-status {
  margin: 4px 2px 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: #101a2a;
}

.sidebar-status span,
.sidebar-status small {
  display: flex;
  align-items: center;
}

.sidebar-status span {
  gap: 7px;
  color: #b8c5d8;
  font-size: 10px;
  font-weight: 620;
}

.sidebar-status span i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #36bc7d;
  box-shadow: 0 0 0 3px rgba(54, 188, 125, 0.1);
}

.sidebar-status small {
  margin-top: 5px;
  color: #58657a;
  font-size: 9px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 13px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.account {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.account > span {
  width: 31px;
  height: 31px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(109, 154, 255, 0.22);
  border-radius: 8px;
  background: #182743;
  color: #81a5f8;
  font-size: 12px;
  font-weight: 750;
}

.account strong,
.account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account strong {
  max-width: 125px;
  color: #d8dfeb;
  font-size: 11px;
}

.account small {
  margin-top: 2px;
  color: #667288;
  font-size: 9px;
}

.icon-button {
  min-width: 34px;
  min-height: 34px;
  padding: 7px;
  background: transparent;
  color: #7c899e;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #dfe6f2;
}

.main {
  width: calc(100% - 252px);
  min-height: 100vh;
  margin-left: 252px;
  background: var(--canvas);
}

.topbar {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(24px, 3vw, 46px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar h1 {
  margin: 4px 0 0;
  color: #162034;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.topbar-title > div > p:last-child {
  margin: 4px 0 0;
  color: #8994a6;
  font-size: 11px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 13px;
  border-right: 1px solid var(--line);
  color: #59677b;
  font-size: 11px;
}

.health b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2bad70;
  box-shadow: 0 0 0 3px #e7f7f0;
}

.mobile-menu {
  display: none;
  border: 1px solid var(--line);
  color: #536076;
}

.content-area {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px clamp(24px, 3vw, 46px) 58px;
}

.page {
  display: none;
  animation: page-in 0.18s ease-out;
}

.page.active {
  display: block;
}

.newapi-page {
  min-width: 0;
}

.newapi-toolbar {
  margin-bottom: 14px;
}

.newapi-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #d8eee3;
  border-radius: 7px;
  background: #f5fcf8;
  color: #32815b;
  font-size: 10px;
  font-weight: 650;
}

.newapi-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2bad70;
  box-shadow: 0 0 0 3px #e2f6eb;
}

.newapi-frame-shell {
  overflow: hidden;
  min-height: calc(100vh - 195px);
  border: 1px solid #dce4ef;
  border-radius: 14px;
  background: #f8fbff;
  box-shadow: 0 14px 36px rgba(31, 57, 92, 0.08);
}

.newapi-frame-caption {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid #e5ebf3;
  background: linear-gradient(90deg, #f8fbff, #f4f9ff);
}

.newapi-frame-caption span:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.newapi-frame-caption strong {
  color: #263954;
  font-size: 12px;
}

.newapi-frame-caption small,
.newapi-caption-tip {
  color: #8a98aa;
  font-size: 10px;
}

.newapi-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 250px);
  min-height: 650px;
  border: 0;
  background: #fff;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 总览 */
.overview-banner {
  min-height: 142px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 26px 30px;
  overflow: hidden;
  border: 1px solid #182946;
  border-radius: 11px;
  background: #101c30;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.overview-banner .section-kicker {
  color: #6f92e8;
}

.overview-banner h2 {
  margin: 7px 0 6px;
  color: #f5f8ff;
  font-size: 22px;
  font-weight: 640;
  letter-spacing: -0.02em;
}

.overview-banner p {
  margin: 0;
  color: #8f9db1;
  font-size: 12px;
}

.banner-status {
  min-width: 216px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: #15233a;
}

.banner-status span,
.banner-status small {
  display: flex;
  align-items: center;
}

.banner-status span {
  gap: 8px;
  color: #dce5f4;
  font-size: 11px;
  font-weight: 650;
}

.banner-status span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #36c484;
}

.banner-status small {
  margin-top: 6px;
  padding-left: 15px;
  color: #738198;
  font-size: 9px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  min-height: 138px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.stat:nth-child(2) .stat-icon {
  background: var(--violet-soft);
  color: var(--violet);
}

.stat:nth-child(3) .stat-icon {
  background: #eaf8f8;
  color: #168e98;
}

.stat:nth-child(4) .stat-icon {
  background: #edf2f8;
  color: #5f7089;
}

.stat-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat .label {
  color: #66748a;
  font-size: 11px;
  font-weight: 620;
}

.stat .value {
  margin-top: 17px;
  color: #111b2c;
  font-size: 29px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: -0.04em;
}

.stat .hint {
  margin-top: 9px;
  color: #939dad;
  font-size: 10px;
}

.stat .hint strong {
  color: #34775e;
  font-weight: 650;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, 0.84fr);
  gap: 16px;
}

.token-chart {
  margin-bottom: 16px;
  padding: 23px;
}

.token-chart-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eaf1ff;
  color: var(--brand);
}

.token-chart-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.token-bars {
  display: grid;
  gap: 14px;
}

.token-chart-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.token-chart-summary span {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f8fc;
  color: var(--muted);
  font-size: 10px;
}

.token-chart-summary strong {
  display: block;
  margin-top: 4px;
  color: #28354a;
  font-size: 14px;
}

.token-chart-more {
  margin: 18px 0 0 auto;
}

.token-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 130px) minmax(120px, 1fr) 90px;
  align-items: center;
  gap: 14px;
  font-size: 11px;
}

.token-bar-user {
  overflow: hidden;
  color: #384357;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2fa;
}

.token-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2867e8, #36a2ff);
}

.token-bar-row strong {
  color: #273348;
  text-align: right;
}

.token-bar-row strong small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

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

.capability-panel,
.audit-panel,
.settings-form {
  padding: 23px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-title h3,
.toolbar h3 {
  margin: 4px 0 0;
  color: #202a3d;
  font-size: 15px;
  font-weight: 680;
}

.panel-title p,
.toolbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.capability-list {
  display: grid;
}

.capability-list > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 75px;
  padding: 13px 0;
  border-top: 1px solid #edf0f4;
}

.capability-list > div:first-child {
  border-top: 0;
}

.capability-list strong {
  color: #303a4c;
  font-size: 12px;
}

.capability-list p {
  margin: 4px 0 0;
  color: #8a95a7;
  font-size: 10px;
}

.cap-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.cap-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cap-icon.blue {
  background: var(--brand-soft);
  color: var(--brand);
}

.cap-icon.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.cap-icon.cyan {
  background: #e9f8f8;
  color: #168f99;
}

.cap-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 9px;
}

.cap-state::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #24ac73;
}

.link-button {
  min-height: 30px;
  padding: 5px 0 5px 9px;
  background: transparent;
  color: var(--brand);
  font-size: 10px;
}

.link-button:hover {
  color: var(--brand-dark);
}

.link-button svg {
  width: 13px;
  height: 13px;
}

.activity-list {
  display: grid;
}

.activity {
  position: relative;
  min-height: 61px;
  padding: 10px 0 10px 30px;
  border-top: 1px solid #edf0f4;
}

.activity::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 17px;
  width: 7px;
  height: 7px;
  border: 3px solid #dce7ff;
  border-radius: 50%;
  background: var(--brand);
}

.activity::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 31px;
  bottom: -11px;
  width: 1px;
  background: #e7ebf1;
}

.activity:last-child::after {
  display: none;
}

.activity strong {
  display: block;
  color: #384357;
  font-size: 11px;
}

.activity span {
  display: block;
  margin-top: 4px;
  color: #919cad;
  font-size: 9px;
}

.empty-state {
  padding: 35px 18px;
  color: #9da6b5;
  text-align: center;
  font-size: 11px;
}

/* 页面工具栏与市场摘要 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-toolbar {
  min-height: 78px;
  padding: 4px 2px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.search-box {
  width: min(280px, 38vw);
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #909bae;
}

.search-box:focus-within {
  border-color: #7a9def;
  box-shadow: 0 0 0 3px rgba(39, 100, 235, 0.08);
}

.search-box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}

.market-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 12px;
}

.market-metric {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 77px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.market-metric-icon {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
}

.market-metric:nth-child(2) .market-metric-icon {
  background: var(--violet-soft);
  color: var(--violet);
}

.market-metric:nth-child(3) .market-metric-icon {
  background: var(--success-soft);
  color: var(--success);
}

.market-metric-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.market-metric strong,
.market-metric span {
  display: block;
}

.market-metric strong {
  color: #1b2639;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.025em;
}

.market-metric span {
  margin-top: 5px;
  color: #8490a3;
  font-size: 10px;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eceff4;
}

.segmented button {
  min-width: 53px;
  padding: 6px 11px;
  border-radius: 5px;
  background: transparent;
  color: #68768b;
  font-size: 10px;
  font-weight: 570;
}

.segmented button:hover {
  color: #32415a;
}

.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(21, 39, 70, 0.1);
  font-weight: 680;
}

.filter-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #909aaa;
  font-size: 9px;
}

.filter-hint svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #7f8ba0;
  stroke-width: 1.8;
}

/* 数据表格 */
.table-panel {
  overflow: auto;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 820px;
  padding: 14px 17px;
  color: #7f8b9e;
  font-size: 12px;
}

.table-pagination div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-pagination strong {
  color: #536177;
  font-weight: 650;
}

.security-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.security-toolbar { margin-bottom: 16px; }

.security-client-picker {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.security-client-picker select {
  min-width: 230px;
  height: 36px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.security-client-picker select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.security-overview article {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.security-overview small,
.security-overview strong {
  display: block;
}

.security-overview small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

.security-overview strong {
  color: #26344c;
  font-size: 15px;
}

.security-overview em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.security-overview strong.active { color: var(--success); }
.security-overview strong.inactive { color: var(--danger); }

.security-metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
}

.security-metric-icon.violet { background: var(--violet-soft); color: var(--violet); }
.security-metric-icon.green { background: var(--success-soft); color: var(--success); }
.security-metric-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.security-keyword-panel,
.security-policy-panel,
.security-chain-panel { padding: 25px 27px 22px; }

.security-chain-panel { margin-bottom: 16px; }

.security-workspace {
  display: grid;
  grid-template-columns: minmax(410px, 1.3fr) minmax(330px, 1fr);
  gap: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.info { border-color: #c9d9ff; background: var(--brand-soft); color: var(--brand); }
.status-badge.success { border-color: #bde8d1; background: var(--success-soft); color: var(--success); }
.status-badge.warning { border-color: #f3dbad; background: #fff8e8; color: #9a6715; }
.status-badge.danger { border-color: #f0c1c1; background: #fff0f0; color: var(--danger); }
.status-badge.muted { border-color: var(--line); background: #f4f6f9; color: var(--muted); }

.security-chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px;
  margin-top: 22px;
}

.security-chain-node {
  position: relative;
  min-height: 114px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}

.security-chain-node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 55px;
  left: calc(100% + 7px);
  width: 12px;
  border-top: 1px solid #b7c1d0;
}

.security-chain-node:not(:last-child)::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 51px;
  left: calc(100% + 19px);
  border-width: 4px 0 4px 5px;
  border-style: solid;
  border-color: transparent transparent transparent #b7c1d0;
}

.security-chain-node:hover,
.security-chain-node.active { border-color: #8eb0ff; box-shadow: 0 8px 22px rgba(39,100,235,.11); transform: translateY(-1px); }
.security-chain-node.active { background: #f6f9ff; }
.security-chain-node header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.security-chain-node b { color: #27364f; font-size: 12px; }
.security-chain-node small { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.security-chain-index { color: #9aa6b7; font-size: 9px; font-weight: 750; letter-spacing: .08em; }

.security-layer-detail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}

.security-layer-detail > span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.security-layer-detail div small,
.security-layer-detail div strong { display: block; }
.security-layer-detail div small { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.security-layer-detail div strong { color: #344259; font-size: 11px; overflow-wrap: anywhere; }

.security-policy-facts { display: grid; gap: 0; margin: 16px 0 0; }
.security-policy-facts div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.security-policy-facts dt { color: var(--muted); font-size: 10px; }
.security-policy-facts dd { margin: 0; color: #344259; font-size: 11px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.security-policy-note { display: flex; gap: 9px; margin-top: 17px; padding: 12px; border-radius: 8px; background: var(--brand-soft); color: #536177; font-size: 10px; line-height: 1.65; }
.security-policy-note svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: var(--brand); stroke-width: 1.8; }

.security-policy-signing { margin: 16px 0; font-size: 11px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.security-policy-signing[data-ready="false"] { color: var(--danger); }
.security-policy-rules { display: grid; gap: 14px; }
.security-rule-level { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; }
.security-rule-level.guard { border-left: 3px solid #d35b5b; }
.security-rule-level.identity { border-left: 3px solid var(--brand); }
.security-rule-level.workflow { border-left: 3px solid #55a778; }
.security-rule-level-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.security-rule-level-head div { display: grid; gap: 4px; }
.security-rule-level-head strong { color: #28364d; font-size: 12px; }
.security-rule-level-head span, .security-rule-level-head em, .security-rule-level-empty { color: var(--muted); font-size: 10px; font-style: normal; }
.security-rule-level-empty { margin: 0; padding: 10px 2px; }
.security-rule { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.security-rule header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.security-rule label { display: grid; gap: 6px; margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.security-rule input, .security-rule textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--text); font: inherit; font-size: 12px; line-height: 1.8; }
.security-rule textarea { min-height: 140px; resize: vertical; }
.security-rule input:focus, .security-rule textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.security-rule small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.7; font-size: 10px; }
.security-policy-add, .security-policy-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.security-policy-actions { justify-content: flex-end; }
.security-policy-actions .link-button { margin-right: auto; }
.security-policy-history { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.security-policy-history summary { cursor: pointer; }
.security-policy-history p { display: flex; gap: 12px; justify-content: space-between; }

.security-heading,
.security-keyword-footer,
.security-editor-title,
.security-switch {
  display: flex;
  align-items: center;
}

.security-heading {
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.security-heading h3 { margin: 4px 0 3px; font-size: 18px; }
.security-heading p { margin: 0; color: var(--muted); font-size: 11px; }

.security-switch { flex-direction: row; gap: 10px; margin: 0; color: #3f4d64; font-size: 12px; font-weight: 650; cursor: pointer; }
.security-switch input { position: absolute; opacity: 0; pointer-events: none; }
.security-switch i { width: 38px; height: 22px; position: relative; border-radius: 99px; background: #cfd6e1; transition: .18s; }
.security-switch i::after { content: ""; width: 16px; height: 16px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(20,35,60,.2); transition: .18s; }
.security-switch input:checked + i { background: var(--brand); }
.security-switch input:checked + i::after { transform: translateX(16px); }

.security-editor { margin-top: 22px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 9px; background: #fbfcfe; }
.security-editor-title { justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #f7f9fc; }
.security-editor-title strong,
.security-editor-title span { display: block; }
.security-editor-title strong { color: #344259; font-size: 12px; }
.security-editor-title div span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.security-keyword-panel textarea {
  width: 100%;
  min-height: 220px;
  display: block;
  padding: 18px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: #fff;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
  font-size: 13px;
  line-height: 1.9;
}

.security-keyword-panel textarea::placeholder { color: #adb5c2; }
.security-keyword-panel textarea:focus { box-shadow: inset 0 0 0 2px rgba(39,100,235,.12); }

.security-keyword-footer { justify-content: space-between; gap: 20px; margin-top: 18px; color: #7f8b9e; font-size: 11px; }
.security-keyword-footer > span { display: flex; align-items: center; gap: 7px; }
.security-keyword-footer svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

@media (max-width: 800px) {
  .security-overview { grid-template-columns: 1fr; }
  .security-workspace,
  .security-chain,
  .security-layer-detail { grid-template-columns: 1fr; }
  .security-chain-node::after,
  .security-chain-node::before { display: none; }
  .security-client-picker select { min-width: 0; width: 100%; }
  .security-heading,
  .security-keyword-footer { align-items: flex-start; flex-direction: column; }
  .security-keyword-footer button { width: 100%; justify-content: center; }
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  height: 59px;
  padding: 12px 17px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  white-space: nowrap;
}

th {
  height: 43px;
  background: #fafbfc;
  color: #7f8b9e;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.035em;
}

th:first-child {
  border-radius: 9px 0 0 0;
}

th:last-child {
  border-radius: 0 9px 0 0;
}

td {
  max-width: 310px;
  overflow: hidden;
  color: #536076;
  font-size: 10px;
  text-overflow: ellipsis;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfcfe;
}

td strong {
  color: #283448;
  font-size: 11px;
  font-weight: 650;
}

td small {
  color: #98a1af;
  font-size: 8px;
}

.action-column {
  text-align: right;
}

.user-index-column,
.user-index-cell {
  width: 58px;
  min-width: 58px;
  text-align: center;
}

.user-index-cell {
  color: #6b7890;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

td:last-child .row-actions {
  justify-content: flex-end;
}

.entity-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.entity-avatar,
.content-avatar,
.device-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 720;
}

.content-avatar.expert {
  background: var(--violet-soft);
  color: var(--violet);
}

.content-avatar.skill {
  background: #eaf8f8;
  color: #168e98;
}

.content-avatar.assistant {
  background: #edf2fb;
  color: #536e9d;
}

.content-avatar.agent {
  background: #eef3f7;
  color: #53687e;
}

.entity-cell strong,
.entity-cell small {
  display: block;
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity-cell small {
  margin-top: 3px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 680;
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.pill.active,
.pill.published {
  background: var(--success-soft);
  color: var(--success);
}

.pill.suspended,
.pill.archived,
.pill.yanked {
  background: var(--danger-soft);
  color: #b64b58;
}

.pill.draft {
  background: #eef1f5;
  color: #657287;
}

.pill.review {
  background: var(--violet-soft);
  color: #694fd1;
}

.role-tag,
.kind-tag,
.channel-tag {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid #e2e7ef;
  border-radius: 5px;
  background: #f8fafc;
  color: #5b687c;
  font-size: 9px;
}

.package-valid {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 9px;
  font-weight: 650;
}

.package-valid svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.row-actions button {
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid #dfe5ed;
  border-radius: 5px;
  background: #fff;
  color: #56677f;
  font-size: 9px;
  font-weight: 580;
}

.row-actions button:hover {
  border-color: #b9caef;
  background: var(--brand-soft);
  color: var(--brand);
}


.row-actions button.danger:hover,
.danger {
  border-color: #f0c9ce !important;
  background: #fff7f8 !important;
  color: #b64c59 !important;
}

.status-select {
  height: 27px;
  min-width: 84px;
  padding: 0 24px 0 8px;
  border: 1px solid #dfe5ed;
  border-radius: 5px;
  outline: 0;
  background: #fff;
  color: #506078;
  font-size: 9px;
  cursor: pointer;
}

.status-select:hover,
.status-select:focus {
  border-color: #9fb8ec;
}

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  padding: 13px 15px;
  border: 1px solid #d7e3fb;
  border-radius: 8px;
  background: #f1f6ff;
  color: #5e6f8a;
}

.notice-icon {
  width: 31px;
  height: 31px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #e1ebff;
  color: var(--brand);
}

.notice-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice strong,
.notice span {
  display: block;
}

.notice strong {
  color: #315999;
  font-size: 10px;
}

.notice div > span {
  margin-top: 3px;
  font-size: 9px;
}

/* 设置 */
.settings-form {
  max-width: 900px;
  margin: 0;
}

.settings-heading {
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9edf2;
}

.settings-section {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  padding: 25px 0;
  border-bottom: 1px solid #e9edf2;
}

.settings-section:last-child {
  padding-bottom: 5px;
  border-bottom: 0;
}

.settings-section-title strong,
.settings-section-title span {
  display: block;
}

.settings-section-title strong {
  color: #313d51;
  font-size: 12px;
}

.settings-section-title span {
  margin-top: 4px;
  color: #939cac;
  font-size: 9px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.settings-form .form-grid label:first-child,
.settings-form .form-grid label:nth-child(2) {
  grid-column: auto;
}

.settings-form input {
  height: 40px;
}

.switch-list {
  display: grid;
}

.switch-field {
  min-height: 63px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 !important;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f4;
}

.switch-field:last-child {
  border-bottom: 0;
}

.switch-field span,
.switch-field strong,
.switch-field small {
  display: block;
}

.switch-field small {
  margin-top: 4px;
  color: #929cad;
  font-size: 9px;
  font-weight: 400;
}

.switch-field input {
  position: relative;
  width: 38px;
  height: 21px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #ccd3dd;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.18s;
}

.switch-field input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(12, 25, 46, 0.2);
  transition: transform 0.18s;
}

.switch-field input:checked {
  background: var(--brand);
}

.switch-field input:checked::after {
  transform: translateX(17px);
}

.channel-model-field { margin-bottom: 18px; }
.channel-model-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.channel-model-head span,
.channel-model-head strong,
.channel-model-head small { display: block; }
.channel-model-head strong { color: #445169; font-size: 12px; }
.channel-model-head small { margin-top: 4px; color: #929cad; font-size: 9px; font-weight: 400; }
.channel-model-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8faff; }
.channel-model-option { min-width: 0; display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; margin: 0 !important; padding: 9px 10px; border: 1px solid #e2e8f2; border-radius: 8px; background: #fff; cursor: pointer; }
.channel-model-option input { width: 16px !important; height: 16px !important; flex: 0 0 auto; margin: 0; padding: 0; accent-color: var(--brand); box-shadow: none !important; }
.channel-model-option span { min-width: 0; overflow: hidden; color: #35445c; font: 10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; text-overflow: ellipsis; white-space: nowrap; }

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(8, 17, 32, 0.58);
}

.modal-card {
  width: min(640px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 26px;
  border: 1px solid #dfe4ec;
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: modal-in 0.18s ease-out;
}

.modal-card:has(.usage-detail-stats) {
  width: min(1120px, 100%);
}

.usage-detail-stats {
  margin-bottom: 18px;
}

.usage-detail-table {
  max-height: 300px;
  overflow: auto;
}

.conversation-toolbar .search { min-width: min(420px, 100%); }
.conversation-privacy { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 15px; border: 1px solid #f1d9a9; border-radius: 12px; background: #fffaf0; color: #836421; font-size: 11px; }
.conversation-privacy svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.conversation-preview { width: min(300px, 28vw); color: #4d5a70; line-height: 1.55; white-space: normal; }
.audit-truncated { color: #b47a16; }
.modal-card:has(.conversation-transcript) { width: min(1120px, 100%); }
.conversation-detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.conversation-detail-meta span { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafd; }
.conversation-detail-meta small { color: var(--muted); }
.conversation-detail-meta strong { color: #263248; font-size: 12px; }
.conversation-transcript { display: grid; gap: 14px; }
.conversation-bubble { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.conversation-bubble header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 15px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.conversation-bubble.user header { background: #f3f7ff; color: #315ca8; }
.conversation-bubble.assistant header { background: #f1fbf7; color: #26745b; }
.conversation-bubble header small { font-weight: 500; color: #b47a16; }
.conversation-bubble pre { max-height: 340px; overflow: auto; margin: 0; padding: 17px; color: #344157; font: 12px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.conversation-request-meta { margin-top: 14px; padding: 11px 14px; border-radius: 10px; background: #f6f8fb; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .conversation-detail-meta { grid-template-columns: 1fr 1fr; }
  .conversation-preview { width: 220px; }
  .conversation-toolbar .search { min-width: 100%; }
}

.version-history { display: grid; gap: 10px; }
.version-history-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; background: var(--surface-soft, #f8fafc); }
.version-history-row > div:first-child { display: grid; gap: 3px; }
.version-history-row span { color: var(--muted, #64748b); font-size: 12px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
  padding-bottom: 17px;
  border-bottom: 1px solid #e9edf2;
}

.modal-header h2 {
  margin: 5px 0 0;
  color: #1d283a;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 680;
}

.modal-header .icon-button {
  border: 1px solid var(--line);
  color: #667389;
  font-size: 18px;
}

.modal-header .icon-button:hover {
  background: #f3f5f8;
  color: #263248;
}

.modal-card textarea {
  min-height: 95px;
  height: auto;
  padding: 11px 13px;
  resize: vertical;
}

.modal-card .form-grid {
  gap: 0 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px -26px -26px;
  padding: 15px 26px;
  border-top: 1px solid #e9edf2;
  background: #fafbfc;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 30;
  min-width: 190px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: #17243a;
  color: #fff;
  box-shadow: 0 12px 35px rgba(8, 20, 42, 0.22);
  font-size: 11px;
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1120px) {
  .sidebar {
    width: 224px;
  }

  .main {
    width: calc(100% - 224px);
    margin-left: 224px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    grid-template-columns: minmax(480px, 1fr) minmax(400px, 0.9fr);
  }

  .auth-feature-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

@media (max-width: 880px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }

  .auth-main {
    padding: 36px 24px;
  }

  .mobile-brand {
    display: flex;
  }

  .sidebar {
    width: 244px;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    box-shadow: 14px 0 45px rgba(7, 16, 31, 0.2);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    height: 84px;
  }

  .market-summary {
    grid-template-columns: 1fr;
  }

  .settings-section {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    min-height: 84px;
    align-items: flex-start;
    padding: 17px 16px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .topbar-title > div > p:last-child,
  .top-actions .health {
    display: none;
  }

  .top-actions {
    margin-top: 3px;
  }

  .top-actions .secondary span {
    display: none;
  }

  .content-area {
    padding: 18px 14px 42px;
  }

  .overview-banner {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .overview-banner h2 {
    font-size: 19px;
  }

  .banner-status {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat {
    min-height: 120px;
  }

  .toolbar,
  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .search-box {
    width: 100%;
    flex-basis: 100%;
  }

  .segmented {
    max-width: 100%;
    overflow-x: auto;
  }

  .filter-hint {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .channel-model-head { align-items: flex-start; flex-direction: column; }
  .channel-model-head button { width: 100%; }
  .channel-model-options { grid-template-columns: 1fr; }

  .settings-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .capability-list > div {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .cap-state {
    display: none;
  }

  .modal-card {
    padding: 20px;
  }

  .modal-actions {
    margin: 10px -20px -20px;
    padding: 14px 20px;
  }
}

/* 2026 管理后台视觉重构 */
:root {
  --brand: #4169e1;
  --brand-dark: #3155c7;
  --brand-soft: #eef3ff;
  --nav: #101827;
  --nav-panel: #182235;
  --text: #182235;
  --text-secondary: #57657a;
  --muted: #8a96a8;
  --line: #e6eaf1;
  --line-strong: #d9e0ea;
  --panel: #fff;
  --canvas: #f6f8fb;
  --shadow-sm: 0 1px 2px rgba(18, 31, 53, .025), 0 10px 26px rgba(18, 31, 53, .045);
  --shadow-md: 0 24px 70px rgba(18, 31, 53, .16);
}

body { background: var(--canvas); }

.sidebar {
  width: 264px;
  padding: 0 16px 16px;
  background: radial-gradient(circle at 25% 0, rgba(65,105,225,.14), transparent 28%), linear-gradient(180deg, #101827 0%, #0d1523 100%);
  box-shadow: 12px 0 36px rgba(19,31,51,.06);
  transition: width .22s ease, padding .22s ease;
}

.brand { height: 84px; padding: 0 8px; }
.brand-copy { min-width: 0; transition: opacity .15s, width .2s; }
.brand .brand-mark { background: linear-gradient(145deg, #5d80f1, #315bd5); box-shadow: 0 8px 20px rgba(49,91,213,.28); }
.brand strong { font-size: 17px; }
.brand small { color: #75829a; }

.sidebar-toggle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: #7f8da5;
}

.sidebar-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; transform: rotate(180deg); transition: transform .2s; }
.sidebar nav { padding: 18px 0; scrollbar-width: thin; scrollbar-color: #29354a transparent; }
.nav-group-label { margin: 20px 12px 8px; color: #5f6d84; font-size: 9px; }
.nav-item { height: 46px; margin: 3px 0; padding: 0 12px; border-radius: 11px; font-size: 13px; transition: .16s ease; }
.nav-item:hover { background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-item.active { background: linear-gradient(90deg, rgba(71,111,229,.22), rgba(71,111,229,.11)); box-shadow: inset 0 0 0 1px rgba(100,138,244,.08); }
.nav-item.active::before { left: -16px; top: 11px; bottom: 11px; width: 4px; background: #6f96ff; box-shadow: 0 0 14px rgba(111,150,255,.55); }
.sidebar-status { border-radius: 12px; background: rgba(255,255,255,.035); }
.sidebar-footer { padding-top: 15px; }

.main { width: calc(100% - 264px); margin-left: 264px; transition: width .22s ease, margin-left .22s ease; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 86px;
  padding: 0 clamp(26px, 3vw, 52px);
  border-bottom-color: rgba(220,226,236,.85);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
}

.topbar h1 { font-size: 23px; font-weight: 720; }
.topbar-meta { min-width: 130px; padding-right: 15px; border-right: 1px solid var(--line); text-align: right; }
.topbar-meta strong,
.topbar-meta span { display: block; }
.topbar-meta strong { color: #47546a; font-size: 10px; font-weight: 680; }
.topbar-meta span { margin-top: 3px; color: #9aa4b3; font-size: 9px; }
.health { padding: 7px 11px; border: 1px solid #dcefe6; border-radius: 99px; background: #f4fbf7; color: #35745a; }

.page-loading { position: fixed; z-index: 20; top: 85px; right: 0; left: 264px; height: 3px; overflow: hidden; pointer-events: none; opacity: 0; transition: left .22s, opacity .15s; }
.page-loading.active { opacity: 1; }
.page-loading i { width: 34%; height: 100%; display: block; border-radius: 99px; background: linear-gradient(90deg, transparent, #4169e1, #6f96ff, transparent); animation: loading-run 1s infinite ease-in-out; }
@keyframes loading-run { from { transform: translateX(-110%); } to { transform: translateX(310%); } }

.content-area { max-width: 1620px; padding: 30px clamp(26px, 3vw, 52px) 72px; }
.page { animation: page-in-v2 .24s ease-out; }
@keyframes page-in-v2 { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.overview-banner {
  position: relative;
  min-height: 178px;
  padding: 32px 36px;
  border: 0;
  border-radius: 20px;
  background: radial-gradient(circle at 82% 18%, rgba(119,158,255,.3), transparent 23%), radial-gradient(circle at 68% 120%, rgba(42,201,170,.15), transparent 30%), linear-gradient(125deg, #17233b 0%, #1b3158 58%, #254b86 100%);
  box-shadow: 0 20px 55px rgba(27,49,88,.17);
}

.overview-banner::after { content: ""; position: absolute; right: 25%; top: -45px; width: 170px; height: 170px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 42px rgba(255,255,255,.025), 0 0 0 84px rgba(255,255,255,.015); }
.overview-hero-copy { position: relative; z-index: 1; }
.overview-banner h2 { margin-top: 9px; font-size: 27px; font-weight: 720; }
.overview-banner p { font-size: 12px; color: #a6b4cb; }
.overview-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 21px; }
.overview-quick-actions button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.07); color: #dce6f7; font-size: 10px; font-weight: 650; backdrop-filter: blur(8px); }
.overview-quick-actions button:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.overview-quick-actions svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.banner-status { position: relative; z-index: 1; min-width: 235px; padding: 18px; border-radius: 13px; background: rgba(10,23,44,.38); backdrop-filter: blur(10px); }

.dashboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 26px 2px 13px; }
.dashboard-section-heading h3 { margin: 5px 0 0; color: #263248; font-size: 17px; }
.dashboard-section-heading > span { color: var(--muted); font-size: 10px; }

.stats-grid { gap: 16px; margin-bottom: 20px; }
.stat {
  min-height: 146px;
  overflow: hidden;
  padding: 21px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat::after { content: ""; position: absolute; right: -25px; bottom: -35px; width: 92px; height: 92px; border-radius: 50%; background: var(--brand-soft); opacity: .55; }
.stat:hover { z-index: 1; transform: translateY(-3px); border-color: #d8e0ee; box-shadow: 0 16px 38px rgba(22,37,62,.09); }
.stat-head,
.stat .value,
.stat .hint { position: relative; z-index: 1; }
.stat-icon { width: 40px; height: 40px; border-radius: 11px; }
.stat .label { font-size: 11px; }
.stat .value { margin-top: 20px; font-size: 31px; }
.stat .hint { font-size: 10px; }
.token-stat { background: linear-gradient(145deg, #fff, #fbfcff); }

.panel { border-color: var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.token-chart,
.capability-panel,
.audit-panel,
.settings-form { padding: 26px; }
.panel-title h3,
.toolbar h3 { font-size: 16px; }
.two-column { gap: 18px; }
.token-chart-summary { gap: 12px; }
.token-chart-summary span { padding: 13px 14px; border: 1px solid #edf0f5; border-radius: 11px; background: #fafbfe; }
.token-bar-row { min-height: 27px; }
.token-bar-track { height: 10px; }

.page > .toolbar.panel-toolbar:first-child,
.newapi-page > .toolbar.panel-toolbar {
  min-height: 96px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.newapi-page > .toolbar.panel-toolbar { margin-top: 18px; }
.newapi-page > .toolbar.panel-toolbar.token-section { margin-top: 24px; }

.token-tabs { display: inline-flex; gap: 5px; margin: 2px 0 16px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.token-tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 37px; padding: 7px 14px; border-radius: 9px; background: transparent; color: #718096; font-size: 11px; font-weight: 650; }
.token-tabs button:hover { color: var(--brand); background: #f5f7fb; }
.token-tabs button.active { background: var(--brand); color: #fff; box-shadow: 0 6px 15px rgba(65,105,225,.2); }
.token-tabs svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.token-workspace { display: none; animation: page-in-v2 .2s ease-out; }
.token-workspace.active { display: block; }
.token-workspace > .toolbar.panel-toolbar { min-height: 96px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }

.page-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.page-metrics > div { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.page-metrics span { color: var(--muted); font-size: 10px; }
.page-metrics strong { color: #26344a; font-size: 23px; line-height: 1; }
.page-metrics strong.positive { color: var(--success); }

.table-panel { border-radius: 16px; box-shadow: var(--shadow-sm); }
table { min-width: 900px; }
th,
td { height: 66px; padding: 13px 19px; }
th { position: sticky; top: 0; z-index: 1; height: 46px; background: #f8fafc; color: #7d899c; font-size: 10px; letter-spacing: .06em; }
td { color: #526078; font-size: 11px; }
td strong { font-size: 12px; }
td small { font-size: 9px; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: #f8faff; }
.entity-avatar,
.content-avatar,
.device-avatar { width: 36px; height: 36px; border-radius: 10px; }
.pill { min-height: 24px; padding: 4px 9px; border-radius: 7px; }
.row-actions button { border-radius: 8px; }
.table-pagination { padding: 16px 19px; border-top: 1px solid var(--line); background: #fbfcfe; }
.table-pagination button { min-height: 31px; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: #536177; }
.table-pagination button:hover:not(:disabled) { border-color: #9fb6ec; color: var(--brand); }
.table-pagination button:disabled { opacity: .4; cursor: not-allowed; }
.feedback-preview { width: min(330px, 29vw); max-height: 4.8em; overflow: hidden; color: #4d5a70; line-height: 1.6; }
.pill.feedback-low { background: #edf7f1; color: #287052; }
.pill.feedback-medium { background: #eef3ff; color: #315ca8; }
.pill.feedback-high { background: #fff5e6; color: #a76512; }
.pill.feedback-critical { background: #fff0f1; color: #b83e4b; }
.modal-card:has(.feedback-detail) { width: min(1050px, 100%); }
.feedback-detail { display: grid; gap: 14px; }
.feedback-detail > div { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.feedback-detail header { padding: 11px 15px; border-bottom: 1px solid var(--line); background: #f6f8fb; color: #344157; font-size: 11px; font-weight: 700; }
.feedback-detail pre { max-height: 360px; overflow: auto; margin: 0; padding: 16px; color: #344157; font: 12px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-detail dl { display: grid; grid-template-columns: 110px 1fr; margin: 0; padding: 10px 16px; font-size: 11px; }
.feedback-detail dt,.feedback-detail dd { margin: 0; padding: 7px 0; border-bottom: 1px solid #eef1f5; }
.feedback-detail dt { color: var(--muted); }
.feedback-detail dd { color: #344157; overflow-wrap: anywhere; }

.primary,
.secondary { min-height: 39px; border-radius: 10px; padding: 9px 15px; }
.primary { background: linear-gradient(135deg, #4b73e8, #315bd5); box-shadow: 0 7px 18px rgba(49,91,213,.18); }
.secondary { background: #fff; }
.search-box { height: 40px; border-radius: 10px; background: #f9fbfd; }
.segmented { padding: 3px; border-radius: 10px; background: #eef2f7; }
.segmented button { border-radius: 7px; }
.notice { padding: 15px 17px; border-radius: 12px; }
.notice-icon { width: 36px; height: 36px; border-radius: 10px; }

.workspace-hero { min-height: 160px; display: flex; align-items: center; gap: 19px; padding: 28px; border: 1px solid #dfe6f2; border-radius: 18px; background: linear-gradient(135deg,#fff,#f5f8ff); box-shadow: var(--shadow-sm); }
.workspace-hero-icon { width: 58px; height: 58px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 16px; background: var(--brand-soft); color: var(--brand); }
.workspace-hero-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.workspace-hero h2 { margin: 6px 0 5px; font-size: 22px; }
.workspace-hero p { max-width: 700px; margin: 0; color: var(--muted); font-size: 11px; }
.workspace-state { margin-left: auto; padding: 6px 11px; border-radius: 99px; background: #eef1f6; color: #728096; font-size: 10px; }
.workspace-state.active { background: #eaf7f0; color: #2c7c57; }
.knowledge-hero { margin-bottom: 18px; }
.knowledge-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
.knowledge-metrics > div { min-height: 88px; }
.knowledge-metrics span { display: flex; flex-direction: column; gap: 5px; }
.knowledge-metrics span small { color: #9aa5b5; font-size: 9px; }
.knowledge-toolbar { margin-top: 22px; margin-bottom: 12px; }
.knowledge-toolbar .search-box { width: min(360px, 43vw); }
.knowledge-toolbar .search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #43516a; font-size: 11px; }
.knowledge-toolbar .search-box button { border: 0; background: transparent; color: var(--brand); font-size: 11px; cursor: pointer; }
.knowledge-boundary { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; border: 1px solid #e5eaf3; background: #fbfcff; }
.knowledge-boundary .notice-icon { flex: 0 0 auto; display: grid; place-items: center; color: var(--brand); }
.knowledge-boundary .notice-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.knowledge-boundary strong, .knowledge-boundary span { display: block; }
.knowledge-boundary span { margin-top: 4px; color: var(--muted); line-height: 1.6; }
.knowledge-table-panel { margin-bottom: 18px; }
.knowledge-lower-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px,.65fr); gap: 16px; }
.knowledge-activity-panel, .knowledge-scope-panel { min-height: 260px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.knowledge-activity-panel .panel-title, .knowledge-scope-panel .panel-title { margin-bottom: 12px; }
.knowledge-activity { display: grid; gap: 2px; }
.knowledge-activity article { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.knowledge-activity article:last-child { border-bottom: 0; }
.knowledge-activity-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #eff4ff; color: var(--brand); }
.knowledge-activity-mark svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.knowledge-activity strong { color: #3d4b61; font-size: 11px; }
.knowledge-activity p { margin: 3px 0 0; color: #8e99aa; font-size: 9px; }
.knowledge-activity time { color: #8e99aa; font-size: 9px; white-space: nowrap; }
.knowledge-activity-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; color: #8e99aa; font-size: 9px; }
.knowledge-activity-pagination div { display: flex; gap: 6px; }
.knowledge-activity-pagination button { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: #58667d; font-size: 9px; }
.knowledge-activity-pagination button:disabled { opacity: .4; }
.knowledge-scope-panel ul { display: grid; gap: 17px; margin: 14px 0 0; padding: 0; list-style: none; }
.knowledge-scope-panel li { display: flex; align-items: flex-start; gap: 10px; }
.scope-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; flex: 0 0 auto; }
.scope-dot.blue { background: #6f91e9; }.scope-dot.green { background: #5db58c; }.scope-dot.amber { background: #e3a64e; }
.knowledge-scope-panel strong, .knowledge-scope-panel small { display: block; }
.knowledge-scope-panel strong { color: #4b5870; font-size: 11px; }
.knowledge-scope-panel small { margin-top: 4px; color: #8b96a8; font-size: 9px; line-height: 1.55; }
.knowledge-detail-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 12px 14px; border: 1px solid #e8edf5; border-radius: 11px; background: #f8faff; color: #77849a; font-size: 10px; }
.knowledge-detail-meta strong { color: #3e4e67; }
.knowledge-detail-note { margin: 13px 0; color: #8490a2; font-size: 10px; line-height: 1.55; }
.knowledge-detail-list { display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.knowledge-detail-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #edf0f5; border-radius: 10px; }
.knowledge-detail-list article > div, .knowledge-detail-list article > span { min-width: 0; }
.knowledge-detail-list strong, .knowledge-detail-list small { display: block; }
.knowledge-detail-list strong { overflow: hidden; color: #43516a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-detail-list small { margin-top: 4px; color: #929cad; font-size: 9px; }
.knowledge-detail-list article > span { color: #56647b; font-size: 10px; text-align: right; }
.knowledge-detail-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: #8792a4; font-size: 10px; }
.knowledge-detail-footer div { display: flex; gap: 7px; }
.knowledge-detail-footer button { padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: #58667d; font-size: 10px; }
.knowledge-detail-footer button:disabled { opacity: .4; }
.knowledge-preview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 18px; }
.knowledge-preview article { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; }
.knowledge-preview article:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(18,31,53,.08); }
.knowledge-preview article > span { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: #f0f4ff; color: var(--brand); }
.knowledge-preview svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.knowledge-preview strong { display: block; margin-top: 17px; color: #2b374b; font-size: 14px; }
.knowledge-preview p { min-height: 42px; margin: 7px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.knowledge-preview small { color: #9aa4b4; font-size: 9px; }

.modal-backdrop { background: rgba(14,24,40,.55); backdrop-filter: blur(6px); }
.modal-card { border: 1px solid rgba(255,255,255,.75); border-radius: 18px; box-shadow: var(--shadow-md); }
.modal-header { margin: -28px -28px 24px; padding: 23px 28px 20px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.toast { bottom: 28px; border-radius: 12px; box-shadow: 0 14px 35px rgba(18,31,53,.18); }

body.sidebar-collapsed .sidebar { width: 82px; padding-right: 12px; padding-left: 12px; }
body.sidebar-collapsed .main { width: calc(100% - 82px); margin-left: 82px; }
body.sidebar-collapsed .page-loading { left: 82px; }
body.sidebar-collapsed .brand { justify-content: center; padding: 0; }
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-item > i,
body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .sidebar-status,
body.sidebar-collapsed .account > div,
body.sidebar-collapsed .sidebar-footer .icon-button { display: none; }
body.sidebar-collapsed .sidebar-toggle { position: absolute; top: 70px; right: -12px; z-index: 2; background: #fff; color: #62718a; box-shadow: 0 4px 14px rgba(18,31,53,.14); }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(0); }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav-item.active::before { left: -12px; }
body.sidebar-collapsed .sidebar-footer { justify-content: center; padding-right: 0; padding-left: 0; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .knowledge-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .knowledge-lower-grid { grid-template-columns: 1fr; }
  .knowledge-preview { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body.sidebar-collapsed .sidebar { width: 252px; padding: 0 13px 14px; }
  body.sidebar-collapsed .main { width: 100%; margin-left: 0; }
  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-item span,
  body.sidebar-collapsed .nav-item > i,
  body.sidebar-collapsed .nav-group-label,
  body.sidebar-collapsed .sidebar-status,
  body.sidebar-collapsed .account > div { display: block; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 0 11px; }
  .topbar-meta,
  .sidebar-toggle { display: none; }
  .topbar { padding: 0 18px; }
  .content-area { padding: 20px 16px 50px; }
  .overview-banner { align-items: flex-start; padding: 26px 22px; }
  .overview-banner::after { display: none; }
  .banner-status { width: 100%; min-width: 0; }
  .stats-grid,
  .page-metrics,
  .token-chart-summary { grid-template-columns: 1fr; }
  .dashboard-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .workspace-hero { align-items: flex-start; flex-wrap: wrap; }
  .workspace-state { margin-left: 0; }
  .knowledge-toolbar { align-items: stretch; flex-direction: column; }
  .knowledge-toolbar .search-box { width: 100%; }
  .knowledge-activity article { grid-template-columns: 30px minmax(0,1fr); }
  .knowledge-activity time { grid-column: 2; }
}
