/* ============================================================
   WebHook 调度中心 — 商业化视觉样式
   设计 Token 统一在 :root，全文件引用，便于主题切换
   ============================================================ */

:root {
  /* 主色 */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-soft: rgba(37, 99, 235, 0.08);

  /* 中性色阶 */
  --ink-900: #0f172a;
  --ink-800: #1f2937;
  --ink-700: #374151;
  --ink-600: #4b5563;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --ink-300: #d1d5db;
  --ink-200: #e5e7eb;
  --ink-100: #f3f4f6;
  --ink-50: #f9fafb;

  /* 语义色 */
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #ea580c;
  --warning-soft: #ffedd5;
  --danger: #dc2626;
  --danger-soft: #fee2e2;

  /* 背景 */
  --bg-app: #f1f5f9;
  /* 页面底：slate-100 */
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-stripe: #fafbfc;

  /* Header 深色品牌条 */
  --header-bg: #0f172a;
  /* slate-900 */
  --header-bg-hover: #1e293b;
  /* slate-800 */
  --header-text: #e2e8f0;
  /* slate-200 */
  --header-text-dim: #94a3b8;
  /* slate-400 */
  --header-border: rgba(255, 255, 255, 0.06);

  /* 圆角 */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.14);
  --shadow-xl: 0 20px 48px rgba(15, 23, 42, 0.2);

  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* 过渡 */
  --ease-in: 0.2s ease;
  --ease-out-back: 0.28s cubic-bezier(.4, 0, .2, 1);
}

/* ============ 全局基础 ============ */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink-800);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ============ 抽屉/弹窗隐藏策略（不用 display:none，避免 CodeMirror 等子元素丢失尺寸） ============ */
/* 抽屉始终参与 DOM 布局（position fixed + visibility 控制显隐） */
.drawer-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

/* 删除确认弹窗也用 visibility 控制（里面无复杂组件，但统一策略） */
.modal-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

/* ============ Toast / Alert ============ */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  color: #fff;
  background: var(--success);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: toast-in .25s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.toast-error {
  background: var(--danger);
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* ============ 登录卡片 ============ */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.08), transparent 70%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
  width: 380px;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px 32px 32px;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.login-title {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  color: var(--ink-900);
  letter-spacing: -0.3px;
}

.login-subtitle {
  display: block;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
  margin-bottom: 28px;
}

/* ============ 表单通用 ============ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color var(--ease-in), box-shadow var(--ease-in);
  color: var(--ink-800);
}

.form-group input::placeholder {
  color: var(--ink-400);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-group textarea {
  font-family: "Consolas", "Monaco", monospace;
  resize: vertical;
}

.hint {
  color: var(--ink-400);
  font-size: 12px;
  font-weight: normal;
  margin-left: 4px;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  color: var(--ink-800);
  transition: all var(--ease-in);
  user-select: none;
  line-height: 1;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.btn-ghost {
  background: transparent;
  border-color: var(--ink-200);
  color: var(--ink-600);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--ink-50);
  border-color: var(--ink-300);
  color: var(--ink-800);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

/* ============ 主页布局 ============ */
.main-wrap {
  min-height: 100vh;
  background: var(--bg-app);
}

/* 顶部品牌 Header（深色） */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.header-brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--header-text);
  letter-spacing: 0.2px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-label {
  color: var(--header-text-dim);
  font-size: 13px;
  padding: 4px 10px;
  background: var(--header-bg-hover);
  border-radius: 999px;
  border: 1px solid var(--header-border);
}

.header-user .btn-ghost {
  color: var(--header-text-dim);
  border-color: var(--header-border);
  background: transparent;
}

.header-user .btn-ghost:hover:not(:disabled) {
  background: var(--header-bg-hover);
  color: var(--header-text);
  border-color: var(--ink-600);
}

/* ============ 任务列表区 ============ */
.task-list-wrap {
  padding: 24px 32px;
  max-width: 1440px;
  margin: 0 auto;
}

/* 工具栏：左（搜索+统计）/ 右（新增按钮） */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrap {
  position: relative;
  max-width: 420px;
  flex-shrink: 0;
}

.search-input {
  width: 340px;
  padding: 8px 34px 8px 36px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
  font-size: 14px;
  outline: none;
  transition: border-color var(--ease-in), box-shadow var(--ease-in), width var(--ease-out-back);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  width: 380px;
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-400);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--ease-in), color var(--ease-in);
}

.search-clear:hover {
  background: var(--ink-100);
  color: var(--ink-600);
}

.list-meta {
  color: var(--ink-500);
  font-size: 13px;
  flex-shrink: 0;
}

/* ============ WebHook 入口 URL 信息栏 ============ */
.webhook-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #f0f7ff, #e8f1fe);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  font-size: 13px;
  flex-wrap: wrap;
}

.webhook-label {
  color: var(--ink-700);
  font-weight: 500;
  flex-shrink: 0;
}

.webhook-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--primary);
  background: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #bfdbfe;
  user-select: all;
  letter-spacing: 0.2px;
  word-break: break-all;
  max-width: 100%;
  display: inline-block;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  background: #fff;
  border-color: #bfdbfe;
  color: var(--primary);
  transition: all var(--ease-in);
}

.copy-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  animation: copy-pop .3s ease;
}

@keyframes copy-pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

.webhook-hint {
  color: var(--ink-500);
  font-size: 12px;
  flex-shrink: 0;
}

.skeleton {
  padding: 48px;
  text-align: center;
  color: var(--ink-400);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

/* ============ 表格（卡片容器 + 商业化） ============ */
.task-table,
.logs-table {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.task-table thead th,
.logs-table thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-600);
  background: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--ink-200);
  white-space: nowrap;
}

.task-table tbody td,
.logs-table tbody td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-800);
  border-bottom: 1px solid #f1f5f9;
  transition: background var(--ease-in);
}

/* 最后一行无下边框 */
.task-table tbody tr:last-child td,
.logs-table tbody tr:last-child td {
  border-bottom: none;
}

/* 斑马纹 */
.task-table tbody tr:nth-child(even) td {
  background: var(--bg-stripe);
}

/* hover 高亮 */
.task-table tbody tr:hover td,
.logs-table tbody tr:hover td {
  background: #eff6ff !important;
}

/* ID 列窄化 + 等宽 */
.task-table th:first-child,
.task-table td:first-child,
.logs-table th:first-child,
.logs-table td:first-child {
  width: 56px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-500);
}

/* 操作列 */
.col-actions {
  width: 220px;
  text-align: right;
  white-space: nowrap;
}

/* 列表操作列按钮紧凑化 */
.task-table .col-actions .btn {
  padding: 3px 9px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  margin-left: 4px;
}

.task-table .col-actions .btn:first-child {
  margin-left: 0;
}

.task-table .col-actions .btn-ghost {
  border-color: var(--ink-200);
  height: 26px;
}

/* 仓库匹配列省略 */
.repo-cell {
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-600);
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

/* 列表每行 WebHook URL 列 */
.col-webhook-url {
  white-space: nowrap;
  width: 220px;
}

.webhook-url-cell {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  user-select: all;
  border: 1px solid transparent;
  transition: background var(--ease-in), border-color var(--ease-in);
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.webhook-url-cell:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.copy-inline {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: var(--radius-xs);
  margin-left: 4px;
  height: 22px;
  vertical-align: middle;
  border-color: var(--ink-200);
  background: #fff;
  color: var(--ink-500);
  cursor: pointer;
  transition: all var(--ease-in);
}

.copy-inline:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ============ 状态徽标（药丸样式） ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.badge-enabled {
  background: var(--success-soft);
  color: var(--success);
}

.badge-disabled {
  background: var(--ink-100);
  color: var(--ink-400);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-timeout {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ============ 抽屉（右侧滑入） ============ */
.drawer-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
  animation: drawer-mask-fade .2s ease;
}

@keyframes drawer-mask-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 880px;
  max-width: 100vw;
  background: #fff;
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  animation: drawer-slide-in .28s var(--ease-out-back);
}

.drawer-panel-lg {
  width: 960px;
}

@keyframes drawer-slide-in {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--ink-200);
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff, #fafbfc);
}

.drawer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.2px;
}

.drawer-close {
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--ink-500);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: background var(--ease-in), color var(--ease-in);
}

.drawer-close:hover {
  background: var(--ink-100);
  color: var(--ink-800);
}

.drawer-body {
  flex: 1 1 auto;
  padding: 24px 28px;
  overflow: hidden;
  /* 默认：内部有独立滚动区域（如日志抽屉的 logs-list-wrap） */
  display: flex;
  flex-direction: column;
}

/* 任务抽屉表单 body：整个 body 可滚动（表单 + CodeMirror 总高度可能超过抽屉） */
.drawer-body-form {
  overflow-y: auto;
  display: block;
  /* 覆盖 flex，让内部 block 正常流式布局 */
}

/* 日志列表可滚动区域（占据 footer 之上的全部空间） */
.logs-list-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* 日志抽屉底部：总数 + 分页 + 清空按钮 */
.logs-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid var(--ink-100);
}

.logs-footer-left,
.logs-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logs-total {
  font-size: 13px;
  color: var(--ink-500);
}

.logs-total b {
  color: var(--ink-900);
  font-weight: 600;
}

.logs-page-size {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-700);
  cursor: pointer;
}

.logs-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
}

.pager-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: var(--radius-xs);
  color: var(--ink-700);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--ease-in);
}

.pager-btn:hover:not(:disabled) {
  background: var(--primary-soft);
  color: var(--primary);
}

.pager-btn:disabled {
  color: var(--ink-300);
  cursor: not-allowed;
}

.pager-info {
  font-size: 12px;
  color: var(--ink-500);
  padding: 0 6px;
}

.pager-info b {
  color: var(--primary);
  font-weight: 600;
}

/* danger outline 按钮（清空日志用） */
.btn-danger-outline {
  background: #fff;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--ease-in);
}

.btn-danger-outline:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

.drawer-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-top: 1px solid var(--ink-200);
  background: #fafbfc;
  flex-shrink: 0;
}

/* 自动保存状态提示（抽屉 footer 中间） */
.auto-save-hint {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--ink-500);
  white-space: nowrap;
  user-select: none;
}

/* 抽屉内表单项两列布局 */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 0;
}

.form-row .col-half {
  flex: 1;
  min-width: 0;
}

/* 脚本编辑器容器（CodeMirror 实例挂载点） */
.script-editor {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--ease-in), box-shadow var(--ease-in);
}

.script-editor .CodeMirror {
  height: 480px;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.55;
}

.script-editor:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ============ 弹窗（删除确认等） ============ */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: auto;
}

.modal-card {
  width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(15, 23, 42, 0.06);
  animation: modal-pop .2s var(--ease-out-back);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-card-lg {
  width: 880px;
}

.modal-card-sm {
  width: 420px;
}

.modal-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.confirm-text {
  margin: 8px 0 16px 0;
  color: var(--ink-600);
  line-height: 1.6;
}

/* ============ 执行日志弹窗 ============ */
.exec-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ink-200);
  padding-bottom: 12px;
}

.exec-log-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink-500);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.exec-log-close:hover {
  color: var(--ink-900);
}

.exec-log-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-500);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.exec-log-meta .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.exec-log-meta .status-success {
  background: #22c55e;
}

.exec-log-meta .status-failed {
  background: #ef4444;
}

.exec-log-meta .status-timeout {
  background: #f59e0b;
}

.exec-log-body {
  margin-top: 12px;
  min-height: 200px;
  max-height: 50vh;
  overflow: hidden;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: #0f172a;
  position: relative;
}

/* 加载态 spinner */
.exec-log-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 200px;
  color: #94a3b8;
  font-size: 13px;
}

.exec-log-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #334155;
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: exec-spin 0.9s linear infinite;
}

@keyframes exec-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 日志输出 */
.exec-log-pre {
  margin: 0;
  padding: 14px 16px;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #e2e8f0;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  height: 100%;
  max-height: 50vh;
}

.exec-log-pre .log-stderr {
  color: #fca5a5;
}

.exec-log-pre .log-stdout {
  color: #e2e8f0;
}

.exec-log-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ============ 日志抽屉内列表 ============ */
.logs-list-wrap {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.log-detail-row td {
  background: #0f172a;
  padding: 12px;
}

.log-detail {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: "Consolas", "Monaco", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 280px;
  overflow-y: auto;
}

.log-detail.stdout {
  color: #4ade80;
}

.log-detail.stderr {
  color: #f87171;
  margin-top: 8px;
}

.log-detail-label {
  display: inline-block;
  color: var(--ink-400);
  font-size: 11px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .app-header {
    padding: 0 16px;
    height: 52px;
  }

  .task-list-wrap {
    padding: 16px;
  }

  .toolbar-left {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search-input,
  .search-input:focus {
    width: 100%;
  }

  .list-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .toolbar-right {
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {

  .modal-card,
  .modal-card-lg,
  .modal-card-sm {
    width: 92vw;
  }

  .drawer-panel,
  .drawer-panel-lg {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .header-user .user-label {
    display: none;
  }
}