/* ================================================================
   YOLO Manager — 全局样式
   ================================================================ */

/* ---- CSS 变量 ---- */
:root {
  --font-base: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
               "WenQuanYi Micro Hei", "Noto Sans SC", system-ui,
               -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "JetBrains Mono",
               "Source Code Pro", "Courier New", monospace;

  --color-primary:   #475569;
  --color-accent:    #6366f1;
  --color-success:   #10b981;
  --color-warning:   #f59e0b;
  --color-danger:    #ef4444;
  --color-info:      #3b82f6;

  --color-bg:        #f1f5f9;
  --color-surface:   #ffffff;
  --color-border:    #e2e8f0;
  --color-text:      #1e293b;
  --color-text-muted:#64748b;
  --color-heading:   #0f172a;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
}

/* ---- 全局 ---- */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-base);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6 {
  font-weight: 650;
  line-height: 1.4;
  color: var(--color-heading);
}

code,pre,kbd,samp { font-family: var(--font-mono); font-size: 0.82rem; }
a { color: var(--color-accent); }
a:hover { color: #4f46e5; }

/* ---- 无障碍跳转链接 ---- */
.skip-link,
.skip-link:focus,
.skip-link:focus-visible {
  background: transparent !important;
  background-color: transparent !important;
}

/* ---- 导航栏 ---- */
.app-header {
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-header .nav-link { color: rgba(255,255,255,.85); }
.app-header .nav-link:hover { color: #fff; }
.app-header .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}

/* ---- 侧边栏 ---- */
.app-sidebar {
  --sidebar-collapsed-width: 4.6rem;
  --sidebar-icon-width: 1.5rem;
  --sidebar-item-x: 0.5rem;
  --sidebar-collapsed-item-width: calc(var(--sidebar-collapsed-width) - (var(--sidebar-item-x) * 2));
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  border-top: 0 !important;
  border-right: none;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: none;
  will-change: min-width, max-width, margin-left, transform;
}
body.app-loaded .app-sidebar {
  transition: min-width .28s cubic-bezier(.2,.8,.2,1),
              max-width .28s cubic-bezier(.2,.8,.2,1),
              margin-left .28s cubic-bezier(.2,.8,.2,1),
              transform .28s cubic-bezier(.2,.8,.2,1);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: flex-start !important;
  padding: 1.15rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align: left;
  transition: padding-left .28s cubic-bezier(.2,.8,.2,1),
              padding-right .28s cubic-bezier(.2,.8,.2,1);
}
.sidebar-brand .brand-link {
  justify-content: flex-start !important;
  flex: 0 1 12rem;
  min-width: 0;
  max-width: 12rem;
  width: 100%;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff !important;
  opacity: 1;
  overflow: hidden;
  transform: translateX(0);
  transition: flex-basis .28s cubic-bezier(.2,.8,.2,1),
              max-width .28s cubic-bezier(.2,.8,.2,1),
              opacity .18s ease,
              transform .28s cubic-bezier(.2,.8,.2,1);
}
.sidebar-brand .brand-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  color: rgba(255,255,255,.72);
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.sidebar-toggle:hover,
.sidebar-toggle:focus {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.sidebar-toggle .bi {
  font-size: 1.2rem;
  line-height: 1;
}
.sidebar-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  transition: padding .28s cubic-bezier(.2,.8,.2,1);
}
.sidebar-menu .nav-link {
  display: grid;
  grid-template-columns: var(--sidebar-icon-width) minmax(0, 1fr);
  align-items: center;
  column-gap: 0.75rem;
  margin: 2px var(--sidebar-item-x);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem !important;
  color: rgba(255,255,255,.7);
  font-size: 0.875rem;
  transition: color .15s ease,
              background .15s ease,
              box-shadow .15s ease,
              grid-template-columns .28s cubic-bezier(.2,.8,.2,1),
              column-gap .28s cubic-bezier(.2,.8,.2,1),
              padding-left .28s cubic-bezier(.2,.8,.2,1),
              padding-right .28s cubic-bezier(.2,.8,.2,1);
}
.sidebar-menu .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.sidebar-menu .nav-link.active {
  color: #fff !important;
  background: var(--color-accent) !important;
  box-shadow: 0 2px 6px rgba(99,102,241,.35);
}
.sidebar-menu .nav-icon {
  font-size: 1.1rem;
  justify-self: center;
  margin: 0 !important;
  width: var(--sidebar-icon-width);
  text-align: center;
}
.sidebar-menu .nav-link p {
  display: block;
  max-width: 11rem;
  min-width: 0;
  overflow: hidden;
  font-size: 0.875rem;
  margin-bottom: 0;
  opacity: 1;
  transform: translateX(0);
  transition: max-width .28s cubic-bezier(.2,.8,.2,1),
              opacity .18s ease,
              transform .28s cubic-bezier(.2,.8,.2,1);
  vertical-align: middle;
  white-space: nowrap;
}
.sidebar-menu .nav-header {
  position: relative;
  display: flex;
  align-items: center;
  height: 2.1rem;
  margin: 1rem var(--sidebar-item-x) 0.8rem !important;
  padding: 0 0.5rem !important;
  overflow: hidden;
  background: transparent !important;
  transition: margin .28s cubic-bezier(.2,.8,.2,1),
              padding .28s cubic-bezier(.2,.8,.2,1);
}
.sidebar-menu .nav-header::before {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  left: 0.25rem;
  height: 1px;
  content: "";
  background: rgba(255,255,255,.12);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .18s ease;
  z-index: 0;
}
.sidebar-menu .nav-header span {
  display: inline-block;
  position: relative;
  max-width: 8rem;
  overflow: hidden;
  opacity: 1;
  transition: max-width .28s cubic-bezier(.2,.8,.2,1),
              opacity .18s ease;
  white-space: nowrap;
}
.sidebar-user {
  display: flex;
  flex: 0 0 auto;
  padding: 0.8rem 1rem 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
  transition: padding-left .28s cubic-bezier(.2,.8,.2,1),
              padding-right .28s cubic-bezier(.2,.8,.2,1);
}
.sidebar-user-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.55rem;
  max-width: 100%;
  color: rgba(255,255,255,.9);
  transition: grid-template-columns .28s cubic-bezier(.2,.8,.2,1),
              column-gap .28s cubic-bezier(.2,.8,.2,1);
}
.sidebar-user-toggle:hover,
.sidebar-user-toggle:focus {
  color: #fff;
}
.sidebar-user-toggle::after {
  margin-left: 0;
}
.sidebar-user-avatar {
  flex: 0 0 auto;
  font-size: 1.55rem;
  justify-self: center;
  line-height: 1;
}
.sidebar-user-name {
  flex: 0 1 9rem;
  min-width: 0;
  max-width: 9rem;
  overflow: hidden;
  opacity: 1;
  text-overflow: ellipsis;
  transform: translateX(0);
  transition: flex-basis .28s cubic-bezier(.2,.8,.2,1),
              max-width .28s cubic-bezier(.2,.8,.2,1),
              opacity .18s ease,
              transform .28s cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
}
.sidebar-user-menu {
  min-width: 220px;
  z-index: 1080;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-brand {
  gap: 0;
  padding-right: calc((var(--sidebar-collapsed-width) - 2.25rem) / 2);
  padding-left: calc((var(--sidebar-collapsed-width) - 2.25rem) / 2);
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-brand .brand-link {
  flex-basis: 0;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.4rem);
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-brand .brand-text {
  animation: none;
  max-width: none;
  visibility: visible;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .app-sidebar {
  max-width: var(--sidebar-collapsed-width) !important;
  min-width: var(--sidebar-collapsed-width) !important;
  overflow: visible;
  z-index: 1040;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-wrapper,
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu {
  overflow: visible;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item {
  position: relative;
  width: var(--sidebar-collapsed-width) !important;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu .nav-header {
  display: flex !important;
  height: 2.1rem;
  margin: 0.75rem var(--sidebar-item-x) 0.65rem !important;
  padding: 0 !important;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu .nav-header::before {
  opacity: 1 !important;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu .nav-header span {
  max-width: 0;
  opacity: 0;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu .nav-link {
  grid-template-columns: var(--sidebar-collapsed-item-width) minmax(0, 0fr);
  column-gap: 0;
  padding-right: 0 !important;
  padding-left: 0 !important;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu .nav-icon {
  margin: 0 !important;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu .nav-link p {
  animation: none;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.4rem);
  visibility: visible;
  width: 0;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item > .nav-treeview {
  position: absolute;
  top: 0;
  left: var(--sidebar-collapsed-width);
  display: none !important;
  width: max-content;
  min-width: 8.5rem;
  max-width: min(14rem, calc(100vw - var(--sidebar-collapsed-width) - 1rem));
  margin: 0 !important;
  padding: 0.45rem;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(2,6,23,.28);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.3rem);
  z-index: 1100;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item > .nav-treeview::before {
  position: absolute;
  top: 0;
  right: 100%;
  width: 1.25rem;
  height: 100%;
  content: "";
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item > .nav-treeview .nav-item {
  width: 100%;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item.submenu-hover > .nav-treeview,
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item:hover > .nav-treeview {
  display: block !important;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item > .nav-treeview .nav-link {
  display: grid;
  grid-template-columns: 1.25rem max-content !important;
  align-items: center;
  column-gap: 0.55rem;
  margin: 2px 0;
  padding: 0.5rem 0.65rem !important;
  color: rgba(255,255,255,.7);
  width: max-content;
  min-width: 100%;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item > .nav-treeview .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item > .nav-treeview .nav-link.active {
  color: #fff !important;
  background: var(--color-accent) !important;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item > .nav-treeview .nav-icon {
  width: 1.25rem;
  font-size: 0.55rem;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-menu > .nav-item > .nav-treeview .nav-link p {
  display: block !important;
  max-width: 10rem !important;
  min-width: 0;
  opacity: 1 !important;
  overflow: hidden;
  pointer-events: auto;
  text-overflow: ellipsis;
  transform: none !important;
  visibility: visible !important;
  white-space: nowrap;
  width: auto !important;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-user-toggle {
  grid-template-columns: 1fr minmax(0, 0fr) 0;
  column-gap: 0;
  width: 100%;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-user-avatar {
  margin: 0 !important;
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-user-name {
  display: inline-block;
  flex-basis: 0;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.4rem);
}
.sidebar-mini.sidebar-collapse.sidebar-without-hover .sidebar-user-toggle::after {
  display: none;
}

/* ---- 主内容区 ---- */
.app-content {
  padding-top: 1rem;
  padding-bottom: 0.75rem;
}

/* ---- 页面标题 ---- */
.app-content .row.mb-4 h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-heading);
}
.app-content .app-page-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.25;
}
.app-content .app-page-title > .bi {
  display: inline-flex;
  flex: 0 0 1.3rem;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  margin: 0;
  line-height: 1;
}
.app-content .app-page-title > span {
  line-height: 1.25;
}
.app-content .app-page-header {
  min-height: 4.65rem;
}
.app-content .app-page-header > .col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.app-content .app-page-header p {
  margin-bottom: 0;
}
.breadcrumb { font-size: 0.8rem; }

/* ---- 卡片 ---- */
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  padding: 0.75rem 1rem;
}
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-body { padding: 1rem; }
.card-footer {
  background: #f8fafc;
  border-top: 1px solid var(--color-border);
}

/* ---- 表格 ---- */
.table {
  font-size: 0.875rem;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}
/* 浅色表头 */
.table thead th {
  font-weight: 600;
  font-size: 0.82rem;
  color: #475569;
  background: #f8fafc;
  border-top: 1px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
  padding: 0.6rem 0.85rem;
  vertical-align: middle;
  white-space: nowrap;
}
/* 行 */
.table tbody td {
  padding: 0.6rem 0.85rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: var(--color-text);
}
.table tbody tr:last-child td { border-bottom: none; }
/* 斑马纹 */
.table-striped > tbody > tr:nth-of-type(odd) > td {
  background: #fafbfc;
}
/* 悬停 */
.table-hover tbody tr:hover td {
  background: #eef2ff !important;
}
/* 首列序号 */
.table tbody td:first-child {
  color: #94a3b8;
  font-size: 0.8rem;
  text-align: center;
}
/* 操作列 */
.table .table-actions {
  white-space: nowrap;
  text-align: right;
}
.table .table-actions a,
.table .table-actions .btn-link {
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  transition: all .12s;
}
.table .table-actions a:hover,
.table .table-actions .btn-link:hover {
  background: #eef2ff;
}
.table .table-actions .text-danger:hover {
  background: #fef2f2;
  color: #dc2626 !important;
}
/* 表格内 badge */
.table .badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25em 0.55em;
}

/* ---- 表单 ---- */
.form-label { font-weight: 500; color: var(--color-text); margin-bottom: 0.3rem; }
.form-control, .form-select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-base);
  padding: 0.45rem 0.75rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* 浏览器自动填充时保持字体、颜色、背景与普通输入一致，避免刷新后内容字体变化 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  font-family: var(--font-base) !important;
  font-size: inherit !important;
  -webkit-text-fill-color: var(--color-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface) inset !important;
  caret-color: var(--color-text);
  transition: background-color 9999s ease-in-out 0s;
}

/* ---- 按钮 ---- */
.btn {
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.9rem;
  transition: all .15s;
}
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: #4f46e5; border-color: #4f46e5; }
.btn-success { background: var(--color-success); border-color: var(--color-success); }
.btn-warning { background: var(--color-warning); border-color: var(--color-warning); }
.btn-danger  { background: var(--color-danger);  border-color: var(--color-danger); }
.btn-info    { background: var(--color-info);    border-color: var(--color-info); }
.btn-outline-info  { color: var(--color-info);    border-color: var(--color-info); }
.btn-outline-danger{ color: var(--color-danger);  border-color: var(--color-danger); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

/* ---- Badge ---- */
.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.3em 0.6em;
  border-radius: var(--radius-sm);
}

/* ---- Alert (inline form validation) ---- */
.alert {
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

/* ---- Toast 弹出消息 ---- */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}
.toast-popup {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.08);
  border-left: 4px solid #6366f1;
  animation: toast-in .3s ease-out;
  font-size: 0.875rem;
  pointer-events: auto;
}
.toast-popup.toast-success { border-left-color: var(--color-success); }
.toast-popup.toast-danger  { border-left-color: var(--color-danger); }
.toast-popup.toast-warning { border-left-color: var(--color-warning); }
.toast-popup.toast-info    { border-left-color: var(--color-info); }
.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
}
.toast-success .toast-icon { color: var(--color-success); }
.toast-danger  .toast-icon { color: var(--color-danger); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info    .toast-icon { color: var(--color-info); }
.toast-body {
  flex: 1;
  line-height: 1.5;
  color: var(--color-text);
}
.toast-close {
  background: none;
  border: none;
  font-size: 1.15rem;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}
.toast-close:hover { color: var(--color-text); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- Dashboard 统计卡片 ---- */
.small-box {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  color: #fff;
  margin-bottom: 1rem;
}
.small-box .inner h3 { font-size: 2rem; font-weight: 700; margin: 0 0 .25rem; letter-spacing: .02em; }
.small-box .inner p  { font-size: .95rem; margin: 0; opacity: .9; }
.small-box .small-box-icon {
  position: absolute; right: 1rem; top: 1rem;
  font-size: 3rem; opacity: .25;
}
.small-box .small-box-footer {
  display: block; padding: .5rem 0;
  color: rgba(255,255,255,.85); text-decoration: none;
  font-size: .875rem; position: relative; z-index: 1;
}
.small-box .small-box-footer:hover { color: #fff; }

/* ---- 分页 ---- */
.pagination { margin-bottom: 0; }
.page-link {
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: .35rem .7rem;
  font-size: .85rem;
}
.page-item.active .page-link {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* ---- 登录 / 注册页 ---- */
.auth-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ---- 日志 ---- */
#train-log {
  white-space: pre-wrap; word-break: break-all;
  font-family: var(--font-mono); font-size: .78rem;
  line-height: 1.6;
}

/* ---- 标注画布 ---- */
#annotation-canvas { background: #f8fafc; }

/* ---- 表格内代码 ---- */
td code { background: #f1f5f9; padding: 2px 6px; border-radius: 3px; font-size: .82rem; }

/* ---- 空状态 ---- */
.empty-state { color: #94a3b8; }
.empty-state .bi { color: #cbd5e1; }

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- Dashboard ---- */
.progress { border-radius: 10px; }
.progress-bar { border-radius: 10px; transition: width .6s ease; }

/* ---- 通用进度条动画（所有插件共享） ---- */
@keyframes progress-stripes {
  0% { background-position: 1rem 0; }
  100% { background-position: 0 0; }
}

@keyframes progress-shimmer {
  0% { opacity: 0.5; }
  50% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

/* 运行中的进度条：条纹动画 */
.progress-bar-animated {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-stripes 1s linear infinite;
}

/* 运行中的进度条轨道：微光呼吸 */
.progress-track-active {
  animation: progress-shimmer 1.8s ease-in-out infinite;
}
.dashboard-stat-card { transition: transform .15s, box-shadow .15s; }
.dashboard-stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.1) !important; }
.spinner-grow-sm { width: 8px; height: 8px; }

/* ---- 应用门户卡片 ---- */
.app-portal-header {
  margin-bottom: 1.25rem !important;
}

.app-portal-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  border-radius: 10px;
  overflow: hidden;
}

.app-portal-card.h-100 {
  height: 300px !important;
}

.app-portal-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

.app-portal-card-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  margin-bottom: 0.8rem !important;
  font-size: 3rem;
  line-height: 1;
}

.app-portal-card-icon .bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-portal-grid {
  --bs-gutter-x: 1.25rem;
  --bs-gutter-y: 1.25rem;
}

.app-portal-card-copy {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  justify-items: center;
  height: 5.65rem;
  min-height: 5.65rem;
  overflow: hidden;
  text-align: center;
  width: 100%;
}

.app-portal-card-title {
  display: block;
  margin: 0;
  max-width: 100%;
  color: var(--color-heading);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
}

.app-portal-card-description {
  display: -webkit-box;
  margin: 0;
  max-width: 14rem;
  color: var(--color-text-muted) !important;
  font-size: 0.86rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
  overflow: hidden;
  text-align: center;
}

.app-portal-card-version {
  flex: 0 0 auto;
  margin-top: auto;
}

.app-portal-card-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

.app-portal-card .btn-primary {
  min-width: 6rem;
}

/* ---- 应用门户卡片拖拽排序 ---- */
.app-portal-card-wrapper {
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: default;
}

.app-portal-card-wrapper[draggable="true"] {
  cursor: grab;
}

.app-portal-card-wrapper[draggable="true"]:active {
  cursor: grabbing;
}

/* 正在拖拽的卡片 */
.app-portal-card-wrapper.app-portal-dragging {
  opacity: 0.45;
  transform: scale(0.96);
}

/* 放置位置指示 — 左侧插入 */
.app-portal-card-wrapper.app-portal-drop-before::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  z-index: 3;
  animation: drop-indicator-pulse 0.8s ease-in-out infinite;
}

/* 放置位置指示 — 右侧插入 */
.app-portal-card-wrapper.app-portal-drop-after::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  z-index: 3;
  animation: drop-indicator-pulse 0.8s ease-in-out infinite;
}

@keyframes drop-indicator-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 非管理员用户 — 卡片保持正常交互 */
.app-portal-card-wrapper:not([draggable="true"]) .app-portal-card {
  cursor: default;
}

/* 登录页密码显示/隐藏按钮 — 透明背景、无边框，仅保留眼睛图标 */
.toggle-password-visibility,
.toggle-password-visibility:hover,
.toggle-password-visibility:focus,
.toggle-password-visibility:active,
.toggle-password-visibility:focus-visible {
  background: transparent;
  border: none;
  box-shadow: none;
  outline: none;
  color: inherit;
}

/* 眼睛按钮定位在输入框内部右侧，不占文档流 */
.input-group .toggle-password-visibility {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  /* 输入框聚焦时 Bootstrap 会把它提到 z-index: 5，按钮必须更高才能浮在输入框上层 */
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  padding: 0;
}

/* 隐藏 Chrome/Edge 的原生密码显示按钮 */
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-ms-reveal {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  visibility: hidden !important;
}
