/* ==========================================================================
   Luna 主题 · 控制台外壳
   目标：把控制台的骨架做成 Pterodactyl + Luna 主题的原样布局
   —— 260px 左侧栏（服务器列表 + 实例导航）、右侧 1200px 内容区、
      页头「服务器名 + 状态」、终端卡片、四张统计卡、图表卡片。
   只接管外壳；文件/整合包等内页沿用 page-console.css 的组件。
   ========================================================================== */

html.luna {
  /* Cloud Crisp 亮色默认值（与官网浅蓝白视觉统一） */
  --color-primary: #2563eb;
  --color-secondary: #1d4ed8;
  --color-neutral: #e2e8f0;
  --color-base: #0f172a;
  --color-muted: #64748b;
  --color-inverted: #0f172a;
  --color-background: #f4f7fc;
  --color-background-secondary: #ffffff;
  --lu-radius: 14px;
  --lu-side-w: 260px;
}

html.luna[data-theme="light"] {
  --color-primary: #2563eb;
  --color-secondary: #1d4ed8;
  --color-neutral: #e2e8f0;
  --color-base: #0f172a;
  --color-muted: #64748b;
  --color-inverted: #0f172a;
  --color-background: #f4f7fc;
  --color-background-secondary: #ffffff;
}

html.luna[data-theme="dark"] {
  --color-primary: #3b82f6;
  --color-secondary: #60a5fa;
  --color-neutral: rgba(148, 163, 184, 0.18);
  --color-base: #f1f5f9;
  --color-muted: #94a3b8;
  --color-inverted: #cbd5e1;
  --color-background: #0b1120;
  --color-background-secondary: #131e35;
}

html.luna body {
  background: var(--color-background);
  color: var(--color-base);
}

/* 控制台页面铺满，不要再套站点的居中容器 */
html.luna .p-console-main {
  padding: 0;
  max-width: none;
  width: 100%;
  background: var(--color-background);
}

html.luna .p-console-main > .p-auth,
html.luna .p-console-main > .p-console-boot {
  padding: 28px 22px 40px;
}

/* ---------- 整体骨架 ---------- */
.lu-app {
  display: flex;
  align-items: stretch;
  /* 顶部固定导航占位 */
  padding-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  background: var(--color-background);
  color: var(--color-base);
  font-family: var(--font-sans);
}

/* ---------- 左侧栏 ---------- */
.lu-side {
  position: sticky;
  top: var(--header-h);
  flex: 0 0 var(--lu-side-w);
  width: var(--lu-side-w);
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  background: var(--color-background-secondary);
  border-right: 1px solid var(--color-neutral);
  z-index: 20;
}

.lu-side-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 0 8px;
  scrollbar-width: thin;
}

.lu-side-sect + .lu-side-sect {
  margin-top: 14px;
}

.lu-side-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.lu-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-neutral);
  color: var(--color-base);
  font-size: 11px;
  letter-spacing: 0;
}

/* 服务器列表项：Luna 侧栏条目的形态（左侧 4px 竖条 + 右侧圆角） */
.lu-side .p-console-side-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 0 0;
}

.lu-side .p-srv {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px 8px 12px;
  border: 1px solid transparent;
  border-left: 4px solid transparent;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--color-base);
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.lu-side .p-srv:hover {
  background: color-mix(in srgb, var(--color-base) 5%, transparent);
}

.lu-side .p-srv.is-active {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border-left-color: var(--color-primary);
  color: var(--color-base);
}
html[data-theme="dark"] .lu-side .p-srv.is-active {
  background: color-mix(in srgb, var(--color-primary) 24%, transparent);
  color: #ffffff;
}
.lu-side .p-console-side-list:empty {
  display: none;
}
.lu-side-sect:has(.p-console-side-list:empty) {
  padding-bottom: 0;
}

/* 当前实例只有一个、也点不动：鼠标别给「可以点」的暗示 */
.lu-side .p-srv[aria-current="true"],
.lu-side .p-srv[aria-current="true"]:hover {
  cursor: default;
}

.lu-side .p-srv-dot {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--color-neutral);
}

.lu-side .p-gamedot {
  width: 14px;
  height: 14px;
}

.lu-side .p-srv-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.lu-side .p-srv-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lu-side .p-srv-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lu-side .p-srv-exp {
  margin-left: auto;
  font-size: 10px;
  color: var(--color-muted);
  white-space: nowrap;
}

.lu-side .p-srv-exp.is-warn { color: hsl(38, 92%, 58%); }
.lu-side .p-srv-exp.is-dead { color: hsl(0, 72%, 60%); }

.lu-side .p-srv-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
}

.lu-side .p-srv-meta code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--color-inverted);
  background: none;
  padding: 0;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lu-side .p-srv.is-active .p-srv-meta,
.lu-side .p-srv.is-active .p-srv-exp,
.lu-side .p-srv.is-active .p-srv-meta code {
  color: var(--color-muted);
}
html[data-theme="dark"] .lu-side .p-srv.is-active .p-srv-meta,
html[data-theme="dark"] .lu-side .p-srv.is-active .p-srv-exp,
html[data-theme="dark"] .lu-side .p-srv.is-active .p-srv-meta code {
  color: rgba(255, 255, 255, 0.82);
}

.lu-side .p-console-side-empty {
  padding: 10px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

/* 状态点 */
.lu-side .p-status,
.lu-pagehead .p-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--color-muted);
}

.lu-side .p-status i,
.lu-pagehead .p-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.lu-side .p-status[data-status="running"],
.lu-pagehead .p-status[data-status="running"] { color: hsl(145, 65%, 47%); }
.lu-side .p-status[data-status="starting"],
.lu-side .p-status[data-status="stopping"],
.lu-pagehead .p-status[data-status="starting"],
.lu-pagehead .p-status[data-status="stopping"] { color: hsl(38, 92%, 58%); }
.lu-side .p-status[data-status="expired"],
.lu-pagehead .p-status[data-status="expired"] { color: hsl(0, 72%, 60%); }
/* 状态未知：用中性灰而不是红/绿 —— 我们既不能说它好，也不能说它坏 */
.lu-side .p-status[data-status="unknown"],
.lu-pagehead .p-status[data-status="unknown"] { color: hsl(220, 10%, 55%); }
/* 上游已取消：这是坏消息且已确定，用红 */
.lu-side .p-status[data-status="missing"],
.lu-pagehead .p-status[data-status="missing"] { color: hsl(0, 72%, 60%); }

/* ---------- 实例导航（纯蓝激活胶囊） ---------- */
.lu-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 10px 8px;
  margin-top: 8px;
  border-top: 1px solid var(--color-neutral);
}

.lu-app.has-srv .lu-nav { display: flex; }
.lu-app:not(.has-srv) .lu-nav { display: none; }

.lu-navbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 550;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.lu-navbtn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.78;
}

.lu-navbtn:hover {
  color: var(--color-base);
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
}
.lu-navbtn:hover svg { opacity: 1; }

.lu-navbtn.is-active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 650;
  box-shadow: 0 6px 14px -5px rgba(37, 99, 235, 0.48);
}
.lu-navbtn.is-active svg { opacity: 1; color: #ffffff; }

.lu-nav-cap {
  padding: 10px 16px 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-muted);
}

/* ---------- 侧栏底部：余额 + 账号 ---------- */
.lu-side-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--color-neutral);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-background-secondary);
}

.lu-billing {
  border: 1px solid var(--color-neutral);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: color-mix(in srgb, var(--color-base) 3%, transparent);
}

.lu-billing-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--color-muted);
}

.lu-billing-row strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-base);
  font-variant-numeric: tabular-nums;
}

.lu-billing-row strong.is-warn { color: hsl(38, 92%, 58%); }
.lu-billing-row strong.is-dead { color: hsl(0, 72%, 60%); }

.lu-billing-acts {
  display: flex;
  gap: 6px;
  padding-top: 2px;
}

.lu-billing-acts .lu-mini {
  flex: 1;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--color-neutral);
  background: transparent;
  color: var(--color-base);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.lu-billing-acts .lu-mini:hover {
  background: color-mix(in srgb, var(--color-base) 7%, transparent);
}

.lu-billing-acts .lu-mini--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.lu-billing-acts .lu-mini--primary:hover { filter: brightness(1.08); }
.lu-billing-acts .lu-mini svg { width: 12px; height: 12px; }

.lu-acct {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lu-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-neutral);
  color: var(--color-base);
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 30px;
  text-transform: uppercase;
}

.lu-acct-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.lu-acct-main strong {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lu-acct-main small {
  font-size: 11px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lu-iconbtn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 140ms ease;
  padding: 0;
}

.lu-iconbtn:hover {
  color: var(--color-base);
  background: var(--color-neutral);
}

.lu-iconbtn svg { width: 15px; height: 15px; }

/* ---------- 右侧主区 ---------- */
.lu-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px 24px 42px;
  background:
    radial-gradient(60% 45% at 80% 0%, rgba(59, 130, 246, 0.08), transparent 70%),
    radial-gradient(45% 40% at 15% 10%, rgba(99, 102, 241, 0.05), transparent 68%),
    var(--color-background);
}

.lu-content {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
}

/* 页头 */
.lu-pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.lu-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 640px;
}

.lu-pagehead-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--color-muted);
}

.lu-sep {
  color: var(--color-neutral);
  user-select: none;
}

.lu-upbadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid var(--color-neutral);
  font-size: 11px;
  color: var(--color-inverted);
}

.lu-upbadge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* 电源按钮组：Luna 的 Button / Button.Text / Button.Danger */
.lu-powers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lu-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: filter 140ms ease, background-color 140ms ease, border-color 140ms ease, opacity 140ms ease;
  white-space: nowrap;
}

.lu-btn:hover { filter: brightness(1.08); }

.lu-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.lu-btn--text {
  background: var(--color-background-secondary);
  color: var(--color-base);
  border-color: var(--color-neutral);
}

.lu-btn--text:hover {
  background: color-mix(in srgb, var(--color-base) 6%, var(--color-background-secondary));
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-neutral));
  filter: none;
}

.lu-btn--danger {
  background: hsl(0, 72%, 51%);
  color: #fff;
}

.lu-btn--ghost {
  background: transparent;
  border-color: var(--color-neutral);
  color: var(--color-base);
}

.lu-btn--ghost:hover { background: color-mix(in srgb, var(--color-base) 6%, transparent); }

.lu-btn .spinner { width: 14px; height: 14px; }
.lu-btn .btn-text { white-space: nowrap; }

/* ---------- 终端 ---------- */
.lu-term {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.lu-term-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 38px;
  padding: 6px 12px;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: 12.5px;
  color: var(--color-muted);
}

.lu-term-title {
  font-weight: 600;
  color: var(--color-base);
}

.lu-term-bar .p-term-dots { display: none; }

.lu-term-tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}

.lu-term-live,
.p-term-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: hsl(145, 65%, 47%);
}

.lu-term-live i,
.p-term-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: lu-live 2s infinite;
}

@keyframes lu-live {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  70% { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

html[data-motion="off"] .lu-term-live i { animation: none; }

.lu-term .p-console-term-body {
  height: 400px;
  min-height: 260px;
  overflow: auto;
  padding: 10px 12px;
  background: #070b12;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-top: none;
  border-bottom: none;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #d7dce5;
}
.lu-term .p-console-term-body::-webkit-scrollbar {
  width: 8px;
}
.lu-term .p-console-term-body::-webkit-scrollbar-track {
  background: #070b12;
}
.lu-term .p-console-term-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  border: 2px solid #070b12;
}
.lu-term .p-console-term-body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

.lu-term-inputwrap {
  position: relative;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.lu-term-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  height: 46px;
}

.lu-term-input .lu-prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-primary);
  user-select: none;
}

.lu-term-input .p-term-cmd-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: none;
  background: transparent;
  color: var(--color-base);
  font-family: var(--font-mono);
  font-size: 12.5px;
  outline: none;
  padding: 0;
}

.lu-term-input .p-term-cmd-input::placeholder { color: var(--color-inverted); }

.lu-term-input .p-term-cmd-hist,
.lu-term-input .p-term-cmd-send {
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  border: 1px solid var(--color-neutral);
  background: transparent;
  color: var(--color-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 140ms ease;
}

.lu-term-input .p-term-cmd-hist:hover {
  color: var(--color-base);
  background: color-mix(in srgb, var(--color-base) 7%, transparent);
}

.lu-term-input .p-term-cmd-send {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.lu-term-input .p-term-cmd-send:hover { filter: brightness(1.08); }

.lu-term-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 7px 2px 0;
  font-size: 11.5px;
  color: var(--color-muted);
}

.lu-term-foot-right {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.lu-term-foot .btn-quiet {
  height: 24px;
  padding: 0 9px;
  font-size: 11.5px;
  border-radius: 6px;
  border: 1px solid var(--color-neutral);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.lu-term-foot .btn-quiet:hover { color: var(--color-base); }

/* 终端增强工具：教程小胶囊 + 日志筛选 + 全屏切换 */
.mk-term-help {
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 140ms ease;
}
.mk-term-help:hover { filter: brightness(1.08); }

.mk-term-search {
  width: 124px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--color-neutral);
  background: var(--color-background);
  color: var(--color-base);
  font-size: 11.5px;
  outline: none;
  transition: border-color 140ms ease, width 160ms ease;
}
.mk-term-search:focus {
  width: 162px;
  border-color: var(--color-primary);
}
.mk-term-iconbtn {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--color-neutral);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}
.mk-term-iconbtn:hover { color: var(--color-base); border-color: var(--color-primary); }
.mk-term-iconbtn svg { width: 13px; height: 13px; }
.p-term-line.is-filtered-out { display: none !important; }

.lu-term.is-fullscreen {
  position: fixed;
  inset: 14px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}
.lu-term.is-fullscreen .p-console-term-body {
  flex: 1;
  height: auto;
  min-height: 0;
}

/* ---------- 部署进度（终端顶部的一体条） ----------
   终端面板在两种主题下都是深色，所以这里也用固定的深色系配色，
   不跟主题变量走，免得浅色主题下这条变成一块白斑。 */
.lu-deploy {
  --dv-fg: #e6edf8;
  --dv-dim: #93a2b8;
  --dv-line: rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px 10px;
  /* 底色必须是不透明的深色：这条夹在深色终端和标题栏之间，
     若用半透明青绿，浅色主题下会变成「白底 + 浅字」，完全读不出来 */
  background-color: #0a1018;
  background-image: linear-gradient(180deg, rgba(63, 232, 200, 0.13), rgba(63, 232, 200, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-bottom: 1px solid var(--dv-line);
  color: var(--dv-fg);
  font-size: 12px;
}

.lu-deploy[hidden] { display: none; }

.lu-deploy-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lu-deploy-ico {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.lu-deploy-ico .p-spinner-ring {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.16);
  border-top-color: #3fe8c8;
}

.lu-deploy-tick {
  display: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.lu-deploy-txt {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lu-deploy-txt b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dv-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lu-deploy-sub {
  font-size: 11.5px;
  color: var(--dv-dim);
  line-height: 1.5;
}

.lu-deploy-time {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dv-dim);
  font-variant-numeric: tabular-nums;
}

.lu-deploy-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.lu-deploy-track i {
  display: block;
  height: 100%;
  width: 36%;
  border-radius: 2px;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  animation: lu-deploy-run 1.7s ease-in-out infinite;
}

@keyframes lu-deploy-run {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

html[data-motion="off"] .lu-deploy-track i {
  animation: none;
  width: 100%;
  opacity: 0.55;
}

.lu-deploy-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.lu-deploy-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--dv-line);
  color: var(--dv-dim);
  font-size: 11px;
  white-space: nowrap;
}

.lu-deploy-step i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.lu-deploy-step.is-done {
  color: #7ee2a8;
  border-color: rgba(126, 226, 168, 0.3);
}

.lu-deploy-step.is-active {
  color: #8ff3dd;
  border-color: rgba(143, 243, 221, 0.44);
  background: rgba(143, 243, 221, 0.09);
}

.lu-deploy.is-ok { background-image: linear-gradient(180deg, rgba(74, 222, 128, 0.16), rgba(74, 222, 128, 0.02)); }
.lu-deploy.is-ok .lu-deploy-track i { animation: none; width: 100%; background: #4ade80; }
.lu-deploy.is-ok .lu-deploy-ico .p-spinner-ring { display: none; }
.lu-deploy.is-ok .lu-deploy-tick { display: block; color: #4ade80; }

.lu-deploy.is-fail { background-image: linear-gradient(180deg, rgba(255, 122, 138, 0.16), rgba(255, 122, 138, 0.02)); }
.lu-deploy.is-fail .lu-deploy-track i { animation: none; width: 100%; background: #ff7a8a; }
.lu-deploy.is-fail .lu-deploy-ico .p-spinner-ring { display: none; }
.lu-deploy.is-fail .lu-deploy-tick { display: block; color: #ff7a8a; }

/* 侧栏「全部 N 台」：控制台只显示当前实例，换实例从这里回列表 */
.lu-side-all {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
}

.lu-side-all b { font-weight: 600; color: var(--color-base); }
.lu-side-all:hover { color: var(--color-primary); }
.lu-side-all:hover b { color: var(--color-primary); }


.lu-term .p-term-jump {
  position: absolute;
  right: 14px;
  top: -38px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--color-neutral);
  background: var(--color-background-secondary);
  color: var(--color-base);
  font-size: 11.5px;
  cursor: pointer;
}

/* 自动滚动开关 */
.lu-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--color-muted);
  cursor: pointer;
  user-select: none;
}

.lu-switch input { position: absolute; opacity: 0; pointer-events: none; }

.lu-switch .switch-track {
  width: 30px;
  height: 17px;
  border-radius: 9px;
  background: var(--color-neutral);
  position: relative;
  transition: background-color 160ms ease;
}

.lu-switch .switch-track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.lu-switch input:checked + .switch-track { background: var(--color-primary); }
.lu-switch input:checked + .switch-track i { transform: translateX(13px); }

/* ==========================================================================
   双栏仪表盘 + 右侧工具栏（.mk-dash）
   ========================================================================== */
.mk-dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 16px;
  align-items: start;
}
.mk-dash-main {
  min-width: 0;
}
.mk-dash-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* 第 1 行：4 张核心信息白卡 */
.mk-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.mk-info-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  text-align: left;
  min-width: 0;
  width: 100%;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
button.mk-info-card {
  cursor: pointer;
}
button.mk-info-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 50%, var(--color-neutral));
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.25);
}
.mk-info-head {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}
.mk-info-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: none;
}
.mk-info-ico svg { width: 13px; height: 13px; }
.mk-info-ico--blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.mk-info-ico--emerald { background: rgba(16, 185, 129, 0.14); color: #059669; }
.mk-info-ico--violet { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.mk-info-ico--amber { background: rgba(217, 119, 6, 0.13); color: #d97706; }

.mk-info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
}
.mk-info-copyhint {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 9%, transparent);
  color: var(--color-primary);
}
.mk-info-val {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 750;
  color: var(--color-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mk-info-val--sm {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.mk-info-card[data-tone="warn"] .mk-info-val { color: #d97706; }
.mk-info-card[data-tone="dead"] .mk-info-val { color: #e11d48; }

/* 第 2 行：4 张资源 KPI 卡片（带底部彩色进度条） */
.lu-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.lu-stat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 15px;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  border-radius: 14px;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  min-width: 0;
}
.lu-stat-ico {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-neutral);
  color: var(--color-muted);
}
.mk-kpi--cpu .lu-stat-ico { background: rgba(16, 185, 129, 0.13); color: #059669; }
.mk-kpi--mem .lu-stat-ico { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.mk-kpi--disk .lu-stat-ico { background: rgba(217, 119, 6, 0.13); color: #d97706; }
.mk-kpi--net .lu-stat-ico { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }

.mk-kpi-track {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 7px;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-neutral) 75%, transparent);
  overflow: hidden;
}
.mk-kpi-track i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.45s ease;
}
.mk-kpi--cpu .mk-kpi-track i { background: #10b981; }
.mk-kpi--mem .mk-kpi-track i { background: #2563eb; }
.mk-kpi--disk .mk-kpi-track i { background: #f59e0b; }
.mk-kpi--net .mk-kpi-track i { background: #6366f1; }

/* 右侧工具栏卡片 */
.mk-rail-card {
  padding: 15px;
  border-radius: 14px;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  box-shadow: 0 2px 10px -2px rgba(15, 23, 42, 0.05);
}
.mk-rail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.mk-rail-head b {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--color-base);
}
.mk-rail-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
}
.mk-rail-ico svg { width: 14px; height: 14px; }
.mk-rail-ico--slate { background: rgba(100, 116, 139, 0.12); color: #475569; }
.mk-rail-ico--blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.mk-rail-ico--indigo { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.mk-rail-ico--emerald { background: rgba(16, 185, 129, 0.14); color: #059669; }
html[data-theme="dark"] .mk-rail-ico--slate { color: #cbd5e1; }

/* 电源控制 3 宫格 */
.mk-power-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mk-power-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 6px;
  border-radius: 10px;
  border: 1px solid var(--color-neutral);
  background: var(--color-background);
  color: var(--color-base);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: all 140ms ease;
}
.mk-power-btn svg { width: 17px; height: 17px; }
.mk-power-btn--start { background: rgba(16, 185, 129, 0.11); border-color: rgba(16, 185, 129, 0.3); color: #059669; }
.mk-power-btn--start:hover:not([disabled]) { background: #10b981; color: #fff; border-color: #10b981; }
.mk-power-btn--restart { background: rgba(37, 99, 235, 0.09); border-color: rgba(37, 99, 235, 0.25); color: #2563eb; }
.mk-power-btn--restart:hover:not([disabled]) { background: #2563eb; color: #fff; border-color: #2563eb; }
.mk-power-btn--stop { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.28); color: #dc2626; }
.mk-power-btn--stop:hover:not([disabled]) { background: #dc2626; color: #fff; border-color: #dc2626; }
.mk-power-btn[disabled] { opacity: 0.42; cursor: not-allowed; }
.mk-power-btn .spinner { width: 14px; height: 14px; }

.mk-power-kill {
  margin-top: 8px;
  width: 100%;
  height: 30px;
  border-radius: 8px;
  border: 1px dashed rgba(239, 68, 68, 0.34);
  background: transparent;
  color: #dc2626;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease;
}
.mk-power-kill:hover:not([disabled]) { background: rgba(239, 68, 68, 0.09); }
.mk-power-kill[disabled] { opacity: 0.4; cursor: not-allowed; }

/* 服务器操作 3 宫格 */
.mk-ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mk-op-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 6px;
  border-radius: 10px;
  border: 1px solid var(--color-neutral);
  background: var(--color-background);
  color: var(--color-base);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
}
.mk-op-btn svg { width: 16px; height: 16px; color: var(--color-muted); }
.mk-op-btn:hover:not([disabled]) {
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-neutral));
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-background));
}
.mk-op-btn:hover:not([disabled]) svg { color: var(--color-primary); }

/* 快捷入口列表 */
.mk-quick-list {
  display: grid;
  gap: 7px;
}
.mk-quick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--color-neutral);
  background: var(--color-background);
  text-align: left;
  cursor: pointer;
  transition: all 140ms ease;
}
.mk-quick-item:hover {
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-neutral));
  transform: translateX(2px);
}
.mk-q-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
.mk-q-ico--blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.mk-q-ico--violet { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.mk-q-ico--emerald { background: rgba(16, 185, 129, 0.13); color: #059669; }
.mk-q-ico--amber { background: rgba(217, 119, 6, 0.13); color: #d97706; }
.mk-quick-item > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.mk-quick-item b { display: block; font-size: 12.5px; font-weight: 700; color: var(--color-base); }
.mk-quick-item small { display: block; font-size: 11px; color: var(--color-muted); }
.mk-quick-item i { font-style: normal; color: var(--color-muted); font-size: 16px; }

/* 当前套餐与 2x2 彩色操作按钮 */
.mk-plan-kv {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.24);
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.mk-plan-kv > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.mk-plan-kv dt { color: var(--color-muted); }
.mk-plan-kv dd { margin: 0; font-weight: 650; color: var(--color-base); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mk-plan-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.mk-act-btn {
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: filter 140ms ease, transform 140ms ease;
}
.mk-act-btn:hover:not([disabled]) { filter: brightness(0.94); transform: translateY(-1px); }
.mk-act-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.mk-act-btn--emerald { background: #10b981; }
.mk-act-btn--blue { background: #2563eb; }
.mk-act-btn--rose { background: #ef4444; }
.mk-act-btn--violet { background: #6366f1; }
.mk-act-btn--indigo { background: #4f46e5; }
.mk-act-btn--span2 { grid-column: 1 / -1; }

.mk-power-state {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  background: rgba(100, 116, 139, 0.12);
  color: var(--color-muted);
}
.mk-power-state[data-state="running"] {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}
.mk-power-state[data-state="starting"],
.mk-power-state[data-state="stopping"],
.mk-power-state[data-state="installing"] {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.mk-plan-banner {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(37, 99, 235, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.24);
}
.mk-plan-banner strong {
  display: block;
  font-size: 13px;
  font-weight: 750;
  color: var(--color-base);
}
.mk-plan-banner span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--color-muted);
}

.mk-help-list {
  display: grid;
  gap: 5px;
}
.mk-help-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-neutral);
  background: var(--color-background);
  color: var(--color-base);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}
.mk-help-item:hover {
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-neutral));
  color: var(--color-primary);
}
.mk-help-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-help-item i { font-style: normal; color: var(--color-muted); font-size: 14px; }

.mk-help-article {
  display: grid;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--color-base);
}
.mk-help-article p { margin: 0; }

@media (max-width: 1140px) {
  .mk-dash {
    grid-template-columns: minmax(0, 1fr);
  }
  .mk-dash-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .mk-info-grid,
  .lu-stats,
  .mk-dash-rail {
    grid-template-columns: minmax(0, 1fr);
  }
}

.lu-stat-ico svg { width: 19px; height: 19px; }

.lu-stat.is-warn .lu-stat-ico { background: hsl(38, 92%, 52%); color: #fff; }
.lu-stat.is-danger .lu-stat-ico { background: hsl(0, 72%, 51%); color: #fff; }

.lu-stat-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.lu-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lu-stat-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.lu-stat-value small {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-inverted);
}

.lu-stat-trend {
  font-size: 11px;
  line-height: 1.3;
  color: var(--color-inverted);
  white-space: normal;
}

/* ---------- 图表卡片（Luna ChartBlock） ---------- */
.lu-chart {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  border-radius: var(--lu-radius);
  padding-top: 2px;
  margin-bottom: 16px;
}

.lu-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
}

.lu-chart-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-base);
}

.lu-chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--color-muted);
}

.lu-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lu-legend-item i {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

.lu-legend-item--cpu { color: var(--color-primary); }
.lu-legend-item--mem { color: var(--color-secondary); }

.lu-chart-range {
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid var(--color-neutral);
  font-size: 11px;
  color: var(--color-muted);
}

.lu-chart-body {
  position: relative;
  height: 190px;
  padding: 0 10px 10px;
}

.lu-chart-body .p-console-chart-axis {
  position: absolute;
  left: 2px;
  top: 0;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--color-inverted);
  pointer-events: none;
  width: 22px;
  text-align: right;
}

.lu-chart-body .p-chart-svg {
  display: block;
  width: 100%;
  height: 100%;
  padding-left: 24px;
  box-sizing: border-box;
  overflow: visible;
}

.lu-chart-body .p-chart-grid line { stroke: color-mix(in srgb, var(--color-base) 8%, transparent); }
.lu-chart-body .p-chart-line { fill: none; stroke: var(--color-primary); stroke-width: 1.8; }
.lu-chart-body .p-chart-line--mem { stroke: var(--color-secondary); }
.lu-chart-body .p-chart-dot { fill: var(--color-primary); }
.lu-chart-body .p-chart-dot--mem { fill: var(--color-secondary); }
.lu-chart-body .p-grad-cpu-top { stop-color: var(--color-primary); stop-opacity: 0.28; }
.lu-chart-body .p-grad-cpu-bottom { stop-color: var(--color-primary); stop-opacity: 0; }
.lu-chart-body .p-grad-mem-top { stop-color: var(--color-secondary); stop-opacity: 0.18; }
.lu-chart-body .p-grad-mem-bottom { stop-color: var(--color-secondary); stop-opacity: 0; }

.lu-chart-body .p-console-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--color-muted);
}

.lu-chart-body .p-console-tip {
  position: absolute;
  z-index: 5;
  padding: 6px 9px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--color-background) 88%, #000);
  border: 1px solid var(--color-neutral);
  font-size: 11px;
  color: var(--color-base);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.7);
}

/* ---------- 详情卡片 ---------- */
.lu-card {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  border-radius: var(--lu-radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.lu-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lu-card-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}

/* 复制条：实例 ID / 地址 / SFTP */
.lu-copy {
  display: grid;
  /* 只剩「实例 ID」「联机地址」两块（SFTP 那块已撤），两列才不会空出三分之一 */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.lu-copy .p-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--color-neutral);
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-base) 3%, transparent);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 140ms ease, background-color 140ms ease;
  min-width: 0;
  width: 100%;
}

.lu-copy .p-copy:hover {
  border-color: color-mix(in srgb, var(--color-primary) 55%, var(--color-neutral));
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.lu-copy .p-copy-key {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.lu-copy .p-copy-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-base);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lu-copy .p-copy--static { cursor: default; }
.lu-copy .p-copy--static:hover { border-color: var(--color-neutral); background: color-mix(in srgb, var(--color-base) 3%, transparent); }

/* 到期 / 续费行 */
.lu-billingline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-neutral);
  font-size: 12px;
  color: var(--color-muted);
}

.lu-billingline .p-inst-exp { display: inline-flex; align-items: baseline; gap: 6px; }
.lu-billingline .p-inst-exp .p-copy-key { font-size: 11px; }
.lu-billingline .p-inst-exp .p-copy-val { font-family: inherit; font-size: 13px; font-weight: 600; }
.lu-billingline .p-inst-exp[data-tone="warn"] .p-copy-val { color: hsl(38, 92%, 58%); }
.lu-billingline .p-inst-exp[data-tone="dead"] .p-copy-val { color: hsl(0, 72%, 60%); }

.lu-billingline .p-renew {
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--color-neutral);
  background: transparent;
  color: var(--color-base);
  font-size: 12px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 140ms ease;
}

.lu-billingline .p-renew:hover {
  background: color-mix(in srgb, var(--color-base) 7%, transparent);
}

.lu-billingline .p-renew-ico { display: inline-flex; }
.lu-billingline .p-renew-ico svg { width: 13px; height: 13px; }
.lu-billingline .p-upgrade-btn { color: var(--color-base); }
.lu-billingline .p-refund-btn { color: var(--color-muted); }

/* 提示条 */
.lu-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--color-neutral);
  background: color-mix(in srgb, var(--color-base) 3%, transparent);
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.lu-note--warn {
  border-color: color-mix(in srgb, hsl(38, 92%, 58%) 40%, var(--color-neutral));
  background: color-mix(in srgb, hsl(38, 92%, 58%) 10%, transparent);
  color: hsl(38, 92%, 68%);
}

.lu-note-ico {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, currentColor 18%, transparent);
}

/* KV 列表 */
.lu-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 0;
}

.lu-kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-base) 6%, transparent);
  min-width: 0;
}

.lu-kv dt {
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
}

.lu-kv dd {
  margin: 0;
  font-size: 12.5px;
  color: var(--color-base);
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lu-kv dd code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-base);
  background: none;
  padding: 0;
}

/* 上游异常提示 */
.lu-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, hsl(38, 92%, 58%) 38%, var(--color-neutral));
  background: color-mix(in srgb, hsl(38, 92%, 58%) 9%, transparent);
  margin-bottom: 14px;
  font-size: 12.5px;
  color: hsl(38, 92%, 70%);
}

.lu-alert .p-alert-ico svg { width: 18px; height: 18px; }
.lu-alert .p-alert-body { flex: 1; min-width: 0; }
.lu-alert .p-alert-text { margin: 0; }
.lu-alert .p-alert-tech { margin-top: 6px; font-size: 11.5px; color: var(--color-muted); }
.lu-alert .p-alert-tech summary { cursor: pointer; }
.lu-alert .p-alert-side { display: flex; gap: 6px; }
.lu-alert .p-alert-retry,
.lu-alert .p-alert-x {
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--color-neutral);
  background: transparent;
  color: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

/* ---------- 空状态 ---------- */
.lu-empty {
  max-width: 520px;
  margin: 8vh auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lu-empty h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
}

.lu-empty p { margin: 0; color: var(--color-muted); font-size: 13px; }

/* ---------- 内页（文件 / 整合包 …）沿用旧组件，只做 Luna 化修补 ---------- */
.lu-panes .panel,
.lu-panes .p-pane {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  border-radius: var(--lu-radius);
}

.lu-panes .p-pane-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-neutral);
}

.lu-panes .p-pane-title .label,
.lu-panes .label {
  color: var(--color-muted);
  letter-spacing: 0.08em;
}

.lu-panes .p-pane-title h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-base);
}

.lu-panes .btn { border-radius: 8px; }

.lu-panes .btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.lu-panes .btn-outline,
.lu-panes .btn-ghost,
.lu-panes .btn-quiet {
  border-color: var(--color-neutral);
  color: var(--color-base);
  background: transparent;
}

.lu-panes .btn-outline:hover,
.lu-panes .btn-ghost:hover,
.lu-panes .btn-quiet:hover {
  background: color-mix(in srgb, var(--color-base) 7%, transparent);
}

.lu-panes .input,
.lu-panes .p-mp-select {
  background: color-mix(in srgb, var(--color-background) 55%, #000);
  border: 1px solid var(--color-neutral);
  color: var(--color-base);
  border-radius: 8px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .lu-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lu-copy { grid-template-columns: 1fr; }
  .lu-kv { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .lu-app { flex-direction: column; }
  .lu-side {
    position: static;
    width: auto;
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--color-neutral);
  }
  .lu-side-scroll { max-height: none; overflow: visible; padding-top: 10px; }

  /* 服务器列表：横向滑动，每项固定宽度，不撑满容器 */
  .lu-side .p-console-side-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 0 12px 4px;
    scrollbar-width: thin;
  }
  .lu-side .p-srv {
    flex: 0 0 232px;
    width: 232px;
    border-left-width: 1px;
    border-radius: 8px;
    padding: 8px 10px;
  }
  .lu-side .p-srv.is-active {
    border-left-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary);
  }

  /* 实例导航：同一行横向滑动，高度统一 */
  .lu-nav {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    border-top: 1px solid var(--color-neutral);
  }
  .lu-navbtn {
    flex: 0 0 auto;
    align-self: center;
    width: auto;
    height: 34px;
    padding: 0 12px;
    white-space: nowrap;
    border-left-width: 1px;
    border-radius: 8px;
    font-size: 12.5px;
  }
  .lu-navbtn.is-active { border-left-color: var(--color-primary); }
  .lu-nav-cap { display: none; }

  /* 手机上账号区并到一行，别占掉半屏 */
  .lu-side-foot {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
  }
  .lu-billing {
    flex: 1;
    padding: 6px 9px;
    gap: 2px;
  }
  .lu-billing-row { font-size: 11px; }
  .lu-billing-row strong { font-size: 11.5px; }
  .lu-acct { flex: 0 0 auto; }
  .lu-acct-main { display: none; }

  .lu-main { padding: 16px 14px 32px; }
  .lu-h1 { font-size: 20px; }
  .lu-pagehead { gap: 12px; }
  .lu-powers { width: 100%; flex-wrap: wrap; gap: 6px; }
  .lu-powers .lu-btn { flex: 1 1 calc(33.333% - 6px); padding: 0 8px; font-size: 12.5px; height: 34px; }
  .lu-term .p-console-term-body { height: 300px; }
  .lu-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lu-chart-body { height: 160px; }
}

/* ==========================================================================
   控制台页面上的站点导航：保留品牌，但把「酸性青柠」换成 Luna 的靛蓝，
   避免进控制台后顶部还是站点配色。只在 body[data-page="console"] 生效，
   官网/商店/账户等其他页面不受影响。
   ========================================================================== */
body[data-page="console"] .nav.is-stuck,
body[data-page="console"] .nav {
  background: color-mix(in srgb, var(--color-background-secondary) 97%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--color-neutral);
}

body[data-page="console"] .nav a,
body[data-page="console"] .nav button {
  color: var(--color-muted);
}

body[data-page="console"] .nav a:hover,
body[data-page="console"] .nav button:hover {
  color: var(--color-base);
}

body[data-page="console"] .nav .nav-link.is-active,
body[data-page="console"] .nav [aria-current="page"] {
  color: var(--color-base);
}

/* 主导航里的「立即开服」按钮：换成 Luna 的主色 */
body[data-page="console"] .nav .btn-primary,
body[data-page="console"] .nav .nav-cta {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body[data-page="console"] .nav .btn-primary:hover,
body[data-page="console"] .nav .nav-cta:hover {
  filter: brightness(1.08);
}

body[data-page="console"] .lu-billing-row strong {
  font-size: 12px;
  text-align: right;
}

/* ==========================================================================
   登录 / 注册：Luna 是「一张居中的卡片」，没有左右分栏。
   保留原有表单结构与 id，只换外观，避免动到 page-console.js 的登录逻辑。
   ========================================================================== */
html.luna .p-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
  padding: 40px 20px;
  overflow: visible;
}

html.luna .p-auth-shell {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

html.luna .p-auth-promo { display: none !important; }

html.luna .p-auth-card {
  padding: 26px 24px;
  border-radius: var(--lu-radius);
  background: var(--color-background-secondary);
  border: 1px solid var(--color-neutral);
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.8);
  backdrop-filter: none;
}

html.luna .p-auth-card::after { display: none; }

html.luna .p-auth-tabs {
  background: var(--color-background);
  border: 1px solid var(--color-neutral);
  border-radius: 9px;
  padding: 3px;
}

html.luna .p-auth-pill {
  background: var(--color-primary);
  border-radius: 7px;
}

html.luna .p-auth-tab {
  color: var(--color-muted);
  font-size: 13px;
}

html.luna .p-auth-tab.is-active { color: #fff; }

html.luna .p-auth-form { margin-top: 18px; }

html.luna .p-auth-card .field-label,
html.luna .p-auth-card .label {
  color: var(--color-muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

html.luna .p-auth-card .input {
  background: color-mix(in srgb, var(--color-background) 70%, #000);
  border: 1px solid var(--color-neutral);
  border-radius: 8px;
  color: var(--color-base);
}

html.luna .p-auth-card .input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

html.luna .p-auth-card .btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
}

html.luna .p-auth-card .btn-primary:hover { filter: brightness(1.08); }

html.luna .p-auth-meta { color: var(--color-muted); font-size: 12px; }
html.luna .p-auth-forgot { color: var(--color-primary); }
html.luna .p-auth-hint,
html.luna .p-auth-status { color: var(--color-muted); }

/* 侧栏内与空状态里的按钮：统一成 Luna 主色 */
.lu-side .btn-primary,
.lu-empty .btn-primary,
.lu-empty .btn {
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
}

.lu-side .btn-primary,
.lu-empty .btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.lu-side .btn-primary:hover,
.lu-empty .btn-primary:hover { filter: brightness(1.08); }

.lu-empty .btn-ghost,
.lu-empty .btn-outline {
  background: transparent;
  border: 1px solid var(--color-neutral);
  color: var(--color-base);
}

/* 空状态里的步骤提示：原来的 .p-console-hints 依赖旧父级，这里重排成清单 */
.lu-empty .p-console-hints {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.lu-empty .p-console-hints li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-neutral);
  border-radius: 8px;
  background: var(--color-background-secondary);
  font-size: 12.5px;
  color: var(--color-muted);
  line-height: 1.55;
}

.lu-empty .p-console-hints li b {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-primary);
  flex: 0 0 auto;
  padding-top: 1px;
}

.lu-empty .p-console-empty-art {
  color: var(--color-muted);
  opacity: 0.75;
}

/* 站点导航的激活下划线：控制台页面换成 Luna 主色 */
body[data-page="console"] .nav .nav-link.is-active::after {
  background: var(--color-primary) !important;
  box-shadow: none !important;
}

body[data-page="console"] .nav .nav-link.is-active {
  color: var(--color-base);
}

/* 侧栏「最近到期」只留一行，避免把账号区挤下去 */
.lu-billing-row strong {
  max-width: 132px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lu-billing-row { min-width: 0; }
.lu-billing-row > span { flex: 0 0 auto; }

/* 「最近到期」改成上下两行：名字 + 剩余时间都能看全，不截断 */
.lu-billing-row:nth-child(2) {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.lu-billing-row:nth-child(2) strong {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--color-inverted);
}

/* 侧栏顶部：返回「我的实例」 */
.lu-back {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 12px 12px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-neutral);
  background: color-mix(in srgb, var(--color-base) 3%, transparent);
  color: var(--color-muted);
  font-size: 12px;
  text-decoration: none;
  transition: all 140ms ease;
}

.lu-back:hover {
  color: var(--color-base);
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-neutral));
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.lu-back svg { width: 14px; height: 14px; }

/* ==========================================================================
   控制台独立成「面板」
   官网顶部导航与站点页脚已从 console.html 移除，这里把整页钉成视口高度：
   左侧栏自己滚，右侧内容区自己滚，页面本身不再随内容变长。
   形态对齐同类平台 / 土豆互联的控制台。
   ========================================================================== */
body[data-page="console"] {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body[data-page="console"] .p-console-main {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

body[data-page="console"] .lu-app {
  height: 100%;
  min-height: 0;
  padding-top: 0;
}

body[data-page="console"] .lu-side {
  position: relative;
  top: 0;
  height: 100%;
}

body[data-page="console"] .lu-main {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* 登录态与骨架屏同样占满一屏 */
body[data-page="console"] .p-auth {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

body[data-page="console"] .p-console-boot {
  height: 100%;
  overflow-y: auto;
  padding-block: clamp(32px, 7vh, 88px);
}

/* ---------- 侧栏品牌区 ---------- */
.lu-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 12px 10px 12px 12px;
  border-bottom: 1px solid var(--color-neutral);
}

.lu-brand-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
  color: var(--color-base);
}

.lu-brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.lu-brand-mark svg { width: 18px; height: 18px; }

.lu-brand-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lu-brand-txt strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lu-brand-txt small {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.lu-brand-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.lu-brand-btn svg { width: 16px; height: 16px; }

.lu-brand-btn:hover {
  color: var(--color-base);
  background: color-mix(in srgb, var(--color-base) 6%, transparent);
  border-color: var(--color-neutral);
}

/* 主题按钮：亮色显示月亮（切暗色），暗色显示太阳（切亮色），与导航栏一致 */
.lu-brand-btn .i-sun { display: none; }
.lu-brand-btn .i-moon { display: block; }
html[data-theme="dark"] .lu-brand-btn .i-sun { display: block; }
html[data-theme="dark"] .lu-brand-btn .i-moon { display: none; }

/* 控制台品牌图标统一皇家蓝渐变方块 */
.lu-brand-mark {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.55);
}

/* 窄屏：回到普通滚动，不强行钉视口（手机上地址栏会吃掉高度） */
@media (max-width: 900px) {
  body[data-page="console"] { height: auto; overflow: visible; }
  body[data-page="console"] .p-console-main { height: auto; min-height: 100dvh; overflow: visible; }
  body[data-page="console"] .lu-app { height: auto; min-height: 100dvh; }
  body[data-page="console"] .lu-side { height: auto; }
  body[data-page="console"] .lu-main { height: auto; overflow: visible; }
  body[data-page="console"] .p-auth,
  body[data-page="console"] .p-console-boot { height: auto; min-height: 70dvh; }
}

/* ==========================================================================
   终端在浅色主题下也保持深色
   真实机柜是深色；土豆/同类平台的面板也是「浅色界面 + 深色终端」。
   更要紧的是：日志行是浅灰文字，一旦跟着主题变浅底就完全看不见了。
   ========================================================================== */
html[data-theme="light"] .lu-term-bar {
  background: #0c121c;
  border-color: rgba(255, 255, 255, 0.1);
  color: #93a2b8;
}

html[data-theme="light"] .lu-term-bar .lu-term-title { color: #e8eef8; }
html[data-theme="light"] .lu-term-bar .lu-term-hint { color: #7c8aa0; }
html[data-theme="light"] .lu-term-bar .lu-switch { color: #93a2b8; }

html[data-theme="light"] .lu-term-bar .switch-track {
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="light"] .lu-term-bar .switch-track i { background: #cbd5e4; }

html[data-theme="light"] .lu-term .p-console-term-body {
  background: #070b12;
  border-color: rgba(255, 255, 255, 0.1);
  color: #d7dce5;
}

html[data-theme="light"] .lu-term-inputwrap {
  background: #0c121c;
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] .lu-term-input .p-term-cmd-input { color: #e8eef8; }
html[data-theme="light"] .lu-term-input .p-term-cmd-input::placeholder { color: #6b7a90; }
html[data-theme="light"] .lu-term-input .lu-prompt { color: #9fe870; }

html[data-theme="light"] .lu-term-input .p-term-cmd-hist {
  color: #a7b4c8;
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="light"] .lu-term-input .p-term-cmd-hist:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="light"] .lu-term .p-term-jump {
  background: #0c121c;
  color: #e8eef8;
  border-color: rgba(255, 255, 255, 0.14);
}

/* ---------- 登录卡片上的品牌行 ---------- */
.lu-auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-neutral);
}

.lu-auth-brand-main {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--color-base);
  min-width: 0;
}

.lu-auth-back {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 140ms ease;
  /* 实测 61×19，低于 WCAG 2.1 SC 2.5.8 的 24×24。它是登录页唯一的退路，
     点不中就只能后退键 —— 用 padding 撑开，负 margin 保持视觉位置不变。 */
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 6px;
}
.lu-auth-back:hover { background: var(--color-fill-2, rgba(0,0,0,.04)); }

.lu-auth-back:hover { color: var(--color-primary); }

/* 登录表单的输入框：浅色主题下要白底，别用「浅灰混黑」得出脏灰块 */
html[data-theme="light"] .p-auth-card .input {
  background: #fff;
  border-color: var(--color-neutral);
  color: var(--color-base);
}

html[data-theme="light"] .p-auth-card .input::placeholder { color: var(--color-muted); }

html[data-theme="light"] .p-auth-card .input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

html[data-theme="light"] .p-auth-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 22px 54px -26px rgba(15, 23, 42, 0.16), 0 4px 12px -4px rgba(15, 23, 42, 0.05);
}
html[data-theme="light"] .p-auth {
  background:
    radial-gradient(60% 55% at 75% 22%, rgba(59, 130, 246, 0.12), transparent 68%),
    radial-gradient(45% 45% at 18% 25%, rgba(99, 102, 241, 0.08), transparent 68%),
    linear-gradient(180deg, #eaf1fe 0%, #f4f7fc 100%);
}
html[data-theme="light"] .p-auth-tabs {
  background: #f1f5fb;
  border-color: #e2e8f0;
}
html[data-theme="light"] .p-auth-pill {
  background: #ffffff;
  border-color: #dbe4f2;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .p-auth-tab.is-active {
  color: #2563eb;
  font-weight: 750;
}

/* ---------- 侧栏底部快捷入口（账户 / 充值 / 工单） ---------- */
.lu-side-more {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 12px 6px;
}

.lu-side-more a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--color-neutral);
  background: color-mix(in srgb, var(--color-base) 2%, transparent);
  color: var(--color-muted);
  font-size: 11.5px;
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.lu-side-more a:hover {
  color: var(--color-base);
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-neutral));
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.lu-mobile-bar,
.lu-menu-close,
.lu-menu-mask {
  display: none;
}

.lu-nav {
  gap: 8px;
  margin: 10px 10px 0;
  padding: 10px 0;
}

.lu-nav-primary,
.lu-nav-utility {
  display: grid;
  gap: 3px;
}

.lu-navbtn {
  min-height: 39px;
  padding: 7px 10px;
  border-width: 1px;
  border-radius: 8px;
  color: color-mix(in srgb, var(--color-base) 77%, var(--color-muted));
}

.lu-navbtn.is-active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 650;
  box-shadow: 0 6px 14px -5px rgba(37, 99, 235, 0.48);
}
.lu-navbtn.is-active:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
}

.lu-navbtn.is-active svg { color: #ffffff; opacity: 1; }
.lu-navbtn:disabled { opacity: .45; cursor: not-allowed; }

.lu-tools-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-top: 1px solid var(--color-neutral);
  color: var(--color-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-align: start;
}

.lu-tools-toggle:hover { color: var(--color-base); }
.lu-tools-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }

@media (max-width: 900px) {
  .lu-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--color-neutral);
    background: var(--color-background-secondary);
    color: var(--color-base);
    font-size: 13px;
    font-weight: 650;
  }

  .lu-mobile-bar .lu-btn { min-height: 38px; }
  .lu-mobile-bar .lu-btn svg { flex: 0 0 18px; }
  .lu-menu-close { display: inline-flex; }

  body[data-page="console"] .lu-side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 55;
    width: min(320px, calc(100vw - 44px));
    height: 100%;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 180ms ease, visibility 180ms;
    border-right: 1px solid var(--color-neutral);
    border-bottom: 0;
  }

  body[data-page="console"] .lu-menu-open .lu-side {
    visibility: visible;
    transform: translateX(0);
  }

  body[data-page="console"]:has(.lu-menu-open) { overflow: hidden; }

  .lu-menu-mask {
    position: fixed;
    inset: 0;
    z-index: 54;
    display: none;
    background: rgb(7 10 22 / 62%);
  }
  .lu-menu-mask[hidden] {
    display: none !important;
  }
  body[data-page="console"] .lu-menu-open .lu-menu-mask {
    display: block;
  }

  .lu-main {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }
  .lu-content,
  .mk-dash,
  .mk-dash-main,
  .mk-dash-rail {
    min-width: 0;
    max-width: 100%;
  }
  .lu-pagehead-titlerow {
    flex-wrap: wrap;
  }
  .lu-h1 {
    font-size: 18px;
    overflow-wrap: anywhere;
  }
  .lu-term-tools {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .mk-term-search {
    flex: 1 1 110px;
    width: auto;
    min-width: 0;
  }
  .mk-term-search:focus {
    width: auto;
  }
  .lu-term-input {
    gap: 6px;
    padding: 0 8px 0 10px;
  }
  .lu-term-input .p-term-cmd-hist {
    display: none;
  }

  .lu-side-scroll { overflow: auto; overscroll-behavior: contain; }
  .lu-side .p-console-side-list { display: block; overflow: visible; }
  .lu-side .p-srv { width: 100%; }
  .lu-side .p-srv.is-active { box-shadow: none; }
  .lu-nav { flex-direction: column; align-items: stretch; overflow: visible; }
  .lu-navbtn { align-self: auto; width: 100%; height: auto; font-size: 13px; }
  .lu-nav .lu-navbtn svg { display: block; }
  .lu-nav-cap { display: block; }
}

@media (max-width: 640px) {
  .lu-main { padding: 12px 12px 28px; }
  .mk-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mk-info-card {
    padding: 10px 11px;
    border-radius: 12px;
  }
  .mk-info-copyhint { display: none; }
  .lu-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .lu-stat {
    padding: 10px 10px 14px;
    gap: 8px;
    border-radius: 12px;
  }
  .lu-stat-ico {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }
  .lu-stat-ico svg { width: 15px; height: 15px; }
  .lu-stat-label { font-size: 11px; }
  .lu-stat-value { font-size: 12.5px; }
  .mk-dash-rail {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .mk-rail-card { padding: 13px; }
  .lu-term .p-console-term-body { height: 260px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="console"] .lu-side { transition: none; }
}

.p-instance-feature { margin-top: 14px; }
.p-instance-feature h4 { margin-bottom: 8px; }
.p-instance-feature .p-mc-row { flex-wrap: wrap; }
.p-instance-feature .p-field { min-width: min(100%, 170px); }
.p-feature-list { color: var(--color-muted); font-size: 13px; }
.p-feature-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-neutral);
  overflow-wrap: anywhere;
}
.p-feature-row strong { color: var(--color-base); }
.p-feature-row small { display: block; color: var(--color-muted); }

.lu-preview-note {
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--color-neutral);
  border-radius: 8px;
  color: var(--color-base);
  background: color-mix(in srgb, var(--color-primary) 11%, var(--color-background-secondary));
  font-size: 13px;
}

.lu-read-only .lu-powers,
.lu-local-instance #luUpgradeLink,
.lu-local-instance #dUpgradeBtn,
.lu-local-instance #dRenewBtn,
.lu-read-only #dCmdForm,
.lu-read-only #bCreate,
.lu-read-only #snapshotToggle,
.lu-read-only #snapshotCreate,
.lu-read-only [data-snapshot-action="restore"],
.lu-read-only [data-snapshot-action="delete"],
.lu-read-only [data-mod-name],
.lu-read-only [data-mod-delete],
.lu-read-only [data-mc-task-cancel],
.lu-read-only #modManageInstall { display: none; }

/* 可爱风控制台适配（html[data-style="cute"]）：唯美樱花背景 + 毛玻璃面板 */
html[data-style="cute"] body[data-page="console"] {
  background: transparent;
}
html[data-style="cute"] .lu-shell,
html[data-style="cute"] .lu-main {
  background: transparent;
}
html[data-style="cute"] .lu-side {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  border-right-color: rgba(244, 114, 182, 0.18);
}
html[data-style="cute"] .lu-topbar,
html[data-style="cute"] .lu-card,
html[data-style="cute"] .lu-console-box,
html[data-style="cute"] .p-card,
html[data-style="cute"] .p-bk-card {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(14px) saturate(1.15);
  border-color: rgba(244, 114, 182, 0.18);
}
html[data-style="cute"][data-theme="dark"] .lu-side,
html[data-style="cute"][data-theme="dark"] .lu-topbar,
html[data-style="cute"][data-theme="dark"] .lu-card,
html[data-style="cute"][data-theme="dark"] .lu-console-box,
html[data-style="cute"][data-theme="dark"] .p-card,
html[data-style="cute"][data-theme="dark"] .p-bk-card {
  background: rgba(22, 26, 42, 0.82);
  border-color: rgba(244, 114, 182, 0.22);
}
html[data-style="cute"] .lu-brand-mark {
  border-radius: 13px;
  box-shadow: 0 6px 14px -4px rgba(244, 114, 182, 0.45);
}

/* ── 控制台桌面超宽屏与移动端深度自适应 ──────────────────────────────── */
@media (min-width: 1520px) {
  .lu-main > section,
  .lu-main > .lu-topbar,
  .lu-main > .mk-hero,
  .lu-main > .p-pane {
    max-width: 1440px;
    width: 100%;
    margin-inline: auto;
  }
}

@media (max-width: 900px) {
  .lu-mobile-bar {
    padding-top: max(8px, env(safe-area-inset-top));
    gap: 8px;
  }
  .lu-mobile-bar .lu-mobile-title,
  .lu-mobile-bar .lu-mobile-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .lu-side {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  .lu-term-head {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .lu-term-tools {
    flex-wrap: wrap;
    gap: 6px;
  }
  .mk-term-iconbtn {
    min-width: 34px;
    min-height: 34px;
  }
  .lu-term .p-console-term-body {
    height: clamp(240px, 44dvh, 380px);
    font-size: 12px;
  }
  .lu-term-input {
    padding: 6px 8px 6px 10px;
  }
  .lu-term-input input {
    min-width: 0;
    font-size: 15px;
  }
  .lu-topbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .lu-top-acts,
  .mk-hero-acts {
    width: 100%;
    flex-wrap: wrap;
  }
}
