/* ===== 设计 Token：墨蓝 + 金点缀 + 暖中性（端庄大气·政务气质）===== */
:root {
  /* 墨蓝主色 */
  --ink-900: #0a2540;
  --ink-800: #0f3354;
  --ink-700: #144070;
  --ink-600: #1b5085;
  --ink-500: #2a6aa3;
  /* 深青 */
  --teal-700: #0d5c5c;
  --teal-500: #147272;
  /* 金点缀 */
  --gold-700: #9a7b2e;
  --gold-600: #b8923a;
  --gold-500: #c8a45c;
  --gold-100: #f5edd6;

  /* 暖中性 */
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --border: #e6e2d8;
  --border-strong: #d8d2c4;
  --text-1: #1a2230;
  --text-2: #545d6b;
  --text-3: #8b94a2;

  /* 语义色 */
  --success: #2e7d5b;
  --warning: #b8860b;
  --danger: #a83232;
  --info: #144070;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.04);
  --shadow-md: 0 4px 16px rgba(10, 37, 64, 0.06);
  --shadow-lg: 0 12px 32px rgba(10, 37, 64, 0.08);

  /* 圆角 */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  /* 字号 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-3xl: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 22px 24px;
  border: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  font-size: var(--fs-base);
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  gap: 6px;
  letter-spacing: 0.02em;
}

.btn-primary {
  background-color: var(--ink-700);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--ink-800);
  box-shadow: 0 2px 8px rgba(20, 64, 112, 0.25);
}

.btn-success {
  background-color: var(--success);
  color: #fff;
}

.btn-success:hover {
  background-color: #256e4d;
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background-color: #8f2828;
}

.btn-warning {
  background-color: var(--gold-600);
  color: #fff;
}

.btn-warning:hover {
  background-color: var(--gold-700);
}

.btn-default {
  background-color: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
}

.btn-default:hover {
  background-color: var(--surface-2);
  border-color: var(--ink-500);
  color: var(--text-1);
}

.btn-sm {
  padding: 5px 12px;
  font-size: var(--fs-xs);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-1);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-1);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px rgba(27, 80, 133, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}
/* 周重点任务弹窗「落实情况」输入框：桌面端高度由这里控制（移动端另设更大高度） */
#w-progress {
  min-height: 120px;
}

/* 责任人多选 */
.assignee-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  max-height: 180px;
  overflow-y: auto;
}
.assignee-multi-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  color: var(--text-1);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.assignee-multi-item:hover {
  border-color: var(--ink-600);
  background: var(--surface-2);
}
.assignee-multi-item input[type="checkbox"] {
  accent-color: var(--ink-600);
  margin: 0;
}
.assignee-multi-item em {
  font-style: normal;
  color: var(--text-3);
  font-size: 12px;
}
.assignee-multi-item:has(input:checked) {
  border-color: var(--ink-600);
  background: var(--surface-2);
}
.assignee-multi-empty {
  color: var(--text-3);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}

th {
  background-color: var(--ink-800);
  padding: 13px 14px;
  text-align: left;
  font-weight: 600;
  color: #f4ecd8;
  border-bottom: 2px solid var(--gold-600);
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-size: var(--fs-sm);
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

tbody tr:nth-child(even) {
  background-color: var(--surface-2);
}

tbody tr:hover {
  background-color: var(--gold-100);
}

.status-tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 11px;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.status-overdue {
  background-color: #f7e6d4;
  color: var(--gold-700);
}

.status-completed {
  background-color: #e3f1e9;
  color: var(--success);
}

.status-incomplete {
  background-color: #e4ecf5;
  color: var(--ink-600);
}

.role-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 11px;
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* 新四角色体系标签 */
.role-admin-global {
  background-color: var(--gold-100);
  color: var(--gold-700);
}
.role-admin-departmental {
  background-color: #e3efef;
  color: var(--teal-700);
}
.role-department-head {
  background-color: #e8e3f6;
  color: #5b46a3;
}
.role-department-staff {
  background-color: #ece9e0;
  color: #6b6553;
}

.duty-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  background-color: #e4ecf5;
  color: var(--ink-600);
  margin: 2px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 37, 64, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

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

.modal-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-1);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-3);
  line-height: 1;
}

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

.modal-body {
  padding: 22px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--r-sm);
  color: #fff;
  font-size: var(--fs-base);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease-out;
  min-width: 220px;
  letter-spacing: 0.02em;
}

.toast-success {
  background-color: var(--success);
}

.toast-error {
  background-color: var(--danger);
}

.toast-info {
  background-color: var(--ink-600);
}

.toast-warning {
  background-color: #e08e0b;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.fade-out {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.main-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 28px 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gold-600);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon-blue {
  background-color: #e4ecf5;
  color: var(--ink-600);
}

.stat-icon-green {
  background-color: #e3f1e9;
  color: var(--success);
}

.stat-icon-orange {
  background-color: var(--gold-100);
  color: var(--gold-700);
}

.stat-icon-purple {
  background-color: #e3efef;
  color: var(--teal-700);
}

.stat-info h3 {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.stat-info .stat-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 18px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.chart-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.chart-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 40px;
  height: 2px;
  background: var(--gold-600);
}

.chart-container {
  position: relative;
  height: 300px;
}

/* 饼图自绘图例：未开始/进行中/已完成/已逾期 一行、自适应居中 */
.main-legend-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 18px;
  margin-top: 10px;
  padding: 0 12px;
}
.main-legend-row .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  justify-content: center;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.main-legend-row .legend-item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-block;
}

.section-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 3px solid var(--gold-600);
  line-height: 1.3;
}

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

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  width: 240px;
  background: var(--surface);
  color: var(--text-1);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px rgba(27, 80, 133, 0.12);
}

/* 每周任务日期选择框固定宽度（桌面 150px；移动端在下方媒体查询中改为弹性），文字居中 */
#weekly-week-input { width: 150px; text-align: center; }
#weekly-week-input::-webkit-datetime-edit { text-align: center; }

.search-select {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  background: var(--surface);
  color: var(--text-1);
}

.table-wrapper {
  overflow-x: auto;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.actions-cell {
  /* 保持表格单元格定位（勿用 display:flex，否则高度收缩、无法随行高垂直居中） */
  vertical-align: middle;
  white-space: nowrap;
}
.actions-cell .btn + .btn {
  margin-left: 6px;
}

/* 任务台账操作按钮略向右移；按钮组在单元格内垂直居中 */
#tasks-table .actions-cell {
  padding-left: 20px;
}

/* 每周计划操作按钮与任务台账保持一致 */
#weekly-table .actions-cell {
  padding-left: 20px;
}

.upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 44px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background: var(--surface-2);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--ink-600);
  background-color: var(--gold-100);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
  color: var(--gold-600);
}

.upload-text {
  font-size: var(--fs-md);
  color: var(--text-1);
  margin-bottom: 8px;
  font-weight: 500;
}

.upload-hint {
  font-size: 13px;
  color: #999;
}

.file-name {
  font-size: 14px;
  color: #333;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(184, 146, 58, 0.16), transparent 60%),
    radial-gradient(1000px 600px at 95% 100%, rgba(42, 106, 163, 0.22), transparent 60%),
    linear-gradient(150deg, var(--ink-900) 0%, var(--ink-700) 55%, var(--ink-800) 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(184, 146, 58, 0.2);
}

.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-800);
  margin-bottom: 8px;
}

.login-subtitle {
  text-align: center;
  font-size: 14px;
  color: #888;
  margin-bottom: 32px;
}

.login-hint {
  text-align: center;
  font-size: 13px;
  color: #999;
  margin-top: 16px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 6px;
}

.password-input-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 16px;
  padding: 4px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.report-preview {
  background: #fafafa;
  border-radius: 6px;
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  min-height: 42px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background-color: #e8eaf6;
  color: #3f51b5;
  border-radius: 12px;
  font-size: 12px;
}

.tag-remove {
  cursor: pointer;
  font-weight: bold;
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 4px;
}

.tags-input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-size: 14px;
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Dashboard: 左侧侧边栏 + 右侧内容 ===== */
.dashboard-layout {
  background-color: var(--bg);
  min-height: 100vh;
}

.layout-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  min-height: 100vh;
}

.sidebar {
  flex: 0 0 220px;
  width: 220px;
  background: linear-gradient(180deg, var(--ink-900) 0%, var(--ink-800) 100%);
  color: rgba(245, 237, 214, 0.78);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(10, 37, 64, 0.18);
  border-right: 1px solid rgba(184, 146, 58, 0.22);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: flex-basis 0.22s ease, width 0.22s ease;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(184, 146, 58, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: #f5edd6;
  min-width: 0;
  letter-spacing: 0.04em;
}

.sidebar-logo-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.02em;
}

.sidebar-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: rgba(245, 237, 214, 0.1);
  border: 1px solid rgba(245, 237, 214, 0.14);
  color: rgba(245, 237, 214, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sidebar-toggle:hover {
  background: rgba(184, 146, 58, 0.22);
  color: var(--gold-500);
  border-color: rgba(184, 146, 58, 0.4);
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.22s ease;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 12px;
  flex: 1;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: rgba(245, 237, 214, 0.74);
  text-decoration: none;
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  line-height: 1.4;
  position: relative;
}

.menu-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  transition: transform 0.18s ease;
}

.menu-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-menu a:hover {
  background-color: rgba(245, 237, 214, 0.08);
  color: #f5edd6;
}

.sidebar-menu a:hover .menu-icon {
  transform: scale(1.12);
  color: var(--gold-500);
}

.sidebar-menu a.active {
  background-color: rgba(184, 146, 58, 0.18);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold-500);
}

.sidebar-menu a.active .menu-icon {
  color: var(--gold-500);
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(184, 146, 58, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-user {
  font-size: var(--fs-sm);
  color: rgba(245, 237, 214, 0.6);
}

.sidebar-user-name {
  font-weight: 600;
  color: #f5edd6;
  margin-bottom: 3px;
  font-size: var(--fs-base);
}

.sidebar-user-role {
  font-size: var(--fs-xs);
  color: var(--gold-500);
  letter-spacing: 0.04em;
}

.sidebar-logout {
  width: 100%;
  background: transparent;
  color: rgba(245, 237, 214, 0.6);
  border: 1px solid rgba(245, 237, 214, 0.16);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  padding: 8px 12px;
  cursor: pointer;
  font-size: var(--fs-base);
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sidebar-logout .menu-icon {
  font-size: 15px;
}

.sidebar-logout:hover {
  background: rgba(184, 146, 58, 0.16);
  color: #f5edd6;
  border-color: rgba(184, 146, 58, 0.4);
}

/* ===== 收起态（窄条，仅图标）===== */
.sidebar.collapsed {
  flex-basis: 64px;
  width: 64px;
}

.sidebar.collapsed .sidebar-header {
  padding: 16px 12px;
  flex-direction: column;
  gap: 12px;
}

.sidebar.collapsed .sidebar-logo-text {
  display: none;
}

.sidebar.collapsed .toggle-icon {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-menu {
  padding: 12px 8px;
}

.sidebar.collapsed .sidebar-menu a {
  justify-content: center;
  padding: 10px 0;
}

.sidebar.collapsed .menu-text {
  display: none;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 8px;
  align-items: center;
}

.sidebar.collapsed .sidebar-user {
  display: none;
}

.sidebar.collapsed .sidebar-logout {
  width: 40px;
  padding: 8px 0;
  justify-content: center;
}

.content-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-wrap .main-container {
  padding: 24px;
  max-width: 100%;
  margin: 0;
}

@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  .layout-wrapper {
    flex-direction: column;
  }
  .sidebar,
  .sidebar.collapsed {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    position: static;
    box-shadow: 0 2px 8px rgba(10, 37, 64, 0.1);
  }
  .sidebar-header {
    padding: 12px 14px;
    flex-direction: row;
  }
  .sidebar-toggle {
    display: none;
  }
  .sidebar-logo-text {
    display: inline;
  }
  .sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
    gap: 6px;
  }
  .sidebar-menu a {
    flex: 0 0 auto;
    white-space: nowrap;
    justify-content: flex-start;
    padding: 8px 12px;
    box-shadow: none;
  }
  .sidebar-menu a.active {
    box-shadow: none;
    background-color: rgba(184, 146, 58, 0.22);
    color: #fff;
  }
  .menu-text {
    display: inline;
  }
  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-user {
    display: block;
  }
  .sidebar-logout {
    width: auto;
    padding: 6px 12px;
  }
  .content-wrap .main-container {
    padding: 16px;
  }
}

/* ---------- 表格：长文本自动换行 + 单元格高度自适应 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.data-table th,
.data-table td {
  padding: 6px;
  border-bottom: 1px solid var(--warm-border);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.55;
}
.data-table thead th {
  background: var(--ink-900);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  border-bottom: 2px solid var(--gold-500);
  font-size: 13px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-align: center;
}
.data-table tbody tr:hover td {
  background: var(--gold-100);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table td.empty-cell {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-3);
}

/* 每周计划：落实情况单元格与任务台账一致（无特殊边框） */
/* 固定列宽布局：保证「重点任务/落实情况」百分比列严格生效，不被内容撑开 */
#weekly-table {
  table-layout: fixed;
}
/* 各单元格内容垂直居中（多行文本行时序号/完成时限/责任人等也居中） */
#weekly-table td {
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 完成时限/责任人 列内容居中，与表头（居中对齐）保持一致，消除错位 */
#weekly-table td[data-label="完成时限"],
#weekly-table td[data-label="责任人"] {
  text-align: center;
}
/* 每周任务「序号」列（第2列）：表头与内容都靠左排列并预留左侧内边距，序号与右侧「重点任务」拉开间距 */
#weekly-table th:nth-child(2),
#weekly-table td:nth-child(2) {
  text-align: left !important;
  padding-left: 8px;
}
/* 任务台账「状态」列内容居中，与表头对齐 */
#tasks-table td[data-label="状态"],
#stats-detail-table td[data-label="状态"] {
  text-align: center;
}
/* 任务台账「责任人/完成时限/倒数日」列内容居中，与表头对齐 */
#tasks-table td[data-label="责任人"],
#tasks-table td[data-label="完成时限"],
#tasks-table td[data-label="倒数日"] {
  text-align: center;
}
/* 统计类明细表格单元格统一内边距 10px（与整体统计弹窗一致） */
#stats-detail-table th,
#stats-detail-table td {
  padding: 10px;
}
/* 表头标签：上下居中 + 左右居中；数据内容：靠左 + 上下居中 */
#stats-detail-table th {
  vertical-align: middle;
}
#stats-detail-table td {
  text-align: left;
  vertical-align: middle;
}
/* 完成时间 / 完成时限 / 责任人 等窄列内边距缩为 8px */
#stats-detail-table th.pad8,
#stats-detail-table td.pad8 {
  padding: 8px;
}
/* 完成时间 / 完成时限 进一步缩为 5px */
#stats-detail-table th.pad5,
#stats-detail-table td.pad5 {
  padding: 5px;
}
/* 任务台账「来文时间」列内边距缩为 5px，与统计明细窄列保持一致 */
#tasks-table th[data-sort="receiveDate"],
#tasks-table td[data-label="来文时间"] {
  padding: 5px;
}
/* 任务台账：表头上下居中+左右居中，数据内容靠左+上下居中 */
#tasks-table th {
  vertical-align: middle;
}
#tasks-table td {
  text-align: left;
  vertical-align: middle;
}

/* ---------- 统计卡点击交互 ---------- */
.stat-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  user-select: none;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 37, 64, 0.08);
  border-color: var(--gold-500);
}
.stat-card:active {
  transform: translateY(0);
}
.stat-card:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* ---------- 大模态 ---------- */
.modal.modal-lg {
  width: 960px;
  max-width: calc(100vw - 32px);
}
/* 已完成任务明细：8 列表格更宽，保证列不被挤压 */
.modal.modal-xl {
  width: 1240px;
  max-width: calc(100vw - 32px);
}
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  .modal.modal-lg,
  .modal.modal-xl {
    width: 100%;
  }
}

/* 智能分析 */
.stat-card { position: relative; }
.stat-analysis,
.chart-analysis {
  padding: 3px 9px;
  font-size: 11px;
  border: 1px solid #d8d9df;
  border-radius: 6px;
  background: #fff;
  color: #1565c0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, border-color .15s, background .15s;
}
.stat-card:hover .stat-analysis,
.stat-card:focus-within .stat-analysis,
.chart-card:hover .chart-analysis,
.card:hover .chart-analysis {
  opacity: 1;
  pointer-events: auto;
}
.stat-card:focus-visible .stat-analysis {
  opacity: 1;
  pointer-events: auto;
}
.stat-analysis:hover,
.chart-analysis:hover {
  border-color: #1e88e5;
  background: #eff6ff;
}
.stat-analysis {
  position: absolute;
  top: 10px;
  right: 10px;
  margin-top: 0;
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.chart-head .chart-title,
.chart-head .section-title { margin: 0; }
.analysis-modal { padding: 4px 0; }
.asummary {
  font-size: 14px;
  line-height: 1.8;
  color: #33405a;
  background: #f3f6fb;
  border-left: 3px solid #1e88e5;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.arows {
  border: 1px solid #e9ebf0;
  border-radius: 8px;
  overflow: hidden;
}
.arow {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f1f4;
  font-size: 13px;
  line-height: 1.6;
}
.arow:last-child { border-bottom: none; }
.akey { flex: 0 0 64px; color: #8a93a0; font-weight: 600; }

/* 详情等“直接显示”的标签-值：标签固定 64px；两列 grid 保证值始终在标签右侧同行换行 */
.detail-grid { gap: 8px; }
.detail-grid > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  justify-items: stretch;
  align-items: start;
  column-gap: 4px;
}
.detail-grid > div > strong {
  width: 64px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #8a93a0;
  line-height: 1.45;
  flex: 0 0 64px;
}
.detail-grid > div > div,
.detail-grid > div > textarea {
  min-width: 0;
  width: 100%;
  margin-top: 0 !important;
}
.detail-grid > div > span,
.detail-grid > div > input { min-width: 0; width: 100%; }
.aval { color: #33405a; word-break: break-word; flex: 1; }

/* 解析结果：单元格内容自动换行 + 自适应行高 */
.parsed-desc-td { vertical-align: middle; }
.parsed-desc {
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  min-height: 36px;
  vertical-align: middle;
}
/* 任务描述列内容居中 */
.parsed-desc-center { text-align: center; }

/* 任务台账排序 */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color .15s;
  position: relative; /* 排序箭头绝对定位锚点：箭头不再挤占文本宽度，保证表头文本真正居中 */
}
th.sortable:hover { color: var(--info); }
.sort-arrow {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--info);
  pointer-events: none;
}
th.sortable .sort-arrow { visibility: hidden; }
th.sortable.sort-active .sort-arrow { visibility: visible; }

/* 任务台账、每周任务、近7天到期任务：表头内容居中 */
#tasks-table thead th,
#weekly-table thead th,
#upcoming-table thead th {
  text-align: center;
}

/* 近7天到期任务：责任人、完成时限、倒数日、状态列数据居中 */
#upcoming-table tbody td:nth-child(3),
#upcoming-table tbody td:nth-child(4),
#upcoming-table tbody td:nth-child(5),
#upcoming-table tbody td:nth-child(6) {
  text-align: center;
}

/* 近7天到期任务：完成时限、倒数日列数值单行显示不换行 */
#upcoming-table tbody td:nth-child(4),
#upcoming-table tbody td:nth-child(5) {
  white-space: nowrap;
}

/* 近7天到期任务：文件名称、任务描述（填写内容）单元格更舒展，美观大方 */
#upcoming-table tbody td:nth-child(1),
#upcoming-table tbody td:nth-child(2) {
  padding: 12px 16px;
  line-height: 1.7;
}
/* 近7天到期任务：其余短数据列（责任人/完成时限/倒数日/状态）内边距匹配，保持垂直居中对齐 */
#upcoming-table tbody td:nth-child(3),
#upcoming-table tbody td:nth-child(4),
#upcoming-table tbody td:nth-child(5),
#upcoming-table tbody td:nth-child(6) {
  padding: 10px 8px;
  vertical-align: middle;
}

/* 任务台账：责任人列单行显示（3 字等人名不换行），并适当收紧内边距 */
#tasks-table tbody td:nth-child(6) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
#tasks-table tbody td:nth-child(6)::before { content: none; }

/* 任务台账：第一列（复选框）单元格内边距调为 10px  */
#tasks-table th:first-child,
#tasks-table td.cell-check {
  padding: 10px;
}
#weekly-table td.cell-check {
  padding: 10px;
}
#weekly-table .weekly-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--ink-600);
  cursor: pointer;
}

/* ===== 移动端顶栏（仅手机显示）===== */
.mobile-header {
  display: none;
}
.mobile-menu-btn {
  background: none;
  border: none;
  color: #f5edd6;
  font-size: 24px;
  line-height: 1;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-btn:active { background: rgba(245,237,214,0.16); }
.mobile-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f5edd6;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-user {
  font-size: 12px;
  color: rgba(245,237,214,0.7);
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.mobile-scrim {
  display: none;
}

/* ===== 移动端布局（抽屉式垂直侧边栏）===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  body { padding-top: 54px; }
  /* 顶栏常驻顶部 */
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 54px;
    padding: 0 12px;
    background: linear-gradient(180deg, var(--ink-900), var(--ink-800));
    color: #f5edd6;
    border-bottom: 1px solid rgba(184,146,58,0.28);
    z-index: 1100;
  }
  /* 遮罩 */
  .mobile-scrim {
    display: block;
    position: fixed;
    inset: 0;
    top: 54px;
    background: rgba(10,37,64,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 1150;
  }
  .mobile-scrim.show {
    opacity: 1;
    pointer-events: auto;
  }
  /* 侧边栏改为抽屉，默认隐藏在左侧 */
  .layout-wrapper {
    flex-direction: column;
  }
  .sidebar,
  .sidebar.collapsed {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 82%;
    max-width: 300px;
    height: 100vh;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
    flex-basis: auto;
    z-index: 1200;
    flex-direction: column;
    display: flex;
    border-right: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(10,37,64,0.28);
  }
  /* 移动端无视桌面「收起」状态，始终完整展示 */
  .sidebar.collapsed .sidebar-logo-text { display: block; }
  .sidebar.collapsed .menu-text { display: inline; }
  .sidebar.collapsed .sidebar-menu a { justify-content: flex-start; padding: 12px 14px; }
  .sidebar.collapsed .sidebar-user { display: block; }
  .sidebar-header { flex-direction: row; padding: 16px 18px; }
  .sidebar-toggle { display: none; }
  .sidebar-logo-text { display: block; }
  .sidebar-menu {
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    overflow-x: visible;
  }
  .sidebar-menu a {
    flex: none;
    width: 100%;
    justify-content: flex-start;
    white-space: nowrap;
    padding: 12px 14px;
    box-shadow: none;
    min-height: 44px;
    align-items: center;
  }
  .sidebar-menu a.active { box-shadow: none; background-color: rgba(184,146,58,0.22); color: #fff; }
  .menu-text { display: inline; }
  .sidebar-footer { flex-direction: column; align-items: stretch; }
  .sidebar-logout { width: 100%; min-height: 44px; }

  .content-wrap .main-container { padding: 14px 12px 32px; }

  /* 表格：小屏更紧凑，保持横向滚动而非撑破 */
  .data-table th, .data-table td { padding: 9px 8px; font-size: 13px; }
  .table-wrapper,
  .table-wrapper > table { -webkit-overflow-scrolling: touch; }

  /* 图表高度降低 */
  .chart-container { height: 240px; }

  /* 卡片内边距收拢 */
  .card { padding: 16px; }
  .stat-card { padding: 14px 16px; gap: 12px; }
  .stat-icon { width: 44px; height: 44px; font-size: 20px; }
  .stat-info .stat-value { font-size: 22px; }

  /* 工具栏：搜索与按钮堆叠，按钮加大触控 */
  .search-bar { flex-direction: column; align-items: stretch; }
  .search-bar .search-input,
  .search-bar .search-select { width: 100%; min-height: 44px; }
  .search-bar .btn,
  .toolbar .btn { min-height: 44px; }
  #report-btns, .toolbar > div:last-child { flex-wrap: wrap; }

  /* 弹窗：靠顶展示，底部留安全区 */
  .modal { max-width: 100%; width: 100%; height: auto; max-height: 94vh; border-radius: 12px 12px 0 0; align-self: flex-end; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-body { padding: 12px 14px; font-size: 15px; }
  .modal-footer { flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { min-height: 44px; }
}

/* 小屏手机（≤480px）：统计卡单列、更紧凑 */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
  .charts-grid { gap: 12px; margin-bottom: 16px; }
  .upload-area { padding: 28px 16px; }
  .form-label { font-size: 15px; }
  #upcoming-table { min-width: 0; }
}

/* ===== 移动端：近7天到期任务转单列卡片 ===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  #upcoming-table {
    display: block;
    width: 100%;
    table-layout: auto;
  }
  #upcoming-table thead { display: none; }
  #upcoming-table tbody {
    display: block;
    width: 100%;
    padding: 2px 0;
  }
  #upcoming-table tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
  }
  #upcoming-table td {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    border: none;
    vertical-align: top;
  }
  #upcoming-table td::before {
    content: attr(data-label);
    flex: 0 0 74px;
    color: var(--text-3);
    font-weight: 600;
  }
  #upcoming-table td:not([data-label])::before { content: none; }
  /* 卡片化后各格统一左端+顶部对齐：覆盖桌面端按列设置的内边距/居中，避免错位 */
  #upcoming-table tbody td:nth-child(1),
  #upcoming-table tbody td:nth-child(2),
  #upcoming-table tbody td:nth-child(3),
  #upcoming-table tbody td:nth-child(4),
  #upcoming-table tbody td:nth-child(5),
  #upcoming-table tbody td:nth-child(6) {
    padding: 6px 0;
    text-align: left;
  }
  #upcoming-table td::before { text-align: left; }
  #upcoming-table td span { text-align: left; }
  #upcoming-table .status-tag { padding: 4px 12px; font-size: 13px; border-radius: 13px; }
  #upcoming-table td.empty-state {
    display: block;
    text-align: center;
    padding: 32px 8px;
  }
  /* 覆盖桌面端 hover/斑马纹 */
  #upcoming-table tbody tr:nth-child(even),
  #upcoming-table tbody tr:hover { background: var(--surface); }
  #upcoming-table tbody tr:hover td { background: transparent; }
}

/* ===== 移动端：任务台账转单列卡片 ===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  #tasks-table {
    display: block;
    width: 100%;
    table-layout: auto;
  }
  #tasks-table thead {
    display: none;
  }
  #tasks-table tbody {
    display: block;
    width: 100%;
    padding: 2px 0;
  }
  #tasks-table tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
  }
  #tasks-table td {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    border: none;
    vertical-align: top;
  }
  /* 字段名标签 */
  #tasks-table td::before {
    content: attr(data-label);
    flex: 0 0 74px;
    color: var(--text-3);
    font-weight: 600;
  }
  #tasks-table td:not([data-label])::before { content: none; }
  /* 卡片化后统一左端+顶部对齐：抵消桌面端按列的居中/内边距，恢复「责任人」标签 */
  #tasks-table tbody td:nth-child(6),
  #tasks-table td[data-label="责任人"] {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-align: left;
  }
  #tasks-table tbody td:nth-child(6)::before,
  #tasks-table td[data-label="责任人"]::before {
    content: attr(data-label);
  }
  #tasks-table td[data-label="来文时间"] {
    padding: 3px 0;
  }
  /* 勾选行：大号触控 */
  #tasks-table td.cell-check { padding-bottom: 4px; }
  #tasks-table .task-checkbox { width: 15px; height: 15px; accent-color: var(--ink-600); cursor: pointer; }
  #weekly-table td.cell-check { padding-bottom: 4px; }
  #weekly-table .weekly-checkbox { width: 15px; height: 15px; accent-color: var(--ink-600); cursor: pointer; }
  /* 状态标签放大 */
  #tasks-table .status-tag { padding: 4px 12px; font-size: 13px; border-radius: 13px; }
  /* 空状态行 */
  #tasks-table td.empty-state {
    display: block;
    text-align: center;
    padding: 32px 8px;
  }
  /* 操作行：右下角 + 加大触控按钮 */
  #tasks-table td.actions-cell {
    justify-content: flex-end;
    border-top: 1px dashed var(--border);
    margin-top: 8px;
    padding-top: 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  #tasks-table td.actions-cell .btn {
    min-height: 44px;
    padding: 10px 22px;
    font-size: 14px;
    min-width: 80px;
  }
  /* 覆盖桌面端 hover/斑马纹，保证卡片白底不被干扰 */
  #tasks-table tbody tr:nth-child(even),
  #tasks-table tbody tr:hover {
    background: var(--surface);
  }
  #tasks-table tbody tr:hover td { background: transparent; }

  /* ==== 每周计划：移动端卡片化（与任务台账一致）==== */
  #weekly-table {
    display: block;
    width: 100%;
    min-width: 0; /* 覆盖桌面端 min-width，避免移动端横向溢出 */
    table-layout: auto;
  }
  #weekly-table thead { display: none; }
  #weekly-table tbody {
    display: block;
    width: 100%;
    padding: 2px 0;
  }
  #weekly-table tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
  }
  #weekly-table td {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere; /* 责任人等多值长文本可换行，避免溢出截断 */
    word-break: break-word;
    border: none;
    vertical-align: top;
  }
  /* 字段名标签 */
  #weekly-table td::before {
    content: attr(data-label);
    flex: 0 0 74px;
    color: var(--text-3);
    font-weight: 600;
  }
  #weekly-table td:not([data-label])::before { content: none; }
  /* 责任人列恢复左对齐标签，避免被桌面端居中覆盖（更高优先级，确保覆盖桌面端 nth-child 居中规则） */
  #weekly-table tbody tr td[data-label="责任人"] {
    white-space: normal;
    overflow: visible;
    text-align: left;
    justify-content: flex-start;
  }
  #weekly-table tbody tr td[data-label="责任人"]::before { content: attr(data-label); }
  /* 序号列在移动端卡片中左对齐（标签+值），避免被桌面端居中规则影响 */
  #weekly-table tbody tr td[data-label="序号"] {
    text-align: left;
    justify-content: flex-start;
  }
  /* 完成时限列也恢复左对齐标签，避免被桌面端居中覆盖，与其他行对齐 */
  #weekly-table tbody tr td[data-label="完成时限"] {
    white-space: normal;
    overflow: visible;
    text-align: left;
    justify-content: flex-start;
  }
  /* 空状态行 */
  #weekly-table td.empty-state {
    display: block;
    text-align: center;
    padding: 32px 8px;
  }
  /* 操作行：右下角 + 加大触控按钮（与任务台账一致，不显示"操作"文字标签） */
  #weekly-table td.actions-cell {
    justify-content: flex-end;
    border-top: 1px dashed var(--border);
    margin-top: 8px;
    padding-top: 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  #weekly-table td.actions-cell::before { content: none; }
  #weekly-table td.actions-cell .btn {
    min-height: 44px;
    padding: 10px 22px;
    font-size: 14px;
    min-width: 80px;
  }
  /* 覆盖桌面端 hover/斑马纹，保证卡片白底不被干扰 */
  #weekly-table tbody tr:nth-child(even),
  #weekly-table tbody tr:hover {
    background: var(--surface);
  }
  #weekly-table tbody tr:hover td { background: transparent; }
}

/* 移动端：统计明细（任务总数/完成数/逾期数）卡片化 */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  #stats-detail-table { display: block; width: 100%; table-layout: auto; }
  #stats-detail-table thead { display: none; }
  #stats-detail-table tbody { display: block; width: 100%; padding: 2px 0; }
  #stats-detail-table tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
  }
  #stats-detail-table td {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.5;
    text-align: left !important;
    white-space: normal !important;
    border: none;
    vertical-align: top;
  }
  #stats-detail-table td::before {
    content: attr(data-label);
    flex: 0 0 76px;
    color: var(--text-3);
    font-weight: 600;
  }
  #stats-detail-table td:not([data-label])::before { content: none; }
  /* 卡片化后统一左端+顶部对齐：抵消桌面端 pad8/pad5 的横向内边距，避免责任人/完成时间错位 */
  #stats-detail-table th.pad8, #stats-detail-table td.pad8,
  #stats-detail-table th.pad5, #stats-detail-table td.pad5 {
    padding: 3px 0;
  }
  #stats-detail-table td::before { text-align: left; }
  #stats-detail-table td.empty-cell {
    display: block;
    text-align: center;
    padding: 32px 8px;
  }
  #stats-detail-table tbody tr:nth-child(even),
  #stats-detail-table tbody tr:hover { background: var(--surface); }
  #stats-detail-table tbody tr:hover td { background: transparent; }
}

/* ===== 移动端：视觉打磨（polish）===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  /* iPhone 底部安全区，防止内容被手势条遮挡 */
  .content-wrap .main-container {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
  /* 表单控件触控目标加大 */
  .form-input,
  .form-select,
  .form-textarea {
    min-height: 46px;
    padding: 12px 14px;
    font-size: 15px;
  }
  /* 移动端：周重点任务「落实情况」输入框 */
  #w-progress {
    min-height: 180px;
    font-size: 15px;
    line-height: 1.6;
  }
  /* 移动端：周重点任务「完成时限」日期框——自适应列宽填满（上限 160px），确保完整显示日期不截断 */
  #w-deadline {
    width: 100%;
    max-width: 160px;
    padding: 8px;
    min-height: 44px;
  }
  /* 移动端：周重点任务「责任人」框内边距收紧 8px */
  #w-assignee {
    padding: 8px;
    min-height: 44px;
  }
  /* 责任人多选：chip 加大、可滚动更高 */
  .assignee-multi { max-height: 40vh; padding: 12px; }
  .assignee-multi-item { padding: 10px 14px; font-size: 14px; gap: 8px; }
  .assignee-multi-item input[type="checkbox"] { width: 18px; height: 18px; }
  /* 弹窗：标题栏紧凑、关闭按钮大触控 */
  .modal-header { padding: 10px 14px; }
  .modal-title { font-size: 16px; }
  .modal-close { width: 40px; height: 40px; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
  .modal-footer {
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  /* 卡片字段标签固定宽、标签与内容间距紧凑 */
  #tasks-table td:not(.cell-check):not(.actions-cell),
  #upcoming-table td { gap: 4px; }
  #tasks-table td::before,
  #upcoming-table td::before { flex-basis: 76px; }
  /* 责任人标签随卡片统一左端+顶部对齐 */
  #tasks-table td[data-label="责任人"] {
    align-items: flex-start;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  /* 上传区图标在手机上略缩小 */
  .upload-icon { font-size: 40px; }
  .jump-page { min-height: 44px; padding: 8px 12px; }
}

/* 尊重系统「减少动效」偏好 */
@media (prefers-reduced-motion: reduce) {
  * ,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== 移动端：任务卡片信息密度 ===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  /* 次要字段标签收窄、更紧凑 */
  #tasks-table td::before,
  #upcoming-table td::before {
    flex-basis: 70px;
    font-size: 12px;
    letter-spacing: .02em;
  }
  /* 状态做成长条形，信息更显眼 */
  #tasks-table .status-tag,
  #upcoming-table .status-tag { padding: 5px 14px; }
}

/* ===== 移动端：仪表盘首页排版 ===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
  .stat-card { padding: 12px 8px; border-radius: 14px; gap: 6px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
  .stat-icon { width: 38px; height: 38px; font-size: 17px; border-radius: 11px; }
  .stat-info .stat-value { font-size: 22px; }
  .stat-info h3 { font-size: 12px; margin-bottom: 2px; letter-spacing: .02em; white-space: nowrap; }
  .chart-card { padding: 18px; border-radius: 14px; }
  .chart-title { font-size: 15px; margin-bottom: 14px; padding-bottom: 10px; }
  .chart-container { height: 256px; }
  .section-title { font-size: 16px; margin: 22px 0 12px; padding-left: 10px; }
  .card { padding: 16px; border-radius: 14px; }
}

/* 任务台账工具栏分组：桌面单行，手机多行 */
/* 桌面端（>768px）：左搜索/筛选 + 右操作按钮，两端对齐、整洁大方 */
@media (min-width: 769px) {
  .tasks-toolbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .tasks-toolbar .toolbar-left,
  .tasks-toolbar .toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
  .tasks-toolbar .toolbar-row { display: contents; }
  .tasks-toolbar .toolbar-row-search .search-input.search-fill { flex: none; width: 240px; }
  /* 统一高度与间距，观感更整洁 */
  .tasks-toolbar .search-input,
  .tasks-toolbar .search-select { height: 38px; }
  .tasks-toolbar .search-select { min-width: 128px; }
  .tasks-toolbar .btn { height: 38px; white-space: nowrap; }
}
/* ===== 移动端：任务提取 → 解析结果转单列卡片 ===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  #parsed-table,
  #parsed-table thead,
  #parsed-table tbody,
  #parsed-table tr,
  #parsed-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  #parsed-table { table-layout: auto; }
  #parsed-table thead { display: none; }
  #parsed-table tbody { padding: 2px 0; }
  #parsed-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
  }
  #parsed-table td {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 0;
    border: none;
  }
  #parsed-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--text-3);
  }
  #parsed-table td:not([data-label])::before { content: none; }
  /* 空状态行 */
  #parsed-table td.empty-state {
    display: block;
    text-align: center;
    padding: 32px 8px;
  }
  /* 可编辑控件全宽、触控加大 */
  #parsed-table .form-input { width: 100%; min-height: 46px; }
  #parsed-table textarea.form-input { min-height: 46px; }
  /* 删除按钮：独立成行、右对齐、加大触控 */
  #parsed-table td.parsed-del-cell {
    align-items: flex-end;
    border-top: 1px dashed var(--border);
    margin-top: 8px;
    padding-top: 12px;
  }
  #parsed-table td.parsed-del-cell .btn {
    min-height: 44px;
    padding: 10px 22px;
    font-size: 14px;
  }
  /* 覆盖桌面端斑马纹/hover */
  #parsed-table tbody tr:hover td,
  #parsed-table tbody tr:nth-child(even) { background: transparent; }
}

/* ===== 移动端：卡片统一排版优化（紧凑·美观大方·不改配色） ===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  /* 手机端卡片各自带边框，去掉外层 table-wrapper 的整圈线 */
  .table-wrapper {
    border: none;
    background: transparent;
  }

  /* 统一所有卡片容器的内边距、圆角与间距，形成一致的“卡片语言” */
  #tasks-table tr,
  #weekly-table tr,
  #upcoming-table tr,
  #stats-detail-table tr,
  #parsed-table tr {
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
  }

  /* 字段行节奏统一：所有卡片标签与内容间距一致、更紧凑 */
  #tasks-table td,
  #weekly-table td,
  #upcoming-table td,
  #stats-detail-table td,
  #parsed-table td {
    gap: 4px !important;
    padding: 3px 0;
    font-size: 13px;
    line-height: 1.45;
    text-align: left !important;
  }
  /* 标签宽度统一，手机端卡片空隙统一 64px */
  #tasks-table td::before,
  #weekly-table td::before,
  #upcoming-table td::before,
  #stats-detail-table td::before,
  #parsed-table td::before {
    flex: 0 0 64px;
  }
  /* 解析结果卡片为纵向排版（标签在上、内容在下），不可套用横向 64px 宽度，恢复按内容自适应 */
  #parsed-table td::before {
    flex: none;
  }

  /* 详情等“直接显示”的标签-值：标签固定 64px；用两列 grid 保证值始终在标签右侧同行换行 */
  .detail-grid { gap: 8px; }
  .detail-grid > div {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    justify-items: stretch;
    align-items: start;
    column-gap: 4px;
  }
  .detail-grid > div > strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-3);
    line-height: 1.45;
  }
  .detail-grid > div > div,
  .detail-grid > div > textarea {
    min-width: 0;
    width: 100%;
    margin-top: 0 !important;
  }
  .detail-grid > div > span,
  .detail-grid > div > input { min-width: 0; width: 100%; }

  /* 智能分析等“直接显示”的标签-值：与卡片一致，标签固定 64px */
  .akey { flex: 0 0 64px; }

  /* 首页三张统计卡：等高标准，内容更紧凑 */
  .stats-grid { gap: 8px; }
  .stat-card {
    min-height: 92px;
    padding: 10px 6px;
    border-radius: 12px;
    gap: 2px;
  }
  .stat-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
  .stat-info .stat-value { font-size: 22px; }

  /* 空状态：居中、留白舒适 */
  #tasks-table td.empty-state,
  #weekly-table td.empty-state,
  #upcoming-table td.empty-state,
  #parsed-table td.empty-state,
  #stats-detail-table td.empty-cell {
    padding: 32px 12px;
    font-size: 13px;
  }
}

/* ===== 移动端：任务台账重排（紧凑 · 现代 · 美观） ===== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  /* ---------- 页面卡片容器：统一紧凑内边距 ---------- */
  #tab-tasks .card {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px !important;
  }

  /* ---------- 工具栏：严格两行布局（紧凑 · 现代化） ---------- */
  .tasks-toolbar {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 0;
  }
  /* 左右分组各自成一行（不再拍平到父级），确保严格两行不拆行 */
  .tasks-toolbar .toolbar-left,
  .tasks-toolbar .toolbar-right {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  /* 行内 toolbar-row 继续拍平，让控件直接参与行内 flex 排列 */
  .tasks-toolbar .toolbar-row { display: contents; }
  .tasks-toolbar .search-input,
  .tasks-toolbar .search-select {
    min-height: 36px;
    height: 36px;
    padding: 6px 10px;
    border-radius: 10px;
  }
  .tasks-toolbar .search-input { font-size: 14px; }
  .tasks-toolbar .search-select { font-size: 12px; }
  .tasks-toolbar .btn {
    min-height: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 10px;
    gap: 5px;
  }
  /* 行1：搜索框 + 状态 + 责任人（状态/责任人等宽，宽度足以完整显示文案） */
  #tasks-toolbar #search-keyword { order: 1; flex: 1 1 auto; min-width: 104px; }
  #tasks-toolbar #filter-status { order: 2; flex: 0 1 116px; min-width: 0; }
  #tasks-toolbar #filter-assignee { order: 3; flex: 0 1 116px; min-width: 0; }
  /* 行2：生成周报 + 生成月报 + 新增任务（三个等宽铺满，两端对齐、空袭均衡） */
  #tasks-toolbar #report-btns { order: 4; display: flex; flex: 2 1 auto; gap: 8px; }
  #tasks-toolbar #report-btns .btn { flex: 1 1 auto; padding: 0 10px; }
  #tasks-toolbar #add-task-btn { order: 5; flex: 1 1 auto; }
  /* 移动端隐藏：搜索 / 重置 / 导出 / 导入 / 下载模板 */
  #tasks-toolbar #search-btn,
  #tasks-toolbar #reset-btn,
  #tasks-toolbar #export-tasks-btn,
  #tasks-toolbar #import-tasks-btn,
  #tasks-toolbar #download-template-btn { display: none; }

  /* ---------- 批量操作条：紧凑精致 ---------- */
  #batch-bar,
  #weekly-batch-bar {
    padding: 10px;
    border-radius: 10px;
    gap: 8px;
    margin-top: 10px;
  }
  #batch-bar .btn,
  #weekly-batch-bar .btn {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 9px;
  }
  #batch-bar .search-select,
  #weekly-batch-bar .search-select {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 9px;
  }
  #batch-bar #batch-count,
  #weekly-batch-bar #weekly-batch-count {
    font-size: 13px;
  }

  /* ---------- 任务卡片：更紧凑、精致 ---------- */
  #tasks-table tr { padding: 10px 12px; }
  #tasks-table td { padding: 3px 0; gap: 4px; }
  #tasks-table td::before { flex: 0 0 64px; }
  #weekly-table tr { padding: 10px 12px; }
  #weekly-table td { padding: 3px 0; gap: 4px; }
  #weekly-table td::before { flex: 0 0 64px; }
  /* 操作行按钮更紧凑 */
  #tasks-table td.actions-cell { margin-top: 6px; padding-top: 10px; gap: 8px; }
  #tasks-table td.actions-cell .btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
    min-width: 64px;
    border-radius: 9px;
  }
  /* 每周任务操作行与按钮：与任务台账保持完全一致（此前缺此规则，按钮仍为大号 44px） */
  #weekly-table td.actions-cell { margin-top: 6px; padding-top: 10px; gap: 8px; }
  #weekly-table td.actions-cell .btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
    min-width: 64px;
    border-radius: 9px;
  }
  /* 复选框保持 15px 精致尺寸 */
  #tasks-table .task-checkbox { width: 15px; height: 15px; }
}

/* ===== 任务台账分页栏 ===== */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 4px 4px;
}
.table-pagination .page-info {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}
.table-pagination .page-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.table-pagination .page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.table-pagination .page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}
.table-pagination .page-btn.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
}
.table-pagination .page-btn:disabled {
  opacity: .45;
  cursor: default;
}
.table-pagination .page-ellipsis {
  padding: 0 2px;
  color: var(--text-3);
  font-size: 13px;
}
@media (max-width: 768px) {
  .table-pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 2px 2px;
  }
  .table-pagination .page-btn { min-width: 34px; height: 34px; font-size: 14px; }
}

/* ===== 移动端：每周任务工具栏 · 精致三段式 =====
   段1：周切换（‹ 日期 › + 本周金色强调）胶囊控件组
   段2：新增周重点任务（通栏渐变主按钮）
   段3：导出 / 导入（等宽柔和描边按钮） */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1194px) and (hover: none) and (pointer: coarse) {
  #weekly-toolbar.tasks-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    margin-bottom: 0;
    padding: 1px 0;
  }
  /* 统一去除移动端点击高亮 */
  #weekly-toolbar button {
    -webkit-tap-highlight-color: transparent;
  }

  /* 段1：周切换 —— 上一周/日期/下一周为方形图标+弹性日期，本周金色强调 */
  #weekly-toolbar .toolbar-left {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    width: 100%;
  }
  #weekly-toolbar .toolbar-left .toolbar-row { display: contents; }
  /* 上一周 / 下一周：方形图标钮，墨蓝描边 */
  #weekly-toolbar #weekly-prev-btn,
  #weekly-toolbar #weekly-next-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-2);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, background 0.2s, border-color 0.2s, color 0.2s;
  }
  #weekly-toolbar #weekly-prev-btn:active,
  #weekly-toolbar #weekly-next-btn:active {
    transform: scale(0.92);
    background: var(--surface-2);
    border-color: var(--ink-500);
    color: var(--ink-700);
  }
  /* 日期字段：弹性伸展主导宽度，高度与下行一致 */
  #weekly-toolbar #weekly-week-input {
    flex: 1 1 auto;
    width: auto;
    height: 36px;
    min-height: 36px;
    padding: 0 5px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-size: 12px;
    color: var(--text-1);
    text-align: center;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-sm);
    position: relative;
    caret-color: transparent;
    -webkit-text-fill-color: transparent;
  }
  /* 用覆盖层强制日期文本在框内水平居中（跨 WebKit/微信内核可靠） */
  #weekly-toolbar #weekly-week-input::after {
    content: attr(data-display);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-1);
    -webkit-text-fill-color: var(--text-1);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.02em;
    pointer-events: none;
  }
  /* 本周：金色强调钮，与下行导出同宽对齐 */
  #weekly-toolbar #weekly-today-btn {
    flex: 0 0 auto;
    width: 100px;
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border: none;
    box-shadow: 0 3px 10px rgba(184, 146, 58, 0.32);
  }
  #weekly-toolbar #weekly-today-btn:active {
    transform: scale(0.95);
  }

  /* 段2/3：新增周重点任务（主）+ 导出（次）同排，导入移动端隐藏 */
  #weekly-toolbar .toolbar-right {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
  }
  #weekly-toolbar .toolbar-right .toolbar-row { display: contents; }
  /* 段2：新增周重点任务 —— 通栏渐变主按钮（占据主导宽度） */
  #weekly-toolbar #weekly-add-btn {
    order: 1;
    flex: 2.2 1 0;
    height: 36px;
    min-height: 36px;
    font-size: 13px;
    letter-spacing: 0.03em;
    border-radius: 9px;
    background: linear-gradient(90deg, var(--ink-700), var(--ink-600));
    color: #fff;
    border: none;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(20, 64, 112, 0.24);
    transition: transform 0.15s, box-shadow 0.2s;
  }
  #weekly-toolbar #weekly-add-btn:active {
    transform: scale(0.98);
    box-shadow: 0 3px 8px rgba(20, 64, 112, 0.24);
  }
  /* 段3：导出 —— 同高柔和描边按钮（等宽排布） */
  #weekly-toolbar #weekly-export-btn {
    order: 2;
    flex: 0 0 100px;
    width: 100px;
    height: 36px;
    min-height: 36px;
    gap: 4px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--ink-700);
    font-weight: 500;
    font-size: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, border-color 0.2s, background 0.2s;
  }
  #weekly-toolbar #weekly-export-btn:active {
    transform: scale(0.97);
    background: var(--surface-2);
    border-color: var(--ink-500);
    color: var(--ink-800);
  }
  /* 段4：导入 —— 移动端不显示 */
  #weekly-toolbar #weekly-import-btn { display: none; }
}
/* 周任务 完成时限/责任人：移动紧凑、桌面宽松协调 */
.weekly-meta-row{display:grid;grid-template-columns:0.86fr 1.64fr;gap:2px;align-items:center;}
.weekly-meta-row input[type=date],.weekly-meta-row select{padding:8px 2px;text-align:left;}
@media (min-width:768px){
 .weekly-meta-row{grid-template-columns:1fr 1.2fr;gap:28px;margin:4px 0 16px;}
 .weekly-meta-row input[type=date],.weekly-meta-row select{padding:9px 14px !important;}
 .weekly-meta-row .form-label{width:92px;line-height:40px;}
}
