/* ---------------------------------------------------------------------------
 * Studio 层：站点级视觉收口。
 *
 * 加载位置在 neon/workspace.css 之后（见 layout 的 <link>），所以这里可以只写
 * 低特异性的选择器就完成覆盖；不复制 neon 的布局规则，也不改页面结构。
 * 分块：外壳 / 排版 / 卡片 / 表单与按钮 / 表格 / 数据块 / 公告 / 空态 / 响应式。
 * ------------------------------------------------------------------------- */

:root {
  --studio-ink: #eaf2fc;
  --studio-dim: #9aacc4;
  --studio-faint: #75879f;
  --studio-line: #94a8c31f;
  --studio-line-strong: #94a8c342;
  --studio-surface: linear-gradient(158deg, #111a2af2 0%, #0c1321f7 56%, #0b1120fa 100%);
  --studio-surface-soft: linear-gradient(150deg, #16223555, #0d1422aa 72%);
  --studio-shadow: 0 26px 74px -42px #000000d9;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scrollbar-color: #2c3d5466 transparent;
}

body {
  color: var(--studio-ink);
  letter-spacing: .002em;
}

::selection {
  background: #78ffe133;
  color: #f3fffc;
}

/* 细滚动条：默认样式在深色下太抢眼。 */
* {
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #2c3d5480;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #3b506d99;
  background-clip: padding-box;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
 * 外壳：侧栏 / 顶栏
 * ========================================================================== */
.sidebar {
  background:
    radial-gradient(120% 40% at 0% 0%, #12233a 0%, transparent 60%),
    linear-gradient(180deg, #0a1322f7 0%, #070f1bfa 100%);
  border-right: 1px solid var(--studio-line);
  padding-top: 26px;
}

.brand {
  color: #f2fffb;
  letter-spacing: .06em;
}

.brand-mark {
  border-color: #78ffe147;
  background: linear-gradient(140deg, #78ffe118, #b7a6ff12);
  box-shadow: inset 0 1px 0 #ffffff14, 0 8px 24px -14px #78ffe180;
  color: #8dffe8;
}

.brand small {
  color: #7e91a9;
  letter-spacing: .06em;
}

.nav-scroll {
  padding-top: 6px;
}

.nav-caption {
  color: #677992;
  font-size: 9.5px;
  letter-spacing: .16em;
  padding: 20px 12px 9px;
}

.nav-link {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #9fb0c6;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.nav-link:hover {
  color: #e9f4ff;
  background: #ffffff07;
  text-decoration: none;
}

.nav-link.active {
  color: #b9fff1;
  background: linear-gradient(96deg, #78ffe11c, #78ffe105 62%, transparent);
  border-color: #78ffe12e;
  box-shadow: inset 2px 0 #78ffe1, 0 10px 30px -22px #78ffe1b3;
}

.nav-icon {
  opacity: .74;
  transition: opacity .18s ease, filter .18s ease;
}

.nav-link.active .nav-icon {
  opacity: 1;
  filter: drop-shadow(0 0 7px #78ffe166);
}

.nav-count {
  background: #78ffe1;
  color: #06231f;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 0 14px -2px #78ffe1a6;
}

.sidebar-footer {
  border-top: 1px solid var(--studio-line);
  color: #9fb0c6;
}

.sidebar-footer small {
  color: #6c7f97;
}

.status-dot {
  background: #78ffe1;
  box-shadow: 0 0 12px #78ffe199;
  animation: st-pulse 3.2s ease-in-out infinite;
}

.topbar {
  background: #0a1220e8;
  border-bottom: 1px solid var(--studio-line);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.breadcrumb {
  color: #7f91aa;
  font-size: 12px;
  letter-spacing: .03em;
}

.breadcrumb span {
  color: #d3dfef;
}

.who .avatar {
  border-color: #ff7edb3d;
  background: linear-gradient(140deg, #ff7edb16, #b7a6ff0f);
  box-shadow: 0 8px 22px -14px #ff7edb80;
}

.top-user {
  color: #dbe6f5;
}

.top-user small {
  color: #7f91a9;
  letter-spacing: .08em;
}

.fx-toggle {
  background: #78ffe108;
  border-color: #78ffe12b;
  color: #9bfff0;
  letter-spacing: .05em;
}

.fx-toggle:hover {
  background: #78ffe114;
  border-color: #78ffe157;
}

/* ==========================================================================
 * 排版
 * ========================================================================== */
.workspace main,
.workspace main.wide {
  max-width: 1480px;
  padding: 36px 36px 76px;
}

main h1,
.page-hero h1,
.gateway-head h1 {
  color: #f2f8ff;
  font-size: 33px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.25;
  margin: 0 0 10px;
  text-shadow: 0 2px 18px #02060f99;
}

.page-hero h1 {
  color: #f2f8ff;
}

.page-hero,
.gateway-head {
  margin-bottom: 26px;
  align-items: flex-start;
}

.page-hero-copy {
  min-width: 0;
}

.page-hero .sub,
.gateway-head .sub {
  max-width: 760px;
  color: var(--studio-dim);
  font-size: 13px;
  line-height: 1.75;
  margin: 0;
}

.page-hero .eyebrow,
.gateway-head .eyebrow {
  color: #7ce9d3;
  opacity: .9;
  letter-spacing: .2em;
  margin-bottom: 10px;
}

main h2,
main h3 {
  color: #eef5ff;
}

.card h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.sub,
.small-note,
.muted {
  color: var(--studio-dim);
}

/* 标题与按钮上的常驻信号杂色会在休息态持续闪色，读起来像渲染错误。
   保留悬停时的 glitch（theme.js 会加 .is-glitching），静止态则干净。 */
main .signal-line:not(.is-glitching) .signal-word {
  animation: none;
  text-shadow: none;
}

main .signal-line:not(.is-glitching) .signal-word::before,
main .signal-line:not(.is-glitching) .signal-word::after {
  animation: none;
  opacity: 0;
}

.hero-index {
  border-color: var(--studio-line-strong);
  background: #0a1220a8;
  color: #93a7bf;
  border-radius: 9px;
  letter-spacing: .1em;
}

.hero-index b {
  color: #b9fff1;
}

/* ==========================================================================
 * 卡片
 * ========================================================================== */
main .card {
  border-color: var(--studio-line);
  border-radius: 18px;
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow), inset 0 1px 0 #ffffff06;
  transition: border-color .22s ease, box-shadow .22s ease;
}

/* 左描边是公告等级的颜色（重要 / 维护 / 普通），只换其余三边，
   免得收口样式把等级色一起抹掉。 */
main .card:hover {
  border-top-color: var(--studio-line-strong);
  border-right-color: var(--studio-line-strong);
  border-bottom-color: var(--studio-line-strong);
}

main .card.announcement {
  border-left-color: var(--accent);
}

main .card.announcement.important {
  border-left-color: var(--magenta);
}

main .card.announcement.maintenance {
  border-left-color: var(--yellow);
}

.card-head {
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--studio-line);
}

.card-head h2 {
  margin: 0;
}

.card-head-copy {
  min-width: 0;
}

.card-head-copy .eyebrow {
  margin: 0 0 7px;
  color: #7ce9d3;
  font-size: 10px;
  letter-spacing: .2em;
  opacity: .85;
}

.card-head .hint {
  color: var(--studio-faint);
  font-size: 10px;
  letter-spacing: .14em;
}

.card > .sub:first-child {
  margin-top: 0;
}

/* 数据块：四块读数 */
.tiles {
  gap: 14px;
}

.tile {
  border-color: var(--studio-line);
  border-radius: 14px;
  background: linear-gradient(150deg, #152133f2 0%, #0d1524f7 72%);
  overflow: hidden;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(80% 120% at 100% 0%, #78ffe10f, transparent 60%);
}

.tile::after {
  left: 20px;
  right: auto;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  opacity: .85;
}

.tile .k {
  color: var(--studio-dim);
  font-size: 11px;
  letter-spacing: .04em;
}

.tile .v {
  color: var(--studio-ink);
  font: 600 28px/1.3 ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: -.05em;
  margin: 12px 0 7px;
}

.tile .h {
  color: var(--studio-faint);
  font-size: 10.5px;
  line-height: 1.55;
}

/* 管理端用量页的读数块用的是 summary-value / muted，与 .tile .v 对齐。 */
.tile > .muted:first-child {
  color: var(--studio-dim);
  font-size: 11px;
  letter-spacing: .04em;
}

.tile .summary-value {
  margin: 12px 0 6px;
  color: var(--studio-ink);
  font: 600 27px/1.3 ui-monospace, "Cascadia Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

/* ==========================================================================
 * 按钮
 * ========================================================================== */
button {
  border-radius: 10px;
  border: 1px solid #9ffff04a;
  background: linear-gradient(180deg, #8bffec, #5fe7d2);
  color: #05231f;
  font-weight: 650;
  letter-spacing: .01em;
  box-shadow: 0 12px 30px -18px #55f0e4b3, inset 0 1px 0 #ffffff5c;
  transition: filter .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

button:hover {
  filter: brightness(1.04);
  transform: none;
}

button:active {
  filter: brightness(.97);
}

button.secondary,
.button-link {
  background: #121c2d;
  border-color: var(--studio-line-strong);
  color: #c8d7e9;
  box-shadow: none;
}

button.secondary:hover,
.button-link:hover {
  background: #18253a;
  border-color: #8fa9c766;
  color: #eff7ff;
}

.button-link.primary-link,
.primary-link {
  background: linear-gradient(180deg, #8bffec, #5fe7d2);
  border-color: #9ffff04a;
  color: #05231f;
}

button.danger {
  background: #ff8bb30d;
  border-color: #ff8bb33d;
  color: #ffb5cd;
  box-shadow: none;
}

button.danger:hover {
  background: #ff8bb31c;
  border-color: #ff8bb36b;
}

button.small {
  min-height: 31px;
  padding: 5px 11px;
  font-size: 11.5px;
}

button:disabled {
  opacity: .45;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

/* ==========================================================================
 * 表单
 * ========================================================================== */
label {
  color: #b8c8db;
  font-size: 11.5px;
  letter-spacing: .02em;
  margin: 16px 0 7px;
}

.field label {
  display: block;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: #0b1322;
  border-color: #8cabc336;
  border-radius: 10px;
  color: #e9f2fd;
  min-height: 42px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #8cabc357;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #78ffe18a;
  background: #0c1526;
  box-shadow: 0 0 0 3px #78ffe114;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, #7f93ab 50%), linear-gradient(135deg, #7f93ab 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
}

details > summary {
  color: #9fb0c6;
  font-size: 12px;
  cursor: pointer;
  padding: 9px 0;
  transition: color .16s ease;
}

details > summary:hover {
  color: #d8e8fa;
}

details[open] > summary {
  color: #9bfff0;
}

fieldset {
  border-color: var(--studio-line-strong);
  border-radius: 12px;
}

.check-block,
.compact-check {
  color: #c3d3e6;
  font-size: 12px;
}

input[type="checkbox"] {
  accent-color: #78ffe1;
}

/* ==========================================================================
 * 时间范围条（概览 / 我的用量 / 全员用量共用）
 * ========================================================================== */
.range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin: 0 0 12px;
  padding: 15px 18px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 16px;
  background:
    radial-gradient(90% 180% at 0% 0%, #78ffe112, transparent 55%),
    linear-gradient(150deg, #121c2ecc, #0a121fe8);
  box-shadow: inset 0 1px 0 #ffffff0a, 0 22px 60px -50px #000000;
}

.range-fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}

.range-bar .field {
  margin: 0;
}

.range-bar .field-date input {
  width: 158px;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color-scheme: dark;
}

.range-bar .field label {
  margin: 0 0 6px;
  color: var(--studio-faint);
  font-size: 10px;
  letter-spacing: .12em;
}

.range-sep {
  padding: 0 2px 11px;
  color: #5f728c;
  font-size: 12px;
}

.range-submit {
  min-height: 42px;
  padding: 8px 22px;
  letter-spacing: .04em;
}

.range-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.range-presets-label {
  margin-right: 6px;
  color: #6f829b;
  font-size: 9.5px;
  letter-spacing: .16em;
}

.preset {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #98aac1;
  font-size: 11px;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.preset:hover {
  background: #ffffff08;
  color: #e8f3ff;
  text-decoration: none;
}

.preset.is-on {
  background: #78ffe114;
  border-color: #78ffe13d;
  color: #a7fff1;
}

.range-note {
  margin: 0 0 18px;
  padding-left: 2px;
  color: #71849c;
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: .02em;
}

.range-note .mono {
  color: #9db0c7;
}

/* 管理端仍用 .toolbar 的筛选表单：统一到同一套外观。 */
.toolbar {
  border: 1px solid var(--studio-line);
  border-radius: 14px;
  background: var(--studio-surface-soft);
}

.toolbar .field {
  min-width: 0;
}

.toolbar button {
  min-height: 40px;
}

/* ==========================================================================
 * 表格
 * ========================================================================== */
.table-wrap {
  border: 1px solid var(--studio-line);
  border-radius: 14px;
  background: #0a1220a6;
}

table {
  font-size: 12.5px;
}

th {
  background: #121c2e;
  color: #8ea2ba;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--studio-line-strong);
  padding: 13px 15px;
  white-space: nowrap;
}

td {
  padding: 14px 15px;
  border-color: #94a8c316;
  color: #d5e2f2;
  vertical-align: middle;
}

tbody tr {
  transition: background .16s ease;
}

tbody tr:hover {
  background: #78ffe109;
}

td.num,
.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.cell-time {
  color: #8ea2ba;
  font-size: 11.5px;
  white-space: nowrap;
}

.actions {
  gap: 6px;
}

.actions button {
  min-height: 29px;
  padding: 4px 9px;
  font-size: 11px;
  box-shadow: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--studio-line);
  color: #8598b0;
  font-size: 11.5px;
}

/* ==========================================================================
 * 徽标 / 提示条 / 公告
 * ========================================================================== */
.badge {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .03em;
}

.badge.active {
  background: #68e9c70d;
}

.flash {
  border: 1px solid var(--studio-line-strong);
  border-radius: 13px;
  background: #0b1322cc;
  color: #d3e0ef;
}

.flash.ok {
  border-color: #68e9c73d;
  background: #68e9c70b;
}

.flash.warn {
  border-color: #edc68140;
  background: #edc6810b;
}

.flash.err {
  border-color: #ff8bb340;
  background: #ff8bb30b;
}

.announcement-banner {
  border-radius: 13px;
  padding: 13px 16px;
  background: #bca0ff0b;
}

.bulletin-overview {
  color: #8fa2ba;
}

.bulletin-overview b {
  color: #ecf5ff;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: -.03em;
}

.announcement {
  padding: 26px 28px;
}

.announcement h2 {
  color: #f2f8ff;
  letter-spacing: -.02em;
}

.announcement-body {
  color: #c2d0e2;
}

.announcement-meta time {
  color: #8b9fb7;
}

.announcement-footer {
  color: #93a6bd;
}

.bulletin-empty {
  padding: 64px 20px;
}

/* ==========================================================================
 * 公告两栏：左「全部公告」时间倒序，右「置顶公告」只列标题
 * ========================================================================== */
.bulletin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
  max-width: 1120px;
}

.bulletin-feed {
  min-width: 0;
  max-width: none;
}

/* 侧栏跟着滚动：长列表翻到下面时置顶仍然可见。 */
.bulletin-pinned {
  position: sticky;
  top: 84px;
  padding: 18px 18px 14px;
  border: 1px solid var(--studio-line);
  border-radius: 18px;
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow), inset 0 1px 0 #ffffff06;
}

.bulletin-pinned-head,
.bulletin-feed-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--studio-line);
}

/* 左栏标题与右栏对称，卡片从标题下方开始留一点呼吸。 */
.bulletin-feed-head {
  margin-bottom: 16px;
}

.bulletin-pinned-head .eyebrow,
.bulletin-feed-head .eyebrow {
  margin: 0;
  color: #7ce9d3;
  font-size: 9.5px;
  letter-spacing: .18em;
  opacity: .85;
}

.bulletin-pinned-head h2,
.bulletin-feed-head h2 {
  margin: 0;
  color: #eaf2fc;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
}

.pinned-count {
  margin-left: auto;
  color: var(--studio-dim);
  font: 600 12px/1 ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: -.02em;
}

.pinned-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pinned-item {
  min-width: 0;
}

.pinned-item + .pinned-item {
  border-top: 1px solid #94a8c314;
}

.pinned-link {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 7px;
  border-radius: 10px;
  color: #cfdcee;
  font-size: 13px;
  line-height: 1.55;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}

.pinned-link:hover,
.pinned-link:focus-visible {
  background: #bca0ff0f;
  color: #f4f9ff;
}

.pinned-link .badge {
  flex: 0 0 auto;
  margin-top: 1px;
}

/* 只显示标题：超长标题截两行，完整文字在 title 属性里（悬停可见）。 */
.pinned-title {
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.pinned-link:hover .pinned-title,
.pinned-link:focus-visible .pinned-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bulletin-pinned-empty {
  margin: 0;
  padding: 14px 7px 8px;
  color: var(--studio-faint);
  font-size: 12px;
}

.bulletin-pinned-more {
  margin: 10px 0 0;
  color: var(--studio-faint);
  font-size: 11px;
  line-height: 1.6;
}

/* 列表卡片标题变成详情页链接：视觉保持原样，只在悬停/聚焦时给反馈。 */
.announcement h2 .announcement-title-link {
  color: inherit;
  text-decoration: none;
}

.announcement h2 .announcement-title-link:hover,
.announcement h2 .announcement-title-link:focus-visible {
  color: #b9fff1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==========================================================================
 * 公告详情页
 * ========================================================================== */
.bulletin-detail-hero h1 {
  overflow-wrap: anywhere;
}

.bulletin-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bulletin-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  max-width: 1120px;
}

.bulletin-detail-meta li {
  padding: 12px 14px;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  background: var(--studio-surface-soft);
}

.bulletin-detail-meta span {
  display: block;
  color: #8fa2ba;
  font-size: 10px;
  letter-spacing: .12em;
}

.bulletin-detail-meta strong {
  display: block;
  margin-top: 6px;
  color: #ecf5ff;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.announcement-detail {
  max-width: 1120px;
}

.announcement-detail .announcement-body {
  margin-top: 4px;
}

/* 窄屏：置顶侧栏整块落到最上面（「置顶公告在最顶上」），不再常驻吸顶。 */
@media (max-width: 1040px) {
  .bulletin-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .bulletin-pinned {
    order: -1;
    position: static;
  }
}

.empty-orbit {
  border-radius: 18px;
  border-color: #78ffe12e;
  background: linear-gradient(140deg, #78ffe112, #b7a6ff12);
  color: #a9fff0;
  box-shadow: inset 0 1px 0 #ffffff12, 0 18px 44px -26px #78ffe180;
}

/* ==========================================================================
 * 使用限制页的读数块
 * ========================================================================== */
.limit-summary {
  margin: 4px 0 18px;
}

.limit-summary .card {
  margin: 0;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--studio-surface-soft);
}

.limit-summary .card > span {
  display: block;
  color: #8fa2ba;
  font-size: 11px;
  letter-spacing: .04em;
}

.limit-summary h2 {
  margin: 10px 0 0;
  color: #a7fff1;
  font: 600 26px/1.25 ui-monospace, "Cascadia Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}

/* ==========================================================================
 * 图表：Key / 用户占比环图与页内小图
 * ========================================================================== */
.chart-pie .donut-ring {
  stroke: #0b1424;
  stroke-width: 19;
}

.chart-pie .donut-slice {
  stroke-width: 19;
  cursor: pointer;
  transition: stroke-width .18s ease, filter .18s ease;
}

.chart-pie .donut-slice:hover {
  stroke-width: 23;
  filter: drop-shadow(0 0 7px var(--cat, var(--accent)));
}

.chart-pie .donut-total {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.chart-pie .legend li {
  padding: 10px 9px;
  border-radius: 8px;
  transition: background .16s ease;
}

.chart-pie .legend li:hover {
  background: #ffffff06;
}

/* 账号设置：单列表单不要拉满整张卡，读起来更稳。 */
.card form[action="/settings/password"] {
  max-width: 560px;
}

/* ==========================================================================
 * 空态 / 细节
 * ========================================================================== */
.empty-state {
  color: #8fa2ba;
}

.empty-state strong {
  color: #e9f4ff;
}

code,
.secret {
  border-radius: 10px;
}

.secret {
  background: #08101d;
  border-color: var(--studio-line-strong);
  color: #dff7ff;
}

/* 降智测试的图例 */
.test-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.test-legend .badge {
  font-size: 11px;
  padding: 5px 11px;
}

.test-history .empty-state {
  padding: 54px 20px;
}

.test-history .empty-state::before {
  content: "✦";
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border: 1px solid #78ffe12b;
  border-radius: 16px;
  background: linear-gradient(140deg, #78ffe112, #b7a6ff12);
  color: #a9fff0;
  font-size: 20px;
  box-shadow: inset 0 1px 0 #ffffff10, 0 16px 38px -24px #78ffe180;
}

/* 公告编辑页的分段标题 */
.section-heading {
  align-items: flex-start;
}

.section-heading h2 {
  margin: 0;
}

.section-number {
  color: #78ffe180;
}

.upload-zone {
  border-color: var(--studio-line-strong);
  border-radius: 14px;
  background: #0b1322a6;
}

/* ==========================================================================
 * 响应式：只补外壳与范围条，不重复 neon 已做的堆叠
 * ========================================================================== */
@media (max-width: 1150px) {
  .workspace main,
  .workspace main.wide {
    padding: 30px 24px 56px;
  }

  .range-bar {
    align-items: stretch;
  }

  .range-presets {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .topbar {
    height: 64px;
  }

  .range-fields {
    flex-wrap: wrap;
  }

  .range-bar .field-date input {
    width: 100%;
    min-width: 0;
  }

  .range-bar .field-date {
    flex: 1 1 140px;
  }

  .range-submit {
    flex: 1 1 100%;
  }

  .range-sep {
    display: none;
  }
}

@media (max-width: 680px) {
  .workspace main,
  .workspace main.wide {
    padding: 22px 16px 40px;
  }

  main h1,
  .page-hero h1,
  .gateway-head h1 {
    font-size: 26px;
  }

  main .card {
    padding: 18px;
    border-radius: 16px;
  }

  .tile .v {
    font-size: 24px;
  }

  .range-bar {
    padding: 13px 14px;
    border-radius: 14px;
  }

  .range-presets .preset {
    flex: 1 1 auto;
    text-align: center;
  }

  .limit-summary h2 {
    font-size: 23px;
  }

  /* 占比环图在窄屏改成上下排，图例不再被挤成「生…」「开…」。 */
  .chart-pie {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .chart-pie .donut {
    width: 158px;
  }

  .chart-pie .legend {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot {
    animation: none !important;
  }
}

@keyframes st-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

/* ==========================================================================
 * 审计页 · 登录记录区块
 *
 * 表有 9 列（含明文失败口令与整条 User-Agent），比「管理动作」那张宽，
 * 所以给它独立的窄屏策略：表格横向滚动而不是压缩列宽，避免口令被截断成半个词。
 * ========================================================================== */
.login-audit-tiles {
  margin-bottom: 18px;
}

.login-audit-table {
  min-width: 1120px;
}

/* 失败口令：等宽 + 轻微底色，提醒"这里是明文"，同时不抢走结果列的注意力。 */
.login-audit-secret code {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 5px;
  border-radius: 6px;
  background: #edc68114;
  color: #f0d3a4;
  vertical-align: bottom;
}

.login-audit-client {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-audit-ua {
  cursor: help;
}

/* 区块下方的明文口令告警：用 warn 色，但比 flash 更收敛（它常驻，不是一次性提示）。 */
.login-audit-alert {
  margin: 16px 0 0;
  padding: 11px 14px;
  border: 1px solid #edc68133;
  border-radius: 12px;
  background: #edc6810a;
  color: #d9c39a;
  font-size: 11.5px;
  line-height: 1.65;
}

.login-audit-alert b {
  color: #f0d3a4;
  font-weight: 600;
}

@media (max-width: 680px) {
  .login-audit-table {
    min-width: 920px;
  }

  .login-audit-secret code {
    max-width: 150px;
  }
}

/* ==========================================================================
 * 审计页 · 入站 IP（按用户）
 *
 * 结构是"一个人一块"：块头一行（显示名 + 邮箱 + 右侧「N 个 IP · 合计 X 次 ·
 * 占全站 Y%」），块内一张六列小表（IP / 次数 / 占本人 / 调用模型 / 首次 / 最近）。
 * 用左侧色条 + 块间距把不同用户隔开，避免整页读成一张长表；未归属块用暖色条区分
 * "认不出是谁"与"某个具体用户"。
 * 表格沿用 .table-wrap 的横向滚动策略：窄屏不压扁列宽（IP 与模型名会被截断成半个词）。
 * ========================================================================== */
.ip-user-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ip-user-block {
  padding: 14px 16px 6px;
  border: 1px solid var(--studio-line);
  border-left: 2px solid #68e9c74d;
  border-radius: 14px;
  background: var(--studio-surface-soft);
}

.ip-user-block.ip-user-unassigned {
  border-left-color: #edc68166;
}

.ip-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 11px;
}

.ip-user-who {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
  flex-wrap: wrap;
}

.ip-user-name {
  color: var(--studio-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
}

.ip-user-email {
  color: var(--studio-faint);
  font-size: 10.5px;
  overflow-wrap: anywhere;
}

.ip-user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--studio-dim);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 分隔点用伪元素：文案里不塞「·」，复制出来的汇总仍然干净。 */
.ip-user-meta > span + span::before {
  content: "·";
  margin-right: 8px;
  color: #4d6178;
}

.ip-user-meta b {
  color: #9ef0dd;
  font-weight: 600;
}

.ip-user-count {
  color: var(--studio-faint);
}

.ip-user-table {
  min-width: 760px;
}

/* 次数 / 占本人两列要等宽数字。插入「地区」列后位置从 2、3 变成 3、4。 */
.ip-user-table td:nth-child(3),
.ip-user-table td:nth-child(4) {
  font-variant-numeric: tabular-nums;
}

.ip-user-share {
  color: #b9e8ff;
}

/* 模型小标签：`model ×N`。允许换行，宁可多占两行也不把模型名截断。 */
.ip-user-models {
  white-space: normal;
  /* 基础样式给 td 的 max-width:235px 太窄：三个标签会被挤成三行。 */
  max-width: 360px;
}

.ip-user-model {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 2px 8px;
  border: 1px solid #68e9c73d;
  border-radius: 999px;
  background: #68e9c70d;
  color: #a9f2e2;
  font-size: 10px;
  letter-spacing: .01em;
  white-space: nowrap;
}

.ip-user-model-more {
  display: inline-block;
  margin: 2px 0;
  color: var(--studio-faint);
  font-size: 10px;
}

.ip-user-more {
  margin: 2px 0 8px;
  font-size: 10.5px;
}

@media (max-width: 680px) {
  .ip-user-block {
    padding: 12px 12px 4px;
  }

  .ip-user-table {
    min-width: 640px;
  }
}

/* ==========================================================================
 * 年级模型策略：分组路由规则（portal/model_policy.py）
 * ========================================================================== */
.route-models {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 180px;
}

.route-models .badge {
  font-weight: 400;
  border: 1px solid #78ffe124;
  background: #78ffe10d;
  color: #cfe9ff;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* 行内操作表单压成按钮大小，不继承卡片的块级间距。 */
.route-actions form {
  margin: 0;
}

.route-source-set {
  margin: 4px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--studio-line);
  border-radius: 14px;
  background: var(--studio-surface-soft);
}

.route-source-set legend {
  padding: 0 6px;
  color: #8ea2ba;
  font-size: 11px;
  letter-spacing: .04em;
}

.route-source-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px 14px;
  max-height: 320px;
  overflow: auto;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  background: #0a1220a6;
}

.route-source-list .check-block {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

/* ==========================================================================
 * 审计 · 管理动作表：长 Key 标识与详情不撑破视口
 *
 * 这张表里 `target_ref` 可能是完整的 Key 标识（几十字符无空格），
 * auto 布局会把它当成一列宽，把「来源 IP」挤出屏幕；固定列宽 + 单行省略，
 * 完整内容走 title 悬停。
 * ========================================================================== */
.audit-table {
  table-layout: fixed;
}

.audit-table th,
.audit-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
 * 滚动条可见性（studio-20261121-5）
 *
 * 背景：上面第 37 行开始的 `* { scrollbar-width: thin }` 是为"别抢眼"写的，
 * 结果在 Windows 上细到 6px、thumb 又是 8 位半透明，审计页那种宽表
 * （管理动作 7 列、登录记录 9 列）明明能横向滚，用户却看不出还有内容。
 *
 * 这里只对**真正需要滚动**的两处放大：表格横向容器 `.table-wrap` 与页面 `html`。
 * 其余元素继续沿用细条，避免整站滚动条一起变粗。
 * ========================================================================== */
.table-wrap {
  /* Firefox：auto = 标准宽度（不再用 thin）；track 要显式给色，否则透明底看不出轨道 */
  scrollbar-width: auto;
  scrollbar-color: #3f5a7d #0a1220cc;
  /* 横条不要贴着卡片边：留 6px 呼吸，滚到底时最后一行不会和条粘在一起 */
  padding-bottom: 6px;
}

.table-wrap::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #0a1220cc;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #3f5a7d;
  border: 3px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #5878a4;
  background-clip: padding-box;
}

/* 页面整体滚动条：比表格那条更暗一档，避免和白卡片抢注意力。 */
html {
  scrollbar-width: auto;
  scrollbar-color: #33425a #0a1220cc;
}

html::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

html::-webkit-scrollbar-track {
  background: #0a1220cc;
}

html::-webkit-scrollbar-thumb {
  background: #33425a;
  border: 3px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover {
  background: #4a5f7d;
  background-clip: padding-box;
}

/* ==========================================================================
 * 审计页表格密度（studio-20261121-5）
 *
 * 基础 `td` 是 14px/15px 内边距，单行就有 ~45px；管理动作一页 20 行时
 * 整张表要滚三屏才能看完。这里压到 10px/12px、行高 1.35，单行 ≤ 40px。
 * 只动内边距与行高：`table-layout: fixed` 与单行省略（上面那段）保持不变。
 * ========================================================================== */
.audit-table th,
.audit-table td {
  padding: 10px 12px;
  line-height: 1.35;
}

/* 登录记录多了一行「地区」小字后，单行被撑到 65px（基础内边距 14px+14px 加两行文字）。
 * 这里同样压到 10px/12px，单行回到 ~50px。**失败口令的省略逻辑不动**：
 * 那是 `.login-audit-secret code` 自己的 max-width + ellipsis，与内边距无关。 */
.login-audit-table th,
.login-audit-table td {
  padding: 10px 12px;
  line-height: 1.35;
}

/* 入站 IP 明细叠加模型标签后实测单行 56px（未到 60px 的阈值），保持基础内边距即可。 */

/* ==========================================================================
 * 审计页 · IP 地区列（迁移 19 / portal/ip_geo.py）
 *
 * 首屏渲染缓存命中的 label；未命中的是 `—` 占位，由 static/admin-audit.js
 * 按批 POST /admin/audit/ip-geo 回填。样式只负责"不换行、别撑宽整张表"。
 * ========================================================================== */
.ip-geo {
  display: block;
  color: var(--studio-faint);
  font-size: 10.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 190px ≈ 「CN · Guangdong · Shenzhen」在等宽字体下的整行宽度：
     再窄就会把城市名截成「Shenzh…」。更长的地区名仍走省略号，全文不在 title
     （title 留给 organization，两者语义不同）。 */
  max-width: 190px;
}

.ip-geo-cell {
  color: #b9c8da;
}

/* 登录记录的 IP 单元格：IP 一行、地区一行，两行之间不要额外空隙。 */
.login-audit-table td .ip-geo {
  margin-top: 1px;
  font-variant-numeric: normal;
}

/* ==========================================================================
 * 审计页 · 提问记录（迁移 20 / portal/prompt_audit.py / 契约 prompt-audit）
 *
 * 类名统一前缀 `prompt-`。这里只做三件事：
 * 1. 问题正文保留换行（契约要求原样保留），并压成"不撑破表格"的块；
 * 2. 账号列两行（人 + Key 名）不换行、超长省略；
 * 3. `<details>` 展开态给出可读的全文块，展开/收起用纯 HTML，不需要 JS
 *    （审计页只有 admin-audit.js 一个脚本，加交互就要重打 app.js bundle）。
 * ========================================================================== */
.prompt-audit-table th,
.prompt-audit-table td {
  padding: 10px 12px;
  line-height: 1.35;
  /* 默认就是 fixed：问题那一列必须由布局切宽度，而不是被一段 4 KB 的正文撑开。 */
  vertical-align: top;
}

.prompt-audit-table {
  table-layout: fixed;
}

/* 5 列：时间 / 账号 / 模型 / 字符数 / 问题。时间与字符数给固定宽，
 * 剩下的大部分留给问题正文——它才是这一页要看的东西。 */
.prompt-audit-table th:nth-child(1),
.prompt-audit-table td:nth-child(1) {
  width: 148px;
}

.prompt-audit-table th:nth-child(2),
.prompt-audit-table td:nth-child(2) {
  width: 210px;
}

.prompt-audit-table th:nth-child(3),
.prompt-audit-table td:nth-child(3) {
  width: 170px;
}


.prompt-audit-who {
  /* 不要动 `<td>` 的 display：把单元格改成 flex 会让 `table-layout: fixed`
   * 的列宽算法失效（实测列宽会被内容顶开）。两行子元素本身就是 block，
   * 自然上下堆叠，不需要 flex。 */
  max-width: 100%;
}

.prompt-audit-owner {
  display: block;
  max-width: 100%;
  color: #e8eef7;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Key 名原文：未归属的行只有这一行能说明"是哪把 Key"，
 * 所以它必须**总是**出现在第二行（哪怕只有省略号）。 */
.prompt-audit-key {
  display: block;
  max-width: 100%;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge.prompt-audit-unassigned {
  color: #f0c27b;
  border-color: #6b5220;
  background: #2a2214;
}

.badge.prompt-audit-model {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.prompt-audit-chars {
  font-variant-numeric: tabular-nums;
}

.prompt-audit-trunc {
  display: block;
  font-size: 10.5px;
}

/* 问题正文：保留换行（契约第 1 节「保留换行」），但按列宽折行；
 * 单行最多 6 行高度，超出的由 `<details>` 展开看全文。 */
.prompt-audit-q,
.prompt-audit-full {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.5;
}

.prompt-audit-q {
  color: #d7e2ef;
  max-height: 7.5em;
  overflow: hidden;
}

.prompt-audit-details {
  margin: 0;
}

.prompt-audit-details > summary {
  cursor: pointer;
  /* 收起时也显示"前 200 字 + …"，点击后展开全文。 */
  list-style: none;
}

.prompt-audit-details > summary::-webkit-details-marker {
  display: none;
}

.prompt-audit-details > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 4px;
  color: var(--studio-faint);
  font-size: 10px;
}

.prompt-audit-details[open] > summary::before {
  content: "▾";
}

.prompt-audit-details[open] > summary {
  max-height: none;
  color: var(--studio-faint);
}

/* 展开后的全文块：整段可读，左侧一条竖线表明它属于上面那一行的摘要。 */
.prompt-audit-full {
  margin-top: 6px;
  padding: 8px 10px;
  border-left: 2px solid #33425a;
  background: #0a1220cc;
  border-radius: 0 6px 6px 0;
  color: #e8eef7;
}

.prompt-filters {
  align-items: flex-end;
}

.prompt-audit-alert {
  margin-top: 12px;
}

.audit-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 8px 0 18px;
  border-bottom: 1px solid var(--studio-line, #33425a);
}
.audit-nav a {
  padding: 10px 8px;
  border-bottom: 2px solid transparent;
  color: var(--studio-faint);
  text-decoration: none;
}
.audit-nav a[aria-current] { color: var(--accent); border-color: currentColor; }
.audit-workspace section[hidden] { display: none; }
.audit-workspace .login-audit-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 0 0 16px;
}
.audit-stat { display: inline-flex; align-items: baseline; gap: 8px; font-size: 13px; }
.audit-stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.audit-secondary, .ov-recent .usage-model small {
  display: block;
  margin-top: 3px;
  font-size: .88em;
  color: var(--studio-faint);
  overflow-wrap: anywhere;
}
.audit-record-details summary, summary.ip-user-head { cursor: pointer; }
.audit-record-details[open] { min-width: 9em; overflow-wrap: anywhere; white-space: normal; }
.audit-record-details > div { margin-top: 5px; }
.audit-workspace .login-audit-table { min-width: 660px; }
.audit-workspace .audit-table { min-width: 700px; }
.audit-workspace .audit-table td { white-space: normal; overflow-wrap: anywhere; }
.audit-workspace .audit-table th:nth-child(5) { width: 24%; }
.audit-workspace .prompt-audit-table { min-width: 690px; }
.audit-workspace .prompt-audit-table :is(th, td):nth-child(1) { width: 16%; }
.audit-workspace .prompt-audit-table :is(th, td):nth-child(2) { width: 21%; }
.audit-workspace .prompt-audit-table :is(th, td):nth-child(3) { width: 20%; white-space: normal; overflow-wrap: anywhere; }
.audit-workspace summary.ip-user-head { margin-bottom: 0; padding-bottom: 8px; }
.audit-workspace summary.ip-user-head::before { content: '▸'; }
.audit-workspace details[open] > summary.ip-user-head::before { content: '▾'; }
.audit-workspace summary.ip-user-head .ip-user-who { flex: 1; }

.ov-page .ov-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr);
  gap: 18px 24px;
  align-items: center;
}
.ov-time-detail { margin: 4px 0 14px; font-size: 12px; color: var(--studio-faint); }
.ov-time-detail summary { width: fit-content; cursor: pointer; }
.ov-summary-grid .ov-composition { border: 0; padding: 0; gap: 12px; }
.ov-summary-grid .ov-orb { width: clamp(140px, 15vw, 210px); height: auto; aspect-ratio: 1; }
.ov-summary-grid .ov-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  gap: 12px 18px;
  border-inline-start: 1px solid var(--ov-edge);
  padding-inline-start: 20px;
}
.ov-summary-grid .ov-metric { padding: 4px 0; border: 0; background: transparent; animation: none; }
.ov-summary-grid .ov-metric-v { margin: 3px 0; }
.ov-page .ov-chart-card :is(.hint, .eyebrow), .ov-page .ov-recent .eyebrow { display: none; }
@media (max-width: 940px) {
  .ov-page .ov-summary-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-summary-grid .ov-metrics { border: 0; padding: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .ov-summary-grid .ov-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

