:root {
  --warm-bg: #fff8f0;
  --warm-sidebar: rgba(255, 248, 240, 0.88);
  --warm-primary: #ff8a80;
  --warm-primary-dark: #ff5252;
  --warm-secondary: #ffb74d;
  --warm-accent: #f48fb1;
  --warm-text: #4e342e;
  --warm-text-light: #8d6e63;
  --warm-border: rgba(255, 255, 255, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow: 0 8px 32px rgba(78, 52, 46, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --ok: #4caf50;
  --err: #f44336;
  --warn: #ff9800;
  --info: #2196f3;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--warm-text);
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(255, 224, 178, 0.45), rgba(255, 171, 145, 0.4)),
    url('https://wallpaper.hongpopo.xyz/') center/cover no-repeat fixed;
  background-color: #ffe0b2;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ============== Sidebar ============== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border-right: 1px solid var(--warm-border);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 18px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--warm-primary), var(--warm-secondary));
  box-shadow: 0 4px 14px rgba(255, 82, 82, 0.28);
}

.brand-title { font-size: 16px; font-weight: 700; color: var(--warm-text); }
.brand-sub { font-size: 12px; color: var(--warm-text-light); margin-top: 2px; }

.nav { padding: 10px 14px; flex: 1; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.2s;
  color: var(--warm-text-light);
  font-size: 14px;
  font-weight: 500;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.nav-item:hover {
  background: rgba(255, 138, 128, 0.1);
  color: var(--warm-primary-dark);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--warm-primary), var(--warm-secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(255, 82, 82, 0.25);
}

.sidebar-bottom {
  padding: 14px;
  border-top: 1px solid var(--glass-border);
}

.start-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--warm-primary), var(--warm-primary-dark));
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
  font-size: 14px;
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 82, 82, 0.35);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-stop {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--err);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--err);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-stop:hover { background: var(--err); color: white; }

.status {
  text-align: center;
  font-size: 12px;
  color: var(--warm-text-light);
  margin-top: 10px;
}

.status.running { color: var(--warn); font-weight: 600; }

/* ============== Main ============== */
.main {
  margin-left: 240px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

.top-bar {
  padding: 16px 24px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar h1 { font-size: 22px; font-weight: 700; }

.clock {
  font-size: 14px;
  color: var(--warm-text-light);
  font-variant-numeric: tabular-nums;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-thumb { background: rgba(141, 110, 99, 0.3); border-radius: 3px; }

/* ============== Log panel ============== */
.log-panel {
  height: 220px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
/* 日志 tab 激活时：撑满剩余空间 */
.log-panel.log-fullscreen {
  height: auto;
  flex: 1;
}

.log-head {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
}

.log-title { font-weight: 600; color: var(--warm-text); }
.log-status { margin-left: auto; font-size: 11px; color: var(--ok); }
.log-status.disconnected { color: var(--err); }

.auto-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--warm-text-light);
  font-size: 12px;
  cursor: pointer;
}

.log-head button {
  padding: 4px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 12px;
}

.log-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  font-family: "Cascadia Code", "Consolas", "Monaco", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--warm-text);
  white-space: pre-wrap;
  word-break: break-all;
}

.log-body::-webkit-scrollbar { width: 6px; }
.log-body::-webkit-scrollbar-thumb { background: rgba(141, 110, 99, 0.3); border-radius: 3px; }

.log-body .ok { color: var(--ok); font-weight: 600; }
.log-body .err { color: var(--err); font-weight: 600; }
.log-body .warn { color: var(--warn); font-weight: 600; }
.log-body .info { color: var(--info); }
.log-body .pre { color: var(--warm-secondary); font-weight: 600; }
.log-body .chain { color: var(--warm-accent); font-weight: 600; }

.log-body .log-ts {
  color: var(--warm-text-light);
  opacity: 0.7;
  margin-right: 4px;
}
.log-body .log-proj {
  font-weight: 700;
  margin-right: 4px;
}

/* ============== Cards & layout ============== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.2);
}

.card h2 {
  font-size: 16px;
  margin-bottom: 14px;
  color: var(--warm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--warm-text);
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stat {
  flex: 1;
  min-width: 160px;
  padding: 16px 18px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  transition: transform 0.15s;
}

.stat:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(78, 52, 46, 0.08); }

.stat .num {
  font-size: 28px;
  font-weight: 700;
  color: var(--warm-primary-dark);
  font-variant-numeric: tabular-nums;
}

.stat .num.ok { color: var(--ok); }
.stat .num.err { color: var(--err); }

.stat .lbl {
  font-size: 12px;
  color: var(--warm-text-light);
  margin-top: 6px;
  line-height: 1.6;
}

.stat .lbl b { color: var(--warm-text); }

/* ============== Table ============== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

th {
  color: var(--warm-text-light);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

tr:hover td { background: rgba(255, 138, 128, 0.05); }

td code {
  background: rgba(141, 110, 99, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Cascadia Code", monospace;
  font-size: 12px;
}

/* ============== Badge ============== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-ok { background: rgba(76, 175, 80, 0.15); color: var(--ok); }
.badge-err { background: rgba(244, 67, 54, 0.15); color: var(--err); }
.badge-run { background: rgba(255, 152, 0, 0.15); color: var(--warn); }
.badge-off { background: rgba(141, 110, 99, 0.15); color: var(--warm-text-light); }

/* ============== Form & buttons ============== */
input, select, textarea {
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--warm-text);
  transition: border 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--warm-primary);
}

input[type="checkbox"] {
  width: auto;
  accent-color: var(--warm-primary);
}

label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--warm-text);
  font-size: 13px;
  margin-right: 12px;
}

button.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--warm-primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

button.btn:hover { background: var(--warm-primary-dark); transform: translateY(-1px); }
button.btn-ghost {
  background: white;
  color: var(--warm-text);
  border: 1px solid var(--glass-border);
}
button.btn-ghost:hover { background: rgba(255, 138, 128, 0.08); }
button.btn-sm { padding: 4px 10px; font-size: 12px; }
button.btn-danger { background: var(--err); }
button.btn-danger:hover { background: #d32f2f; }

/* ============== Duration bar ============== */
.duration-bar {
  height: 8px;
  background: rgba(255, 138, 128, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.duration-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--warm-primary), var(--warm-secondary));
  transition: width 0.3s;
}

.duration-bar.running > div {
  background: linear-gradient(90deg, var(--warn), var(--warm-secondary));
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============== Project card ============== */
.project-card {
  background: white;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.15s;
}

.project-card:hover {
  box-shadow: 0 4px 14px rgba(78, 52, 46, 0.08);
  border-color: var(--warm-primary);
}

.project-card .pc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.project-card .pc-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--warm-text);
}

.project-card .pc-meta {
  font-size: 12px;
  color: var(--warm-text-light);
  line-height: 1.8;
}

.project-card .pc-meta code {
  background: rgba(141, 110, 99, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

/* ============== Chain card ============== */
.chain-card {
  background: white;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.chain-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.chain-node {
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--warm-primary), var(--warm-secondary));
  color: white;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.chain-node.disabled {
  background: rgba(141, 110, 99, 0.2);
  color: var(--warm-text-light);
  text-decoration: line-through;
}

.chain-arrow {
  color: var(--warm-text-light);
  font-size: 16px;
}

/* ============== Modal ============== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(78, 52, 46, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(78, 52, 46, 0.25);
}

.modal h2 {
  margin-bottom: 16px;
  color: var(--warm-text);
}

.modal .form-row {
  margin-bottom: 12px;
}

.modal .form-row label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--warm-text-light);
  font-weight: 600;
}

.modal .form-row input,
.modal .form-row select,
.modal .form-row textarea {
  width: 100%;
}

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

/* ============== Empty ============== */
.empty {
  text-align: center;
  padding: 40px;
  color: var(--warm-text-light);
  font-size: 14px;
}

/* ============== Misc ============== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 138, 128, 0.12);
  color: var(--warm-primary-dark);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}

.muted { color: var(--warm-text-light); }
.tabular { font-variant-numeric: tabular-nums; }

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: white;
  margin-bottom: 6px;
  border: 1px solid var(--glass-border);
}

.list-item:hover { border-color: var(--warm-primary); }

/* ============== 移动端适配 ============== */
/* 汉堡按钮（移动端显示） */
.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
}
.menu-toggle svg { width: 22px; height: 22px; color: var(--warm-text); }

/* 侧栏关闭按钮（移动端显示） */
.sidebar-close {
  display: none;
  margin-left: auto;
  font-size: 26px;
  line-height: 1;
  color: var(--warm-text-light);
  cursor: pointer;
  padding: 0 6px;
}

/* 遮罩层（保留兼容，不再使用） */
.sidebar-mask { display: none; }

/* ============== 移动端顶部栏 ============== */
.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 0;
  border-bottom: 1px solid var(--glass-border);
}
.mobile-top-bar h1 { font-size: 16px; font-weight: 700; margin: 0; }
.mobile-top-actions { display: flex; align-items: center; gap: 8px; }
.mobile-top-bar .clock { font-size: 12px; color: var(--warm-text-light); }
.mobile-stop-btn {
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: linear-gradient(135deg, #ff5252, #ff8a80);
  color: #fff; border: none;
}

/* ============== 移动端底部导航 ============== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--glass-border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
}
.mbn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--warm-text-light);
  font-size: 10px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.15s;
  flex: 1;
}
.mbn-item svg { width: 22px; height: 22px; }
.mbn-item.active { color: var(--warm-primary-dark); }
.mbn-item:active { background: rgba(255, 138, 128, 0.1); }

/* 平板及手机断点 */
@media (max-width: 768px) {
  html, body { overflow: hidden; height: 100%; }

  /* 隐藏桌面侧栏，显示移动端导航 */
  .sidebar { display: none; }
  .mobile-top-bar { display: flex; }
  .mobile-bottom-nav { display: flex; }
  .hamburger { display: none; }
  .menu-toggle { display: none; }
  .sidebar-close { display: none; }

  /* 主区域：fixed 定位，直接锚定顶部栏和底部导航之间 */
  .main {
    position: fixed;
    top: 46px; /* mobile-top-bar 高度 */
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)); /* mobile-bottom-nav 高度 + 安全区 */
    left: 0;
    right: 0;
    margin-left: 0;
    padding: 10px;
    gap: 10px;
    overflow: hidden;
    flex-direction: column;
    display: flex;
  }

  /* 桌面顶栏隐藏（用 mobile-top-bar 替代） */
  .top-bar { display: none; }

  /* 卡片更紧凑 */
  .card {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
  }
  .card h2 { font-size: 15px; margin-bottom: 10px; }

  /* 统计块单列堆叠 */
  .row { gap: 8px; margin-bottom: 12px; }
  .stat {
    flex: 1 1 100%;
    min-width: 0;
    padding: 12px 14px;
  }
  .stat .num { font-size: 22px; }
  .stat .lbl { font-size: 11px; }

  /* 表格水平滚动 */
  .card > table,
  .card > div > table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  th, td { padding: 8px 10px; }

  /* 项目/链卡片 */
  .project-card, .chain-card { padding: 12px; }
  .project-card .pc-head { flex-wrap: wrap; gap: 8px; }
  .project-card .pc-name { font-size: 15px; }
  .project-card .pc-meta code { font-size: 10px; }
  .pc-head > div:last-child { width: 100%; display: flex; justify-content: flex-end; }

  /* 日志面板：默认紧凑高度 */
  .log-panel {
    height: 220px;
    border-radius: var(--radius-sm);
    margin-bottom: 0;
    flex-shrink: 0;
  }
  /* 日志 tab 激活时：撑满剩余空间（不占用全屏，保留边距） */
  .log-panel.log-fullscreen {
    height: 0;
    flex: 1;
    min-height: 200px;
    margin-bottom: 0;
  }
  .log-head {
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
  }
  .log-head button { padding: 3px 8px; font-size: 11px; }
  .log-body { padding: 8px 12px; font-size: 11px; line-height: 1.5; }
  .log-status { font-size: 10px; }

  /* 内容区允许滚动 */
  .content-area {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 0;
    flex: 1;
    min-height: 0;
  }

  /* modal 适配 */
  .modal { width: 96%; padding: 16px; border-radius: var(--radius-sm); }
  .modal h2 { font-size: 15px; }
  .modal .form-row input,
  .modal .form-row select,
  .modal .form-row textarea { font-size: 13px; }

  /* 链流程节点换行 */
  .chain-flow { gap: 6px; }
  .chain-node { padding: 5px 10px; font-size: 11px; }

  /* 侧栏底部按钮 */
  .sidebar-bottom { padding: 10px; }
  .start-btn { padding: 10px; font-size: 13px; }
  .btn-stop { padding: 7px; font-size: 12px; }

  /* 图表高度小一点 */
  canvas { max-height: 180px !important; }
}

/* 超小屏（手机竖屏）进一步压缩 */
@media (max-width: 380px) {
  .main { padding: 8px; padding-top: 64px; }
  .top-bar h1 { font-size: 16px; }
  .stat .num { font-size: 18px; }
  .log-panel { height: 160px; }
}

/* 桌面端：侧栏打开时遮罩不显示 */
@media (min-width: 769px) {
  .sidebar.open { transform: none; }
  .sidebar-mask { display: none !important; }
  .hamburger { display: none; }
}

/* ============== 汉堡按钮 ============== */
.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  font-size: 20px;
  color: var(--warm-text);
}

/* ============== 运行页 ============== */
.current-run {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 152, 0, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 152, 0, 0.3);
  margin-bottom: 16px;
  font-size: 14px;
}

.running-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  animation: pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.project-btn {
  background: white;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.project-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(78, 52, 46, 0.12);
  border-color: var(--warm-primary);
}

.project-btn.running {
  background: rgba(255, 152, 0, 0.08);
  border-color: var(--warn);
  cursor: not-allowed;
  opacity: 0.8;
}

.project-btn-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--warm-text);
  margin-bottom: 6px;
}

.project-btn-status {
  font-size: 12px;
  color: var(--warm-text-light);
}

.project-btn.running .project-btn-status {
  color: var(--warn);
  font-weight: 600;
}

.project-btn-last {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.project-btn-last .last-dur {
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-text);
  font-variant-numeric: tabular-nums;
}

.project-btn-last .last-time {
  font-size: 11px;
  color: var(--warm-text-light);
  opacity: 0.85;
}

/* ============== 定时页 ============== */
/* 虚拟机管理卡片 */
.vm-card {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.06), rgba(255, 255, 255, 0.9));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--glass-border);
}

.vm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 15px;
}

.vm-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-icon { font-size: 18px; }

.vm-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.vm-badge.on {
  background: rgba(76, 175, 80, 0.15);
  color: var(--ok);
}

.vm-badge.off {
  background: rgba(244, 67, 54, 0.15);
  color: var(--err);
}

.vm-restart-btn {
  background: linear-gradient(135deg, #7c4dff, #5e35b1) !important;
  color: white !important;
}

.vm-restart-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #651fff, #4527a0) !important;
  transform: translateY(-1px);
}

.vm-restart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sched-project {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--glass-border);
}

.sched-proj-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 15px;
}

.sched-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sched-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 248, 240, 0.6);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  font-size: 13px;
}

.sched-item.disabled {
  opacity: 0.5;
}

.sched-time {
  font-weight: 600;
  color: var(--warm-text);
  min-width: 120px;
}

.sched-cron {
  background: rgba(141, 110, 99, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--warm-text-light);
  flex: 1;
}

/* ============== 定时内联表单 ============== */
.sched-add-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--glass-border);
  flex-wrap: wrap;
}

/* 自定义时间选择器：时:分 */
.time-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tp-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: none !important;
  background: transparent !important;
  padding: 6px 22px 6px 8px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--warm-text) !important;
  cursor: pointer;
  font-family: "Cascadia Code", "Consolas", monospace;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d6e63' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 4px center !important;
  transition: background-color 0.15s;
}

.tp-select:hover { background-color: rgba(255, 138, 128, 0.12) !important; }
.tp-select:focus { outline: none; background-color: rgba(255, 138, 128, 0.18) !important; }

.tp-colon {
  font-size: 16px;
  font-weight: 700;
  color: var(--warm-primary-dark);
  font-family: "Cascadia Code", "Consolas", monospace;
  user-select: none;
}

/* 星期按钮组 */
.dow-btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex: 1;
  min-width: 0;
}

.dow-btn {
  border: none;
  background: transparent;
  color: var(--warm-text-light);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  min-width: 30px;
}

.dow-btn:first-child { padding: 5px 12px; } /* "每天" 稍宽 */

.dow-btn:hover:not(.active) {
  background: rgba(255, 138, 128, 0.14);
  color: var(--warm-primary-dark);
}

.dow-btn.active {
  background: linear-gradient(135deg, var(--warm-primary), var(--warm-secondary));
  color: white;
  box-shadow: 0 2px 8px rgba(255, 82, 82, 0.28);
}

/* ============== 开关 ============== */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 22px;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: var(--warm-primary);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* ============== 日志行 ============== */
.log-line {
  padding: 1px 0;
}

.log-line.log-err { color: var(--err); }
.log-line.log-warn { color: var(--warn); }
.log-line.log-ok { color: var(--ok); }

.log-pid {
  font-weight: 700;
}

.log-msg {
  word-break: break-all;
}

/* ============== 移动端：项目网格单列 ============== */
@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
  .sched-time { min-width: auto; }
  .sched-item { flex-wrap: wrap; }
  .sched-cron { flex: none; width: 100%; }
  /* 定时表单：时间/星期/添加换行堆叠 */
  .sched-add-form { gap: 8px; }
  .time-picker { order: 1; }
  .dow-btn-group { order: 2; flex: 1 1 100%; }
  .sched-add-form > .btn { order: 3; margin-left: auto; }
  .dow-btn { padding: 6px 8px; font-size: 11px; min-width: 28px; }
  .dow-btn:first-child { padding: 6px 10px; }
}
