/* ═══════════════════════════════════════════════════════════
   AWS Assistant — Global Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Layout ── */
html, body { height: 100%; margin: 0; }
body { background: #f0f2f5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
#sidebar {
  width: 220px;
  min-width: 220px;
  background: #1a1f2e;
  display: flex;
  flex-direction: column;
  transition: width .2s ease, min-width .2s ease;
  overflow: hidden;
  z-index: 100;
}
#sidebar.collapsed { width: 56px; min-width: 56px; }

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  border-bottom: 1px solid #2d3448;
  gap: 10px;
  min-height: 52px;
}
.sidebar-logo { color: #38bdf8; font-size: 1.3rem; flex-shrink: 0; }
.sidebar-title {
  color: #f8fafc;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
}
#sidebar.collapsed .sidebar-title { display: none; }

#sidebar-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  font-size: 1rem;
}
#sidebar-toggle:hover { color: #f8fafc; background: #2d3448; }

/* ── Sidebar nav ── */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #2d3448; border-radius: 2px; }

.nav-section-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 12px 16px 4px;
  white-space: nowrap;
  overflow: hidden;
}
#sidebar.collapsed .nav-section-label { visibility: hidden; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s, color .15s;
  white-space: nowrap;
  border-left: 3px solid transparent;
  user-select: none;
}
.nav-item:hover { background: #243044; color: #e2e8f0; }
.nav-item.active { background: #1e3a5f; color: #60a5fa; border-left-color: #3b82f6; }
.nav-item .nav-icon { font-size: 1.05rem; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item .nav-label { font-size: .875rem; overflow: hidden; }
#sidebar.collapsed .nav-label { display: none; }
#sidebar.collapsed .nav-item { padding: 9px 0; justify-content: center; border-left: none; }
#sidebar.collapsed .nav-item.active { background: #1e3a5f; }

.sidebar-divider { border-top: 1px solid #2d3448; margin: 8px 0; }

/* ── Main content ── */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Top bar ── */
#topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.topbar-breadcrumb { font-size: .875rem; color: #64748b; display: flex; align-items: center; gap: 6px; }
.topbar-breadcrumb .current { color: #1e293b; font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ── Page container ── */
#page-container { flex: 1; overflow-y: auto; padding: 0; }
.page-section { display: none; height: 100%; }
.page-section.active { display: flex; flex-direction: column; height: 100%; }

/* ── Module tabs (within a page) ── */
.module-tabs {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px;
  display: flex;
  gap: 0;
  flex-shrink: 0;
}
.module-tab {
  padding: 12px 16px;
  font-size: .875rem;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  user-select: none;
}
.module-tab:hover { color: #3b82f6; }
.module-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }

/* ── Tab content ── */
.tab-content-area { flex: 1; overflow-y: auto; }
.tab-panel { display: none; padding: 20px; height: 100%; box-sizing: border-box; }
.tab-panel.active { display: block; }

/* Give schedule navigation and the long editor separate scroll areas. */
#sched-list { max-height: calc(100vh - 350px); }
/* The editor must scroll its actions clear of the fixed tools at the lower right. */
#sched-form-content { padding-bottom: calc(144px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 992px) {
  .tab-panel[data-page="domain-binding"][data-tab="schedules"].active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #sched-project-nav, #sched-project-heading { flex-shrink: 0; }
  .sched-layout {
    --bs-gutter-y: 0;
    flex: 1;
    flex-wrap: nowrap;
    min-height: 0;
  }
  .sched-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  .sched-sidebar > :not(#sched-list) { flex-shrink: 0; }
  .sched-sidebar > #sched-list {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    overscroll-behavior-y: contain;
  }
  .sched-editor {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
}

/* ── Prerequisite guard card ── */
.prereq-card {
  max-width: 520px;
  margin: 60px auto;
  background: #fff;
  border-radius: 12px;
  padding: 36px 40px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  text-align: center;
}
.prereq-card .prereq-icon { font-size: 2.5rem; color: #f59e0b; margin-bottom: 16px; }
.prereq-card h5 { font-weight: 700; margin-bottom: 8px; }
.prereq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 8px;
  text-align: left;
  font-size: .875rem;
}
.prereq-item.ok { color: #16a34a; }
.prereq-item.missing { color: #dc2626; }

/* ── Onboarding wizard ── */
#onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-card {
  background: #fff;
  border-radius: 16px;
  padding: 44px 48px;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.onboarding-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.onboarding-step:last-child { border-bottom: none; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dbeafe;
  color: #2563eb;
  font-weight: 700;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-num.done { background: #dcfce7; color: #16a34a; }

/* ── Cards & panels ── */
.content-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  overflow: hidden;
}

/* Data-write projects stay above the list, leaving its full width available. */
.cs-project-bar { display: flex; align-items: center; gap: 12px; min-width: 0; margin-bottom: 14px; padding: 10px 0; border-bottom: 1px solid #dce1e8; }
.cs-project-label { flex-shrink: 0; color: #6b7280; font-size: .8rem; }
.cs-project-tabs { position: relative; display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; padding: 2px 0 4px; }
.cs-project-tab { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; max-width: 240px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #475569; padding: 6px 10px; font-size: .82rem; white-space: nowrap; }
.cs-project-tab:hover { background: #e8edf5; }
.cs-project-tab.is-active { background: #e9efff; border-color: #c8d7ff; color: #315ad7; font-weight: 600; }
.cs-project-tab:focus-visible { outline: 2px solid #4773eb; outline-offset: -2px; }
.cs-project-count { color: #64748b; font-size: .7rem; font-variant-numeric: tabular-nums; }
.cs-project-tab.is-active .cs-project-count { color: #315ad7; }
.cs-project-create { flex-shrink: 0; color: #315ad7; white-space: nowrap; }
.cs-project-create:hover { background: #e9efff; color: #2447b7; }
.cs-project-context { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin: -2px 0 14px; font-size: .78rem; color: #64748b; }
.cs-project-context[hidden] { display: none; }
.cs-project-description { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.cs-task-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cs-task-filters input { max-width: 340px; }
.cs-task-card { cursor: pointer; border-color: #dce1e8; border-radius: 8px; }
.cs-task-card:hover { border-color: #b8c7df; }
.cs-task-card .card-body { padding: 12px 14px; }
.cs-task-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: start; }
.cs-task-main { min-width: 0; }
.cs-task-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; margin-bottom: 5px; }
.cs-task-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 600; }
.cs-task-project { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px; background: #f1f5f9; color: #64748b; padding: 1px 6px; font-size: .7rem; }
.cs-task-state { display: inline-flex; align-items: center; gap: 4px; color: #8a94a3; font-size: .7rem; white-space: nowrap; }
.cs-task-state > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cs-task-state.is-enabled { color: #21845a; }
.cs-task-target, .cs-task-dependency { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #768192; font-size: .75rem; line-height: 1.7; }
.cs-task-meta { display: flex; flex-wrap: wrap; gap: 3px 18px; margin-top: 3px; color: #768192; font-size: .75rem; }
.cs-task-meta > span { max-width: 100%; overflow-wrap: anywhere; }
.cs-task-dependency { margin-top: 4px; color: #7b8494; }
.cs-task-actions { display: flex; align-items: center; gap: 4px; }
.cs-task-actions > .btn, .cs-task-actions > .dropdown > .btn { min-height: 30px; font-size: .75rem; }
.cs-task-actions .dropdown-menu { font-size: .8rem; }
.cs-task-error { margin-top: 4px; color: #c54646; font-size: .75rem; }
.cs-task-error summary { width: fit-content; cursor: pointer; }
.cs-task-error > div { padding-top: 5px; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 767.98px) {
  .cs-project-bar { gap: 6px; }
  .cs-project-label { display: none; }
  .cs-project-create { padding-left: 6px; padding-right: 0; font-size: .75rem; }
  .cs-project-tab { max-width: 170px; padding: 6px 8px; }
  .cs-project-context { flex-wrap: wrap; }
  .cs-task-filters input { max-width: none; width: 100%; }
  .cs-task-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cs-task-actions { justify-content: flex-end; }
}

/* 数据写入任务的新建/编辑工作区：与下方任务列表形成明确边界 */
.cs-task-editor {
  border: 2px solid #3b82f6;
  border-radius: 12px;
  background: #f8fbff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, .16);
  overflow: hidden;
  position: relative;
}
.cs-task-editor::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.cs-editor-header {
  padding: 14px 18px;
  color: #1e3a8a;
  background: #dbeafe;
  border-bottom: 1px solid #93c5fd;
}
.cs-editor-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #fff;
  background: #2563eb;
  font-size: 1.05rem;
}
.cs-editor-body { padding: 20px 18px 0; }
.cs-editor-footer {
  margin-left: calc(-.5 * var(--bs-gutter-x));
  width: calc(100% + var(--bs-gutter-x));
  padding: 14px 18px;
  background: #fff;
  border-top: 1px solid #bfdbfe;
}
@media (max-width: 767.98px) {
  .cs-editor-header { align-items: flex-start !important; gap: 12px; }
  .cs-editor-body { padding: 14px 12px 0; }
  .cs-editor-footer { align-items: stretch !important; flex-direction: column; }
  .cs-editor-footer > div { justify-content: flex-end; }
}
.card-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.card-toolbar h6 { margin: 0; font-weight: 600; font-size: .9rem; }

/* ── Job cards ── */
.job-card {
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: border-color .15s, box-shadow .15s;
  border-radius: 6px;
  margin-bottom: 8px;
}
.job-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.job-card.selected { border-left-color: #3b82f6; background: #eff6ff; }
.job-card.status-DONE    { border-left-color: #16a34a; }
.job-card.status-FAILED  { border-left-color: #dc2626; }
.job-card.status-PARTIAL { border-left-color: #f97316; }
.job-card.status-RUNNING { border-left-color: #0ea5e9; }

/* ── Template & schedule cards ── */
.tpl-card, .sched-card {
  cursor: pointer;
  border-left: 3px solid #cbd5e1;
  transition: border-color .15s, box-shadow .15s;
  border-radius: 6px;
  margin-bottom: 6px;
}
.tpl-card:hover, .sched-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); border-left-color: #3b82f6; }
.tpl-card.selected, .sched-card.selected { border-left-color: #3b82f6; background: #eff6ff; }

/* ── Detail panel ── */
#detail-panel { min-height: 200px; }
.job-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}
.job-detail-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.job-detail-title code {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-size: .86rem !important;
}
.job-detail-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 360px;
}
.job-detail-actions .btn {
  padding: 4px 8px;
  font-size: .78rem;
  min-height: 30px;
}
.job-detail-actions .badge {
  align-self: center;
  font-size: .82rem !important;
}
.job-meta-grid {
  padding: 10px 12px 0;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  font-size: .78rem;
  color: #64748b;
}
.job-meta-grid span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-meta-grid strong { color: #334155; }
.domain-row { font-size: .82rem; }
.domain-row td { vertical-align: top; }
.domain-row code { font-size: .76rem; }
.binding-domain-table { min-width: 700px; }
.binding-domain-table th, .binding-domain-table .btn { white-space: nowrap; }
.binding-domain-table td:first-child { min-width: 180px; }
.binding-domain-table td:nth-child(2) { min-width: 130px; }
.manual-detail {
  font-size: .86rem;
  line-height: 1.55;
}
.manual-detail summary {
  cursor: pointer;
  list-style-position: inside;
}
.manual-detail pre {
  max-height: 220px;
  overflow: auto;
}
@media (max-width: 1280px) {
  .job-detail-header { flex-direction: column; }
  .job-detail-actions { justify-content: flex-start; max-width: none; }
  .job-meta-grid { grid-template-columns: 1fr; }
}

/* ── Spinner ── */
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Event log ── */
#event-log { max-height: 260px; overflow-y: auto; font-size: .8rem; }
.event-entry { border-bottom: 1px solid #f1f5f9; padding: 3px 0; }
.event-domain { color: #3b82f6; font-weight: 600; min-width: 180px; display: inline-block; }
.event-ts { color: #94a3b8; font-size: .75rem; }

/* ── Section headings ── */
.section-title { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 6px; }

/* ── Refresh badge ── */
#refresh-badge { font-size: .75rem; }

/* ── List scrollable areas ── */
.list-scroll { overflow-y: auto; }
.list-scroll-400 { max-height: 400px; overflow-y: auto; }
.list-scroll-420 { max-height: 420px; overflow-y: auto; }

/* ── Inline quick-add panel ── */
.quick-add-panel {
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  padding: 16px;
  margin-top: 8px;
}

/* ── EC2 instance status dots ── */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot-running  { background: #16a34a; }
.dot-stopped  { background: #94a3b8; }
.dot-pending  { background: #f59e0b; animation: pulse .8s infinite alternate; }
.dot-stopping { background: #f97316; animation: pulse .8s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }

/* ── Extra-small button ── */
.btn-xs {
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
  border-radius: 0.2rem;
  line-height: 1.4;
}

/* Keep long server paths and permission details inside their own columns. */
.lxs-server-table td:not(:last-child) { overflow-wrap: anywhere; }
.lxs-server-access, .lxs-server-notes { white-space: normal; overflow-wrap: anywhere; }
.lxs-server-path { max-width: 100%; overflow-wrap: anywhere; }
.lxs-server-remark { white-space: pre-wrap; }
.lxs-server-notes .btn { max-width: 100%; white-space: normal; }

/* ── Table utilities ── */
.table-action-col { width: 120px; white-space: nowrap; }
.text-mono { font-family: ui-monospace, "SFMono-Regular", monospace; font-size: .82rem; }

/* ── Dashboard stat cards ── */
.dash-stat-card {
  transition: transform .15s ease, box-shadow .15s ease;
}
.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.1) !important;
}

/* ── Onboarding wizard overlay ── */
#onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.onboarding-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.onboarding-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  max-width: 680px;
  width: 100%;
  z-index: 1;
}
.onboarding-step-card {
  background: #f8f9fa;
  transition: box-shadow .15s;
}
.onboarding-step-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  margin: 0 auto;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar { width: 56px; min-width: 56px; }
  #sidebar .sidebar-title, #sidebar .nav-label, #sidebar .nav-section-label { display: none; }
  #sidebar .nav-item { padding: 9px 0; justify-content: center; }
}


/* ═══════════════════════════════════════════════════════════
   AI 智能助手悬浮窗样式
   ═══════════════════════════════════════════════════════════ */

/* 悬浮按钮 */
#cleanup-fab {
  right: 88px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 112px);
  z-index: 1055;
}
#cleanup-fab > button { max-width: 100%; white-space: normal; }
#assistant-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(14,165,233,.45);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
#assistant-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(14,165,233,.55);
}
#assistant-fab.panel-open { display: none; }

/* 对话面板 */
.assistant-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 620px;
  height: 75vh;
  min-height: 480px;
  max-height: 860px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  z-index: 1049;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
}
.assistant-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* 标题栏 */
.assistant-header {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.assistant-header-title {
  color: #f1f5f9;
  font-weight: 600;
  font-size: .93rem;
  display: flex;
  align-items: center;
}
.assistant-header-actions { display: flex; gap: 6px; }
.assistant-btn-icon {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: .95rem;
  transition: color .15s, background .15s;
}
.assistant-btn-icon:hover { color: #e2e8f0; background: rgba(255,255,255,.08); }

/* 消息区 */
.assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}
.assistant-messages::-webkit-scrollbar { width: 4px; }
.assistant-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* 欢迎区 */
.assistant-welcome {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}
.assistant-welcome-icon {
  font-size: 1.6rem;
  color: #6366f1;
  flex-shrink: 0;
  margin-top: 2px;
}
.assistant-welcome-text { font-size: .88rem; line-height: 1.6; }
.assistant-suggestions {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.assistant-suggestions li {
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s;
}
.assistant-suggestions li:hover { background: #bae6fd; }

/* 消息气泡 */
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
}
.msg-avatar.ai { background: linear-gradient(135deg,#0ea5e9,#6366f1); color: #fff; }
.msg-avatar.user { background: #e2e8f0; color: #475569; }

.msg-bubble {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: .87rem;
  line-height: 1.55;
  word-break: break-word;
}
.msg-bubble.ai {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  color: #1e293b;
}
.msg-bubble.user {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble.ai pre {
  background: #f1f5f9;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: .82rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 6px 0 0;
}
.msg-bubble.ai code {
  background: #f1f5f9;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: .82rem;
}
.msg-bubble.ai ul, .msg-bubble.ai ol { padding-left: 18px; margin: 4px 0; }
.msg-bubble.ai .md-table-wrap { overflow-x: auto; margin: 6px 0; }
.msg-bubble.ai table { border-collapse: collapse; font-size: .82rem; white-space: nowrap; }
.msg-bubble.ai th, .msg-bubble.ai td { border: 1px solid #e2e8f0; padding: 5px 10px; text-align: left; }
.msg-bubble.ai th { background: #f1f5f9; font-weight: 600; }
.msg-bubble.ai tr:hover td { background: #f8fafc; }

/* Tool 调用提示 */
.tool-call-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: #64748b;
  padding: 4px 10px;
  background: #f1f5f9;
  border-radius: 8px;
  border-left: 3px solid #0ea5e9;
  margin: 2px 0;
}
.tool-call-indicator .spinner-border { width: 12px; height: 12px; border-width: 2px; }

/* 打字指示器 */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* 输入区 */
.assistant-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}
.assistant-textarea {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .88rem;
  resize: none;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
  font-family: inherit;
  transition: border-color .15s;
}
.assistant-textarea:focus { border-color: #0ea5e9; }
.assistant-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
  transition: transform .15s, opacity .15s;
}
.assistant-send-btn:hover { transform: scale(1.08); }
.assistant-send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* DNS schedules: fewer columns, stacked metadata and compact secondary actions. */
.dns-task-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; margin:20px 0; }
.dns-task-toolbar h5 { margin-bottom:8px; }
.dns-task-toolbar .btn { margin-right:0 !important; }
.dns-task-list { background:#fff; border:1px solid #e2e8f0; border-radius:10px; }
.dns-task-list table { min-width:1080px; table-layout:fixed; }
.dns-task-list thead th { padding:15px 20px; white-space:nowrap; background:#f8fafc; color:#64748b; font-size:.8rem; font-weight:600; }
.dns-task-list tbody td { padding:20px; font-size:.875rem; line-height:1.55; }
.dns-task-list tbody tr:last-child td { border-bottom:0; }
.dns-task-name,.dns-task-account { font-weight:600; overflow-wrap:anywhere; }
.dns-task-meta,.dns-task-record { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:9px; }
.dns-task-meta { color:#64748b; font-size:.76rem; }
.dns-task-meta .badge { white-space:nowrap; font-weight:500; }
.dns-task-record code { font-size:.82rem; overflow-wrap:anywhere; color:#475569; }
.dns-task-secondary { margin-top:5px; color:#64748b; font-size:.75rem; overflow-wrap:anywhere; }
.dns-task-counts { display:flex; flex-wrap:wrap; gap:4px 10px; margin-top:8px; font-size:.75rem; color:#64748b; }
.dns-task-counts span { white-space:nowrap; }
.dns-task-counts strong { font-weight:600; color:inherit; }
.dns-task-actions { display:flex; justify-content:flex-end; align-items:center; gap:8px; white-space:nowrap; }
.dns-task-actions>.btn { margin-right:0 !important; }
.dns-task-actions .dropdown-menu { min-width:160px; }
@media (max-width:767px) { .dns-task-toolbar { align-items:flex-start; gap:14px; } .dns-task-list tbody td { padding:16px; } }
