:root {
  --dp-bg: #f3f6fa;
  --dp-surface: #ffffff;
  --dp-surface-soft: #fbfdff;
  --dp-ink: #0f172a;
  --dp-text: #1f2937;
  --dp-muted: #64748b;
  --dp-faint: #94a3b8;
  --dp-border: #dbe3ef;
  --dp-border-soft: #e7edf5;
  --dp-brand: #2563eb;
  --dp-brand-strong: #1d4ed8;
  --dp-brand-soft: #eff6ff;
  --dp-success: #059669;
  --dp-success-soft: #ecfdf5;
  --dp-warning: #d97706;
  --dp-warning-soft: #fffbeb;
  --dp-danger: #dc2626;
  --dp-danger-soft: #fef2f2;
  --dp-cyan: #0891b2;
  --dp-rose: #e11d48;
  --dp-nav: #0f172a;
  --dp-nav-2: #1e293b;
  --dp-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  margin: 0;
}

html {
  min-height: 100%;
  margin: 0;
}

body.dp-app {
  display: block;
  min-height: 100vh;
  margin: 0;
  color: var(--dp-text);
  background: var(--dp-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.login-page {
  min-height: 100vh;
  margin: 0;
  color: var(--dp-text);
  background: var(--dp-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

a {
  text-decoration: none;
}

code {
  color: #334155;
  word-break: break-all;
}

pre {
  color: var(--dp-text);
}

pre.log-box {
  color: #d1d5db;
}

.dp-navbar {
  min-height: 64px;
  background: linear-gradient(135deg, var(--dp-nav-2) 0%, var(--dp-nav) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.content-shell {
  width: 92%;
  margin: 0 auto;
  padding: 28px 0 56px;
}

.dp-navbar .content-shell {
  width: 90%;
  min-height: 64px;
  padding: 0;
}

.dp-navbar-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
}

.dp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.dp-brand:hover {
  color: #fff;
}

.dp-brand-icon,
.dp-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.dp-brand-icon {
  color: #93c5fd;
  background: rgba(37, 99, 235, .18);
  border: 1px solid rgba(147, 197, 253, .25);
}

.dp-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 10px;
  flex-wrap: wrap;
}

.dp-user-chip {
  color: #cbd5e1;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dp-user-chip strong {
  color: #fff;
  font-weight: 700;
}

.btn i {
  line-height: 1;
}

.btn-nav {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-nav:hover {
  color: #fff;
  background: rgba(255, 255, 255, .16);
}

.btn-soft {
  color: var(--dp-brand);
  border-color: transparent;
  background: var(--dp-brand-soft);
  font-weight: 600;
}

.btn-soft:hover {
  color: #fff;
  background: var(--dp-brand);
  border-color: var(--dp-brand);
}

.dp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.dp-page-title {
  margin: 0;
  color: var(--dp-ink);
  font-size: 25px;
  line-height: 1.25;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dp-page-title i {
  color: var(--dp-brand);
}

.dp-page-subtitle {
  margin-top: 6px;
  color: var(--dp-muted);
  font-size: 14px;
}

.dp-page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dp-hero {
  margin: 0 0 0;
  padding: 54px 5vw 58px;
  color: #f8fafc;
  background: linear-gradient(135deg, var(--dp-nav-2) 0%, var(--dp-nav) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.dp-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.dp-hero-left,
.dp-hero-right {
  position: relative;
  z-index: 1;
}

.dp-hero-title-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-8px);
}

.dp-hero-title {
  margin: 0;
  color: #f1f5f9;
  font-size: 42px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.dp-hero-subtitle {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.dp-hero-right {
  max-width: 560px;
  text-align: right;
}

.dp-hero-desc {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.8;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card,
.dp-panel,
.project-card,
.dp-card {
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.metric-card {
  min-width: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dp-brand);
  background: var(--dp-brand-soft);
  flex: 0 0 auto;
}

.metric-icon.success {
  color: var(--dp-success);
  background: var(--dp-success-soft);
}

.metric-icon.warning {
  color: var(--dp-warning);
  background: var(--dp-warning-soft);
}

.metric-icon.danger {
  color: var(--dp-danger);
  background: var(--dp-danger-soft);
}

.metric-value {
  color: var(--dp-ink);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.metric-label {
  margin-top: 5px;
  color: var(--dp-muted);
  font-size: 12px;
  font-weight: 650;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  min-height: 100%;
  padding: 18px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.project-card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--dp-shadow);
  transform: translateY(-2px);
}

.dp-panel.project-card {
  min-height: 0;
  padding: 0;
  transition: none;
}

.dp-panel.project-card:hover {
  border-color: var(--dp-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  transform: none;
}

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

.project-title {
  min-width: 0;
}

.project-title h2,
.project-title h3 {
  margin: 0;
  color: var(--dp-ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.project-meta {
  margin-top: 6px;
  color: var(--dp-muted);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.status-pill {
  min-height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.terminal-occupied {
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  min-height: 25px;
}

.status-pill[data-status="active"],
.status-pill.status-active,
.status-pill.status-success,
.status-pill.status-enabled {
  color: var(--dp-success);
  background: var(--dp-success-soft);
  border-color: #bbf7d0;
}

.status-pill[data-status="deploying"],
.status-pill.status-running,
.status-pill.status-pending {
  color: var(--dp-brand);
  background: var(--dp-brand-soft);
  border-color: #bfdbfe;
}

.status-pill[data-status="inactive"],
.status-pill.status-inactive,
.status-pill.status-disabled {
  color: var(--dp-muted);
  background: #f8fafc;
  border-color: #e2e8f0;
}

.status-pill[data-status="error"],
.status-pill.status-error,
.status-pill.status-failed,
.status-pill.status-danger {
  color: var(--dp-danger);
  background: var(--dp-danger-soft);
  border-color: #fecaca;
}

.status-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

.project-facts,
.detail-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.fact-row,
.detail-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.fact-label,
.detail-label {
  color: var(--dp-muted);
  font-size: 12px;
  font-weight: 700;
}

.fact-value,
.detail-value {
  color: var(--dp-ink);
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.dp-panel {
  overflow: hidden;
}

.dp-panel + .dp-panel {
  margin-top: 16px;
}

.dp-panel-header {
  min-height: 50px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--dp-border-soft);
  background: var(--dp-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dp-panel-title {
  margin: 0;
  color: var(--dp-ink);
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dp-panel-title i {
  color: var(--dp-brand);
}

.dp-panel-body {
  padding: 18px;
}

.dp-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dp-access-panel {
  margin-bottom: 16px;
}

.access-url {
  display: block;
  font-size: 14px;
  line-height: 1.7;
}

.dp-access-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.dp-access-box code {
  display: inline-block;
  margin-top: 4px;
}

/* Access cards – public URL + edge server addresses */
.access-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.access-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--dp-surface);
  border: 1px solid var(--dp-border-soft);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}

.access-card:hover {
  border-color: var(--dp-border);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.access-card-empty {
  opacity: .6;
}

.access-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--dp-brand-soft);
  color: var(--dp-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.access-card-body {
  flex: 1;
  min-width: 0;
}

.access-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--dp-muted);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.access-card-url {
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
  background: transparent;
  padding: 0;
  color: var(--dp-ink);
}

.access-card-meta {
  font-size: 11px;
  color: var(--dp-muted);
  display: block;
  margin-top: 2px;
}

.access-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.test-result {
  font-size: 12px;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

.test-result.test-ok { color: #157347; }
.test-result.test-fail { color: #b02a37; }
.test-result.test-loading { color: var(--dp-muted); }

.dp-form-card {
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  overflow: hidden;
}

.dp-form-section {
  padding: 20px;
}

.dp-form-section + .dp-form-section {
  border-top: 1px solid var(--dp-border-soft);
}

.dp-section-caption {
  margin-bottom: 16px;
}

.dp-section-caption h2 {
  margin: 0;
  color: var(--dp-ink);
  font-size: 16px;
  font-weight: 800;
}

.dp-section-caption p {
  margin: 5px 0 0;
  color: var(--dp-muted);
  font-size: 13px;
}

.form-text {
  color: var(--dp-muted);
  font-size: 12px;
}

.empty-state {
  padding: 54px 20px;
  color: var(--dp-muted);
  text-align: center;
}

.empty-state i {
  display: block;
  margin-bottom: 12px;
  color: #cbd5e1;
  font-size: 36px;
}

.log-box {
  min-height: 220px;
  max-height: 480px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  color: #d1d5db;
  background: #0f172a;
  border-radius: 0 0 8px 8px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.route-param-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Framework badges (Flask / FastAPI / MCP) ─────────────── */
.framework-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.4;
}

.framework-badge i {
  font-size: 11px;
  flex-shrink: 0;
}

/* Flask — steel blue */
.framework-badge.framework-flask {
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.framework-badge.framework-flask i { color: #3b82f6; }

/* FastAPI — teal */
.framework-badge.framework-fastapi {
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
}
.framework-badge.framework-fastapi i { color: #14b8a6; }

/* MCP — indigo/purple */
.framework-badge.framework-mcp {
  color: #6d28d9;
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
}
.framework-badge.framework-mcp i { color: #8b5cf6; }

/* Docker — sky blue（与 Flask 的钢蓝区分开） */
.framework-badge.framework-docker {
  color: #0c4a6e;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}
.framework-badge.framework-docker i { color: #0284c7; }

/* Larger variant for page titles */
.framework-badge.framework-badge-lg {
  padding: 5px 14px;
  font-size: 14px;
  gap: 7px;
}
.framework-badge.framework-badge-lg i {
  font-size: 14px;
}

.route-param {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
}

.login-page {
  display: flex;
  color: var(--dp-text);
  background: #f8fafc;
}

.login-brand {
  flex: 0 0 44%;
  min-height: 100vh;
  padding: 64px 48px;
  color: #f8fafc;
  background:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(135deg, var(--dp-nav-2) 0%, var(--dp-nav) 100%);
  background-size: 34px 34px, 34px 34px, auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.login-brand-mark {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
  background: rgba(37, 99, 235, .18);
  border: 1px solid rgba(147, 197, 253, .25);
  font-size: 34px;
  margin-bottom: 28px;
}

.login-brand h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 380px;
  margin: 14px 0 0;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.8;
}

.login-brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 42px;
  max-width: 440px;
}

.login-brand-item {
  padding: 13px 14px;
  border: 1px solid rgba(203, 213, 225, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 9px;
}

.login-brand-item i {
  color: #93c5fd;
}

.login-panel {
  flex: 1;
  min-height: 100vh;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(410px, 100%);
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: #eef2f7;
  border-radius: 10px;
}

.mode-tab {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: #64748b;
  background: transparent;
  font-size: 14px;
  font-weight: 750;
}

.mode-tab.active {
  color: var(--dp-brand);
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.auth-form.hidden,
.hidden {
  display: none !important;
}

.link-btn {
  border: 0;
  padding: 0;
  color: var(--dp-brand);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.link-btn:disabled {
  color: #94a3b8;
}

.auth-msg {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.auth-msg:not(:empty) {
  display: block;
}

.auth-msg.error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.auth-msg.success {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.login-card h2 {
  margin: 0;
  color: var(--dp-ink);
  font-size: 25px;
  font-weight: 850;
}

.login-card .login-subtitle {
  margin: 8px 0 28px;
  color: var(--dp-muted);
  font-size: 14px;
}

.input-wrap {
  position: relative;
}

.input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.input-wrap .form-control {
  height: 44px;
  padding-left: 42px;
}

.login-submit {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-note {
  margin-top: 28px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1100px) {
  .project-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dp-hero-inner,
  .dp-page-header,
  .dp-access-box,
  .dp-access-panel .dp-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dp-hero-right,
  .dp-hero-desc {
    max-width: none;
    text-align: left;
  }

  .dp-page-actions {
    justify-content: flex-start;
  }

  .login-brand {
    display: none;
  }

  .login-panel {
    padding: 28px;
  }
}

@media (max-width: 700px) {
  .content-shell {
    width: 94%;
    padding-top: 20px;
  }

  .dp-navbar {
    position: static;
    padding: 10px 0;
  }

  .dp-navbar-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    gap: 10px;
  }

  .dp-navbar .content-shell {
    width: 94%;
  }

  .dp-nav-actions {
    width: 100%;
    justify-content: flex-start;
    justify-self: stretch;
  }

  .dp-nav-actions {
    align-items: stretch;
  }

  .dp-brand {
    margin-bottom: 0;
  }

  .dp-hero {
    padding-top: 26px;
    padding-bottom: 28px;
  }

  .dp-hero-title {
    font-size: 32px;
    white-space: normal;
  }

  .metric-grid,
  .project-grid,
  .login-brand-grid {
    grid-template-columns: 1fr;
  }

  .fact-row,
  .detail-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .btn,
  .btn-nav {
    justify-content: center;
  }
}

/* ── Terminal Modal ── */
.terminal-modal .modal-dialog {
  max-width: 80vw;
}

.terminal-modal .modal-header {
  justify-content: flex-start;
}

.terminal-modal .modal-body {
  padding: 0;
  background: #0f172a;
}

.terminal-modal .xterm {
  padding: 8px;
  height: 100%;
}

.terminal-modal .xterm-viewport {
  scrollbar-width: thin;
  scrollbar-color: #475569 transparent;
}

.terminal-modal .xterm-viewport::-webkit-scrollbar {
  width: 8px;
}

.terminal-modal .xterm-viewport::-webkit-scrollbar-thumb {
  background-color: #475569;
  border-radius: 4px;
}

.terminal-modal .xterm .xterm-screen canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* 数字输入框去掉 Bootstrap is-invalid 的 X 图标（与上下按钮重叠），改用感叹号 */
input[type="number"].is-invalid {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23e6a23c' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zM7.5 4h1v5h-1V4zm.5 7a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5z'/%3E%3C/svg%3E");
  background-position: right calc(0.375em + 1.5rem) center;
  background-size: calc(0.65em + 0.375rem) calc(0.65em + 0.375rem);
  border-color: #e6a23c;
  padding-right: calc(1.5em + 1.5rem);
}
input[type="number"].is-invalid:focus {
  border-color: #e6a23c;
  box-shadow: 0 0 0 0.2rem rgba(230, 162, 60, 0.25);
}

/* ═══════════════════════════════════════════
   Project Team / Agent Workspace
   ═══════════════════════════════════════════ */

/* Agent status animations */
@keyframes agent-working-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

@keyframes agent-transfer-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
  60% { transform: translateY(0); }
}

@keyframes agent-idle-breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Working agent glow effect */
.agent-working {
  animation: agent-working-pulse 2s infinite;
}

/* Transferring agent bounce */
.agent-transferring {
  animation: agent-transfer-bounce 0.6s infinite;
}

/* Idle agent subtle animation */
.agent-idle {
  animation: agent-idle-breathe 3s infinite;
}

/* Connection status dot in team workspace */
.conn-live {
  background-color: #059669;
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.5);
  animation: agent-working-pulse 2s infinite;
}
.conn-dead {
  background-color: #dc2626;
}

/* Task flow arrow animation */
@keyframes flow-arrow {
  0% { opacity: 0.3; transform: translateX(-5px); }
  50% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0.3; transform: translateX(5px); }
}
.flow-arrow {
  animation: flow-arrow 1.5s infinite;
  display: inline-block;
  color: #d97706;
}

/* Activity feed scrollbar */
.activity-feed::-webkit-scrollbar,
.message-panel::-webkit-scrollbar {
  width: 4px;
}
.activity-feed::-webkit-scrollbar-thumb,
.message-panel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Refined member card hover */
.member-card {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s, background 0.3s;
}
.member-card:hover {
  transform: translateY(-3px);
}

/* Task item drag hint */
.task-item {
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.task-item:active {
  transform: scale(0.97);
}

/* Empty column placeholder */
.task-column:empty::after {
  content: "拖放任务到此处";
  display: block;
  text-align: center;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 1rem;
  border: 1px dashed #e2e8f0;
  border-radius: 6px;
}

/* ── Feishu Pipeline Flow ── */
.pipeline-flow {
  padding: 24px 24px 16px;
}

.pipeline-cards-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin-bottom: 20px;
}

.pipeline-card-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.pipeline-lines-row {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.pipeline-dot-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
}

.pipeline-dot-col:first-child .line-left { display: none; }
.pipeline-dot-col:last-child .line-right { display: none; }

.pipeline-node-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #cbd5e1;
  border: 3px solid #94a3b8;
  z-index: 1;
}

.pipeline-node-dot[data-status="success"] { background: #059669; border-color: #059669; }
.pipeline-node-dot[data-status="running"] { background: #2563eb; border-color: #2563eb; animation: pipeline-pulse 2s infinite; }
.pipeline-node-dot[data-status="error"]   { background: #dc2626; border-color: #dc2626; }

.pipeline-node-line {
  flex: 1;
  height: 3px;
  background: #e2e8f0;
}

.pipeline-node-line[data-status="success"] { background: #059669; }

.pipeline-node-card {
  width: 100%;
  max-width: 170px;
  padding: 18px 12px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}

.pipeline-node-card:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 12px rgba(37,99,235,.15);
  transform: translateY(-2px);
}

.pipeline-node-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.25);
}

.pipeline-node-card[data-status="success"] { border-color: #059669; background: #f0fdf6; }
.pipeline-node-card[data-status="running"] { border-color: #2563eb; background: #eff6ff; animation: pipeline-border-pulse 2s infinite; }
.pipeline-node-card[data-status="error"]   { border-color: #dc2626; background: #fef2f2; }
.pipeline-node-card[data-status="pending"] { background: #f8fafc; }

.pipeline-node-icon {
  font-size: 24px;
  margin-bottom: 8px;
  color: #94a3b8;
}

.pipeline-node-card[data-status="success"] .pipeline-node-icon { color: #059669; }
.pipeline-node-card[data-status="running"] .pipeline-node-icon { color: #2563eb; }
.pipeline-node-card[data-status="error"]   .pipeline-node-icon { color: #dc2626; }

.pipeline-node-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.pipeline-node-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.pipeline-step-progress {
  display: flex;
  gap: 3px;
  align-items: center;
}

.pipeline-mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}

.pipeline-mini-dot.success { background: #059669; }
.pipeline-mini-dot.running { background: #2563eb; }
.pipeline-mini-dot.error   { background: #dc2626; }

@keyframes pipeline-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
}

@keyframes pipeline-border-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.15); }
  50%      { box-shadow: 0 0 0 4px rgba(37,99,235,.08); }
}

/* ── Dify AI Chatbot ─────────────────────────────────────────────── */

.dp-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--dp-brand, #2563eb);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
  transition: transform .2s, box-shadow .2s;
}
.dp-chat-bubble:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 24px rgba(37,99,235,.5);
}
.dp-chat-bubble:active { transform: scale(.95); }
.dp-chat-bubble.hidden { display: none; }

.dp-chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 570px;
  height: 780px;
  max-height: calc(100vh - 120px);
  background: var(--dp-surface, #fff);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(15,23,42,.18);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity .2s, transform .2s;
}
.dp-chat-window.hidden {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.dp-chat-header {
  background: var(--dp-brand, #2563eb);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.dp-chat-header-title {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dp-chat-header-actions { display: flex; gap: 4px; }
.dp-chat-header-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.dp-chat-header-btn:hover { background: rgba(255,255,255,.3); }

.dp-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dp-chat-body::-webkit-scrollbar { width: 5px; }
.dp-chat-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

.dp-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--dp-muted, #64748b);
  text-align: center;
  padding: 24px;
}
.dp-chat-empty-icon { font-size: 36px; margin-bottom: 8px; opacity: .5; }
.dp-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.dp-chat-suggestion {
  background: var(--dp-surface, #fff);
  border: 1px solid var(--dp-border, #dbe3ef);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--dp-text, #1f2937);
  transition: all .15s;
}
.dp-chat-suggestion:hover { border-color: var(--dp-brand, #2563eb); color: var(--dp-brand, #2563eb); }

.dp-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.dp-chat-msg.user {
  align-self: flex-end;
  background: var(--dp-brand, #2563eb);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.dp-chat-msg.ai {
  align-self: flex-start;
  background: var(--dp-surface, #fff);
  border: 1px solid var(--dp-border-soft, #e7edf5);
  border-bottom-left-radius: 4px;
  color: var(--dp-text, #1f2937);
}
.dp-chat-msg.ai pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  margin: 6px 0;
}
.dp-chat-msg.ai code:not(pre code) {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}
.dp-chat-msg.ai p { margin: 0; line-height: 1.75; }
.dp-chat-msg.ai p + p { margin-top: 8px; }
.dp-chat-msg.ai ul, .dp-chat-msg.ai ol { margin: 6px 0; padding-left: 20px; }
.dp-chat-msg.ai li { margin: 2px 0; }
.dp-chat-msg.ai strong { color: var(--dp-ink, #0f172a); }
.dp-chat-msg.ai a { color: var(--dp-brand, #2563eb); text-decoration: underline; }
.dp-chat-msg.ai h1, .dp-chat-msg.ai h2, .dp-chat-msg.ai h3,
.dp-chat-msg.ai h4, .dp-chat-msg.ai h5, .dp-chat-msg.ai h6 {
  font-size: 1em;
  margin: 8px 0 4px;
  color: var(--dp-ink, #0f172a);
}
.dp-chat-msg.ai hr { border: none; border-top: 1px solid var(--dp-border-soft, #e7edf5); margin: 8px 0; }
.dp-chat-msg.ai blockquote {
  border-left: 3px solid var(--dp-brand, #2563eb);
  padding-left: 12px;
  margin: 6px 0;
  color: var(--dp-muted, #64748b);
}

.dp-chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--dp-surface, #fff);
  border: 1px solid var(--dp-border-soft, #e7edf5);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.dp-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dp-muted, #94a3b8);
  animation: dp-chat-typing-bounce 1.4s ease-in-out infinite both;
}
.dp-chat-typing span:nth-child(1) { animation-delay: 0s; }
.dp-chat-typing span:nth-child(2) { animation-delay: .16s; }
.dp-chat-typing span:nth-child(3) { animation-delay: .32s; }

@keyframes dp-chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.dp-chat-footer {
  border-top: 1px solid var(--dp-border-soft, #e7edf5);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: #fff;
}
.dp-chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--dp-border, #dbe3ef);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  max-height: 100px;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
.dp-chat-input:focus { border-color: var(--dp-brand, #2563eb); }
.dp-chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: var(--dp-brand, #2563eb);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
}
.dp-chat-send-btn:hover { background: var(--dp-brand-strong, #1d4ed8); }
.dp-chat-send-btn:active { transform: scale(.92); }
.dp-chat-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* History sidebar */
.dp-chat-history {
  position: absolute;
  inset: 0;
  background: var(--dp-surface, #fff);
  z-index: 10;
  display: flex;
  flex-direction: column;
  transition: transform .2s;
}
.dp-chat-history.hidden { transform: translateX(100%); pointer-events: none; }

.dp-chat-history-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--dp-border-soft, #e7edf5);
  cursor: pointer;
  font-size: 14px;
  transition: background .1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dp-chat-history-item:hover { background: #f1f5f9; }
.dp-chat-history-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}
.dp-chat-history-item-time { font-size: 12px; color: var(--dp-faint, #94a3b8); flex-shrink: 0; }

@media (max-width: 576px) {
  .dp-chat-window {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  .dp-chat-bubble { bottom: 16px; right: 16px; }
}

/* Blinking cursor during streaming */
.dp-chat-cursor {
  display: inline;
  color: var(--dp-brand, #2563eb);
  animation: dp-chat-blink 0.8s step-end infinite;
}
@keyframes dp-chat-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
