/* PushPlus 风格：浅色 SaaS、蓝色主色 */
:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-light: #e6f4ff;
  --primary-border: #91caff;
  --success: #52c41a;
  --success-bg: #f6ffed;
  --warning: #faad14;
  --warning-bg: #fffbe6;
  --danger: #ff4d4f;
  --danger-bg: #fff2f0;
  --text: #1f1f1f;
  --text-secondary: #595959;
  --text-muted: #8c8c8c;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --topbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1677ff 0%, #69b1ff 100%);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; }
.brand-text small { font-size: 11px; color: var(--text-muted); }

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.topnav-item {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.topnav-item:hover { color: var(--primary); background: var(--primary-light); }
.topnav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.topbar-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--bg-page);
  border-radius: 12px;
}
.topbar-health {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.status-dot.ok { background: var(--success); }

.page {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-hero { margin-bottom: 20px; }
.page-hero h1 { font-size: 24px; font-weight: 600; margin-bottom: 6px; }
.page-hero p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.page-hero.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-head { margin: 24px 0 12px; }
.section-head h2 { font-size: 16px; font-weight: 600; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.keepalive-settings {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 13px;
}
.keepalive-settings label { color: var(--text-secondary); white-space: nowrap; }
.keepalive-settings .input-sm { width: 72px; text-align: center; }

.burst-settings-card { margin-bottom: 16px; }
.burst-settings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 12px 0;
  align-items: flex-end;
}
.burst-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  width: auto;
}
.burst-settings-grid .input-sm {
  width: 2cm;
  min-width: 2cm;
  max-width: 2cm;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-icon { font-size: 16px; font-weight: 300; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.35);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { color: var(--primary); border-color: var(--primary-border); }

.btn-text { background: none; border: none; color: var(--text-muted); padding: 4px 8px; }
.btn-text:hover { color: var(--primary); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-danger-outline {
  background: var(--bg-card);
  color: var(--danger);
  border: 1px solid #ffccc7;
}
.btn-danger-outline:hover { background: var(--danger-bg); }

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.panel-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.panel-card-title.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-fill {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.card-grid.compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); max-width: 900px; }

.registry-card {
  position: relative;
  cursor: pointer;
  padding-bottom: 38px;
  min-height: 88px;
}
.registry-card .registry-del {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--danger);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
}
.registry-card .registry-del:hover {
  border-color: var(--danger);
  background: #fff1f0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-meta { font-size: 12px; color: var(--text-muted); margin-top: 10px; line-height: 1.7; }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.account-card .card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.account-card .card-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.account-card .card-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.card-head .card-actions {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.stack-list { display: flex; flex-direction: column; gap: 10px; }
.stack-list.scroll-y {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 320px);
  min-height: 200px;
}

.job-card {
  cursor: pointer;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  transition: all 0.2s;
}
.job-card:hover { border-color: var(--primary-border); background: var(--primary-light); }
.job-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}
.job-card.job-failed-card {
  border-color: #ffccc7;
  background: var(--danger-bg);
}
.job-card.job-failed-card:hover,
.job-card.job-failed-card.selected {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.job-error-text {
  color: var(--danger);
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.badge.ready { background: var(--success-bg); color: #389e0d; border: 1px solid #b7eb8f; }
.badge.expired, .badge.token_expired, .badge.waf_blocked { background: var(--danger-bg); color: var(--danger); border: 1px solid #ffccc7; }
.badge.unknown { background: var(--warning-bg); color: #d48806; border: 1px solid #ffe58f; }
.badge.running, .badge.pending, .badge.scheduled { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); }
.badge.completed, .badge.done { background: var(--success-bg); color: #389e0d; border: 1px solid #b7eb8f; }
.badge.failed { background: var(--danger-bg); color: var(--danger); border: 1px solid #ffccc7; }
.badge.cancelled { background: var(--bg-page); color: var(--text-muted); border: 1px solid var(--border); }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.field .required { color: var(--danger); }

.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}
.input-sm { max-width: 140px; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr minmax(100px, 140px); gap: 12px; align-items: end; }
.form-row-3 .field { margin-bottom: 0; }

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.form-inline .field { margin-bottom: 0; min-width: 160px; }
.form-inline .field-time-flag { min-width: 100px; max-width: 140px; flex: 0 0 auto; }
.form-inline .flex-grow { flex: 1; min-width: 200px; }

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.checkbox-pill:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}
.checkbox-pill input { accent-color: var(--primary); }

.mode-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layout-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.control-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.inline-field label { margin-bottom: 4px; font-size: 12px; }

.jobs-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 20px;
  min-height: calc(100vh - 420px);
}
.jobs-refresh-bar {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}
.log-panel-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.log-panel-head-left {
  justify-self: start;
  min-width: 0;
}
.log-panel-head-right {
  justify-self: end;
}
.jobs-refresh-btn {
  justify-self: center;
  min-width: 132px;
  padding: 7px 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.28);
}
.jobs-refresh-btn:disabled {
  opacity: 0.72;
  box-shadow: none;
}
.jobs-sidebar, .jobs-main { display: flex; flex-direction: column; min-height: 0; }
.jobs-main .log-panel { flex: 1; }

.log-view {
  flex: 1;
  min-height: 400px;
  max-height: calc(100vh - 300px);
  overflow: auto;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

.log-empty {
  color: #888;
  padding: 8px 0;
}

.log-line {
  padding: 7px 0;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.55;
}

.log-line:last-child {
  border-bottom: none;
}

.log-line.log-line-key,
.log-line.log-line-ok {
  color: #8ee4a0;
}

.log-line.log-line-fail {
  color: #f48771;
}

.log-line.log-line-warn {
  color: #dcdcaa;
}

.log-line.log-line-sep {
  color: #9cdcfe;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.log-highlight {
  color: #73d991;
  font-weight: 600;
}

.code-area {
  width: 100%;
  min-height: 480px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: #fafafa;
  resize: vertical;
}
.code-area:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

table.data { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
table.data th, table.data td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
table.data th { background: var(--bg-page); font-weight: 600; color: var(--text-secondary); }
table.data tr:hover td { background: #fafafa; }

.result-area { margin-top: 16px; }

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-page);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  grid-column: 1 / -1;
}

.list-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 14px;
  grid-column: 1 / -1;
}
.list-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: list-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes list-spin {
  to { transform: rotate(360deg); }
}

.task-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.task-check input { margin-top: 4px; accent-color: var(--primary); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }

html.auth-locked #app-mount:empty + .auth-gate,
html.auth-locked body {
  background: var(--bg-page);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-gate.hidden { display: none; }

.auth-gate-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 0;
}
.auth-gate-brand strong { display: block; font-size: 18px; }
.auth-gate-brand small { color: var(--text-muted); font-size: 12px; }

.auth-gate-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 280px;
  box-shadow: none;
  border: none;
  background: transparent;
}

.login-error {
  color: #c0392b;
  font-size: 13px;
  margin: 0 0 8px;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg-page); color: var(--text); }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid var(--border-light);
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .layout-2col { grid-template-columns: 1fr; }
  .jobs-layout { grid-template-columns: 1fr; min-height: auto; }
  .stack-list.scroll-y { max-height: 240px; }
  .log-view { min-height: 300px; max-height: 400px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .page-hero.row-between { flex-direction: column; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ── 医生查询 / 排班 / 时段滚轮 ── */
.form-inline.wrap { flex-wrap: wrap; }
.section-head.compact { margin: 20px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head.compact h2 { font-size: 15px; margin: 0; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.hidden { display: none !important; }

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.entry-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  background: var(--bg-card);
}
.entry-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }
.entry-card.selected { border-color: var(--primary); background: var(--primary-light); }

.entry-card .entry-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.entry-card .entry-meta { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap.compact-table { max-height: 280px; overflow-y: auto; }

table.schedule-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.schedule-table th,
table.schedule-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); text-align: left; white-space: nowrap; }
table.schedule-table th { position: sticky; top: 0; background: var(--bg-page); z-index: 1; font-weight: 600; color: var(--text-secondary); }
table.schedule-table tr:last-child td { border-bottom: none; }
table.schedule-table tr:hover td { background: #fafcff; }
table.schedule-table tr.selected td { background: var(--primary-light); }
table.schedule-table tr.disabled td { opacity: .55; }

.badge-leave {
  display: inline-block;
  min-width: 36px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge-leave.ok { background: var(--success-bg); color: #389e0d; }
.badge-leave.zero { background: var(--bg-page); color: var(--text-muted); }

.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .input { flex: 1; }
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }

.wheel-picker {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafafa;
  scroll-snap-type: y mandatory;
  padding: 8px 0;
}
.wheel-picker.tall { max-height: 280px; }
.wheel-picker:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22,119,255,.1); }

.wheel-item {
  padding: 12px 16px;
  scroll-snap-align: center;
  cursor: pointer;
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  transition: background .12s, color .12s;
}
.wheel-item:hover { background: #f0f0f0; }
.wheel-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.wheel-item.disabled { color: var(--text-muted); cursor: not-allowed; }

.selection-summary {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.advanced-block {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fafafa;
}
.advanced-block summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
}
.advanced-block .nested { margin-top: 12px; }
.period-template-editor { margin-top: 8px; }
.period-template-table-wrap {
  overflow-y: auto;
  min-height: 420px;
  max-height: 520px;
}
.period-template-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.period-template-table th,
.period-template-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.period-template-table th { text-align: left; color: var(--text-muted); font-weight: 500; }
.period-template-table .input { width: 100%; min-width: 0; }
.period-template-table .period-pid { max-width: 88px; }
.period-template-log-import { margin-top: 10px; }
.period-template-log-import .log-cand-table { font-size: 12px; }
.period-template-log-import .log-cand-table td { vertical-align: middle; }
.period-template-log-import .log-cand-slots {
  color: var(--text-muted);
  font-size: 11px;
  max-width: 420px;
  word-break: break-all;
}
.input-mono { font-family: var(--mono); font-size: 12px; }

.modal-sm { max-width: 420px; }
.modal-footer { padding: 16px 24px; margin-top: 0; border-top: 1px solid var(--border-light); }

.btn-text-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
}
.btn-text-link:hover { text-decoration: underline; }

.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.field-hint a { color: var(--primary); }
.notify-result {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
}
.notify-result.ok { background: var(--success-bg); border: 1px solid #b7eb8f; color: #389e0d; }
.keepalive-ok { color: #389e0d; }
.keepalive-fail { color: var(--danger); }
.scheduler-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
}
.scheduler-banner-ok {
  background: var(--success-bg);
  border-color: #b7eb8f;
  color: #389e0d;
}
.scheduler-banner-bad {
  background: #fff2f0;
  border-color: #ffccc7;
  color: #cf1322;
}
.readiness-summary {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.readiness-summary.ok { background: var(--success-bg); border: 1px solid #b7eb8f; color: #389e0d; }
.readiness-summary.bad { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.readiness-actions {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: var(--radius);
  font-size: 13px;
}
/* 系统检测页：禁止 flex 子项被压扁导致文案截断 */
.system-audit-panel .readiness-sections {
  display: block;
  max-height: none;
  overflow: visible;
}
.system-audit-panel .readiness-section {
  overflow: visible;
  margin-bottom: 12px;
}
.system-audit-panel .readiness-section:last-child {
  margin-bottom: 0;
}
.readiness-sections { display: block; }
.readiness-section { border: 1px solid var(--border); border-radius: var(--radius); overflow: visible; margin-bottom: 12px; }
.readiness-section:last-child { margin-bottom: 0; }
.readiness-section-title { padding: 10px 14px; background: var(--bg-muted); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--border-light); }
.readiness-section-title .sec-title-text { flex: 1; min-width: 120px; }
.readiness-section-title .sec-badge { font-weight: 500; font-size: 13px; white-space: nowrap; }
.readiness-section-title .sec-badge.ok { color: #389e0d; }
.readiness-section-title .sec-badge.warn { color: #d48806; }
.readiness-section-title .sec-badge.fail { color: var(--danger); }
.readiness-section-title .sec-status { font-weight: 700; font-size: 15px; line-height: 1; flex-shrink: 0; }
.readiness-section-title .sec-status.ok { color: #389e0d; }
.readiness-section-title .sec-status.warn { color: #d48806; }
.readiness-section-title .sec-status.fail { color: var(--danger); }
.readiness-section-body { background: var(--bg-card); }
.readiness-item { padding: 10px 14px; font-size: 14px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; align-items: flex-start; line-height: 1.65; }
.readiness-item:first-child { border-top: none; }
.readiness-item-body { flex: 1; min-width: 0; overflow: visible; }
.readiness-item .audit-icon { flex-shrink: 0; width: 20px; text-align: center; font-weight: 700; font-size: 15px; line-height: 1.5; margin-top: 1px; }
.readiness-item .audit-icon.ok { color: #389e0d; }
.readiness-item .audit-icon.fail { color: var(--danger); }
.readiness-item .audit-icon.warn { color: #d48806; }
.readiness-item .audit-icon.info { color: var(--text-muted); }
.readiness-item.fail .audit-msg-main { color: var(--danger); font-weight: 500; }
.readiness-item.warn .audit-msg-main { color: #ad6800; font-weight: 500; }
.readiness-item.ok .audit-msg-main { color: #389e0d; font-weight: 500; }
.readiness-item.info .audit-msg-main { color: var(--text-secondary); }
.audit-msg-main { word-break: break-word; overflow-wrap: anywhere; white-space: normal; }
.readiness-item-detail { margin-top: 6px; font-size: 13px; color: var(--text-secondary); line-height: 1.65; word-break: break-word; overflow-wrap: anywhere; white-space: normal; }
.modal-lg { max-width: 720px; width: 92vw; }
.guard-banner .guard-clear-btn {
  margin-left: 12px;
  vertical-align: middle;
}
.account-label-mismatch {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.55;
  display: inline-block;
  margin-top: 4px;
}
.account-identities-block {
  margin: 4px 0 10px;
}
.account-identities-title {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.account-identities-empty {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  background: var(--bg-page);
  font-size: 14px;
}
.account-card .identity-checklist.compact {
  gap: 8px;
}
.account-card .identity-check.readonly {
  min-height: 44px;
  padding: 10px 12px;
  border-color: var(--primary-border);
  background: var(--primary-light);
}
.account-card .identity-check.readonly input {
  width: 16px;
  height: 16px;
}
.account-card .identity-check.readonly .identity-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.account-card .identity-check.readonly .identity-meta {
  display: inline;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.scheduled-section {
  margin-bottom: 16px;
}
.scheduled-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}
.scheduled-task-card {
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  padding: 16px 18px;
  border-color: var(--primary-border);
  background: var(--primary-light);
}
.scheduled-task-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.scheduled-task-card.task-node-bad-card {
  border-color: #ff7875;
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.18);
}
.node-health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.5;
}
.node-health-badge {
  display: inline-block;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.node-health-badge.good { background: var(--success-bg); color: #389e0d; border: 1px solid #b7eb8f; }
.node-health-badge.warn { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.node-health-badge.bad { background: var(--danger-bg); color: var(--danger); border: 1px solid #ffccc7; }
.node-health-detail { color: var(--text-secondary); font-size: 12px; }
.node-health-warn { color: var(--danger); font-size: 12px; }
.account-health .node-health-detail { display: block; margin-top: 2px; }

.scheduled-task-card.task-failed-card {
  border-color: #ffccc7;
  background: var(--danger-bg);
}
.scheduled-task-card.task-failed-card:hover {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.scheduled-task-card.task-done-card {
  border-color: #b7eb8f;
  background: var(--success-bg);
}
.scheduled-task-card.task-done-card:hover {
  border-color: var(--success);
  background: var(--success-bg);
}
.task-fail-reason {
  color: var(--danger);
  font-weight: 600;
}
.scheduled-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.scheduled-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.scheduled-card-sep {
  color: var(--text-muted, #999);
  font-weight: 400;
}
.scheduled-card-doctor {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.scheduled-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  font-size: 13px;
  line-height: 1.5;
}
.scheduled-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.scheduled-kv.span-2 {
  grid-column: 1 / -1;
}
.scheduled-kv .k {
  font-size: 11px;
  color: var(--text-muted, #888);
}
.scheduled-kv .v {
  color: var(--text);
  word-break: break-word;
}
.scheduled-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.scheduled-trigger {
  color: var(--text-muted, #666);
}
.scheduled-trigger strong {
  color: var(--primary);
  font-weight: 600;
}
@media (max-width: 720px) {
  .scheduled-card-grid {
    grid-template-columns: 1fr;
  }
}
.scheduled-task-meta {
  line-height: 1.65;
  font-size: 13px;
}
.scheduled-task-meta .mono {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
}
.scheduled-task-card .card-title {
  margin-bottom: 6px;
}
.jobs-sidebar .stack-list.scroll-y { max-height: calc(100vh - 380px); }

.time-sync-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--mono);
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  cursor: pointer;
  user-select: none;
}
.time-sync-bar:hover { border-color: var(--primary-border); }
.time-label { color: var(--text-muted); font-family: var(--font); font-size: 11px; }
.time-value { min-width: 8.5em; font-variant-numeric: tabular-nums; }
.time-sep { color: var(--border); }
.time-offset { font-family: var(--font); font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.time-offset.warn { color: var(--warning); }
.time-offset.bad { color: var(--danger); font-weight: 500; }

.identity-picks-host { margin-top: 4px; }
.identity-picks-host .identity-checklist,
.identity-picks-compact .identity-checklist {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.identity-picks-host .identity-check,
.identity-picks-compact .identity-check {
  width: 4cm;
  max-width: 4cm;
  min-width: 4cm;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  box-sizing: border-box;
}
.identity-picks-host .identity-name,
.identity-picks-compact .identity-name {
  font-size: 13px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity-picks-host .identity-meta,
.identity-picks-compact .identity-meta { display: none; }
.identity-picks-compact { max-width: 100%; }
.field-identity-compact { max-width: 100%; }
.field-identity-compact > label { margin-bottom: 6px; }
.identity-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.identity-checklist.compact { gap: 6px; }
.identity-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.identity-check:hover:not(.readonly):not(.disabled) {
  border-color: var(--primary-border);
  background: var(--primary-light);
}
.identity-check:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.identity-check.readonly { cursor: default; opacity: .95; }
.identity-check.disabled { opacity: .55; cursor: not-allowed; }
.identity-check input { accent-color: var(--primary); flex-shrink: 0; }
.identity-name { font-weight: 500; min-width: 4em; }
.identity-meta { font-size: 12px; margin-left: auto; }

/* 服务器管理 */
.servers-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  min-height: calc(100vh - 220px);
}
.servers-sidebar .stack-list,
.servers-main { min-height: 480px; }
.server-node-card {
  cursor: pointer;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  transition: all .15s;
}
.server-node-card:hover { border-color: var(--primary-border); background: var(--primary-light); }
.server-node-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.12);
}
.server-node-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.server-node-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; }
.server-detail-title { margin: 0 0 4px; font-size: 18px; }
.server-detail-sub { margin: 0; font-size: 13px; }
.server-detail-body { display: flex; flex-direction: column; height: 100%; }
.server-detail-head { margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.server-ip-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.server-ip-edit .input-sm { width: 180px; max-width: 100%; }
.server-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.server-stat {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  text-align: center;
}
.server-stat strong { display: block; font-size: 20px; line-height: 1.2; }
.server-stat span { font-size: 12px; color: var(--text-muted); }
.server-time-panel { margin-bottom: 16px; }
.server-time-clocks { font-size: 13px; line-height: 1.7; margin-bottom: 8px; }
.server-time-clocks strong { color: var(--text); font-variant-numeric: tabular-nums; }
.compact-list .job-card { padding: 10px 12px; }
.scroll-y-sm { max-height: 220px; overflow-y: auto; }
.server-log-view { flex: 1; min-height: 180px; max-height: 280px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .input { flex: 1; min-width: 0; }
.online-pulse::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52c41a;
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.5);
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(82, 196, 26, 0); }
  100% { box-shadow: 0 0 0 0 rgba(82, 196, 26, 0); }
}
@media (max-width: 960px) {
  .servers-layout { grid-template-columns: 1fr; }
  .server-stats { grid-template-columns: repeat(2, 1fr); }
}
