/* ============================================================
   AQ助手V2 - 全局样式表
   移动优先响应式设计（≤768px 为手机端布局）
   浅色清爽商务风，纯 CSS 图标/emoji，无图片资源
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
  /* 主题色 */
  --primary: #4f8ef7;
  --primary-dark: #3a74d8;
  --primary-light: #e8f0fe;
  --secondary: #6c7a89;
  --danger: #e5534b;
  --danger-light: #fdecea;
  --success: #2fbf71;
  --success-light: #e6f7ee;
  --warning: #f0a020;
  --warning-light: #fef4e0;
  --info: #17a2b8;

  /* 中性色 */
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-secondary: #6c7a89;
  --text-muted: #9aa5b1;
  --border: #e3e8ef;
  --border-light: #eef1f5;

  /* 状态色（统一状态机） */
  --st-todo: #9aa5b1;      /* 未开始 - 灰 */
  --st-doing: #4f8ef7;     /* 进行中 - 蓝 */
  --st-waiting: #f0a020;   /* 等待中 - 橙 */
  --st-done: #2fbf71;      /* 已完成 - 绿 */
  --st-delayed: #e5534b;   /* 已延期 - 红 */
  --st-paused: #9b59b6;    /* 搁置   - 紫 */
  --st-canceled: #5d6d7e;  /* 已取消 - 暗灰 */

  /* 圆角 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(44, 62, 80, .08);
  --shadow: 0 2px 10px rgba(44, 62, 80, .10);
  --shadow-lg: 0 6px 24px rgba(44, 62, 80, .16);

  /* 尺寸 */
  --nav-height: 56px;
  --nav-bottom-height: 64px;    /* 最新版底部导航：单层 8 项，正文只预留一层高度 */
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  /* 手机端底部留出固定导航高度 */
  padding-bottom: calc(var(--nav-bottom-height) + 8px);
}

a { color: var(--primary); text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 600; }

/* ---------- 顶部导航栏（PC / 默认） ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.topnav .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  margin-right: 8px;
}

.topnav .logo::before { content: "📋 "; }

.topnav .nav-links {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
}

.topnav .nav-links::-webkit-scrollbar { display: none; }

.topnav .nav-links a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.topnav .nav-links a:hover { background: var(--primary-light); color: var(--primary); }

.topnav .nav-links a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ---------- 手机底部固定导航 ---------- */
.bottomnav {
  display: none; /* PC 默认隐藏 */
}

/* ---------- 页面容器 ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.page-header h1 { font-size: 22px; }
.page-header .sub { color: var(--text-secondary); font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background .15s, box-shadow .15s, transform .05s;
  background: var(--card-bg);
  color: var(--text);
  line-height: 1.4;
}

.btn:active { transform: translateY(1px); }

.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 主按钮 */
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

/* 次按钮 */
.btn-secondary {
  background: var(--card-bg);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg); border-color: var(--secondary); }

/* 危险按钮（1.24.3：透明底 + 红字 + 极细淡红边框，禁止粗红框/大色块） */
.btn-danger { background: transparent; color: #ef4444; border: 1px solid #fca5a5; }
.btn-danger:hover:not(:disabled) { background: #fef2f2; }

/* 成功按钮 */
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #27a862; }

/* 小尺寸按钮 */
.btn-sm { padding: 3px 10px; font-size: 12px; border-radius: 5px; }

/* 块级按钮 */
.btn-block { width: 100%; }

/* 链接型按钮 */
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  padding: 4px 6px;
  font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .more {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.card.hoverable { transition: box-shadow .15s, transform .15s; }
.card.hoverable:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-group label .req { color: var(--danger); margin-left: 2px; }

.form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, .15);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea { resize: vertical; min-height: 80px; }

input[type="checkbox"], input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
}

.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

/* ---------- 徽标 badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--bg);
  color: var(--text-secondary);
}

/* 状态徽标（统一状态机配色） */
.badge-status-未开始 { background: #eef1f4; color: var(--st-todo); }
.badge-status-进行中 { background: var(--primary-light); color: var(--st-doing); }
.badge-status-等待中 { background: var(--warning-light); color: var(--st-waiting); }
.badge-status-已完成 { background: var(--success-light); color: var(--st-done); }
.badge-status-已延期 { background: var(--danger-light); color: var(--st-delayed); }
.badge-status-搁置   { background: #f3e8f9; color: var(--st-paused); }
.badge-status-已取消 { background: #e5e9ee; color: var(--st-canceled); }
.badge-status-暂停 { background: #f0efed; color: #78716c; }
.badge-status-已挂起 { background: #f0efed; color: #78716c; }
.badge-status-已搁置 { background: #f0efed; color: #78716c; }
.badge-status-暂停跟进 { background: #f0efed; color: #78716c; }

/* 1.25.0 四态派生徽标（新增，不替换 .badge；记录详情「来源条目状态」仍用 .badge） */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}
.status-badge.status-todo      { background: #f3f4f6; color: #6b7280; }
.status-badge.status-doing     { background: #e0f2fe; color: #0284c7; }
.status-badge.status-waiting   { background: #ede9fe; color: #6d28d9; }
.status-badge.status-accepting { background: #fef9c3; color: #a16207; }
.status-badge.status-paused    { background: #fef3c7; color: #d97706; }
.status-badge.status-terminated{ background: #fee2e2; color: #dc2626; }
.status-badge.status-finished  { background: #f3f4f6; color: #4b5563; }
.status-badge.status-promoted  { background: #e5e7eb; color: #6b7280; }

/* 1.25.2 模块 G：子任务行收纳 —— 标题最多两行截断，操作区不被压缩 */
.subtask-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.subtask-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.subtask-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-break: break-word;
  line-height: 1.45;
}
.subtask-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 1.25.3：子任务跟进按钮三态直显 —— 尺寸钉死（不随文案变化），配色随派生状态 */
.subtask-follow-btn {
  width: 76px !important;
  min-width: 76px !important;
  height: 32px !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid #c9cede;
  border-radius: 6px;
  background: #f6f8fc;
  color: #5a6b8c;
  cursor: pointer;
}
.subtask-follow-btn.is-paused {
  background: #fef3c7;
  color: #d97706;
  border-color: #fcd34d;
}
.subtask-follow-btn.is-terminated {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* 优先级徽标 */
.badge-prio-高 { background: var(--danger-light); color: var(--danger); }
.badge-prio-中 { background: var(--warning-light); color: var(--warning); }
.badge-prio-低 { background: #eef1f4; color: var(--text-secondary); }

/* 象限徽标（四象限配色） */
.badge-quad { background: var(--primary-light); color: var(--primary); }
.badge-quad-1 { background: var(--danger-light); color: var(--danger); }
.badge-quad-2 { background: var(--success-light); color: var(--st-done); }
.badge-quad-3 { background: var(--warning-light); color: var(--warning); }
.badge-quad-4 { background: #eef1f4; color: var(--text-secondary); }

/* ---------- 标签 tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin: 2px 3px 2px 0;
}

.tag::before { content: "#"; margin-right: 2px; color: var(--text-muted); }

.tag-primary { background: var(--primary-light); color: var(--primary); border-color: transparent; }

/* ---------- 模态框 modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 30, 45, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .18s ease;
}

.modal-dialog {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .22s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 { font-size: 17px; }

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

/* 1.24.4：底部操作栏改为两排网格（4 + 2），文字绝不截断、去大色块 */
.modal-footer, .action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  justify-content: flex-start;
  align-items: center;
  overflow: visible;
  border-top: none;
}
.modal-footer .btn, .action-bar .btn {
  flex: 1 1 calc(25% - 8px);
  min-width: 0;
  height: 36px;
  min-height: 36px;
  padding: 0 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
/* 第二排：低频/危险操作各占一半（保险箱靠左、删除靠右） */
.modal-footer .btn-danger, .modal-footer .btn-safe,
.action-bar .btn-danger, .action-bar .btn-safe {
  flex: 1 1 calc(50% - 8px);
}
/* 次操作：浅灰底深灰字 */
.modal-footer .btn:not(.btn-primary):not(.btn-danger),
.action-bar .btn:not(.btn-primary):not(.btn-danger) {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}
/* 主操作：蓝底白字 */
.modal-footer .btn-primary, .action-bar .btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
/* 危险操作：透明底红字极细淡红边框 */
.modal-footer .btn-danger, .action-bar .btn-danger,
.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid #fca5a5;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

.modal-mask.closing { animation: fadeOut .15s ease forwards; }
.modal-mask.closing .modal-dialog { animation: slideDown .15s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes slideDown { to { opacity: 0; transform: translateY(14px); } }

/* ---------- Toast 通知 ---------- */
.toast-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(90vw, 360px);
}

/* 1.22.5：重温池跟进反馈固定在右下角（不改变默认右上角 toast） */
.toast-wrap.toast-wrap-bottom {
  top: auto;
  bottom: 16px;
}

.toast {
  pointer-events: auto;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--info);
  padding: 10px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .25s ease;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-success::before { content: "✅"; }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-error::before   { content: "❌"; }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-warning::before { content: "⚠️"; }
.toast.toast-info::before    { content: "ℹ️"; }

.toast.toast-out { animation: toastOut .25s ease forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------- 看板 kanban ---------- */
.kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.kanban-col {
  flex: 0 0 280px; /* 每列固定宽 */
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 10px;
  font-size: 14px;
  font-weight: 600;
}

.kanban-col-header .count {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--card-bg);
  border-radius: 12px;
  padding: 0 8px;
}

.kanban-col-body {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow .15s;
}

.kanban-card:hover { box-shadow: var(--shadow); }

/* ---------- 表格 table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.table th {
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
}

/* 斑马纹 */
.table tbody tr:nth-child(even) { background: #fafbfd; }
.table tbody tr:hover { background: var(--primary-light); }

.table td.wrap, .table th.wrap { white-space: normal; }

/* ---------- 选项卡 tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  margin-bottom: 16px;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs .tab {
  padding: 9px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}

.tabs .tab:hover { color: var(--primary); }

.tabs .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ---------- 时间线 timeline ---------- */
.timeline {
  position: relative;
  padding-left: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 18px;
}

.timeline-item:last-child { padding-bottom: 0; }

/* 圆点 */
.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-item.t-danger::before { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }
.timeline-item.t-success::before { background: var(--success); box-shadow: 0 0 0 2px var(--success-light); }
.timeline-item.t-warning::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-light); }
.timeline-item.t-muted::before { background: var(--text-muted); box-shadow: 0 0 0 2px var(--border-light); }

.timeline-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.timeline-content { font-size: 14px; }

/* ---------- 进度条 progress ---------- */
.progress {
  height: 8px;
  background: var(--border-light);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 10px;
  transition: width .3s ease;
  text-align: right;
  font-size: 0;
}

.progress-bar.progress-success { background: var(--success); }
.progress-bar.progress-warning { background: var(--warning); }
.progress-bar.progress-danger  { background: var(--danger); }

/* 带文字的进度条 */
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ---------- 响应式网格 ---------- */
.grid2, .grid3 {
  display: grid;
  gap: 14px;
}

/* 手机端默认单列 */
.grid2 { grid-template-columns: 1fr; }
.grid3 { grid-template-columns: 1fr; }

/* ---------- 空状态 empty ---------- */
.empty {
  text-align: center;
  padding: 44px 16px;
  color: var(--text-muted);
}

.empty::before {
  content: "📭";
  display: block;
  font-size: 44px;
  margin-bottom: 10px;
  opacity: .7;
}

.empty .empty-text { font-size: 14px; }
.empty .empty-action { margin-top: 14px; }

/* ---------- 快速记录输入框 ---------- */
.quick-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}

.quick-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, .15);
}

.quick-input textarea, .quick-input input {
  border: none;
  box-shadow: none;
  padding: 6px 0;
  background: transparent;
  flex: 1;
}

.quick-input textarea:focus, .quick-input input:focus { box-shadow: none; }

/* 麦克风按钮 */
.quick-input .mic-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 17px;
  cursor: pointer;
  transition: background .15s;
}

.quick-input .mic-btn:hover { background: var(--primary-light); }

/* 录音中状态：红色脉冲动画 */
.quick-input .mic-btn.recording {
  background: var(--danger);
  animation: micPulse 1s ease infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 83, 75, .5); }
  50%      { box-shadow: 0 0 0 8px rgba(229, 83, 75, 0); }
}

/* 发送按钮 */
.quick-input .send-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s;
}

.quick-input .send-btn:hover { background: var(--primary-dark); }

/* ---------- 已完成事项折叠 ---------- */
.collapsed > .collapsible-body { display: none; }

.collapsible-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
}

.collapsible-header::before {
  content: "▸";
  color: var(--text-muted);
  transition: transform .15s;
  font-size: 12px;
}

.collapsed > .collapsible-header::before,
.collapsed .collapsible-header::before { transform: rotate(90deg); }

.collapsible-header:hover { color: var(--primary); }

/* ---------- 工具类 ---------- */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs18 { font-size: 18px; }
.fw600 { font-weight: 600; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 已完成事项文字划线 */
.item-done .item-title, .done-line { text-decoration: line-through; color: var(--text-muted); }

/* 滚动条美化（PC） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cdd6e0; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b6c2cf; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   响应式断点：≥769px 视为 PC
   ============================================================ */
@media (min-width: 769px) {
  body { padding-bottom: 0; }

  .grid2 { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: repeat(3, 1fr); }

  .container { padding: 24px; }
  .page-header h1 { font-size: 26px; }
}

/* ============================================================
   手机端：≤768px
   ============================================================ */
@media (max-width: 768px) {
  /* 隐藏顶部导航中的链接，仅保留 logo（也可整隐藏） */
  .topnav { padding: 0 14px; }
  .topnav .nav-links { display: none; }

  /* 显示底部固定导航：最新版单层 8 项（7 个主入口 + 更多） */
  .bottomnav {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(44, 62, 80, .08);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .bottomnav-row { display: flex; flex: 0 0 auto; width: 100%; min-height: 0; }
  .bottomnav-row + .bottomnav-row { border-top: 1px solid var(--border); }

  .bottomnav a {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 7px 0 6px;
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-muted);
    transition: color .15s;
  }

  .bottomnav a .icon { font-size: 19px; line-height: 1; }

  .bottomnav a.active { color: var(--primary); font-weight: 600; }

  /* 模态框接近全屏 */
  .modal-dialog { max-height: 92vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal-mask .modal-dialog { max-width: 100%; }

  /* 看板列稍窄适配手机屏 */
  .kanban-col { flex-basis: 250px; }
}

/* ============================================================
   手机 UA 强制移动布局：兼容华为等浏览器报告桌面级 CSS 宽度的情况。
   必须与上方 max-width 移动规则等效，且优先级高于 PC min-width 规则。
   ============================================================ */
html.mobile-shell body {
  padding-bottom: calc(var(--nav-bottom-height) + 8px);
  padding-bottom: calc(var(--nav-bottom-height) + env(safe-area-inset-bottom, 0) + 8px);
}

html.mobile-shell .topnav { padding: 0 14px; }
html.mobile-shell .topnav .nav-links { display: none; }

html.mobile-shell .bottomnav {
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(44, 62, 80, .08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

html.mobile-shell .bottomnav-row {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
}

html.mobile-shell .bottomnav-row + .bottomnav-row { border-top: 1px solid var(--border); }

html.mobile-shell .bottomnav a {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  max-width: 130px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 0 6px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text-muted);
  transition: color .15s;
}

html.mobile-shell .bottomnav a .icon { font-size: 19px; line-height: 1; }
html.mobile-shell .bottomnav a.active { color: var(--primary); font-weight: 600; }
