@font-face {
  font-family: "Fusion Pixel 12px Mono zh_hans";
  src: url("/fonts/fusion-pixel-12px-monospaced-zh-hans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #070a09;
  --bg-deep: #030504;
  --surface: rgba(15, 20, 18, 0.88);
  --surface-strong: rgba(20, 27, 24, 0.96);
  --surface-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(211, 235, 224, 0.12);
  --line-strong: rgba(211, 235, 224, 0.2);
  --text: #edf5f1;
  --muted: #91a39a;
  --subtle: #62736b;
  --accent: #66e6a6;
  --accent-soft: rgba(102, 230, 166, 0.12);
  --accent-glow: rgba(72, 225, 149, 0.25);
  --hub-soft: #9ef0c4;
  --hub-softer: #c6f6dc;
  --hub-sleep: #3d9a6e;
  --warning: #e7b66f;
  --warning-soft: rgba(231, 182, 111, 0.12);
  --danger: #ec847d;
  --danger-soft: rgba(236, 132, 125, 0.12);
  --radius-panel: 22px;
  --radius-control: 12px;
  --shadow: 0 8px 20px rgba(0, 14, 8, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.025);
  --gap: clamp(10px, 1vw, 16px);
  color-scheme: dark;
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f4f8ff;
  --bg-deep: #edf4ff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-soft: rgba(61, 155, 255, 0.065);
  --line: rgba(37, 103, 178, 0.14);
  --line-strong: rgba(37, 103, 178, 0.26);
  --text: #10243f;
  --muted: #5e718c;
  --subtle: #8494aa;
  --accent: #3d9bff;
  --accent-soft: rgba(61, 155, 255, 0.12);
  --accent-glow: rgba(61, 155, 255, 0.25);
  --hub-soft: #82c5ff;
  --hub-softer: #b9ddff;
  --hub-sleep: #2e6fd8;
  --warning: #a96b16;
  --warning-soft: rgba(205, 132, 27, 0.11);
  --danger: #c84f55;
  --danger-soft: rgba(200, 79, 85, 0.1);
  --shadow: 0 4px 12px rgba(48, 91, 145, 0.06), inset 0 1px 0 #ffffff;
  color-scheme: light;
}

:root[data-theme="moon"] {
  --font-pixel: "Fusion Pixel 12px Mono zh_hans", ui-monospace, monospace;
  --bg: #1a1a1a;
  --bg-deep: #121212;
  --surface: transparent;
  --surface-strong: rgba(18, 18, 18, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #f5f5f5;
  --muted: #c8c8c8;
  --subtle: #9a9a9a;
  --accent: #f2f2f2;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --accent-glow: rgba(255, 255, 255, 0.2);
  --hub-soft: #c8c8c8;
  --hub-softer: #e0e0e0;
  --hub-sleep: #7a7a7a;
  --warning: #e7b66f;
  --warning-soft: rgba(231, 182, 111, 0.12);
  --danger: #ec847d;
  --danger-soft: rgba(236, 132, 125, 0.12);
  --shadow: none;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

html {
  background: var(--bg-deep);
}

body {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -14%, rgba(71, 175, 126, 0.16), transparent 34%),
    radial-gradient(circle at 8% 108%, rgba(38, 103, 73, 0.18), transparent 36%),
    linear-gradient(145deg, #090d0b 0%, #050706 56%, #080c0a 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  top: 12px;
  left: 12px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #06140d;
}

.ambient,
.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient {
  z-index: 0;
  overflow: hidden;
}

.ambient-grid {
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(141, 176, 159, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 176, 159, 0.07) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.ambient-orbit {
  position: absolute;
  border: 1px solid rgba(102, 230, 166, 0.08);
  border-radius: 50%;
}

.ambient-orbit-one {
  width: 48vw;
  aspect-ratio: 1;
  right: -20vw;
  top: -28vw;
}

.ambient-orbit-two {
  width: 34vw;
  aspect-ratio: 1;
  left: -20vw;
  bottom: -22vw;
}

.ambient-pixel-floor,
.ambient-pixel-dust,
.ambient-galaxy,
.ambient-nebula,
.ambient-stars,
.moon-glitch {
  display: none;
}

.moon-glitch {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 70;
  pointer-events: none;
  image-rendering: pixelated;
}

:root[data-theme="moon"] .moon-glitch.is-on {
  display: block;
}

.console {
  position: relative;
  z-index: 1;
  width: min(100%, 1760px);
  height: 100dvh;
  margin: 0 auto;
  padding: clamp(12px, 1.35vw, 22px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--gap);
  overflow: hidden;
  background: transparent;
}

.console-header {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(280px, 1fr);
  align-items: center;
  gap: 18px;
}

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

.brand-mark,
.auth-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(102, 230, 166, 0.34);
  border-radius: 14px;
  color: var(--accent);
  background: radial-gradient(circle at 68% 16%, rgba(174, 255, 216, 0.18), rgba(102, 230, 166, 0.06) 45%, rgba(8, 12, 10, 0.8));
  animation: brand-breathe 3.5s ease-in-out infinite;
}

@keyframes brand-breathe {
  0%, 100% {
    box-shadow: inset 0 0 22px rgba(102, 230, 166, 0.05), 0 10px 30px rgba(32, 118, 76, 0.12), 0 0 8px rgba(102, 230, 166, 0.1);
  }
  50% {
    box-shadow: inset 0 0 24px rgba(102, 230, 166, 0.08), 0 12px 34px rgba(32, 118, 76, 0.18), 0 0 24px rgba(102, 230, 166, 0.42);
  }
}

.brand h1,
.panel h2,
.auth-card h1 {
  margin: 0;
  text-wrap: balance;
}

.brand h1 {
  font-size: clamp(18px, 1.3vw, 23px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 690;
}

.brand-version {
  margin-left: 8px;
  color: var(--subtle);
  font-family: "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.16em;
}

.header-account {
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 6px 14px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 20, 18, 0.68);
  color: var(--muted);
  font-size: 10px;
}

.header-account strong {
  display: block;
  max-width: 120px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border-radius: 10px;
  color: #092015;
  background: var(--accent);
  font-size: 13px;
  font-weight: 720;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock {
  color: var(--muted);
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  transition: 180ms ease;
}

.icon-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover {
  color: var(--accent);
  border-color: rgba(102, 230, 166, 0.3);
  transform: rotate(12deg);
}

.icon-button:active,
.button:active {
  transform: translateY(1px) scale(0.98);
}

.icon-button:focus-visible,
.button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.console-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(480px, 1.58fr) minmax(275px, 0.9fr);
  grid-template-rows: minmax(0, 1fr) clamp(210px, 29vh, 260px);
  gap: var(--gap);
  overflow: hidden;
  background: transparent;
}

.panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background:
    radial-gradient(circle at 94% 0%, rgba(113, 183, 148, 0.055), transparent 34%),
    linear-gradient(145deg, rgba(19, 25, 22, 0.92), rgba(10, 14, 12, 0.91));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rail-panel {
  --activity-visible: 5;
  --activity-row: 28px;
  --activity-gap: 3px;
  grid-row: 1 / 3;
  padding: clamp(16px, 1.4vw, 24px);
  display: flex;
  flex-direction: column;
}

.panel-heading,
.action-topline,
.group-column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel h2 {
  font-size: clamp(16px, 1.2vw, 21px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.panel-note {
  margin: 8px 0 15px;
  /* overflow:hidden 会把 flex 自动 min-height 打成 0；左栏一挤，这行就被压成一条线 */
  flex: none;
  min-height: 1.35em;
  overflow: hidden;
  color: var(--subtle);
  font-family: "SFMono-Regular", monospace;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-state {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 48%;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.pulse-dot,
.semantic-dot,
.queue-state-dot {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subtle);
  box-shadow: 0 0 0 3px rgba(98, 115, 107, 0.09);
}

.pulse-dot.ok,
.semantic-dot.ok {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 14px var(--accent-glow);
}

.pulse-dot.warning,
.semantic-dot.warning,
.semantic-dot.paused,
.queue-state-dot[data-level="warning"] {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-soft);
}

.semantic-dot.sleeping {
  background: #5B7BD5;
  box-shadow: 0 0 0 3px rgba(91, 123, 213, 0.16), 0 0 12px rgba(91, 123, 213, 0.35);
}

.pulse-dot.off,
.semantic-dot.error,
.queue-state-dot[data-level="error"] {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.pulse-dot.ok::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(102, 230, 166, 0.4);
  border-radius: 50%;
  animation: status-ping 2.2s ease-out infinite;
}

.status-list {
  display: grid;
  gap: 2px;
  min-height: 0;
  flex: none;
}

.status-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(211, 235, 224, 0.07);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-copy {
  min-width: 0;
}

.status-copy strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 580;
}

.status-copy p,
.login-state p,
.command-copy > p:not(.eyebrow),
.auth-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.status-copy p {
  margin: 0;
  color: var(--muted);
  white-space: normal;
  line-height: 1.45;
}

.status-copy p:empty {
  display: none;
}

.status-value {
  max-width: 140px;
  overflow: hidden;
  color: var(--subtle);
  font-family: "SFMono-Regular", monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-divider {
  height: 1px;
  margin: clamp(6px, 1vh, 12px) 0;
  background: linear-gradient(90deg, var(--line), transparent);
}

.rail-subhead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.rail-subhead span:last-child {
  color: var(--subtle);
}

.about-list {
  display: grid;
  gap: 4px;
}

.about-row {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.about-row code {
  overflow: hidden;
  color: var(--text);
  font-family: "SFMono-Regular", monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-clock {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.rail-clock strong {
  color: var(--text);
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.privacy-note {
  margin: auto 0 0;
  padding-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--subtle);
  font-size: 9px;
}

.privacy-note span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.console-main {
  grid-column: 2;
  grid-row: 1;
  padding: clamp(16px, 1.4vw, 22px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px 14px;
  background:
    radial-gradient(circle at 69% 45%, rgba(90, 228, 163, 0.11), transparent 26%),
    radial-gradient(circle at 12% 100%, rgba(90, 228, 163, 0.055), transparent 38%),
    linear-gradient(145deg, rgba(19, 26, 22, 0.95), rgba(8, 12, 10, 0.95));
}

.console-main::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background: linear-gradient(115deg, transparent 43%, rgba(143, 255, 199, 0.03) 43.2%, transparent 43.5%);
}

.console-main[data-level="ok"] {
  border-color: rgba(102, 230, 166, 0.18);
}

.console-main[data-level="warning"] {
  border-color: rgba(231, 182, 111, 0.22);
}

.console-main[data-level="error"] {
  border-color: rgba(236, 132, 125, 0.28);
}

.console-main[data-level="sleeping"] {
  border-color: rgba(91, 123, 213, 0.3);
}

.command-copy {
  position: relative;
  z-index: 2;
}

.command-copy h2 {
  max-width: 16ch;
  margin-bottom: 8px;
  font-size: clamp(24px, 2.15vw, 38px);
  line-height: 1;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.command-copy > p:not(.eyebrow) {
  max-width: 38ch;
  font-size: 11px;
}

.system-core {
  position: relative;
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: visible;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(61, 155, 255, 0.18);
}

.core-halo,
.core-node {
  position: absolute;
  border-radius: 50%;
}

.core-halo-one {
  width: min(12vw, 174px);
  aspect-ratio: 1;
  border: 1px dashed rgba(102, 230, 166, 0.21);
  animation: slow-spin 22s linear infinite;
}

.core-halo-one::before,
.core-halo-one::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

.core-halo-one::before {
  top: 17%;
  left: 10%;
}

.core-halo-one::after {
  right: 3%;
  bottom: 35%;
}

.core-halo-two {
  width: min(8.4vw, 122px);
  aspect-ratio: 1;
  border: 1px solid rgba(102, 230, 166, 0.12);
  box-shadow: inset 0 0 24px rgba(102, 230, 166, 0.035);
  animation: slow-spin 14s linear infinite reverse;
}

.core-node {
  width: min(5.1vw, 74px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(160, 255, 208, 0.42);
  background:
    radial-gradient(circle at 35% 27%, #b9ffdb, #63e6a5 16%, #17482f 55%, #08110d 80%);
  box-shadow: 0 0 24px rgba(86, 232, 158, 0.22), inset -12px -18px 30px rgba(0, 15, 9, 0.5);
}

.core-node i {
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e4fff1;
  box-shadow: 0 0 20px #caffdf;
  animation: core-breathe 2.8s ease-in-out infinite;
}

.core-caption {
  position: absolute;
  bottom: 3px;
  color: var(--subtle);
  font-family: "SFMono-Regular", monospace;
  font-size: 8px;
  letter-spacing: 0.16em;
}

.hero-stats {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(211, 235, 224, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.hero-stat {
  min-width: 0;
  padding: 8px 12px;
  border-left: 1px solid rgba(211, 235, 224, 0.07);
}

.hero-stat:first-child {
  border-left: 0;
}

.hero-stat span {
  display: block;
  margin-bottom: 4px;
  min-height: 2.9em;
  color: var(--subtle);
  font-size: 8px;
  line-height: 1.45;
  white-space: normal;
}

.hero-stat strong {
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.hero-stat strong {
  font-size: 17px;
  font-weight: 600;
}

.action-panel {
  padding: clamp(16px, 1.4vw, 23px);
  display: flex;
  flex-direction: column;
}

.action-topline {
  align-items: center;
}

.button {
  position: relative;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 10px;
  font-weight: 620;
  line-height: 1;
  cursor: pointer;
  transition: 180ms ease;
}

/* Galaxy-inspired radial edge lighting, reduced to one project accent. */
.button-primary {
  color: #092016;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(102, 230, 166, 0.18);
}

.button-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 24px rgba(102, 230, 166, 0.26);
  transform: translateY(-1px);
}

.button-secondary {
  color: var(--muted);
  border-color: var(--line);
  background:
    radial-gradient(circle 54px at 80% -50%, rgba(255, 255, 255, 0.1), transparent 64%),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.button-secondary:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background-color: rgba(255, 255, 255, 0.06);
}

.button-danger {
  color: var(--danger);
  border-color: rgba(236, 132, 125, 0.22);
  background: var(--danger-soft);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.button-small {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 590;
}

.pause-button {
  min-width: 76px;
}

.login-state {
  margin-top: clamp(15px, 2.3vh, 25px);
  min-height: 69px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(211, 235, 224, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.026);
}

.login-state .semantic-dot {
  margin-top: 4px;
}

.login-state strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
}

.login-button {
  width: 100%;
  margin-top: 10px;
}

.alert-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(211, 235, 224, 0.62);
}

.alert-notify-button {
  width: 100%;
  margin-top: 8px;
}

.login-modal {
  width: min(320px, 88vw);
}

.login-qr {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.login-qr img {
  width: 172px;
  height: 172px;
  object-fit: contain;
  border-radius: 10px;
  background: white;
}

.login-qr-copy h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.login-qr-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.mini-list {
  min-height: 0;
  display: grid;
  gap: 3px;
  overflow: hidden;
}

/* 左栏「最近动态」固定露出 5 行，多出来的在这一块里滚 */
.rail-panel .activity-list {
  height: auto;
  max-height: calc(
    var(--activity-visible) * var(--activity-row)
    + (var(--activity-visible) - 1) * var(--activity-gap)
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: none;
}

.mini-row {
  min-height: 28px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
}

.mini-row span:not(.activity-kind) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-row time {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--subtle);
  font-family: "SFMono-Regular", monospace;
}

.console-main-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(170px, 0.95fr) minmax(150px, 0.78fr);
  grid-template-rows: auto auto;
  gap: 14px 20px;
}

.console-main-top .command-copy {
  grid-column: 1;
  grid-row: 1;
}

.console-main-top .system-core {
  grid-column: 2;
  grid-row: 1 / 3;
}

.console-main-top .hero-stats {
  grid-column: 1;
  grid-row: 2;
}

.console-main-bottom {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.console-main-divider {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 6px 0;
  border-top: 1px solid rgba(211, 235, 224, 0.07);
  border-bottom: 1px solid rgba(211, 235, 224, 0.07);
}

.console-main-divider-title {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 13px;
  font-weight: 590;
}

.console-main-divider .divider-notice {
  flex: 1 0 auto;
  margin-left: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.console-main-divider .divider-notice .notice {
  flex: 0 1 auto;
  min-width: 0;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

/* wxlink 这类短句保持一行；340px 上限会把「次）。」单独挤下去。 */
.console-main-divider .divider-notice .notice.is-single-line {
  flex: 0 0 auto;
  white-space: nowrap;
}

.console-main-divider .heal-notice {
  flex: 0 1 auto;
  font-size: 12px;
  line-height: 1.45;
  color: var(--subtle);
  white-space: nowrap;
}

.console-main-divider .divider-notice:not(:has(.notice:not([hidden]), .heal-notice:not([hidden]))) {
  display: none;
}

.command-updated {
  margin-top: 8px;
  color: var(--subtle);
  font-family: "SFMono-Regular", monospace;
  font-size: 12px;
}

.header-actions .command-updated {
  margin-top: 0;
  white-space: nowrap;
}

.group-panel {
  grid-column: 2 / 4;
  grid-row: 2;
  padding: clamp(13px, 1.2vw, 18px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
}

.notice,
.model-notice {
  padding: 7px 10px;
  border: 1px solid rgba(231, 182, 111, 0.2);
  border-radius: 9px;
  color: var(--warning);
  background: var(--warning-soft);
  font-size: 9px;
  line-height: 1.35;
}

.queue-list,
.group-list {
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.group-list {
  flex: 1 1 0;
}

.queue-list::-webkit-scrollbar,
.group-list::-webkit-scrollbar {
  display: none;
}

.queue-item {
  min-height: 66px;
  padding: 9px 10px;
  border-top: 1px solid rgba(211, 235, 224, 0.07);
}

.queue-item:first-child {
  border-top: 0;
}

.queue-item-top,
.queue-title,
.queue-item-actions,
.queue-meta {
  display: flex;
  align-items: center;
}

.queue-item-top {
  justify-content: space-between;
  gap: 10px;
}

.queue-title,
.queue-item-actions {
  gap: 8px;
  min-width: 0;
}

.queue-item-title {
  overflow: hidden;
  font-size: 10px;
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-reason {
  margin: 5px 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta {
  gap: 9px;
  color: var(--subtle);
  font-size: 8px;
  white-space: nowrap;
}

.queue-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-badge,
.group-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 6px;
  border: 1px solid rgba(231, 182, 111, 0.18);
  border-radius: 6px;
  color: var(--warning);
  background: var(--warning-soft);
  font-size: 8px;
  white-space: nowrap;
}

.group-rule-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--subtle);
  background: var(--surface-soft);
  font-size: 8px;
  white-space: nowrap;
}

.group-rule-badge.is-force {
  border-color: rgba(102, 230, 166, 0.22);
  color: var(--accent);
  background: var(--accent-soft);
}

.queue-badge {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
}

.queue-badge.error {
  color: var(--danger);
  border-color: rgba(236, 132, 125, 0.2);
  background: var(--danger-soft);
}

.queue-empty,
.empty-state {
  min-height: 66px;
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-size: 9px;
}

.empty-state-error {
  color: var(--danger);
}

.group-column {
  container: group-column / inline-size;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 2px;
}

.group-column:first-child {
  padding-right: 14px;
  border-right: 1px solid rgba(211, 235, 224, 0.07);
}

.group-column-head {
  align-items: center;
}

.group-column-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.group-column-head span {
  display: block;
  color: var(--text);
  font-size: 10px;
  font-weight: 590;
}

.group-column-head small {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 8px;
  line-height: 1.45;
  white-space: normal;
}

.group-column-head .button {
  flex: 0 0 auto;
}

.group-panel .button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.group-row {
  padding: 7px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(211, 235, 224, 0.07);
}

.group-row-main,
.group-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.group-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.group-actions .button {
  min-width: 44px;
  box-shadow: none;
}

.group-actions .button-secondary {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.group-actions .button:hover {
  transform: none;
  box-shadow: none;
}

.group-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-badge {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--accent);
  border-color: rgba(102, 230, 166, 0.16);
  background: var(--accent-soft);
  font-size: 11px;
}

.group-badge.is-unbound {
  color: var(--muted);
  border-color: rgba(211, 235, 224, 0.12);
  background: rgba(211, 235, 224, 0.06);
}

/* 群列变窄时：名称省略，打开/加入收成贴名的小按钮，不再整行撑满 */
@container group-column (max-width: 520px) {
  .group-column-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }

  .group-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .group-row-main {
    flex-wrap: nowrap;
    min-width: 0;
  }

  .group-name {
    flex: 0 1 auto;
    min-width: 4ch;
  }

  .group-badge,
  .group-rule-badge {
    flex: 0 0 auto;
    min-height: 0;
    padding: 0 6px;
    font-size: 10px;
  }

  .group-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    width: auto;
  }

  .group-actions .button {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    padding-left: 8px;
    padding-right: 8px;
    box-shadow: none;
  }
}

.auth-card input,
select {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(3, 6, 5, 0.72);
}

.auth-card input {
  padding: 0 11px;
  font-size: 13px;
}

.model-line {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.model-row {
  min-height: 32px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.model-row > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 590;
  white-space: nowrap;
  overflow: hidden;
}

.model-row select {
  font-size: 13px;
}

.model-select {
  position: relative;
  min-width: 0;
}

.model-select-trigger {
  width: 100%;
  min-height: 32px;
  padding: 0 26px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.model-select-trigger:hover {
  border-color: var(--line-strong);
}

.model-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(102, 230, 166, 0.55);
  box-shadow: 0 0 0 3px rgba(102, 230, 166, 0.12);
}

.model-select-trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.model-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-select-trigger-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-select-trigger-price {
  color: rgba(255, 255, 255, 0.28);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-select-trigger svg {
  width: 10px;
  height: 6px;
  flex: 0 0 auto;
  color: var(--accent);
  transition: transform 180ms ease;
}

.model-select-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.model-select-menu {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1310;
  box-shadow: 0 16px 40px rgba(0, 14, 8, 0.5);
}

.model-select-item {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.model-select-item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-select-price {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.28);
  font-size: 11px;
}

.model-select-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.model-select-item.is-selected {
  color: var(--accent);
}

.modal-overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 4, 0.62);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(360px, 88vw);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.modal p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

select {
  width: 100%;
  padding: 0 32px 0 12px;
  font-size: 13px;
  color-scheme: dark;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.035);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2366e6a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

select option {
  color: var(--text);
  background: #0d1310;
}

select:hover {
  border-color: var(--line-strong);
}

select:focus-visible {
  outline: none;
  border-color: rgba(102, 230, 166, 0.55);
  box-shadow: 0 0 0 3px rgba(102, 230, 166, 0.12);
}

.console-footer {
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: var(--subtle);
  font-size: 9px;
}

.error-banner {
  position: absolute;
  z-index: 20;
  top: 80px;
  left: 50%;
  width: min(620px, calc(100% - 40px));
  padding: 10px 14px;
  border: 1px solid rgba(236, 132, 125, 0.28);
  border-radius: 12px;
  color: #ffd3cf;
  background: rgba(54, 19, 18, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  font-size: 10px;
  transform: translateX(-50%);
}

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 11px 14px;
  border: 1px solid rgba(102, 230, 166, 0.24);
  border-radius: 12px;
  color: var(--text);
  background: rgba(16, 27, 21, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  font-size: 10px;
  animation: toast-in 200ms ease-out;
}

.skeleton-box,
.skeleton-row {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
}

.skeleton-box::after,
.skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  transform: translateX(-100%);
  animation: skeleton 1.6s ease-in-out infinite;
}

.skeleton-queue {
  min-height: 66px;
  border-radius: 10px;
}

.auth-gate {
  position: fixed;
  z-index: 25;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 5, 0.78);
  backdrop-filter: blur(20px);
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(102, 230, 166, 0.12), transparent 40%),
    rgba(13, 18, 16, 0.96);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
}

.auth-mark {
  width: 48px;
  border-radius: 15px;
}

.auth-card h1 {
  margin: 4px 0 2px;
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.auth-card > p:not(.eyebrow) {
  margin-bottom: 8px;
}

.auth-card label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.auth-card input {
  min-height: 42px;
  padding: 0 12px;
  font-size: 12px;
}

.auth-submit {
  min-height: 42px;
  margin-top: 8px;
}

.auth-error {
  margin: 2px 0 0 !important;
  color: var(--danger) !important;
}

.viewport-notice {
  display: none;
}

@keyframes slow-spin {
  to { transform: rotate(360deg); }
}

@keyframes status-ping {
  0% { opacity: 0.8; transform: scale(0.7); }
  70%, 100% { opacity: 0; transform: scale(1.5); }
}

@keyframes core-breathe {
  0%, 100% { opacity: 0.7; transform: scale(0.74); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes skeleton {
  to { transform: translateX(100%); }
}

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

@media (max-height: 760px) {
  :root {
    --gap: 9px;
    --radius-panel: 18px;
  }

  .console {
    padding: 10px 14px 8px;
  }

  .console-header {
    min-height: 44px;
  }

  .brand-mark {
    width: 36px;
    border-radius: 12px;
  }

  .brand .eyebrow,
  .privacy-note,
  .core-caption {
    display: none;
  }

  .console-grid {
    grid-template-rows: minmax(0, 1fr) 190px;
  }

  .rail-panel,
  .action-panel,
  .console-main {
    padding: 14px;
  }

  .panel-note {
    margin-bottom: 8px;
  }

  .status-row {
    min-height: 43px;
    padding: 5px 0;
  }

  .status-copy p {
    display: none;
  }

  .rail-divider {
    margin: 8px 0;
  }

  .about-row:nth-child(n+5) {
    display: none;
  }

  .console-main {
    gap: 9px 14px;
  }

  .command-copy h2 {
    font-size: clamp(22px, 2vw, 31px);
  }

  .system-core {
    min-height: 140px;
  }

  .login-state {
    min-height: 58px;
    margin-top: 10px;
    padding: 10px;
  }

  .action-panel .rail-divider {
    margin-top: 10px;
  }

  .queue-item {
    min-height: 56px;
    padding: 7px 9px;
  }

  .queue-meta span:nth-child(n+3) {
    display: none;
  }

  .console-footer {
    min-height: 12px;
    font-size: 8px;
  }
}

@media (max-width: 1120px) {
  .console-grid {
    grid-template-columns: minmax(230px, 0.76fr) minmax(440px, 1.4fr) minmax(255px, 0.84fr);
  }

  .header-account {
    min-width: 155px;
  }

  .status-value,
  .panel-note {
    display: none;
  }
}

/* ===== 平板竖屏（iPad Mini 7 744×1133）：主面板全宽 → 健康/控制各半 → 群面板全宽 ===== */
@media (min-width: 621px) and (max-width: 959px) {
  body {
    min-width: 0;
    overflow: auto;
  }

  .console {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 12px 14px;
  }

  .console-header {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
  }

  .header-account {
    min-width: 0;
  }

  .console-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .console-main {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .rail-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .action-panel {
    grid-column: 2;
    grid-row: 2;
    overflow: visible;
  }

  .group-panel {
    grid-column: 1 / 3;
    grid-row: 3;
  }

  .rail-panel,
  .action-panel,
  .console-main,
  .group-panel {
    padding: 14px;
  }

  /* 圆球保持在主面板右上，适度放大 */
  .console-main-top .system-core .hub-bot {
    width: min(15vw, 132px);
    height: min(15vw, 132px);
  }

  /* 平板双列：名称省略，按钮贴在同一行，不再整行撑满 */
  .group-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .group-row-main {
    flex-wrap: nowrap;
    min-width: 0;
  }

  .group-name {
    flex: 0 1 auto;
    min-width: 4ch;
  }

  .group-badge,
  .group-rule-badge {
    flex: 0 0 auto;
    min-height: 0;
    padding: 0 6px;
    font-size: 10px;
  }

  .group-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    width: auto;
  }

  .group-actions .button {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    padding-left: 8px;
    padding-right: 8px;
    box-shadow: none;
  }

  /* 列表限高内部滚动，防止把整页撑爆 */
  .queue-list {
    max-height: 420px;
  }

  .group-list {
    max-height: 320px;
  }

  .mini-list {
    max-height: 150px;
    overflow-y: auto;
  }

  .button,
  .button-small {
    min-height: 36px;
  }

  .model-select-trigger {
    min-height: 38px;
  }
}

/* 窄屏到窄桌面：模型路由改两行，标签不被 58px 列裁掉，下拉能显示更长名称 */
@media (max-width: 1240px) {
  .model-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 4px;
    align-items: end;
    min-height: 0;
  }

  .model-row > span {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 12px;
    overflow: visible;
  }

  .model-row .model-select {
    grid-column: 1;
    grid-row: 2;
  }

  .model-row > .button {
    grid-column: 2;
    grid-row: 2;
  }

  .model-select-trigger-price {
    display: none;
  }
}

/* 窄桌面（960-1240px，含 iPad Mini 7 横屏走桌面布局时） */
@media (min-width: 960px) and (max-width: 1240px) {
  .button,
  .button-small {
    min-height: 36px;
  }

  .model-select-trigger {
    min-height: 38px;
  }
}

.mobile-strip,
.mobile-nav {
  display: none;
}

/* 手机壳：竖屏 + 横屏矮窗口共用底栏分区，不再把桌面三栏硬拆成一列长页 */
@media (max-width: 620px), (max-width: 959px) and (max-height: 620px) {
  html,
  body {
    height: 100%;
    background: var(--bg);
  }

  body {
    min-width: 0;
    overflow: hidden;
  }

  .ambient {
    display: none;
  }

  .console {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: env(safe-area-inset-top) 0 0;
    background: var(--bg);
    overflow: hidden;
  }

  .mobile-strip,
  .mobile-nav {
    display: flex;
  }

  .console-header {
    flex: 0 0 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 12px 6px;
    background: var(--bg);
  }

  .brand {
    display: none;
  }

  .brand-version,
  .header-actions .command-updated,
  .brand-mark {
    display: none;
  }

  .header-account {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
    max-width: 58vw;
    width: auto;
    padding: 4px 10px 4px 4px;
  }

  .header-account strong,
  .account-copy strong {
    max-width: 28vw;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 6px;
  }

  .icon-button,
  .theme-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .theme-switch {
    padding: 2px;
  }

  .console-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow: hidden;
    background: var(--bg);
  }

  .console-grid > .panel {
    display: none !important;
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-column: auto;
    grid-row: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 12px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
  }

  .console-grid > .panel::before {
    display: none;
  }

  .console-grid > .panel.is-mobile-active.rail-panel,
  .console-grid > .panel.is-mobile-active.action-panel {
    display: flex !important;
  }

  .console-grid > .panel.is-mobile-active.console-main {
    display: grid !important;
    height: 100%;
    max-height: 100%;
  }

  .console-grid > .panel.is-mobile-active.group-panel {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    max-height: 100%;
  }

  .action-panel .pause-button {
    display: none;
  }

  .console-main {
    grid-template-rows: auto auto auto;
    align-content: start;
  }

  .console-main-top {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: stretch;
    gap: 4px 0;
  }

  .console-main-top .command-copy {
    display: none;
  }

  .console-main-top .system-core {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    min-height: 138px;
    place-items: center;
    overflow: visible;
  }

  .console-main-top .system-core .hub-bot {
    width: 138px;
    height: 138px;
  }

  .console-main-top .system-core .core-caption {
    display: none;
  }

  .console-main-top .hero-stats {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero-stat {
    padding: 6px 4px 5px;
  }

  .hero-stat span {
    min-height: 0;
    margin-bottom: 2px;
    white-space: nowrap;
  }

  img.header-avatar:not([src]) {
    color: transparent;
    font-size: 0;
  }

  .console-main-divider {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 6px 0;
  }

  .console-main-tabs,
  .console-tab {
    flex: 0 0 auto;
  }

  .console-tab {
    min-height: 40px;
    padding: 0 12px;
  }

  .console-main-divider .divider-notice {
    width: 100%;
    max-width: none;
    margin-left: 0;
    display: grid;
    gap: 4px;
  }

  .console-main-divider .divider-notice .notice,
  .console-main-divider .divider-notice .notice.is-single-line,
  .console-main-divider .heal-notice {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .console-main-bottom,
  .queue-list,
  .scheduled-list {
    min-height: 0;
    overflow: visible;
  }

  .queue-item-title,
  .queue-reason,
  .queue-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .queue-meta {
    flex-wrap: wrap;
  }

  .queue-item-top,
  .queue-title,
  .queue-item-actions {
    flex-wrap: wrap;
  }

  .group-panel {
    --group-row-slot: 40px;
    --group-list-gap: 0px;
    display: flex !important;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    gap: 18px;
    overflow: hidden;
  }

  .group-column {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    grid-template-rows: none;
    gap: 6px;
    padding: 0;
  }

  .group-column:first-child {
    padding-right: 0;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .group-column-head {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .group-column-head > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .group-column-head small {
    display: none;
  }

  .group-column-head .button,
  html.is-mobile-shell .group-column-head .button {
    width: auto;
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 4px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-weight: 520;
  }

  .group-list {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: var(--group-list-gap);
    min-height: 0;
    max-height: calc(5 * var(--group-row-slot) + 4 * var(--group-list-gap));
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .group-list::-webkit-scrollbar {
    display: block;
    width: 4px;
  }

  .group-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    min-height: var(--group-row-slot);
    padding: 8px 2px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  .group-row:last-child {
    border-bottom: 0;
  }

  .group-badge:not(.is-unbound) {
    display: none;
  }

  .group-row-main {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    min-width: 0;
    width: auto;
    row-gap: 0;
  }

  .group-name {
    flex: 0 1 auto;
    min-width: 4ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .group-badge,
  .group-rule-badge {
    flex: 0 0 auto;
    min-height: 18px;
    padding: 0 6px;
    font-size: 10px;
  }

  .group-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    width: auto;
    gap: 4px;
  }

  html.is-mobile-shell .group-actions .button,
  .group-actions .button {
    flex: 0 0 auto;
    width: auto;
    min-width: auto;
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
    box-shadow: none;
  }

  html.is-mobile-shell .group-actions .button-secondary,
  .group-actions .button-secondary {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
  }

  html.is-mobile-shell .group-actions .button-primary,
  .group-actions .button-primary,
  html.is-mobile-shell .group-actions .button-danger,
  .group-actions .button-danger {
    min-width: 44px;
    padding: 0 10px;
    box-shadow: none;
  }

  html.is-mobile-shell .group-actions .button-primary,
  .group-actions .button-primary {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: transparent;
  }

  .mini-list {
    max-height: none;
    height: auto;
    overflow: visible;
  }

  .rail-panel .activity-list {
    height: auto;
    max-height: calc(
      var(--activity-visible) * var(--activity-row)
      + (var(--activity-visible) - 1) * var(--activity-gap)
    );
    overflow-y: auto;
  }

  .status-value,
  .panel-note {
    display: block !important;
    white-space: normal;
  }

  .login-state {
    margin-top: 8px;
    min-height: 0;
    padding: 10px;
  }

  .login-button,
  .button,
  .button-small,
  .model-select-trigger,
  .model-row select {
    min-height: 36px;
  }

  .privacy-note {
    margin-top: 12px;
  }

  .model-select-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom) + 72px);
    top: auto;
    z-index: 80;
    max-height: min(52dvh, 420px);
  }

  .error-banner {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 12px);
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom) + 76px);
    max-width: none;
  }

  .modal-overlay {
    padding: 16px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
    align-items: end;
  }

  .modal,
  .login-modal {
    width: 100%;
  }

  .viewport-notice {
    display: none !important;
  }
}

.mobile-strip {
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 8px;
  min-height: 0;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
}

.mobile-strip-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-strip-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mobile-strip-copy strong {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  white-space: normal;
}

.mobile-strip-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mobile-pause {
  flex: 0 0 auto;
  align-self: center;
  min-width: 80px;
  min-height: 34px;
}

body[data-mobile-current="groups"] .mobile-strip {
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
}

body[data-mobile-current="groups"] .mobile-strip-copy small {
  display: none;
}

body[data-mobile-current="groups"] .mobile-pause {
  min-width: 72px;
  min-height: 30px;
  box-shadow: none;
}

.mobile-nav {
  position: relative;
  z-index: 8;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: space-around;
  gap: 2px;
  margin: 0;
  padding: 4px 8px calc(env(safe-area-inset-bottom) + 6px);
  border-top: 1px solid var(--line);
  background: var(--bg);
  backdrop-filter: none;
}

.mobile-nav-item {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 42px;
  padding: 3px 2px 2px;
  border: 0;
  border-radius: 10px;
  color: var(--subtle);
  background: transparent;
  font-size: 10px;
  font-weight: 620;
  line-height: 1;
}

.mobile-nav-item svg {
  width: 18px;
  height: 18px;
}

.mobile-nav-item.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.mobile-nav-badge {
  position: absolute;
  top: 3px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  color: #06140d;
  background: var(--warning);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.mobile-nav-badge.is-alert {
  background: var(--danger);
  color: #fff;
}

.model-select-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(3, 5, 4, 0.42);
}

.model-select-backdrop[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body > .model-select-menu {
  position: fixed;
  z-index: 80;
}

:root[data-theme="light"] .mobile-strip,
:root[data-theme="light"] .mobile-nav {
  background: var(--bg);
}

:root[data-theme="light"] .mobile-nav {
  border-top-color: rgba(37, 103, 178, 0.12);
}

:root[data-theme="moon"] .mobile-strip,
:root[data-theme="moon"] .mobile-nav {
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

:root[data-theme="moon"] .mobile-nav {
  border-top-color: rgba(255, 255, 255, 0.1);
}


@media (max-width: 959px) and (max-height: 500px) {
  .console-header {
    display: none;
  }

  .mobile-strip {
    min-height: 40px;
    padding: 5px 6px;
  }

  .console-main-top {
    grid-template-columns: minmax(0, 1fr) 104px;
    grid-template-rows: auto;
    align-items: center;
  }

  .console-main-top .system-core {
    grid-column: 2;
    grid-row: 1;
    min-height: 100px;
  }

  .console-main-top .system-core .hub-bot {
    width: 96px;
    height: 96px;
  }

  .console-main-top .hero-stats {
    grid-column: 1;
    grid-row: 1;
  }

  .command-copy h2 {
    font-size: 16px;
  }
}

@media (max-width: 620px) {
  .header-actions {
    gap: 6px;
  }
}

/* 桌面短窗口：改为整页自适应滚动，废除全屏强制遮罩 */
@media (min-width: 960px) and (max-height: 620px) {
  body {
    min-width: 0;
    overflow: auto;
  }

  .console {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .console-grid {
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .viewport-notice {
    display: none !important;
  }

  html.is-touch body {
    overflow: auto;
  }

  html.is-touch .console {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  html.is-touch .console-grid {
    grid-template-rows: auto auto;
    overflow: visible;
  }

  html.is-touch .group-list {
    max-height: 300px;
  }

  html.is-touch .mini-list {
    max-height: 150px;
    overflow-y: auto;
  }

  html.is-touch .rail-panel .activity-list {
    max-height: calc(
      var(--activity-visible) * var(--activity-row)
      + (var(--activity-visible) - 1) * var(--activity-gap)
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ 可读性放大（2026-08-12）：最小 12.5px，正文 14px ============ */
.core-caption,
.hero-stat span,
.queue-meta,
.queue-badge,
.group-column-head small,
.console-footer,
.status-value,
.about-row code,
.privacy-note,
.mini-row,
.notice,
.queue-reason,
.queue-empty {
  font-size: 12.5px !important;
}

.eyebrow,
.header-account,
.panel-note,
.rail-state,
.status-copy p,
.rail-subhead,
.about-row,
.button,
.queue-item-title,
.group-column-head span,
.error-banner,
.toast,
.login-qr span,
.button-small {
  font-size: 13px !important;
}

.command-copy > p:not(.eyebrow),
.login-qr strong,
.brand-mark,
.header-account strong,
.status-copy strong,
.login-state strong,
.viewport-notice span {
  font-size: 14px !important;
}

.header-avatar,
.clock {
  font-size: 15px !important;
}

/* ============ 当前账号：重新设计（2026-08-12） ============ */
.header-account {
  min-width: 180px;
  justify-content: flex-start;
  gap: 10px;
  padding: 5px 13px 5px 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}
.header-avatar {
  width: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #7df0b5, #2e8c5f);
  color: #04150c;
  box-shadow: 0 4px 14px rgba(50, 193, 122, 0.28);
}
.account-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}
.account-copy small {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.account-copy strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-dot {
  margin-left: auto;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: account-breathe 2.6s ease-in-out infinite;
}
@keyframes account-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
img.header-avatar {
  display: block;
  object-fit: cover;
  font-size: 0;
}

/* ============ 通道中枢：值班小球，颜色跟主题强调色走 ============ */
.system-core .hub-bot {
  width: min(9.2vw, 138px);
  height: min(9.2vw, 138px);
  overflow: visible;
  display: block;
}
.hub-body,
.hub-alert-dot {
  fill: var(--accent);
}
.hub-body {
  transition: fill 600ms ease;
}
.hub-dither,
.hub-moon-craters,
.hub-pixel-moon {
  display: none;
}
.hub-glow {
  fill: var(--accent);
  opacity: 0;
  pointer-events: none;
  filter: blur(20px);
  transition: fill 700ms ease;
}
#hubGlowGrad .hub-glow-stop {
  stop-color: var(--accent);
}
/* iPhone/iPad：WebKit 会把 SVG blur 裁在 viewBox 里，改用径向渐变 */
html.is-touch .hub-glow {
  fill: url(#hubGlowGrad);
  filter: none;
}

html.is-touch[data-theme="moon"] .hub-glow {
  opacity: 0 !important;
  fill: transparent;
}
.hub-shadow {
  fill: rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
}
.hub-eye-shape {
  fill: #fff;
}
.hub-eye-mark {
  fill: none;
  stroke: #fff;
  stroke-width: 3.5;
  stroke-linecap: round;
  opacity: 0;
}
.hub-trail {
  fill: var(--hub-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms cubic-bezier(0.77, 0, 0.175, 1);
}
.hub-trail-far {
  fill: var(--hub-softer);
}
.hub-orbit {
  fill: none;
  stroke: var(--hub-soft);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 90 420;
  opacity: 0;
  transform-origin: 100px 104px;
  transform: rotate(-28deg);
  transition: opacity 140ms cubic-bezier(0.77, 0, 0.175, 1);
}
.hub-alert-dot {
  opacity: 0;
  transition: fill 300ms ease;
}
.hub-particle {
  fill: var(--hub-soft);
  opacity: 0;
  pointer-events: none;
}
.hub-particle.is-offline {
  fill: #8ea1b5;
}
.hub-particle.is-sleep-fragment {
  fill: var(--hub-soft);
  stroke: none;
}
:root[data-theme="light"] .hub-particle.is-sleep-fragment {
  fill: var(--hub-sleep);
}
.hub-sleep-bubble {
  fill: var(--hub-soft);
  stroke: none;
  opacity: 0;
  pointer-events: none;
}
:root[data-theme="light"] .hub-sleep-bubble {
  fill: var(--hub-sleep);
  filter: drop-shadow(0 1px 1.5px rgba(46, 111, 216, 0.16));
}
.hub-pop-ring {
  fill: none;
  stroke: var(--hub-soft);
  stroke-width: 1.4;
  opacity: 0;
  pointer-events: none;
}
:root[data-theme="light"] .hub-pop-ring {
  stroke: var(--hub-sleep);
}
.hub-zzz {
  fill: none;
  stroke: var(--hub-soft);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
:root[data-theme="light"] .hub-zzz {
  stroke: var(--hub-sleep);
  filter: drop-shadow(0 1px 1.5px rgba(46, 111, 216, 0.18));
}
.system-core.is-sleeping .hub-body,
.system-core.is-sleeping .hub-glow {
  fill: var(--hub-sleep);
}
.system-core.is-offline .hub-body,
.system-core.is-offline .hub-alert-dot,
.system-core.is-offline .hub-glow {
  fill: #6b7280;
}
.system-core.is-sleeping .core-halo-one,
.system-core.is-sleeping .core-halo-two {
  opacity: 0.4;
  animation-play-state: paused;
  transition: opacity 1.4s ease;
}
.system-core.is-sleeping .core-halo-one::before,
.system-core.is-sleeping .core-halo-one::after {
  opacity: 0.45;
}
.system-core.burst {
  animation: core-burst-jolt 900ms cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes core-burst-jolt {
  0%, 100% { transform: scale(1); }
  13% { transform: scale(0.96); }
  40% { transform: scale(1.06); }
  72% { transform: scale(0.995); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-trail,
  .hub-orbit,
  .hub-particle {
    display: none !important;
  }
}

/* ============ 消息/定时任务 切换 + 定时任务展示（2026-08-12） ============ */
.console-main-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.console-tab {
  min-height: 32px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.console-tab:hover:not(.is-active) {
  color: var(--text);
  border-color: var(--line-strong);
}
.console-tab.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.scheduled-list {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scheduled-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
}
.scheduled-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scheduled-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}
.scheduled-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 19px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
}
.scheduled-badge.is-enabled {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--accent);
  border-color: rgba(102, 230, 166, 0.16);
  background: var(--accent-soft);
}
.activity-kind {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}
.activity-kind.is-fired {
  color: var(--accent);
}
.activity-kind.is-drain {
  color: var(--warning);
}
.activity-kind.is-auto {
  color: var(--accent);
}

/* iPad Mini 横屏：适度紧凑，并把总览指标放到完整宽度。 */
@media (min-width: 960px) and (max-width: 1240px) and (max-height: 820px) {
  html.is-touch .console {
    padding: 9px 12px 8px;
    gap: 8px;
  }

  html.is-touch .console-grid {
    grid-template-columns: minmax(230px, 0.82fr) minmax(0, 1.5fr) minmax(245px, 0.88fr);
    grid-template-rows: minmax(0, 1fr) 200px;
    gap: 8px;
  }

  html.is-touch .rail-panel,
  html.is-touch .action-panel,
  html.is-touch .console-main {
    padding: 12px;
  }

  html.is-touch .group-panel {
    padding: 10px;
    gap: 10px;
  }

  html.is-touch .rail-panel .panel-heading {
    gap: 8px;
  }

  html.is-touch .rail-state {
    max-width: none;
    font-size: 11px !important;
  }

  html.is-touch .console-main-top {
    grid-template-columns: minmax(0, 1fr) 112px;
    grid-template-rows: auto auto;
    gap: 8px 12px;
  }

  html.is-touch .console-main-top .system-core {
    grid-column: 2;
    grid-row: 1;
    min-height: 112px;
    overflow: visible;
  }

  html.is-touch .console-main-top .system-core .hub-bot {
    width: 88px;
    height: 88px;
  }

  html.is-touch .console-main-top .hero-stats {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  html.is-touch .hero-stat {
    padding: 6px 8px;
  }

  html.is-touch .hero-stat span {
    min-height: 1.45em;
    font-size: 11.5px !important;
    white-space: nowrap;
  }

  html.is-touch .command-copy h2 {
    font-size: 22px;
  }

  html.is-touch .command-copy > p:not(.eyebrow) {
    font-size: 12px !important;
  }

  html.is-touch .button,
  html.is-touch .button-small {
    min-height: 32px;
    font-size: 12px !important;
  }

  html.is-touch .group-actions .button-small {
    min-width: 44px;
    min-height: 26px;
    padding: 0 7px;
    box-shadow: none;
  }

  html.is-touch .model-select-trigger {
    min-height: 34px;
  }

  html.is-touch .group-row {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  html.is-touch .group-name {
    font-size: 12px;
  }
}

/* ============ 显示模式：右上角图标切换 ============ */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.theme-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

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

.theme-button:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.theme-button:active {
  transform: scale(0.94);
}

.theme-button.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 3px 10px var(--accent-glow);
}

.theme-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ============ 白天模式：球体蓝 + 清透蓝白 ============ */
:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 78% -14%, rgba(61, 155, 255, 0.18), transparent 36%),
    radial-gradient(circle at 8% 108%, rgba(117, 181, 255, 0.16), transparent 38%),
    linear-gradient(145deg, #f8fbff 0%, #eef5ff 58%, #f5f9ff 100%);
}

:root[data-theme="light"] .ambient-grid {
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(61, 155, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 155, 255, 0.08) 1px, transparent 1px);
}

:root[data-theme="light"] .ambient-orbit {
  border-color: rgba(61, 155, 255, 0.12);
}

:root[data-theme="light"] .brand-mark {
  border-color: rgba(61, 155, 255, 0.28);
  color: #287fdc;
  background: radial-gradient(circle at 68% 16%, #ffffff, rgba(61, 155, 255, 0.13) 52%, rgba(61, 155, 255, 0.06));
  box-shadow: 0 10px 26px rgba(61, 155, 255, 0.14), inset 0 1px 0 #ffffff;
  animation: none;
}

:root[data-theme="light"] .header-account,
:root[data-theme="light"] .theme-switch,
:root[data-theme="light"] .icon-button {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 24px rgba(54, 104, 164, 0.08), inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .panel {
  background:
    radial-gradient(circle at 94% 0%, rgba(61, 155, 255, 0.08), transparent 35%),
    linear-gradient(145deg, #ffffff, #f7fbff);
}

:root[data-theme="light"] .panel::before {
  box-shadow: inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .console-main {
  background:
    radial-gradient(circle at 69% 45%, rgba(61, 155, 255, 0.14), transparent 28%),
    radial-gradient(circle at 12% 100%, rgba(61, 155, 255, 0.06), transparent 40%),
    linear-gradient(145deg, #ffffff, #f4f9ff);
}

:root[data-theme="light"] .console-main::after {
  background: linear-gradient(115deg, transparent 43%, rgba(61, 155, 255, 0.045) 43.2%, transparent 43.5%);
}

:root[data-theme="light"] .console-main[data-level="ok"] {
  border-color: rgba(61, 155, 255, 0.24);
}

:root[data-theme="light"] .pulse-dot.ok::after {
  border-color: rgba(61, 155, 255, 0.42);
}

:root[data-theme="light"] .status-row,
:root[data-theme="light"] .queue-item,
:root[data-theme="light"] .group-row {
  border-color: rgba(37, 103, 178, 0.1);
}

:root[data-theme="light"] .hero-stats,
:root[data-theme="light"] .login-state {
  border-color: rgba(37, 103, 178, 0.12);
  background: rgba(61, 155, 255, 0.045);
}

:root[data-theme="light"] .alert-note {
  color: rgba(32, 58, 92, 0.62);
}

:root[data-theme="light"] .hero-stat,
:root[data-theme="light"] .console-main-divider,
:root[data-theme="light"] .group-column:first-child {
  border-color: rgba(37, 103, 178, 0.1);
}

:root[data-theme="light"] .button-primary,
:root[data-theme="light"] .console-tab.is-active {
  color: #ffffff;
  box-shadow: 0 7px 20px rgba(61, 155, 255, 0.22);
}

:root[data-theme="light"] .button-primary:hover {
  box-shadow: 0 9px 26px rgba(61, 155, 255, 0.28);
}

:root[data-theme="light"] .group-actions .button,
:root[data-theme="light"] .group-actions .button-primary,
:root[data-theme="light"] .group-actions .button-primary:hover {
  box-shadow: none;
}

:root[data-theme="light"] .group-actions .button-secondary {
  color: var(--text);
  border-color: rgba(37, 103, 178, 0.22);
  background: rgba(255, 255, 255, 0.88);
}

:root[data-theme="light"] .button-secondary,
:root[data-theme="light"] .group-panel .button-secondary,
:root[data-theme="light"] .model-select-trigger,
:root[data-theme="light"] .auth-card input,
:root[data-theme="light"] select {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.82);
  background-image: none;
  box-shadow: inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .button-secondary:hover,
:root[data-theme="light"] .model-select-item:hover {
  background-color: rgba(61, 155, 255, 0.09);
}

:root[data-theme="light"] .model-select-trigger:focus-visible,
:root[data-theme="light"] select:focus-visible {
  border-color: rgba(61, 155, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(61, 155, 255, 0.13);
}

:root[data-theme="light"] .model-select-trigger-price,
:root[data-theme="light"] .model-select-price {
  color: var(--subtle);
}

:root[data-theme="light"] .model-select-menu,
:root[data-theme="light"] select option {
  color: var(--text);
  background: #ffffff;
}

:root[data-theme="light"] .model-select-menu {
  box-shadow: 0 16px 40px rgba(48, 91, 145, 0.16);
}

:root[data-theme="light"] .modal-overlay {
  background: rgba(52, 82, 119, 0.25);
}

:root[data-theme="light"] .error-banner {
  color: #8f3037;
  background: rgba(255, 247, 247, 0.96);
  box-shadow: 0 18px 48px rgba(111, 55, 61, 0.14);
}

:root[data-theme="light"] .toast {
  border-color: rgba(61, 155, 255, 0.22);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 50px rgba(48, 91, 145, 0.16);
}

:root[data-theme="light"] .skeleton-box,
:root[data-theme="light"] .skeleton-row {
  background: rgba(61, 155, 255, 0.06);
}

:root[data-theme="light"] .skeleton-box::after,
:root[data-theme="light"] .skeleton-row::after {
  background: linear-gradient(90deg, transparent, rgba(61, 155, 255, 0.09), transparent);
}

:root[data-theme="light"] .auth-gate {
  background: rgba(237, 244, 255, 0.78);
}

:root[data-theme="light"] .auth-card {
  background:
    radial-gradient(circle at 100% 0, rgba(61, 155, 255, 0.13), transparent 42%),
    rgba(255, 255, 255, 0.97);
  box-shadow: 0 30px 100px rgba(48, 91, 145, 0.2);
}

:root[data-theme="light"] .header-avatar {
  background: linear-gradient(135deg, #82c5ff, #3d9bff);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(61, 155, 255, 0.24);
}

:root[data-theme="light"] .icon-button:hover,
:root[data-theme="light"] .group-rule-badge.is-force,
:root[data-theme="light"] .group-badge,
:root[data-theme="light"] .scheduled-badge.is-enabled {
  border-color: rgba(61, 155, 255, 0.24);
}

/* ============ 月相模式：Fusion Pixel + 抖动月面 + 透明面板 ============ */
:root[data-theme="moon"],
:root[data-theme="moon"] body,
:root[data-theme="moon"] button,
:root[data-theme="moon"] input,
:root[data-theme="moon"] select {
  font-family: var(--font-pixel);
  letter-spacing: 0;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:root[data-theme="moon"] .brand-version,
:root[data-theme="moon"] .panel-note,
:root[data-theme="moon"] .status-value,
:root[data-theme="moon"] .about-row code,
:root[data-theme="moon"] .rail-clock strong,
:root[data-theme="moon"] .hero-stat strong,
:root[data-theme="moon"] .mini-row time,
:root[data-theme="moon"] .command-updated,
:root[data-theme="moon"] .clock {
  font-family: inherit;
}

:root[data-theme="moon"] html,
:root[data-theme="moon"] body {
  background: #121212;
}

:root[data-theme="moon"] body {
  background: #121212;
}

:root[data-theme="moon"] .ambient-orbit,
:root[data-theme="moon"] .ambient-grid {
  display: none;
}

:root[data-theme="moon"] .ambient-nebula,
:root[data-theme="moon"] .ambient-stars,
:root[data-theme="moon"] .ambient-stars::before,
:root[data-theme="moon"] .ambient-stars::after {
  display: none;
}

:root[data-theme="moon"] .ambient,
:root[data-theme="moon"] .ambient-nebula,
:root[data-theme="moon"] .ambient-stars,
:root[data-theme="moon"] .ambient-galaxy {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100vw;
  min-height: 100%;
  min-height: 100lvh;
}

:root[data-theme="moon"] .ambient-galaxy {
  display: block;
  pointer-events: none;
  image-rendering: pixelated;
}

:root[data-theme="moon"] .button,
:root[data-theme="moon"] .button-primary,
:root[data-theme="moon"] .button-secondary,
:root[data-theme="moon"] .button-danger,
:root[data-theme="moon"] .button-small {
  border-radius: var(--radius-control);
}

:root[data-theme="moon"] .hub-dither,
:root[data-theme="moon"] .hub-moon-craters,
:root[data-theme="moon"] .hub-pixel-moon {
  display: none;
}

:root[data-theme="moon"] .hub-body,
:root[data-theme="moon"] .hub-alert-dot {
  fill: #9a9a9a;
}

:root[data-theme="moon"] .hub-glow {
  fill: #9a9a9a;
}

:root[data-theme="moon"] #hubGlowGrad .hub-glow-stop {
  stop-color: #9a9a9a;
}

:root[data-theme="moon"] #hubFace {
  display: block;
}

:root[data-theme="moon"] .hub-moon-live {
  animation: none;
}

:root[data-theme="moon"] .hub-eye-shape {
  fill: #fff;
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme="moon"] .ambient-nebula,
  :root[data-theme="moon"] .ambient-stars,
  :root[data-theme="moon"] .ambient-stars::after,
  :root[data-theme="moon"] .brand-mark {
    animation: none;
  }
}

:root[data-theme="moon"] .skip-link:focus {
  color: #000000;
}

:root[data-theme="moon"] .brand-mark {
  border-color: rgba(255, 255, 255, 0.34);
  color: #f2f2f2;
  background: radial-gradient(circle at 68% 16%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06) 45%, rgba(0, 0, 0, 0.82));
  animation: moon-brand-breathe 3.8s ease-in-out infinite;
}

@keyframes moon-brand-breathe {
  0%, 100% {
    box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.04), 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 8px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.08), 0 12px 34px rgba(0, 0, 0, 0.28), 0 0 24px rgba(255, 255, 255, 0.28);
  }
}

:root[data-theme="moon"] .header-account,
:root[data-theme="moon"] .theme-switch,
:root[data-theme="moon"] .icon-button {
  background: rgba(12, 12, 12, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="moon"] .panel,
:root[data-theme="moon"] .group-panel,
:root[data-theme="moon"] .console-main {
  background: transparent;
  box-shadow: none;
}

:root[data-theme="moon"] .panel::before {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="moon"] .console-main::after {
  background: linear-gradient(115deg, transparent 43%, rgba(255, 255, 255, 0.04) 43.2%, transparent 43.5%);
}

:root[data-theme="moon"] .core-halo-one {
  border-color: rgba(255, 255, 255, 0.22);
}

:root[data-theme="moon"] .core-halo-two {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.04);
}

:root[data-theme="moon"] .console-main[data-level="ok"] {
  border-color: rgba(255, 255, 255, 0.22);
}

:root[data-theme="moon"] .account-dot,
:root[data-theme="moon"] .pulse-dot.ok,
:root[data-theme="moon"] .semantic-dot.ok {
  background: #3d9bff;
  box-shadow: 0 0 0 3px rgba(61, 155, 255, 0.12), 0 0 14px rgba(61, 155, 255, 0.25);
}

:root[data-theme="moon"] .account-dot {
  box-shadow: 0 0 8px rgba(61, 155, 255, 0.25);
}

:root[data-theme="moon"] .pulse-dot.ok::after {
  border-color: rgba(61, 155, 255, 0.42);
}

:root[data-theme="moon"] .status-row,
:root[data-theme="moon"] .queue-item,
:root[data-theme="moon"] .group-row {
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="moon"] .hero-stats,
:root[data-theme="moon"] .login-state {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 12, 0.16);
}

:root[data-theme="moon"] .hero-stat,
:root[data-theme="moon"] .console-main-divider,
:root[data-theme="moon"] .group-column:first-child {
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="moon"] .button-primary,
:root[data-theme="moon"] .console-tab.is-active {
  color: #000000;
  box-shadow: 0 7px 20px rgba(255, 255, 255, 0.12);
}

:root[data-theme="moon"] .button-primary:hover {
  box-shadow: 0 9px 26px rgba(255, 255, 255, 0.18);
}

:root[data-theme="moon"] .group-actions .button,
:root[data-theme="moon"] .group-actions .button-primary,
:root[data-theme="moon"] .group-actions .button-primary:hover {
  box-shadow: none;
}

:root[data-theme="moon"] .button-secondary,
:root[data-theme="moon"] .group-panel .button-secondary,
:root[data-theme="moon"] .model-select-trigger,
:root[data-theme="moon"] .auth-card input,
:root[data-theme="moon"] select {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.04);
  background-image: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme="moon"] .button-secondary:hover,
:root[data-theme="moon"] .model-select-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="moon"] .model-select-trigger:focus-visible,
:root[data-theme="moon"] select:focus-visible {
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.13);
}

:root[data-theme="moon"] .model-select-menu,
:root[data-theme="moon"] select option {
  color: var(--text);
  background: rgba(18, 18, 18, 0.92);
}

:root[data-theme="moon"] .model-select-menu {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

:root[data-theme="moon"] .modal-overlay {
  background: rgba(0, 0, 0, 0.62);
}

:root[data-theme="moon"] .hero-stats,
:root[data-theme="moon"] .hero-stat,
:root[data-theme="moon"] .button,
:root[data-theme="moon"] .command-copy h2,
:root[data-theme="moon"] .brand h1 {
  overflow: visible;
}

:root[data-theme="moon"] .hero-stat span {
  min-height: 32px;
  color: #c8c8c8;
}

:root[data-theme="moon"] .queue-reason,
:root[data-theme="moon"] .alert-note,
:root[data-theme="moon"] .heal-notice,
:root[data-theme="moon"] .notice,
:root[data-theme="moon"] .model-notice {
  overflow: visible;
  color: #e8e0e0;
  white-space: normal;
  text-overflow: unset;
}

:root[data-theme="moon"] .error-banner {
  color: #ffd8d4;
  background: #2a1416;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

:root[data-theme="moon"] .toast {
  border-color: rgba(255, 255, 255, 0.22);
  background: #161616;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

:root[data-theme="moon"] .skeleton-box,
:root[data-theme="moon"] .skeleton-row {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="moon"] .skeleton-box::after,
:root[data-theme="moon"] .skeleton-row::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

:root[data-theme="moon"] .auth-gate {
  background: rgba(0, 0, 0, 0.78);
}

:root[data-theme="moon"] .auth-card {
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.1), transparent 42%),
    rgba(12, 12, 12, 0.42);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
}

:root[data-theme="moon"] .header-avatar {
  background: linear-gradient(135deg, #ffffff, #d8d8d8);
  color: #000000;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.16);
}

:root[data-theme="moon"] .icon-button:hover,
:root[data-theme="moon"] .group-rule-badge.is-force,
:root[data-theme="moon"] .group-badge,
:root[data-theme="moon"] .scheduled-badge.is-enabled {
  border-color: rgba(255, 255, 255, 0.24);
}

:root[data-theme="moon"] .hub-sleep-bubble,
:root[data-theme="moon"] .hub-particle.is-sleep-fragment {
  fill: var(--hub-sleep);
}

:root[data-theme="moon"] .hub-pop-ring,
:root[data-theme="moon"] .hub-zzz {
  stroke: var(--hub-sleep);
}

:root[data-theme="moon"] .mobile-nav-badge {
  color: #000000;
}

/* 移动端覆盖后置的桌面规则（账号条最小宽度、字号 !important） */
@media (max-width: 620px), (max-width: 959px) and (max-height: 620px) {
  :root[data-theme="light"] {
    --bg: #f2f3f5;
    --bg-deep: #eceef1;
    --surface-soft: rgba(16, 24, 40, 0.04);
    --line: rgba(16, 24, 40, 0.1);
    --line-strong: rgba(16, 24, 40, 0.18);
    --text: #1c2430;
    --muted: #5a6573;
    --subtle: #7b8694;
  }

  .console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
  }

  .brand {
    display: none !important;
  }

  .header-account {
    min-width: 0;
    max-width: 58vw;
    width: auto;
    min-height: 40px;
    padding: 3px 8px 3px 3px;
  }

  .header-account strong,
  .account-copy strong {
    max-width: 28vw;
  }

  .account-copy small {
    display: none;
  }

  img.header-avatar,
  img.header-avatar:not([src]) {
    width: 28px;
    height: 28px;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    text-indent: -999px;
  }

  .header-actions .icon-button,
  .theme-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .button,
  .button-small {
    font-size: 12px !important;
  }

  .hero-stat span,
  .queue-meta,
  .queue-reason,
  .group-column-head small,
  .privacy-note,
  .notice,
  .panel-note,
  .rail-subhead,
  .about-row,
  .status-copy p,
  .mini-row {
    font-size: 11px !important;
  }

  .mobile-strip-copy strong,
  .login-state strong,
  .status-copy strong,
  .queue-item-title,
  .group-column-head span,
  .command-copy > p:not(.eyebrow) {
    font-size: 13px !important;
  }

  .model-select-trigger,
  .model-select-item {
    font-size: 13px !important;
  }

  .mobile-nav-item {
    font-size: 10px !important;
  }

  .hero-stat strong {
    font-size: 15px;
  }

  .action-topline h2,
  .rail-panel .panel-heading h2 {
    font-size: 16px;
  }

  html.is-mobile-shell .console-grid > .panel.is-mobile-active.group-panel,
  .console-grid > .panel.is-mobile-active.group-panel {
    display: flex !important;
    flex-direction: column;
  }

  html.is-mobile-shell .group-column,
  .group-column {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    height: auto;
  }

  html.is-mobile-shell .group-list,
  .group-list {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: calc(5 * var(--group-row-slot, 44px) + 4 * var(--group-list-gap, 6px));
    overflow-y: auto;
  }

  html.is-mobile-shell .group-row,
  .group-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: auto;
  }

  .queue-empty,
  .empty-state {
    min-height: 72px;
  }

  .rail-panel .activity-list,
  html.is-mobile-shell .rail-panel .activity-list {
    height: auto;
    max-height: calc(
      var(--activity-visible) * var(--activity-row)
      + (var(--activity-visible) - 1) * var(--activity-gap)
    );
    overflow-y: auto;
  }

  .console-main-top .system-core {
    display: grid !important;
    grid-column: 1;
    grid-row: 1;
    min-height: 138px;
  }

  .console-main-top .system-core .hub-bot {
    width: 138px;
    height: 138px;
  }

  html.is-mobile-shell .heal-notice {
    display: none !important;
  }

  .header-account,
  .theme-switch,
  .icon-button {
    box-shadow: none;
  }

  .ambient {
    display: none !important;
  }

  :root[data-theme="moon"] .ambient,
  :root[data-theme="moon"] .ambient-galaxy {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    min-width: 100vw;
    min-height: 100lvh;
  }

  :root[data-theme="moon"] .ambient-nebula,
  :root[data-theme="moon"] .ambient-stars {
    display: none !important;
  }

  .console-grid > .panel.is-mobile-active.console-main,
  .console-grid > .panel.is-mobile-active.group-panel,
  .console-grid > .panel.is-mobile-active.rail-panel,
  .console-grid > .panel.is-mobile-active.action-panel {
    height: 100% !important;
    max-height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
  }

  :root[data-theme="moon"] .console-grid > .panel.is-mobile-active.console-main,
  :root[data-theme="moon"] .console-grid > .panel.is-mobile-active.group-panel,
  :root[data-theme="moon"] .console-grid > .panel.is-mobile-active.rail-panel,
  :root[data-theme="moon"] .console-grid > .panel.is-mobile-active.action-panel {
    background: transparent;
  }

  .console-main::after,
  .panel::before {
    display: none;
  }

  html,
  body,
  :root[data-theme="light"] body,
  :root[data-theme="light"] .console,
  :root[data-theme="light"] .console-header,
  :root[data-theme="light"] .console-grid,
  :root[data-theme="light"] .console-grid > .panel,
  :root[data-theme="light"] .console-main,
  :root[data-theme="light"] .mobile-strip,
  :root[data-theme="light"] .mobile-nav {
    background: var(--bg);
  }

  :root[data-theme="light"] .header-account,
  :root[data-theme="light"] .theme-switch,
  :root[data-theme="light"] .icon-button {
    background: color-mix(in srgb, #ffffff 72%, transparent);
    box-shadow: none;
  }

  :root[data-theme="moon"] .header-account,
  :root[data-theme="moon"] .theme-switch,
  :root[data-theme="moon"] .icon-button {
    background: rgba(12, 12, 12, 0.16);
    box-shadow: none;
  }

  :root[data-theme="moon"],
  :root[data-theme="moon"] body {
    background: #121212;
  }

  :root[data-theme="moon"] .console {
    background: linear-gradient(
      to bottom,
      var(--bg) 0,
      var(--bg) env(safe-area-inset-top),
      transparent env(safe-area-inset-top)
    );
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  :root[data-theme="moon"] .console-grid,
  :root[data-theme="moon"] .console-grid > .panel.is-mobile-active.console-main,
  :root[data-theme="moon"] .console-grid > .panel.is-mobile-active.group-panel,
  :root[data-theme="moon"] .console-grid > .panel.is-mobile-active.rail-panel,
  :root[data-theme="moon"] .console-grid > .panel.is-mobile-active.action-panel,
  :root[data-theme="moon"] .console-main,
  :root[data-theme="moon"] .console-grid > .panel {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  :root[data-theme="moon"] .console-header,
  :root[data-theme="moon"] .mobile-strip,
  :root[data-theme="moon"] .mobile-nav {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-color: rgba(255, 255, 255, 0.1);
  }

  :root[data-theme="moon"] .mobile-nav-item.is-active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }

  :root[data-theme="light"] .group-row {
    background: transparent;
    border-bottom-color: rgba(16, 24, 40, 0.08);
  }

  :root[data-theme="light"] .group-column-head .button,
  .group-column-head .button {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
  }

  :root[data-theme="light"] .group-actions .button-secondary {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--muted);
  }

  :root[data-theme="light"] .group-actions .button-primary,
  html.is-mobile-shell .group-actions .button-primary {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: transparent;
    box-shadow: none;
  }

  :root[data-theme="light"] .group-actions .button-danger {
    box-shadow: none;
  }

}

@media (max-width: 959px) and (max-height: 500px) {
  .console-main-top {
    grid-template-columns: minmax(0, 1fr) 104px;
    grid-template-rows: auto;
    align-items: center;
  }

  .console-main-top .system-core {
    grid-column: 2;
    grid-row: 1;
    min-height: 100px;
  }

  .console-main-top .system-core .hub-bot {
    width: 96px;
    height: 96px;
  }

  .console-main-top .hero-stats {
    grid-column: 1;
    grid-row: 1;
  }
}

/* ============ 2026-09 体验优化：模型搜索、分类过滤与群操作 ============ */
.model-menu-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 6px 8px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

:root[data-theme="light"] .model-menu-header {
  background: #ffffff;
}

:root[data-theme="moon"] .model-menu-header {
  background: rgba(18, 18, 18, 0.96);
}

.model-search-wrap {
  margin-bottom: 6px;
}

.model-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.model-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.model-vendor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.model-vendor-tab {
  padding: 2px 7px;
  font-size: 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.model-vendor-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.model-vendor-tab.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.model-menu-list {
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.model-select-empty {
  padding: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* 群面板搜索与操作 */
.group-head-actions {
  flex: 0 0 auto !important;
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.group-search-wrap {
  flex: 0 0 auto;
  padding: 0 0 4px 0;
}

.group-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.group-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

button.group-rule-badge {
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

button.group-rule-badge:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

button.group-rule-badge:active {
  transform: translateY(0);
}

/* 微信视窗按钮 */
.action-topline-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.vnc-button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
}

/* 手动加群弹窗 */
.modal-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 12px;
  line-height: 1.5;
}

.manual-add-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  text-align: left;
}

.manual-add-form label {
  font-size: 11px;
  color: var(--muted);
}

.manual-input {
  width: 100%;
  box-sizing: border-box;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  outline: none;
}

.manual-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* 队列异常快速清理栏 */
.queue-bad-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: var(--danger-soft);
  border: 1px solid rgba(235, 87, 87, 0.25);
  border-radius: var(--radius-control);
  font-size: 11px;
  color: var(--danger);
}

/* ---------- 模型用量卡片（方案一：星轨双环 + Gemini 星芒） ---------- */
.model-quota-card {
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.model-quota-card:hover {
  border-color: var(--line-strong);
}

.quota-visual {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.quota-orbital-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.quota-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
}

:root[data-theme="light"] .quota-track {
  stroke: #d0d7de;
}

.quota-arc {
  fill: none;
  stroke-width: 3.8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 38px 38px;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.quota-star {
  fill: #50c4f8;
  animation: quotaStarPulse 3.5s ease-in-out infinite alternate;
  transform-origin: 38px 38px;
}

:root[data-theme="moon"] .quota-star {
  fill: #82c5ff;
}

@keyframes quotaStarPulse {
  0% {
    transform: scale(0.9) rotate(-6deg);
    opacity: 0.85;
    filter: drop-shadow(0 0 3px rgba(80, 196, 248, 0.3));
  }
  100% {
    transform: scale(1.08) rotate(6deg);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(80, 196, 248, 0.7));
  }
}

.quota-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.quota-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  font-size: 9.5px;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.quota-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38ef7d;
  box-shadow: 0 0 6px rgba(56, 239, 125, 0.7);
}

.quota-dot.is-warning {
  background: #e7b66f;
  box-shadow: 0 0 6px rgba(231, 182, 111, 0.7);
}

.quota-dot.is-danger {
  background: #ec847d;
  box-shadow: 0 0 6px rgba(236, 132, 125, 0.7);
}

.quota-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 9px;
  color: var(--subtle);
  line-height: 1.1;
  white-space: nowrap;
}

.stat-val {
  font-size: 15px;
  font-weight: 650;
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.stat-val small {
  font-size: 10px;
  font-weight: normal;
  color: var(--muted);
  margin-left: 1px;
}

.stat-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  flex-shrink: 0;
}

.quota-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 9.5px;
  color: var(--subtle);
  margin-top: 1px;
}

.quota-reset-tip {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quota-detail-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 9.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.quota-detail-toggle:hover {
  opacity: 0.8;
}

/* 账号明细抽屉 */
.quota-drawer {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
  /* 兜底：无论外层怎么压缩，行内容都不许越过卡片底边/圆角 */
  overflow: hidden;
}

:root[data-theme="light"] .model-quota-card {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(37, 103, 178, 0.18);
  box-shadow: 0 4px 16px rgba(48, 91, 145, 0.08);
}

:root[data-theme="light"] .quota-drawer {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(37, 103, 178, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .quota-badge {
  background: rgba(37, 103, 178, 0.06);
  border-color: rgba(37, 103, 178, 0.14);
}

.quota-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  /* 上限兜底；实际高度由 JS 按整行折算，保证底边不出现半个账号 */
  max-height: 152px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y proximity;
  padding-right: 5px;
}

.quota-drawer-list::-webkit-scrollbar {
  width: 4px;
}

.quota-drawer-list::-webkit-scrollbar-track {
  background: transparent;
}

.quota-drawer-list::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 2px;
}

.quota-drawer-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.quota-account-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 5px;
  scroll-snap-align: start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

:root[data-theme="light"] .quota-account-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.quota-account-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.quota-account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
}

.quota-acc-name {
  color: var(--text);
  font-weight: 500;
  font-family: "SFMono-Regular", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.quota-acc-tag {
  font-size: 8.5px;
  padding: 1px 4px;
  border-radius: 4px;
}

.quota-acc-tag.tag-active {
  color: #38ef7d;
  background: rgba(56, 239, 125, 0.12);
}

.quota-acc-tag.tag-cooling {
  color: #e7b66f;
  background: rgba(231, 182, 111, 0.12);
}

.quota-acc-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quota-mini-bar-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  color: var(--subtle);
}

.quota-mini-bar-wrap span:first-child {
  flex: 0 0 16px;
  color: var(--subtle);
  font-size: 8.5px;
}

.quota-mini-bar-wrap span:last-child {
  flex: 0 0 28px;
  text-align: right;
  font-family: "SFMono-Regular", "Roboto Mono", monospace;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 8.5px;
}

.quota-mini-bar {
  flex: 1 1 auto;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
}

:root[data-theme="light"] .quota-mini-bar {
  background: #d8dee4;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.quota-mini-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease, background 0.3s ease;
}

.fill-5h {
  background: linear-gradient(90deg, #00c6ff, #0072ff);
}

.fill-weekly {
  background: linear-gradient(90deg, #11998e, #38ef7d);
}

.fill-warning {
  background: linear-gradient(90deg, #f7b733, #fc4a1a) !important;
}

.fill-depleted {
  background: #8492a6 !important;
  opacity: 0.5;
}

/* 页面 CSP 为 style-src 'self'，行内 style 属性一律失效；需要样式就写进样式表。 */
label[for="manualGroupUid"] {
  margin-top: 6px;
}


