/* 统一设计层：状态语义、按钮与信息层级
   原则：常用内容优先；同一含义同一颜色；装饰不抢信息。
   本文件在 style.css / ux.css 之后加载，只做“统一”和“收敛”，不改变业务布局。 */

:root {
  --st-done: #047857;
  --st-done-bg: #ecfdf5;
  --st-doing: #1d4ed8;
  --st-doing-bg: #eff6ff;
  --st-todo: #475569;
  --st-todo-bg: #f1f5f9;
  --st-warn: #b45309;
  --st-warn-bg: #fffbeb;
  --st-danger: #b91c1c;
  --st-danger-bg: #fef2f2;
  --ds-focus: #bfdbfe;
}

/* ---------- 状态色：一套语义，所有页面共用 ---------- */
.badge.ok,
.badge.done,
.badge.success {
  background: var(--st-done-bg);
  color: var(--st-done);
}
.badge.blue,
.badge.doing,
.badge.running {
  background: var(--st-doing-bg);
  color: var(--st-doing);
}
.badge.gray,
.badge.todo,
.badge.draft {
  background: var(--st-todo-bg);
  color: var(--st-todo);
}
.badge.warn,
.badge.attention,
.badge.overdue {
  background: var(--st-warn-bg);
  color: var(--st-warn);
}
.badge.danger,
.badge.blocked,
.badge.failed {
  background: var(--st-danger-bg);
  color: var(--st-danger);
}
.badge.purple {
  background: #f5f3ff;
  color: #6d28d9;
}

/* ---------- 按钮：尺寸、焦点、禁用统一 ---------- */
.btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn.sm {
  min-height: 26px;
}
.btn:focus-visible,
.input:focus-visible,
.tab:focus-visible {
  outline: 2px solid var(--ds-focus);
  outline-offset: 1px;
}
.btn.danger:hover {
  background: var(--st-danger-bg);
  border-color: #fca5a5;
}
.btn.primary:disabled,
.btn.primary[disabled] {
  background: #93b4f8;
  border-color: #93b4f8;
}

/* ---------- 状态图例：一眼看懂颜色 ---------- */
.ds-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #64748b;
}
.ds-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.ds-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--st-todo);
}
.ds-dot.done { background: var(--st-done); }
.ds-dot.doing { background: var(--st-doing); }
.ds-dot.todo { background: #94a3b8; }
.ds-dot.warn { background: var(--st-warn); }
.ds-dot.danger { background: var(--st-danger); }

/* ---------- 信息层级：标题、说明、次要信息 ---------- */
.ds-title {
  font-size: 15px;
  font-weight: 650;
  color: #22304d;
  line-height: 1.35;
}
.ds-sub {
  font-size: 12px;
  color: #7b879d;
  line-height: 1.6;
}
.ds-note {
  padding: 9px 11px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.75;
}
.ds-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ds-actions .btn.primary { margin-left: auto; }

/* ---------- 卡片信息块：减少重复内联样式 ---------- */
.ds-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.75;
  color: #475569;
}
.ds-meta-row b {
  flex: 0 0 auto;
  color: #22304d;
  font-weight: 600;
}
.ds-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- 空状态：统一文案位置 ---------- */
.ds-empty {
  padding: 28px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}

/* ---------- 次要操作收纳：默认只露主操作，减少每张卡片的按钮噪音 ---------- */
.ds-more {
  position: relative;
  display: inline-flex;
}
.ds-more > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.ds-more > summary::-webkit-details-marker { display: none; }
.ds-more[open] > summary {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.ds-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: none;
  flex-direction: column;
  min-width: 118px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}
.ds-more[open] .ds-more-menu { display: flex; }
.ds-more-menu .btn {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.ds-more-menu .btn:hover { background: #f8fafc; }
.ds-more-menu .btn.danger:hover { background: var(--st-danger-bg); }

/* ---------- 高级筛选：默认收起，只保留核心条件 ---------- */
.ds-filter-more {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}
.ds-filter-more > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.ds-filter-more > summary::-webkit-details-marker { display: none; }
.ds-filter-more[open] {
  flex: 1 0 100%;
}
.ds-filter-more[open] > summary {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.ds-filter-panel {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px dashed #e2e8f0;
}
.ds-filter-panel .input { min-width: 130px; }




/* ---------- 登录验证码 ---------- */
.login-captcha-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-captcha-wrap .input { flex: 1; min-width: 90px; }
.login-captcha-img {
  width: 116px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  background: #f8fafc;
  flex: 0 0 auto;
}
.login-captcha-refresh {
  border: 1px solid var(--line);
  background: #fff;
  color: #475569;
  border-radius: 7px;
  height: 36px;
  padding: 0 9px;
  font-size: 12px;
  cursor: pointer;
  flex: 0 0 auto;
}
.login-captcha-refresh:hover { background: #f8fafc; color: var(--ink); }
