/* ant-simple 统一 Web 门户 · 布局与专属组件
   主从布局：左侧状态栏选服务，右侧是该服务的状态 / 启停 / 配置编辑。
   复用 theme.css 的 Polar Precision 令牌，不硬编码颜色。 */

.shell { position: relative; z-index: 1; min-height: 100%; display: flex; }

/* ── 左侧状态栏 ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 20;
  display: flex; flex-direction: column;
  background: rgba(var(--glass-rgb), var(--glass-alpha));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; }
.sidebar .brand .mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--accent-grad-a), var(--accent-grad-b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 10px 22px -14px rgba(var(--accent-rgb),.8);
}
.sidebar .brand .n { font-weight: 640; letter-spacing: -.02em; font-size: 15px; line-height: 1.1; }
.sidebar .brand .n small { display: block; font-size: 11px; color: var(--text-2); font-weight: 400; font-family: var(--mono); letter-spacing: 0; }

.side-scroll { flex: 1; min-height: 0; overflow: auto; padding: 6px 10px 10px; }
.side-eyebrow { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 12px 8px 6px; }

.nav-item {
  display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 10px;
  border-radius: 10px; cursor: pointer; color: var(--text-1);
  border: 1px solid transparent; transition: background .16s, border-color .16s;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-dim); border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.nav-item .nm { flex: 1; min-width: 0; }
.nav-item .nm b { display: block; font-size: 13px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nm span { display: block; font-size: 10.5px; color: var(--text-3); }
.nav-item .pt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--text-3); }

.side-foot { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.side-foot .row2 { display: flex; gap: 8px; }
.side-foot .row2 .btn { flex: 1; }

/* ── 主区 ── */
.main { flex: 1; min-width: 0; margin-left: 250px; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 24px; background: rgba(var(--glass-rgb), var(--glass-alpha));
  border-bottom: 1px solid var(--border); backdrop-filter: blur(10px);
}
.topbar .menu-btn { display: none; }
.topbar .summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar .summary .stat { display: flex; align-items: baseline; gap: 5px; }
.topbar .summary .stat b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 620; }
.topbar .summary .stat span { font-size: 12px; color: var(--text-2); }
.topbar .spacer { flex: 1; }

.content { padding: 24px; width: 100%; max-width: 900px; margin: 0 auto; }

/* ── 右侧详情面板 ── */
.detail { display: flex; flex-direction: column; }
.d-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.d-head .ic { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-dim); border: 1px solid var(--border); }
.d-head .d-title { min-width: 0; flex: 1; }
.d-head .d-title .name { font-weight: 640; font-size: 17px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-head .d-title .sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.d-head .d-title .sub .status-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.d-head .d-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.d-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 15px; }
.d-body .sec-eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.d-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.d-foot .spacer { flex: 1; }

.empty-detail { text-align: center; color: var(--text-3); padding: 60px 20px; }

/* ── 表单 ── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; font-weight: 560; color: var(--text-1); }
.field .hint { font-size: 11px; color: var(--text-3); }
.field.row2c { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inp, .ta {
  width: 100%; font-family: var(--sans); font-size: 13px; color: var(--text-1);
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 8px 11px; min-height: 36px; transition: border-color .16s, box-shadow .16s;
}
.inp.mono, .ta.mono { font-family: var(--mono); font-size: 12.5px; }
.inp:disabled { opacity: .6; }
.ta { min-height: 62px; resize: vertical; line-height: 1.5; }
.inp:focus, .ta:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.seg { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); width: fit-content; }
.seg button { border: 0; background: transparent; color: var(--text-2); height: 28px; padding: 0 14px; border-radius: 8px;
  cursor: pointer; font-size: 12px; font-weight: 540; font-family: var(--sans); }
.seg button.on { color: #fff; background: var(--accent); }
html.dark .seg button.on { color: #03161B; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-1); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }

/* ── 手写按钮（零依赖） ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 560; font-family: var(--sans);
  border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-1);
  transition: transform .3s var(--ease-premium), box-shadow .3s var(--ease-premium), border-color .2s, background .2s, color .2s;
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.icon { padding: 0; width: 34px; }
.btn.sm.icon { width: 30px; }
.btn.primary { color: #fff; border-color: var(--accent);
  background: linear-gradient(145deg, var(--accent-grad-a), var(--accent-grad-b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 24px -18px rgba(var(--accent-rgb),.75); }
html.dark .btn.primary { color: #03161B; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface-1)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text-1); border-color: transparent; }

.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 日志控制台（底部 dock） ── */
.dock { position: sticky; bottom: 0; z-index: 16; margin-top: 20px;
  background: rgba(var(--glass-rgb), var(--glass-alpha)); border-top: 1px solid var(--border); backdrop-filter: blur(10px); }
.dock .bar { display: flex; align-items: center; gap: 10px; padding: 10px 24px; cursor: pointer; }
.dock .bar .t { font-weight: 580; font-size: 13px; }
.dock .bar .t .sub { color: var(--text-2); font-weight: 400; font-family: var(--mono); font-size: 12px; margin-left: 8px; }
.dock .bar .spacer { flex: 1; }
.dock .term { background: #0A0C10; color: #C9D6DE; font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  padding: 14px 24px; overflow: auto; white-space: pre-wrap; word-break: break-all; height: 280px; border-top: 1px solid rgba(255,255,255,.05); }
.dock.collapsed .term { display: none; }

/* ── toast ── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 220px; max-width: 380px; padding: 10px 14px; border-radius: 11px;
  background: var(--surface-1); border: 1px solid var(--border-strong); box-shadow: var(--shadow-2);
  font-size: 13px; animation: toast-in .3s var(--ease-premium) both; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.scrim { display: none; }

/* ── 移动端：侧栏变抽屉 ── */
@media (max-width: 900px) {
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform .3s var(--ease-premium); box-shadow: var(--shadow-pop); z-index: 45; }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(25,45,55,.42); }
  html.dark .scrim.show { background: rgba(4,6,10,.6); }
}
@media (max-width: 767px) {
  .topbar { padding: 0 14px; height: 52px; }
  .content { padding: 16px 14px; }
  .d-head { flex-wrap: wrap; }
  .d-head .d-actions { width: 100%; }
  .dock .bar, .dock .term { padding-left: 14px; padding-right: 14px; }
  .dock .term { height: 220px; }
  .field.row2c { grid-template-columns: 1fr; }
}
