/* ============================================================
   技术经理工作台 (技术经理版) - 样式
   简洁清晰个人风
   ============================================================ */

:root {
  /* ── 色彩系统 ── */
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-bg: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* ── 中性色 ── */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* ── 间距系统 ── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* ── 圆角系统 ── */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ── 阴影系统 ── */
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 10px 15px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);

  /* ── 字体系统 ── */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Monaco", "Consolas", "Liberation Mono", monospace;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* ── 过渡动画 ── */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  font-weight: var(--font-weight-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 顶栏 ── */
.topbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* v3.37 P1-8 修复：v3.37 P2 给 html/body 加了 overflow-x: hidden 让 body 成为滚动容器，
     微信 X5 内核下 position: sticky 会失效，下拉后顶栏消失。改用 fixed + body padding-top 兜底。
     注意：必须同步给 body 加 padding-top: 60px（移动端高度按响应式调整），否则下方内容会被遮挡。*/
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
body { padding-top: 60px; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { font-size: 20px; font-weight: 700; color: var(--primary); }
.topbar-subtitle { font-size: 13px; color: var(--gray-500); }
.topbar-right { display: flex; align-items: center; gap: 16px; position: relative; }
/* v3.38 X5：顶栏汉堡按钮（PC 默认隐藏，小屏显示） */
.topbar-hamburger {
  display: none;
  background: transparent; border: 0; padding: 6px;
  cursor: pointer; color: var(--gray-700);
  border-radius: 4px;
  min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.topbar-hamburger:active { background: var(--gray-100); }
.topbar-menu {
  display: none;  /* PC 默认隐藏，只在小屏 .show 时显示 */
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 6px 0;
  z-index: 101;
}
.topbar-menu.show { display: flex; flex-direction: column; gap: 0; }
.topbar-menu-item {
  display: block; padding: 10px 14px; font-size: 13px;
  color: var(--gray-700); text-decoration: none;
  min-height: 44px;  /* 满足 44px 最小触控区域 */
  display: flex; align-items: center;
  transition: background .15s;
}
.topbar-menu-item:hover, .topbar-menu-item:active { background: var(--gray-100); }

/* ── 通知铃铛 ── */
.bell-wrap { position: relative; cursor: pointer; padding: 6px; }
.bell-wrap svg { width: 22px; height: 22px; color: var(--gray-500); }
.bell-badge {
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: white;
  font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 600; padding: 0 4px;
}
.bell-badge.hidden { display: none; }

/* ── 通知面板 ── */
.notify-panel {
  position: fixed; top: 60px; right: 20px;
  width: 380px; max-height: 500px;
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200);
  overflow: hidden; display: none; z-index: 200;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.notify-panel.show { display: block; }
.notify-header {
  padding: 14px 16px; border-bottom: 1px solid var(--gray-200);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 600;
}
.notify-list { overflow-y: auto; max-height: 400px; }
.notify-item {
  padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
  cursor: pointer; transition: background 0.15s;
}
.notify-item:hover { background: var(--primary-bg); }
.notify-item.unread { border-left: 3px solid var(--primary); }
.notify-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notify-time { font-size: 11px; color: var(--gray-400); }
.notify-empty { padding: 32px; text-align: center; color: var(--gray-400); font-size: 14px; }

/* ── 工作台导航（固定，v3.37 P1-8：sticky → fixed，X5/微信内核兼容） ── */
.workbench-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 99;
  background: linear-gradient(135deg, #f0f7ff, #e8f5e9);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px max(24px, calc((100vw - 1400px) / 2 + 24px));
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.workbench-nav::-webkit-scrollbar { display: none; }
/* 占位元素（高度由 JS 同步 = nav 实际高度，避免 fixed 后下方内容上跳） */
.workbench-nav-spacer { width: 100%; flex-shrink: 0; }
.workbench-nav span { cursor: pointer; color: var(--primary); transition: opacity .15s; }
.workbench-nav span:hover { opacity: 0.75; }
.workbench-nav .nav-title { font-weight: 600; cursor: default; }
/* 导航项滚动高亮（参照运维工具助手效果） */
.workbench-nav .wb-nav-item { padding: 2px 10px; border-radius: 8px; transition: background .2s, color .2s; }
.workbench-nav .wb-nav-item:hover { opacity: 1; background: var(--gray-100); }

/* ── 仪表盘统计 ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  cursor: pointer; text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card[hidden] { display: none !important; }
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.stat-number { font-size: 32px; font-weight: 700; color: var(--primary); line-height: 1.2; text-align: left; }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; text-align: left; }
.stat-card.warn .stat-number { color: var(--warning); }
.stat-card.danger .stat-number { color: var(--danger); }
.stat-card.success .stat-number { color: var(--success); }

/* ── 主内容区 ── */
.main { max-width: 1400px; margin: 0 auto; padding: 24px 32px; }

/* ── 豆腐块网格 ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; text-align: left;
  min-height: 300px;
  transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card.card-collapsed .card-body { display: none; }
.card-full.card-collapsed { min-height: auto !important; }

/* ── 折叠按钮 ── */
.card-collapse-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 4px;
  cursor: pointer; color: var(--gray-400); font-size: 12px;
  transition: all 0.2s; margin-right: 4px;
}
.card-collapse-btn:hover { background: var(--gray-100); color: var(--gray-600); }
.card-collapse-btn svg { transition: transform 0.3s ease; }
.card-collapsed .card-collapse-btn svg { transform: rotate(-90deg); }
.card-full { grid-column: 1 / -1; min-height: 400px; }
/* v3.38 P1-22：我的设置卡片恢复 max-height + 内部滚动 —— 之前去掉 overflow 导致卡片无限长覆盖下方卡片。
   下拉面板已通过 portal 移到 body（不再受 card-body overflow 限制），所以可以安全恢复滚动。
   注意：不能用 overflow-x:visible + overflow-y:auto 组合 —— CSS 标准会让 visible 升级为 auto。
   用 overflow-x:hidden + overflow-y:auto（两个都非 visible，标准不会升级）。 */
#myconfig-card { overflow: visible !important; }
#myconfig-card .card-body { max-height: 520px; overflow-x: hidden; overflow-y: auto; }

/* ── v3.38.P2-23：任务安排卡片去双滚动条（只影响 #tasks-card）────────
   之前：外层 .container 滚动 + 内层 420px 表区滚动 + card-body 默认 overflow-y:auto —— 三层都有机会出现滚动条
   现在：让 #tasks-card 内部所有 max-height 限制 + overflow 限制都失效，由外层（body/.container）单一滚动
   理由：双滚动条同时存在 → 看不到底 + 找不到右边 / 表头，体验糟糕
   影响范围：仅 #tasks-card，其他卡片不动（它们依赖各自的滚动模式） */
#tasks-card { overflow: visible !important; }
#tasks-card .card-body { overflow: visible !important; max-height: none !important; }
/* 抹掉各页签表格区硬编码的 max-height:420px 限制（5 处：loadResolvedItems/tasks-inprogress/tasks-todo 等） */
#tasks-card .card-body div[style*="max-height:420"] {
  max-height: none !important;
  overflow-y: visible !important;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-100);
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-sm);
}
.card-title { 
  font-size: 15px; font-weight: var(--font-weight-semibold); 
  color: var(--gray-800); text-align: left;
}
.card-action { 
  font-size: 12px; color: var(--primary); cursor: pointer;
  padding: 4px 6px; border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.card-action:hover { background: var(--primary-bg); }
.card-action.card-refresh { display:inline-flex; align-items:center; padding:2px 6px; transition:transform var(--transition-normal); }
.card-action.card-refresh:hover { transform:rotate(90deg); }
.card-action.card-refresh svg { vertical-align:middle; }
.card-body { padding: 12px 20px 20px; flex: 1; overflow-y: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── 表格 ── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--gray-50);
}
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--gray-100); }
th { font-weight: 600; color: var(--gray-500); font-size: 12px; text-transform: uppercase; }
tr:hover td { background: var(--gray-50); }

/* ── 标签 ── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fce4ec; color: #c62828; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--gray-200); cursor: pointer;
  background: white; color: var(--gray-700);
  transition: all var(--transition-fast);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}
.btn:hover { background: var(--gray-50); border-color: var(--gray-300); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
/* v3.38.P2-24：评价/星级按钮（黄棕色，与评分卡片配色一致） */
.btn-warning {
  background: linear-gradient(135deg, #ffd54f, #ffb74d);
  color: #5d4037; border-color: #ffb74d; font-weight: 500;
}
.btn-warning:hover { background: linear-gradient(135deg, #ffe082, #ffcc80); border-color: #ffcc80; }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── 输入框 ── */
input, textarea, select {
  padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 6px;
  font-size: 13px; font-family: inherit; width: 100%; outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }

/* ── 空状态 ── */
.empty-state { padding: 40px 20px; text-align: center; color: var(--gray-400); font-size: 14px; }

/* ── 弹窗 ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center; z-index: 500;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-overlay.show { display: flex; }
.modal {
  background: white; border-radius: var(--radius);
  width: 65vw; max-width: 90vw; max-height: 85vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.2s ease;
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-wide { width: 96vw; max-width: 1700px; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
  display: flex; justify-content: space-between; align-items: center; font-weight: 600;
}
.modal-body { padding: 20px; overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { cursor: pointer; font-size: 20px; color: var(--gray-400); }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--gray-700); }
/* v3.38 X5：表单双列栅格（PC 默认双列，移动端在 @media 内改为单列） */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-full { grid-column: 1 / -1; }

/* ── 周报内容 ── */
.markdown-content { font-size: 14px; line-height: 1.7; }
.markdown-content h1 { font-size: 20px; margin: 16px 0 8px; }
.markdown-content h2 { font-size: 17px; margin: 12px 0 6px; }
.markdown-content p { margin: 8px 0; }
.markdown-content ol, .markdown-content ul { margin: 8px 0 12px; padding-left: 28px; }
.markdown-content li { margin: 4px 0; line-height: 1.8; }
.markdown-content pre, .markdown-content code { white-space: pre-wrap; word-break: break-word; }

/* ════════════════════════════════════════════════════════════
   v3.5+ 增强样式
   ════════════════════════════════════════════════════════════ */

/* ── 卡片折叠 ── */
.card-fold-btn {
  background: none; border: none; cursor: pointer; font-size: 12px;
  color: var(--gray-400); padding: 2px 6px; border-radius: 4px;
  transition: all .2s; margin-left: auto;
}
.card-fold-btn:hover { background: var(--gray-100); color: var(--gray-600); }
.card-body.collapsed { display: none !important; }

/* 卡片折叠时缩小高度 */
.card-full.collapsed { min-height: auto !important; }
.card.collapsed { min-height: auto !important; }

/* ── Loading 动画 ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spinner { display: inline-block; }

/* ── 新手指引动画 ── */
.onb-dot.active { transform: scale(1.3); }

/* ── 刷新按钮脉冲动画 ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.refreshing svg { animation: pulse .6s ease infinite; }

/* ── 返回顶部优化 ── */
#back-to-top:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(67,97,238,0.5); }

/* ── 卡片悬浮效果 ── */
.card { transition: box-shadow .3s ease, transform .2s ease; }
.card:hover { box-shadow: var(--shadow-lg); }
.card-header { transition: background .2s; }

/* ── Toast 增强 ── */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 9999; padding: 10px 24px; border-radius: 8px;
  font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: none; align-items: center; gap: 8px;
  animation: slideDown .3s ease;
  background: var(--gray-800); color: white;
}
.toast.show { display: flex; }
.toast.success { background: #065f46; }
.toast.warn { background: #92400e; }
.toast.error { background: #991b1b; }
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── 移动端精简模式 ── */
@media (max-width: 768px) {
  .mobile-simplified .main { padding: 8px; }

  /* 统计面板 2 列 */
  .mobile-simplified .stats-grid { grid-template-columns: repeat(2,1fr); gap: 6px; }
  .mobile-simplified .stat-card { padding: 8px; }
  .mobile-simplified .stat-number { font-size: 20px; }

  /* 豆腐块紧凑布局 */
  .mobile-simplified .grid { gap: 8px; }
  .mobile-simplified .card { font-size: 13px; }
  .mobile-simplified .card-body { padding: 12px 10px; }
  .mobile-simplified .card-header { padding: 10px 10px 6px; font-size: 13px; }

  /* 待办事项列表手机优化 */
  .mobile-simplified #tab-todo-list .todo-item {
    flex-wrap: wrap; gap: 4px; padding: 8px 10px;
  }
  .mobile-simplified #tab-todo-list .todo-item > * {
    flex: 1 1 auto; min-width: 0;
  }

  /* 弹窗 — 全屏底部抽屉 */
  .modal {
    width: 96vw !important; max-width: 96vw !important; max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0; margin-top: auto;
  }
  .modal-wide { width: 96vw !important; max-width: 96vw !important; }
  .modal-header { padding: 14px 16px; font-size: 14px; }
  .modal-body { padding: 14px; }
  .modal-footer { padding: 10px 16px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  /* 导航栏手机适配 */
  .mobile-simplified #workbench-nav { gap: 6px; flex-wrap: wrap; }
  .mobile-simplified #workbench-nav span { font-size: 12px; padding: 4px 8px; }

  /* 表格横向滚动 */
  .mobile-simplified table { display: block; overflow-x: auto; white-space: nowrap; font-size: 12px; }
}

/* ── TAB 切换 ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--gray-200); margin-bottom: 12px; }
.tab { padding: 8px 16px; font-size: 13px; cursor: pointer; color: var(--gray-500);
  border-bottom: 2px solid transparent; transition: all var(--transition-fast);
  user-select: none; }
.tab:hover { color: var(--gray-700); background: var(--gray-50); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: var(--font-weight-medium); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── 页签角标 ── */
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 6px; border-radius: 9px;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: #fff; background: var(--primary);
  vertical-align: middle; position: relative; top: -1px;
}
.tab-count.oa-warn {
  background: linear-gradient(135deg, #f7931a, #ff6b35);
  box-shadow: 0 1px 3px rgba(247, 147, 26, 0.3);
}

/* ── 配置页 ── */
.config-section { margin-bottom: 20px; }
.config-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.config-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ── 加载中 ── */
.loading { text-align: center; padding: 40px; color: var(--gray-400); }

/* ── 全屏 Loading 遮罩 ── */
.loading-overlay {
  position: fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.45); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.25s ease;
}
#loading-overlay[hidden] { display: none !important; }
.loading-box {
  background: white; border-radius: var(--radius-lg); padding: 40px 48px;
  text-align: center; box-shadow: var(--shadow-xl);
  min-width: 280px;
  animation: scaleIn 0.25s ease;
}
.loading-spinner {
  width: 48px; height: 48px; margin: 0 auto 16px;
  color: var(--primary);
}
.spinner-svg { animation: spin 1s linear infinite; }
.spinner-path {
  stroke-dasharray: 125; stroke-dashoffset: 100;
  animation: dash 1.5s ease-in-out infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes dash {
  0% { stroke-dashoffset: 125; }
  50% { stroke-dashoffset: 30; }
  100% { stroke-dashoffset: 125; }
}
.loading-title { font-size: 16px; font-weight: 600; color: var(--gray-800); margin-bottom: 12px; }
.loading-progress { margin-bottom: 8px; }
.loading-bar {
  height: 4px; background: var(--gray-100); border-radius: 2px;
  overflow: hidden; width: 200px; margin: 0 auto;
}
.loading-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px; width: 0%; transition: width 0.5s ease;
}
.loading-estimate { font-size: 12px; color: var(--gray-400); }

/* ── 响应式 ── */

/* 返回顶部按钮动画 */
#back-to-top {
  animation: fadeInUp .3s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 平板竖屏 & 小屏幕笔记本 */
@media (max-width: 1024px) {
  .main { padding: 16px 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .modal { width: 80vw; }
  .modal-wide { width: 92vw; }
}

/* 手机横屏 & 小平板竖屏 */
@media (max-width: 768px) {
  /* 全局调整 */
  .main { padding: 10px; }
  body { font-size: 14px; }

  /* v3.38 X5：顶栏 — 隐藏次要链接，显示汉堡按钮 */
  .topbar-link-pc { display: none !important; }
  .topbar-hamburger { display: flex; }
  /* 小屏隐藏 topbar-subtitle 和 topbar-location，腾出空间 */
  .topbar-subtitle, .topbar-location { display: none; }
  /* 时钟在小屏保留，但用更小字号 */
  #topbar-clock { font-size: 11px !important; }
  /* 用户名 + 退出按钮在小屏也保留 */
  #topbar-user { font-size: 12px; }

  /* 顶栏 */
  .topbar { padding: 0 10px; height: 48px; }
  .topbar-subtitle { display: none; }
  .topbar-location { display: none; }
  .topbar-logo { font-size: 15px; }
  .topbar-right { gap: 8px; }
  #topbar-clock { font-size: 11px !important; }
  .bell-wrap { padding: 4px; }
  .bell-wrap svg { width: 18px; height: 18px; }
  .bell-badge { font-size: 9px; min-width: 14px; height: 14px; }

  /* 仪表盘统计卡片 - 2列 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-number { font-size: 24px; }
  .stat-label { font-size: 11px; }

  /* 工作台导航固定位置适配移动端顶栏 */
  .workbench-nav { top: 48px; padding: 10px 12px; gap: 4px 10px; font-size: 12px; }

  /* 豆腐块卡片 — 单列、紧凑 */
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .card { min-height: auto; font-size: 13px; }
  .card-full { min-height: auto; }
  .card-body[style*="max-height"] { max-height: 50vh !important; }
  .card-header { padding: 10px 12px; flex-wrap: wrap; gap: 4px; align-items: center; }
  .card-header > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .card-title { font-size: 14px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* v3.38 X5：按钮最小高度 32px + 不压缩 + 自动换行 */
  .card-action { font-size: 11px; padding: 4px 10px; min-height: 32px; flex-shrink: 0; white-space: nowrap; }
  .card-body { padding: 10px 12px; }

  /* 待办事项手机优化 */
  #todo-card .card-body { padding: 0; }
  #todo-card #tab-todo-list { max-height: 55vh; }
  #todo-card .todo-item {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px;
    padding: 10px 12px; border-bottom: 1px solid var(--gray-100);
  }
  #todo-card .todo-item > * { flex: 0 1 auto; }

  /* 表格 - 水平滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 11px; }
  th, td { padding: 5px 5px; white-space: nowrap; }
  tr:hover td { background: transparent; } /* 移动端无 hover */

  /* 按钮 - 触屏友好 */
  .btn { padding: 8px 14px; font-size: 13px; min-height: 36px; }
  .btn-sm { padding: 6px 10px; font-size: 12px; min-height: 32px; }

  /* 弹窗 - 全屏底部抽屉效果（v3.38 X5 修复） */
  /* 关键修复：overlay 默认是 align-items: center，.modal { margin-top: auto } 完全无效
     改为 align-items: flex-end（底部对齐）+ justify-content: center（横向居中）
     这样 margin-top: auto 才能把 modal 推到屏幕底部，形成底部抽屉效果 */
  .modal-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }
  .modal {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-top: auto;
  }
  .modal-wide { width: 96vw !important; max-width: 96vw !important; }
  .modal-header { padding: 14px 16px; font-size: 14px; }
  .modal-body { padding: 14px; }
  .modal-footer { padding: 10px 16px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  /* Tab 横向滚动 */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 0; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 8px 10px; white-space: nowrap; font-size: 12px; flex-shrink: 0; }

  /* 通知面板 */
  .notify-panel { right: 6px; width: calc(100vw - 12px); max-height: 65vh; top: 50px; }

  /* 表单双列变单列（v3.38 X5：用 class 替代 attribute 选择器——attribute 匹配经常失效） */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  [style*="grid-column:1/3"],
  [style*="grid-column: 1/3"] { grid-column: 1 !important; }
  /* 推荐用 class（更稳）：.form-grid 双列 → 移动端单列 */
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid-full { grid-column: 1 !important; }

  /* 输入框 */
  input, textarea, select { font-size: 16px !important; padding: 10px 12px; } /* 防 iOS 缩放 */
  .form-label { font-size: 13px; }

  /* 登录弹窗 - 全屏 */
  #login-overlay > div { width: 92vw !important; max-width: 380px; padding: 32px 24px !important; border-radius: 16px; }
  #login-overlay > div h2 { font-size: 18px !important; }
  #login-overlay input { font-size: 15px !important; padding: 12px 14px !important; }

  /* 空状态 */
  .empty-state { padding: 24px 12px; font-size: 13px; }

  /* 加载状态 */
  .loading { padding: 24px; }

  /* DevOps 会话过期横幅 */
  [id*="session-warning"] { font-size: 12px !important; padding: 8px 12px !important; }
}

/* 小屏手机 */
@media (max-width: 480px) {
  /* 统计卡片 - 单列 */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card { padding: 10px; flex-direction: row; align-items: center; gap: 10px; min-height: 44px; }
  .stat-number { font-size: 20px; }
  .stat-label { font-size: 11px; margin-top: 0; }
  .main { padding: 6px; }
  .grid { gap: 8px; }
  .card { min-height: auto; }
  .card-full { min-height: auto; }

  /* 顶栏更紧凑 */
  .topbar { padding: 0 6px; height: 44px; }
  .topbar-logo { font-size: 13px; }
  #topbar-clock { font-size: 10px !important; }

  /* 弹窗几乎全屏 */
  .modal { width: 100vw !important; max-width: 100vw !important; max-height: 100vh; border-radius: 0; }
  .modal-wide { width: 100vw !important; max-width: 100vw !important; }
  .modal-body { padding: 10px; }
  .modal-header { padding: 12px 14px; }

  /* 表格更紧凑 */
  th, td { padding: 4px 4px; font-size: 10px; }
  table { font-size: 10px; }

  /* 按钮全宽 */
  .btn { padding: 6px 10px; font-size: 12px; min-height: 32px; }
  .btn-sm { padding: 4px 8px; font-size: 11px; min-height: 28px; }
  .modal-footer .btn { flex: 1; }

  /* 登录弹窗 */
  #login-overlay > div { width: 96vw !important; padding: 24px 16px !important; }
  #login-overlay input { padding: 10px 12px !important; }

  /* card-body 内边距 */
  .card-body { padding: 6px 10px 10px; }
  .card-header { padding: 8px 10px; }
  .card-title { font-size: 13px; }

  /* 通知面板 */
  .notify-panel { right: 4px; width: calc(100vw - 8px); max-height: 70vh; }

  /* Tab */
  .tab { padding: 6px 8px; font-size: 11px; }
}

/* 超小屏手机 (iPhone SE 等) */
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-logo { font-size: 12px; }
  .stat-number { font-size: 18px; }
  .stat-card { min-height: 40px; padding: 8px; }
  .card { min-height: auto; }
  .card-full { min-height: 200px; }
  th, td { padding: 3px 3px; font-size: 9px; }
}

/* 横屏提示 */
@media (orientation: landscape) and (max-height: 500px) {
  .modal { max-height: 90vh; }
  .modal-body { max-height: 55vh; }
}

/* ============================================================
   v3.36.41 富文本任务描述编辑器（RDE: Rich Desc Editor）
   ============================================================ */
.rde-toolbar {
  user-select: none;
}
.rde-tb-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--gray-700);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.rde-tb-btn:hover {
  background: #fff;
  border-color: var(--gray-300);
  color: var(--primary);
}
.rde-tb-btn:active {
  background: var(--gray-100);
}

/* AI 完善按钮（突出显示） */
.rde-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  height: 32px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  background-size: 200% 200%;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform .15s, box-shadow .15s, background-position .4s;
  animation: rde-ai-shimmer 4s ease-in-out infinite;
}
.rde-ai-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.25);
  background-position: 100% 0;
}
.rde-ai-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.4);
}
.rde-ai-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  animation: none;
}
.rde-ai-icon {
  font-size: 14px;
  display: inline-block;
  animation: rde-ai-pulse 2s ease-in-out infinite;
}
.rde-ai-text {
  letter-spacing: 0.3px;
}
@keyframes rde-ai-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes rde-ai-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* 编辑区 */
.rde-wrap {
  transition: border-color .2s, box-shadow .2s;
}
.rde-wrap:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.rde-editor {
  position: relative;
}
.rde-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--gray-400);
  font-style: italic;
  pointer-events: none;
}
.rde-editor b { color: var(--gray-800); }
.rde-editor code {
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  color: #d6336c;
}
.rde-editor i { color: var(--gray-700); }

/* 预览区 */
.rde-preview {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.rde-preview code {
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  color: #d6336c;
}

/* v3.36.44 AI 完善进度遮罩 */
.rde-ai-overlay {
  animation: rde-ai-overlay-fadein .25s ease;
}
@keyframes rde-ai-overlay-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.rde-ai-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 32px;
  max-width: 420px;
}
.rde-ai-overlay-icon {
  font-size: 42px;
  line-height: 1;
  animation: rde-ai-overlay-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.35));
}
@keyframes rde-ai-overlay-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}
.rde-ai-overlay-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: 0.5px;
}
.rde-ai-overlay-msg {
  font-size: 13px;
  color: var(--gray-500);
  text-align: center;
  min-height: 18px;
  word-break: break-word;
  line-height: 1.5;
}
.rde-ai-overlay-bar {
  width: 280px;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.rde-ai-overlay-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  background-size: 200% 100%;
  animation: rde-ai-overlay-shimmer 2s linear infinite;
  transition: width .35s ease;
  border-radius: 4px;
}
@keyframes rde-ai-overlay-shimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.rde-ai-overlay-pct {
  font-size: 24px;
  font-weight: 700;
  color: #6366f1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.rde-ai-overlay-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}
/* v3.36.47：实时生成预览区（进度条下方，显示 AI 正在生成的文本）*/
.rde-ai-overlay-stream-wrap {
  width: 360px;
  max-width: 90%;
  margin-top: 10px;
  background: #f8f9fc;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: left;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.04);
}
.rde-ai-overlay-stream-title {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.rde-ai-overlay-stream {
  font-size: 12px;
  line-height: 1.55;
  color: var(--gray-700);
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.rde-ai-overlay-stream::-webkit-scrollbar { width: 4px; }
.rde-ai-overlay-stream::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }


/* ═══════════════════════════════════════════════════════════════════
   v3.37 P2 移动端适配优化（首页 + 邮箱/设置/会议纪要 三大通用豆腐块）
   分 4 档：≤900px (iPad 竖屏) / ≤768px (主流手机) / ≤480px (小屏) / ≤375px (iPhone SE)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── iPad 竖屏 / 小平板 (≤900px) ─── */
@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .topbar-right a { font-size: 12px !important; margin-left: 4px !important; }
  .topbar-right span[onclick="logout()"] { font-size: 12px !important; }
}

/* ─── 手机（≤768px）—— 增强版：导航 + 三大卡片专门优化 ─── */
@media (max-width: 768px) {
  /* 顶栏：隐藏不常用项（时钟 + location） */
  #topbar-clock, #topbar-location { display: none !important; }

  /* 顶栏导航链接紧凑化（指南/运维工具助手/任务与周报/用户管理） */
  .topbar-right a[href="/guide.html"],
  .topbar-right a[href="/ops-tools.html"],
  #topbar-nav-task-weekly,
  #topbar-nav-user-mgmt {
    padding: 4px 8px !important;
    font-size: 13px !important;
    margin-left: 4px !important;
  }

  /* 工作台导航：横向滚动（不再换行占用垂直空间） */
  #workbench-nav {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #workbench-nav::-webkit-scrollbar { display: none; }
  #workbench-nav span { flex-shrink: 0; }
  #workbench-nav .nav-title { flex-shrink: 0; }

  /* 统计面板：5 项目 → 3 列 */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  /* ═══ 邮箱卡片（我的邮箱）═══ */
  #email-card .card-body { padding: 10px 8px; }
  #email-card .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  #email-card .tabs::-webkit-scrollbar { display: none; }
  #email-card .tab { white-space: nowrap; flex-shrink: 0; font-size: 13px; padding: 8px 14px; }
  #email-card input[type="text"] { min-width: 100px !important; font-size: 14px; padding: 8px 10px; }
  #email-card button {
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-height: 32px;
  }
  /* 工具栏两段：搜索框全宽 + 操作按钮组自动换行 */
  #email-card > .card-body > div[style*="display:flex"][style*="flex-wrap:wrap"] {
    gap: 8px !important;
  }
  #email-card > .card-body > div[style*="display:flex"][style*="flex-wrap:wrap"] > div:first-child {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* ═══ 我的设置 ═══ */
  #myconfig-card .card-body { padding: 10px 12px; }
  #myconfig-card input,
  #myconfig-card select,
  #myconfig-card textarea {
    font-size: 14px !important;  /* iOS 不自动缩放 */
    padding: 9px 12px !important;
  }
  #myconfig-card .form-group,
  #myconfig-card .config-section { margin-bottom: 12px; }

  /* ═══ 会议纪要 ═══ */
  #meeting-minutes-card .card-body { padding: 10px 8px; }
  #meeting-minutes-card .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #meeting-minutes-card .tabs::-webkit-scrollbar { display: none; }
  #meeting-minutes-card .tab {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 12px;
    padding: 8px 12px;
  }

  /* 通用：touch 友好（按钮最小高度 36px） */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 32px; }
}

/* ─── 小屏手机（≤480px）—— 强化版：极简布局 ─── */
@media (max-width: 480px) {
  /* 顶栏极致紧凑 */
  .topbar { padding: 0 8px !important; height: 44px !important; }
  .topbar-logo { font-size: 13px !important; }
  .topbar-right { gap: 4px !important; }
  .topbar-right a { padding: 3px 6px !important; font-size: 11px !important; margin-left: 2px !important; }
  .topbar-right a span { display: inline !important; }
  #topbar-user { font-size: 11px !important; }
  .topbar-right span[onclick="logout()"] { padding: 2px 6px !important; font-size: 11px !important; }

  /* 主区 */
  .main { padding: 6px !important; }
  .grid { gap: 8px !important; }

  /* 卡片头 */
  .card-header { padding: 8px 10px !important; gap: 4px !important; }
  .card-title { font-size: 13px !important; }
  .card-body { padding: 8px 10px !important; }
  .card-action { font-size: 11px !important; padding: 2px 6px !important; }

  /* 统计面板：2 列（5 项目，3 列太挤） */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .stat-card { padding: 10px 8px !important; min-height: 50px; }
  .stat-number { font-size: 18px !important; line-height: 1.2; }
  .stat-label { font-size: 11px !important; }

  /* 邮箱：操作按钮极简 */
  #email-card button[onclick*="showComposeMail"],
  #email-card button[onclick*="showTemplateManager"],
  #email-card button[onclick*="batchMarkMailRead"],
  #email-card button[onclick*="markAllMailRead"] {
    padding: 4px 8px !important;
    font-size: 11px !important;
    min-height: 30px;
  }

  /* 我的设置：标签字体缩小 */
  #myconfig-card label { font-size: 12px !important; }
  #myconfig-card .form-label { font-size: 12px !important; }

  /* 会议纪要：tab 极简 */
  #meeting-minutes-card .tab { font-size: 11px !important; padding: 6px 10px !important; }
}

/* ─── iPhone SE 等超小屏（≤375px）─── */
@media (max-width: 375px) {
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .stat-number { font-size: 16px !important; }
  .main { padding: 4px !important; }
  .topbar-right a { font-size: 10px !important; padding: 2px 4px !important; }
}


/* v3.37 P2 mobile patch */
@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .topbar-right a { font-size: 12px !important; margin-left: 4px !important; }
  .topbar-right span[onclick="logout()"] { font-size: 12px !important; }
}
@media (max-width: 768px) {
  #topbar-clock, #topbar-location { display: none !important; }
  .topbar-right a[href="/guide.html"], .topbar-right a[href="/ops-tools.html"],
  #topbar-nav-task-weekly, #topbar-nav-user-mgmt {
    padding: 4px 8px !important; font-size: 13px !important; margin-left: 4px !important;
  }
  #workbench-nav { overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #workbench-nav::-webkit-scrollbar { display: none; }
  #workbench-nav span { flex-shrink: 0; }
  #workbench-nav .nav-title { flex-shrink: 0; }
  .stats-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }

  /* 邮箱卡片 */
  #email-card .card-body { padding: 10px 8px; }
  #email-card .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  #email-card .tabs::-webkit-scrollbar { display: none; }
  #email-card .tab { white-space: nowrap; flex-shrink: 0; font-size: 13px; padding: 8px 14px; }
  #email-card input[type="text"] { min-width: 100px !important; font-size: 14px; padding: 8px 10px; }
  #email-card button { padding: 6px 10px !important; font-size: 12px !important; min-height: 32px; }

  /* 我的设置 */
  #myconfig-card .card-body { padding: 10px 12px; }
  #myconfig-card input, #myconfig-card select, #myconfig-card textarea {
    font-size: 14px !important; padding: 9px 12px !important;
  }
  #myconfig-card .form-group, #myconfig-card .config-section { margin-bottom: 12px; }

  /* 会议纪要 */
  #meeting-minutes-card .card-body { padding: 10px 8px; }
  #meeting-minutes-card .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #meeting-minutes-card .tabs::-webkit-scrollbar { display: none; }
  #meeting-minutes-card .tab { white-space: nowrap; flex-shrink: 0; font-size: 12px; padding: 8px 12px; }

  .btn { min-height: 36px; }
  .btn-sm { min-height: 32px; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 8px !important; height: 44px !important; }
  .topbar-logo { font-size: 13px !important; }
  .topbar-right { gap: 4px !important; }
  .topbar-right a { padding: 3px 6px !important; font-size: 11px !important; margin-left: 2px !important; }
  #topbar-user { font-size: 11px !important; }
  .topbar-right span[onclick="logout()"] { padding: 2px 6px !important; font-size: 11px !important; }
  .main { padding: 6px !important; }
  .grid { gap: 8px !important; }
  .card-header { padding: 8px 10px !important; gap: 4px !important; }
  .card-title { font-size: 13px !important; }
  .card-body { padding: 8px 10px !important; }
  .card-action { font-size: 11px !important; padding: 2px 6px !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }
  .stat-card { padding: 10px 8px !important; min-height: 50px; }
  .stat-number { font-size: 18px !important; line-height: 1.2; }
  .stat-label { font-size: 11px !important; }
  #email-card button[onclick*="showComposeMail"], #email-card button[onclick*="showTemplateManager"],
  #email-card button[onclick*="batchMarkMailRead"], #email-card button[onclick*="markAllMailRead"] {
    padding: 4px 8px !important; font-size: 11px !important; min-height: 30px;
  }
  #myconfig-card label { font-size: 12px !important; }
  #myconfig-card .form-label { font-size: 12px !important; }
  #meeting-minutes-card .tab { font-size: 11px !important; padding: 6px 10px !important; }
}
@media (max-width: 375px) {
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .stat-number { font-size: 16px !important; }
  .main { padding: 4px !important; }
  .topbar-right a { font-size: 10px !important; padding: 2px 4px !important; }
}


/* v3.37 P2 wechat-x5 patch */
*, *::before, *::after {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-touch-callout: none;
}
html, body {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  max-width: 100vw;
  overflow-x: hidden;
}
body {
  position: relative;
  width: 100%;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: auto !important;
  user-select: auto !important;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: checkbox;
  appearance: checkbox;
}
button, .btn {
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}
a {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-user-select: none;
  user-select: none;
}
/* v3.38 X5 修复：取消 translateZ(0) 兜底（污染层叠上下文，让子元素 absolute 错位）
   改用 contain: layout 做层叠隔离——既能避免内部样式溢出又不污染子元素定位。
   will-change 仅在动画期间动态加，避免常驻合成层浪费显存。 */
.card, .modal, .stat-card { contain: layout; }
.workbench-nav, .tab, .btn { contain: layout style; }
.topbar {
  /* v3.37 P1-8 修复：position: sticky 在 X5 内核 + overflow-x: hidden 滚动容器下失效，改用 fixed */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
#workbench-nav {
  /* v3.37 P1-8：sticky → fixed（X5 内核兼容）—— .main 是滚动容器，sticky 会失效 */
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 99;
}
.modal-overlay {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
table {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.grid img, .card img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}
@media (max-width: 768px) {
  /* v3.37 P1-8：topbar 用 fixed，body 需要 padding-top 配合 */
  body { padding-top: calc(60px + env(safe-area-inset-top) - 12px); padding-bottom: env(safe-area-inset-bottom); }
  .topbar { height: calc(48px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  #workbench-nav { top: calc(48px + env(safe-area-inset-top)); }
  .stat-card:active { opacity: 0.7; }
  .card:active { transform: scale(0.99); }
  .btn:active { opacity: 0.7; }
  .btn-sm:active { opacity: 0.7; }
  .topbar-right a:active { opacity: 0.6; }
  .workbench-nav .wb-nav-item:active { background: var(--gray-100); }
}
@media (max-width: 480px) {
  .topbar { height: calc(44px + env(safe-area-inset-top)); }
  #workbench-nav { top: calc(44px + env(safe-area-inset-top)); }
  body { padding-top: calc(60px + env(safe-area-inset-top) - 16px); }
}

