/* ================================================================
   项目计划管理 — "Refined Cerulean" 设计系统
   纯 CSS 变量驱动，零依赖，系统字体栈
   ================================================================ */

/* === 1. 设计令牌 === */
:root {
  /* 背景面 */
  --bg-page:         #F8F6F2;
  --bg-surface:      #FEFDFB;
  --bg-surface-alt:  #F2F0EC;
  --bg-overlay:      rgba(30, 45, 61, 0.25);

  /* 强调色：钢蓝 */
  --accent:          #5B8CB8;
  --accent-deep:     #3E719B;
  --accent-tint:     #E8EFF6;
  --accent-surface:  #DCE8F2;
  --accent-glow:     #7AA8CE;

  /* 文字：深蓝石板 */
  --text-primary:    #1E2D3D;
  --text-secondary:  #6B7B8D;
  --text-tertiary:   #94A3B0;
  --text-inverse:    #F8F6F2;

  /* 语义色 */
  --semantic-green:       #689F63;
  --semantic-green-light: #EDF5EC;
  --semantic-red:         #C96B6B;
  --semantic-red-light:   #F9EEEE;
  --semantic-orange:      #E09E5E;
  --semantic-orange-light:#FDF5ED;
  --semantic-gray:        #A3ADB8;
  --semantic-gray-light:  #F0EFEC;

  /* 边框 */
  --border-subtle:   #E6E3DD;
  --border-visible:  #D4D0C8;

  /* 阴影：深蓝调 */
  --shadow-xs:  0 1px 2px rgba(30, 45, 61, 0.04);
  --shadow-sm:  0 1px 3px rgba(30, 45, 61, 0.06),
                0 1px 2px rgba(30, 45, 61, 0.04);
  --shadow-md:  0 4px 16px rgba(30, 45, 61, 0.08),
                0 2px 4px rgba(30, 45, 61, 0.04);
  --shadow-lg:  0 8px 32px rgba(30, 45, 61, 0.10),
                0 4px 8px rgba(30, 45, 61, 0.04);
  --shadow-ring: 0 0 0 3px rgba(91, 140, 184, 0.12);

  /* 字体 */
  --font-heading: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-body:    "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono:    "Cascadia Code", "Consolas", "SF Mono", monospace;
  --font-size-xs:  11px;
  --font-size-sm:  12px;
  --font-size-base:14px;
  --font-size-md:  15px;
  --font-size-lg:  18px;
  --font-size-xl:  20px;
  --font-size-xxl: 24px;

  /* 间距和圆角 */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  14px;
  --space-lg:  20px;
  --space-xl:  28px;
  --space-xxl: 36px;
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-round: 50%;

  /* 布局 */
  --sidebar-width: 180px;

  /* 过渡 */
  --transition-fast: 120ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* === 老变量别名（JS 兼容性） === */
  --primary:       var(--accent);
  --primary-dark:  var(--accent-deep);
  --primary-light: var(--accent-tint);
  --green:         var(--semantic-green);
  --green-light:   var(--semantic-green-light);
  --red:           var(--semantic-red);
  --orange:        var(--semantic-orange);
  --gray:          var(--semantic-gray);
  --gray-light:    var(--semantic-gray-light);
  --text:          var(--text-primary);
  --card:          var(--bg-surface);
  --bg:            var(--bg-page);
  --shadow-md:     0 4px 16px rgba(30, 45, 61, 0.08),
                   0 2px 4px rgba(30, 45, 61, 0.04);
  --radius:        10px;
  --radius-sm:     6px;
  --font:          "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* === 2. Reset & 基础 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-page);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 页面纹理覆盖层 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(91, 140, 184, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 100%, rgba(224, 158, 94, 0.03) 0%, transparent 50%);
}

::selection { background: var(--accent-tint); color: var(--text-primary); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: var(--font-size-base); }

/* === 3. 侧边导航栏 === */
#sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #EBF0F5 0%, #E8EEF4 100%);
  border-right: 1px solid var(--border-subtle);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.nav-brand {
  padding: 14px 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}
.nav-brand h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  font-weight: 600;
}
.nav-date {
  font-family: var(--font-heading);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.nav-item {
  padding: 13px 20px;
  margin: 0 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
  cursor: pointer;
  position: relative;
}
.nav-item:hover {
  background: rgba(91, 140, 184, 0.08);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--accent);
  color: var(--text-inverse);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(91, 140, 184, 0.25);
  transform: translateX(0);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--text-inverse);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 17px; filter: grayscale(0.3); transition: filter var(--transition-base); }
.nav-item.active .nav-icon { filter: grayscale(0); }

/* === 4. 主内容区 === */
#mainContent {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 28px 36px;
  overflow-y: auto;
  min-height: 100vh;
}

.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.view-header h2 {
  font-family: var(--font-heading);
  font-size: var(--font-xl);
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.date-nav { display: flex; gap: 10px; align-items: center; }

/* === 按钮系统 === */
.btn-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: var(--font-size-base);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-base);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-deep); }
.btn-icon:active { transform: scale(0.96); }

.btn-text {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all var(--transition-base);
}
.btn-text:hover { background: var(--accent-deep); box-shadow: var(--shadow-sm); }
.btn-text:active { transform: scale(0.97); }

.btn-text.btn-success { background: var(--semantic-green); }
.btn-text.btn-success:hover { background: #558B50; }
.btn-text.btn-danger { background: var(--semantic-red); }
.btn-text.btn-danger:hover { background: #B55A5A; }

.btn-outline {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent-deep);
  border: 1px solid var(--accent);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-base);
}
.btn-outline:hover { background: var(--accent-tint); border-color: var(--accent-deep); }

.btn-xs {
  padding: 4px 10px;
  font-size: var(--font-size-xs);
}

/* === 5. 今日计划布局 === */
.daily-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
  position: relative;
  min-height: calc(100vh - 140px);
}
.daily-main { flex: 1; min-width: 300px; overflow: hidden; }
.daily-sidebar {
  width: 340px;
  min-width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.resize-handle {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  transition: background var(--transition-base);
  align-self: stretch;
  min-height: 400px;
  position: relative;
}
.resize-handle::after {
  content: '';
  position: absolute;
  left: 2px; top: 20px; bottom: 20px;
  width: 2px;
  background: var(--border-subtle);
  border-radius: 1px;
  transition: background var(--transition-base);
}
.resize-handle:hover,
.resize-handle.active { background: rgba(91, 140, 184, 0.12); }
.resize-handle:hover::after,
.resize-handle.active::after { background: var(--accent); }

/* === 小工具面板 === */
.widget {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.widget:hover { box-shadow: var(--shadow-md); border-color: var(--border-visible); }

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--accent-tint), var(--accent-surface));
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
}
.widget-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent-deep);
  letter-spacing: 0.03em;
}
.widget-collapse {
  font-size: 16px; cursor: pointer; color: var(--text-secondary);
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.widget-collapse:hover { background: rgba(91, 140, 184, 0.12); }
.widget-body { flex: 1; padding: 12px 16px; overflow: auto; }
.widget.collapsed .widget-body { display: none; }

.widget-corner-handle {
  position: absolute;
  right: 0; bottom: 0;
  width: 20px; height: 20px;
  cursor: nwse-resize;
  z-index: 5;
  opacity: 0.25;
  transition: opacity var(--transition-fast);
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
}
.widget-corner-handle:hover { opacity: 0.7; }
.widget-corner-handle-left {
  position: absolute;
  left: 0; bottom: 0;
  width: 20px; height: 20px;
  cursor: nesw-resize;
  z-index: 5;
  opacity: 0.25;
  transition: opacity var(--transition-fast);
  background: linear-gradient(225deg, transparent 50%, var(--accent) 50%);
}
.widget-corner-handle-left:hover { opacity: 0.7; }
.widget.dragging { opacity: 0.85; z-index: 10; box-shadow: var(--shadow-lg); border-color: var(--accent); }

/* === 6. 九宫格 6×6 Grid === */
.grid-container {
  display: grid;
  grid-template-columns: 1fr 4px 1fr 4px 1fr 4px;
  grid-template-rows: 1fr 5px 1fr 5px 1fr 5px;
  gap: 0;
  min-height: 540px;
}
.grid-row-handle {
  cursor: row-resize;
  background: transparent;
  transition: background var(--transition-fast);
  z-index: 1;
  position: relative;
}
.grid-row-handle::after {
  content: '';
  position: absolute;
  left: 20px; right: 20px; top: 50%;
  height: 1px;
  background: var(--border-subtle);
  transform: translateY(-50%);
}
.grid-row-handle:hover,
.grid-row-handle.active { background: rgba(91, 140, 184, 0.10); }
.grid-col-handle {
  cursor: col-resize;
  background: transparent;
  transition: background var(--transition-fast);
  z-index: 1;
  position: relative;
}
.grid-col-handle::after {
  content: '';
  position: absolute;
  top: 20px; bottom: 20px; left: 50%;
  width: 1px;
  background: var(--border-subtle);
  transform: translateX(-50%);
}
.grid-col-handle:hover,
.grid-col-handle.active { background: rgba(91, 140, 184, 0.10); }

/* 格子单元格 */
.grid-cell {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.grid-cell:hover { box-shadow: var(--shadow-md); border-color: var(--accent-surface); }
.grid-cell:focus-within {
  box-shadow: var(--shadow-md), var(--shadow-ring);
  border-color: var(--accent);
}

.grid-cell-header {
  font-family: var(--font-heading);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.grid-cell-count {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--text-tertiary);
}
.grid-cell-body { flex: 1; overflow-y: auto; min-height: 60px; }

.cell-empty-hint {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  text-align: center;
  padding: 16px 0;
  font-style: italic;
}

.grid-cell-add { margin-top: 8px; display: flex; gap: 4px; }
.grid-cell-add input {
  flex: 1;
  border: 1px dashed var(--border-visible);
  outline: none;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: transparent;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.grid-cell-add input:focus {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(91, 140, 184, 0.03);
}

/* 「我」特殊格 */
.grid-cell.me-cell {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--accent-tint) 100%);
  border: 1px dashed var(--accent);
  justify-content: center;
}
.me-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  min-height: 100px;
  cursor: pointer;
  overflow: hidden;
}
.me-content img {
  flex: 1;
  width: 100%;
  min-height: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.me-motto {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: var(--font-size-md);
  color: var(--text-primary);
  font-style: italic;
  line-height: 1.6;
}
.me-edit-hint {
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

/* === 任务行 === */
.task-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background var(--transition-fast);
}
.task-row:hover { background: rgba(91, 140, 184, 0.05); }

.task-status {
  width: 20px; height: 20px;
  border-radius: var(--radius-round);
  border: 2px solid var(--border-visible);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
  color: transparent;
  transition: all var(--transition-base);
}
.task-status.completed {
  border-color: var(--semantic-green);
  background: var(--semantic-green);
  color: #fff;
  animation: checkPop 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.task-status.closed {
  border-color: var(--semantic-gray);
  background: var(--semantic-gray);
  color: #fff;
}

.task-title {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  padding: 2px 4px;
  min-width: 0;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.task-title:focus { border-bottom: 1px solid var(--accent); }

.task-progress {
  width: 50px; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: var(--semantic-gray-light);
  border-radius: 2px;
  outline: none; cursor: pointer; flex-shrink: 0;
}
.task-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: var(--radius-round);
  background: var(--accent-deep);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(30, 45, 61, 0.15);
}

.task-progress-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.task-delete {
  font-size: 12px;
  color: var(--text-tertiary);
  cursor: pointer; flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}
.task-row:hover .task-delete { opacity: 1; }
.task-delete:hover { color: var(--semantic-red); }

/* 已完成/已关闭 */
.task-row.task-done .task-title { color: var(--text-tertiary); text-decoration: line-through; }

/* === 7. 统计面板 === */
.stats-content { padding: 4px 0; }
.stats-overview { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.stats-ring-container { flex-shrink: 0; }
.stats-detail { display: flex; flex-direction: column; gap: 4px; }
.stats-item { font-size: var(--font-size-sm); display: flex; align-items: center; gap: 6px; }
.stats-dot { width: 10px; height: 10px; border-radius: var(--radius-round); flex-shrink: 0; }
.stats-bar-wrap { margin-top: 6px; }
.stats-bar {
  height: 8px;
  background: var(--semantic-gray-light);
  border-radius: 4px;
  display: flex;
  overflow: hidden;
}
.stats-bar-done { background: var(--semantic-green); height: 100%; transition: width var(--transition-slow); }
.stats-bar-active { background: var(--accent); height: 100%; transition: width var(--transition-slow); }
.stats-bar-label { font-size: var(--font-size-xs); color: var(--text-tertiary); text-align: right; margin-top: 2px; }

/* === 时钟面板 === */
.clock-body {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 4px;
}
.clock-task-list { flex: 1; min-width: 120px; max-height: 240px; overflow-y: auto; font-size: var(--font-size-sm); }
.clock-task-item { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.clock-task-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-round);
  flex-shrink: 0;
}
.clock-task-time {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-deep);
  min-width: 38px;
  font-size: var(--font-size-xs);
}
.clock-legend { font-size: 10px; color: var(--text-tertiary); text-align: center; padding: 16px 0; }

/* === 四象限：Eisenhower Matrix === */
.quadrant-compact {
  display: grid;
  grid-template-columns: 1fr 4px 1fr;
  grid-template-rows: 1fr 5px 1fr 5px;
  gap: 0;
  min-height: 260px;
  background: var(--border-visible);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.q-cell { padding: 8px 10px; display: flex; flex-direction: column; overflow: hidden; transition: background var(--transition-fast); }
.q-cell.q1 { background: #FCE8E8; }
.q-cell.q2 { background: #E2ECF4; }
.q-cell.q3 { background: #FDF0E5; }
.q-cell.q4 { background: #E6F0E5; }

.q-label {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  text-align: center;
}
.q-list { flex: 1; overflow-y: auto; font-size: var(--font-size-xs); }
.q-item {
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  cursor: grab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--transition-fast);
}
.q-item:hover { background: rgba(30, 45, 61, 0.05); }
.q-item:active { cursor: grabbing; }
.q-add { margin-top: 4px; }
.q-add input {
  width: 100%;
  border: 1px dashed var(--border-visible);
  outline: none;
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  font-size: var(--font-size-xs);
  background: transparent;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.q-add input:focus { border-color: var(--accent); border-style: solid; background: rgba(91,140,184,0.03); }

.q-cell.drag-over {
  outline: 2px dashed var(--accent-deep);
  outline-offset: -2px;
  background: var(--accent-tint) !important;
}

.q-item[draggable="true"] { cursor: grab; }
.q-item[draggable="true"]:active { cursor: grabbing; }

.quadrant-row-resize {
  cursor: row-resize;
  background: var(--border-visible);
  transition: background var(--transition-fast);
}
.quadrant-row-resize:hover,
.quadrant-row-resize.active { background: var(--accent); }

@media (max-width: 768px) {
  .quadrant-compact {
    grid-template-columns: 1fr;
    grid-template-rows: auto 4px auto 4px auto 4px auto 4px;
    min-height: auto;
  }
}

/* === 8. 日历 === */
#calendarContainer {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: linear-gradient(180deg, var(--accent-tint), var(--accent-surface));
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
}
.calendar-header span {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.calendar-header span:first-child,
.calendar-header span:last-child { color: var(--semantic-red); }

.calendar-cell {
  min-height: 84px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}
.calendar-cell:hover { background: var(--accent-tint); border-color: var(--accent-surface); }
.calendar-cell.today {
  background: linear-gradient(180deg, rgba(91,140,184,0.06), rgba(91,140,184,0.02));
  border: 2px solid var(--accent);
}
.calendar-cell.other-month { opacity: 0.25; }
.calendar-cell .cell-date {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.calendar-cell.today .cell-date {
  color: var(--text-inverse);
  background: var(--accent);
  width: 26px; height: 26px;
  border-radius: var(--radius-round);
  display: flex; align-items: center; justify-content: center;
  animation: todayPulse 2s ease-in-out infinite;
}
.calendar-cell .cell-summary {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
}

.cell-lunar { font-size: 10px; color: var(--text-tertiary); line-height: 1.2; min-height: 13px; }
.cell-holiday { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 1px; }
.holiday-tag {
  font-size: 9px;
  background: var(--semantic-red-light);
  color: var(--semantic-red);
  padding: 1px 4px;
  border-radius: 2px;
  white-space: nowrap;
  line-height: 1.3;
}

.cell-badge {
  display: inline-block;
  font-size: 9px;
  width: 16px; height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: var(--radius-round);
  margin-left: 2px;
  font-weight: 700;
  vertical-align: middle;
}
.badge-rest { background: var(--semantic-red); color: #fff; }
.badge-work { background: var(--accent-deep); color: #fff; }
.badge-tag {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
  vertical-align: middle;
}
.badge-tag.badge-rest { background: var(--semantic-red-light); color: var(--semantic-red); }
.badge-tag.badge-work { background: var(--accent-tint); color: var(--accent-deep); }

.calendar-switch { display: flex; gap: 8px; margin-top: 16px; justify-content: center; }

/* === 9. 悬停便签 === */
.tooltip {
  position: fixed;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 16px 20px;
  min-width: 260px;
  max-width: 360px;
  z-index: 200;
  pointer-events: auto;
}
.tooltip.hidden { display: none; }
.tooltip h4 { font-family: var(--font-heading); font-size: var(--font-size-base); margin-bottom: 8px; color: var(--text-primary); }
.tooltip-filter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tooltip-filter .filter-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-visible);
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition-fast);
}
.tooltip-filter .filter-tag.on { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
.tooltip-task { font-size: var(--font-size-sm); padding: 3px 0; display: flex; align-items: center; gap: 6px; }
.tooltip-task .dot { width: 8px; height: 8px; border-radius: var(--radius-round); flex-shrink: 0; }
.tooltip-task .dot.active { background: var(--accent); }
.tooltip-task .dot.completed { background: var(--semantic-green); }
.tooltip-task .dot.closed { background: var(--semantic-gray); }

/* === 10. 团队任务 === */
.team-summary-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin-bottom: 14px;
}
.team-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: var(--font-size-sm); }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-sep { color: var(--border-visible); }

.team-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--radius-round);
  border: 2px solid var(--border-visible);
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-base);
}
.team-circle.done { border-color: var(--semantic-green); background: var(--semantic-green); color: #fff; }
.team-circle.closed-icon { border-color: var(--semantic-gray); background: var(--semantic-gray); color: #fff; }
.team-circle.dot-red { border-color: var(--semantic-red); background: var(--semantic-red-light); }
.team-circle.dot-yellow { border-color: var(--semantic-orange); background: var(--semantic-orange-light); }
.team-circle.dot-green { border-color: var(--semantic-green); background: var(--semantic-green-light); }
.team-circle.active-blank { border-color: var(--semantic-green); }

.team-priority-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: var(--radius-round);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.team-priority-dot:hover { transform: scale(1.2); }
.team-priority-dot.dot-red { background: var(--semantic-red); }
.team-priority-dot.dot-yellow { background: var(--semantic-orange); }
.team-priority-dot.dot-green { background: var(--semantic-green); }

.team-priority-badge {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: var(--radius-round);
  margin-left: 2px;
  cursor: pointer;
}
.team-priority-badge.badge-red { background: var(--semantic-red); }
.team-priority-badge.badge-yellow { background: var(--semantic-orange); }
.team-priority-badge.badge-green { background: var(--semantic-green); }

.team-filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filter-input {
  padding: 6px 12px;
  border: 1px solid var(--border-visible);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  min-width: 160px;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.filter-input:focus { border-color: var(--accent); box-shadow: var(--shadow-ring); outline: none; }
.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border-visible);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  background: var(--bg-surface);
  cursor: pointer;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.filter-select:focus { border-color: var(--accent); outline: none; }

.team-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}
.team-table th {
  background: var(--accent-tint);
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-surface);
}
.team-table td {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-primary);
}
.team-table td input,
.team-table td select {
  width: 100%;
  border: 1px solid transparent;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.team-table td input:focus,
.team-table td select:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--bg-surface);
  box-shadow: var(--shadow-ring);
}
/* 责任人输入框 */
.person-input {
  width: 100%;
  border: 1px solid transparent;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.person-input:focus { border-color: var(--accent); outline: none; background: var(--bg-surface); }
/* 组合框容器 */
.combo-wrap { position: relative; }
.combo-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 180px;
  overflow-y: auto;
  z-index: 50;
  min-width: 120px;
}
.combo-item {
  padding: 5px 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
  white-space: nowrap;
}
.combo-item:hover, .combo-item:focus { background: var(--accent-tint); outline: none; }
.combo-no-match { pointer-events: none; }
/* 勾选式下拉 */
.combo-check-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.combo-check-item:hover { background: var(--accent-tint); }
.combo-check-item input[type="checkbox"] { margin: 0; cursor: pointer; }
/* Chip 标签 */
.mention-chip {
  display: inline-flex; align-items: center;
  background: var(--accent-tint); color: var(--accent-deep);
  padding: 2px 6px; border-radius: 12px; font-size: 11px;
  font-weight: 500; white-space: nowrap;
}
.mention-chip-x:hover { color: var(--semantic-red) !important; }
/* 勾选项高亮 */
.mention-sel-item.selected {
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 500;
}
/* 日状态标签 */
.day-status-badge {
  display: block;
  font-size: 11px;
  padding: 2px 0;
  margin-bottom: 2px;
}
.day-status-badge.done { color: var(--semantic-green); }
.day-status-badge.closed { color: var(--semantic-gray); }
.team-table .add-row td { background: var(--accent-tint); }
.team-table .add-row input,
.team-table .add-row select { background: var(--bg-surface); border: 1px dashed var(--border-visible); }

.team-status {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.team-status.active { background: var(--accent-tint); color: var(--accent-deep); }
.team-status.completed { background: var(--semantic-green-light); color: var(--semantic-green); }
.team-status.closed { background: var(--semantic-gray-light); color: var(--text-secondary); }

.team-daily-table .date-col { text-align: center; font-size: var(--font-size-xs); white-space: nowrap; }
.team-daily-table .date-col.col-today { background: var(--accent-tint); color: var(--accent-deep); font-weight: 700; }
.team-daily-table .date-col.col-yesterday { background: var(--semantic-gray-light); color: var(--text-secondary); }
.date-input-cell { padding: 2px 4px; }
.date-input-cell input:focus { outline: none; }
.team-table-wrap { overflow-x: auto; }
#toggleHistoryBtn:hover { text-decoration: underline; }
.date-input-cell textarea { display: block; font-family: inherit; outline: none; }

/* 责任人弹窗 */
.person-dialog {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-overlay);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.person-dialog.hidden { display: none; }
.person-dialog-content {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  width: 360px;
}
.person-dialog-content h4 { font-family: var(--font-heading); margin-bottom: 8px; color: var(--accent-deep); }
/* 右侧面板模式 */
.person-dialog.person-dialog-right {
  justify-content: flex-end;
  align-items: flex-start;
}
.person-dialog.person-dialog-right .person-dialog-content {
  margin: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  max-height: 100vh;
  overflow-y: auto;
  animation: slideInRight 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.person-dialog-content textarea {
  width: 100%;
  border: 1px solid var(--border-visible);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  resize: vertical;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.person-dialog-content textarea:focus { border-color: var(--accent); outline: none; box-shadow: var(--shadow-ring); }

/* === 11. 班组例会 === */
.meeting-col-toggles {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 8px; font-size: var(--font-size-xs); color: var(--text-secondary);
  padding: 6px 0; background: var(--bg-page); position: sticky; top: 0; z-index: 6;
}
.toggle-label { cursor: pointer; display: flex; align-items: center; gap: 2px; }
.toggle-label input { cursor: pointer; }
.meeting-table-wrap {
  overflow: auto; max-width: 100%; max-height: calc(100vh - 210px);
}
.hist-date-col { min-width: 240px; }

.meeting-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  table-layout: auto;
}
.meeting-table th {
  background: var(--accent-tint);
  padding: 8px 12px;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--font-size-xs);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 4;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--accent-surface);
}
.meeting-table td {
  padding: 6px 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
  vertical-align: middle;
  text-align: center;
  color: var(--text-primary);
}
.th-num { width: 40px; text-align: center !important; position: sticky; left: 0; z-index: 3; }
.th-team { width: 120px; text-align: center !important; position: sticky; left: 40px; z-index: 3; }
.th-date { min-width: 220px; text-align: center !important; }
.th-hist { width: 45px; text-align: center; }
.th-info { min-width: 80px; text-align: center !important; }
.td-team { font-weight: 600; font-size: var(--font-size-sm); white-space: nowrap; text-align: center; vertical-align: middle; position: sticky; left: 40px; z-index: 1; background: var(--bg-surface); }
.td-info { font-size: var(--font-size-xs); color: var(--text-secondary); white-space: nowrap; text-align: center; vertical-align: middle; }

.resizable-col { position: relative; }
.col-resize-handle {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 5px;
  cursor: col-resize;
  background: transparent;
  transition: background var(--transition-fast);
}
.col-resize-handle:hover { background: var(--accent); }

.meeting-cell { min-width: 200px; min-height: 80px; }
.meeting-cell.meeting-yesterday { background: rgba(30, 45, 61, 0.02); }
.meeting-cell.meeting-yesterday .meeting-fields { border: 1px dashed var(--border-subtle); border-radius: var(--radius-sm); padding: 6px; }
.meeting-cell.meeting-yesterday .mf-row textarea,
.meeting-cell.meeting-yesterday .mf-row input {
  border: 1px dashed var(--border-subtle) !important;
  background: var(--bg-surface-alt) !important;
}
.meeting-cell.meeting-yesterday .mf-row input[readonly],
.meeting-cell.meeting-yesterday .mf-row textarea[readonly] { color: var(--text-tertiary); }
.meeting-cell.meeting-today { background: rgba(91, 140, 184, 0.03); }
.meeting-cell.meeting-today .meeting-fields { border: 1px solid var(--accent-surface); border-radius: var(--radius-sm); padding: 6px; }
.meeting-drag-handle {
  cursor: grab;
  font-weight: 700;
  color: var(--text-tertiary);
  user-select: none;
  text-align: center;
  vertical-align: middle !important;
  position: sticky; left: 0; z-index: 1;
  background: var(--bg-surface);
}
.meeting-drag-handle:hover { color: var(--accent-deep); }
.meeting-fields { display: flex; flex-direction: column; gap: 4px; }
.mf-row { display: flex; align-items: flex-start; gap: 4px; font-size: var(--font-size-xs); }
.mf-row label { font-family: var(--font-heading); font-weight: 600; color: var(--accent-deep); min-width: 55px; text-align: right; padding-top: 3px; flex-shrink: 0; }
.mf-row input[type="text"],
.mf-row input:not([type]) { padding: 3px 6px; border: 1px solid var(--border-visible); border-radius: 2px; font-size: var(--font-size-xs); background: var(--bg-surface); color: var(--text-primary); }
.mf-row input[type="text"]:focus { border-color: var(--accent); outline: none; box-shadow: var(--shadow-ring); }
.mf-row textarea {
  flex: 1; padding: 3px 6px; border: 1px solid var(--border-visible); border-radius: 2px;
  font-size: var(--font-size-xs); resize: vertical; font-family: inherit; min-height: 28px;
  background: var(--bg-surface); color: var(--text-primary);
}
.mf-row textarea:focus { border-color: var(--accent); outline: none; box-shadow: var(--shadow-ring); }

.mention-dropdown {
  position: fixed;
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  min-width: 160px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.mention-item {
  padding: 6px 14px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: background var(--transition-fast);
}
.mention-item:last-child { border-bottom: none; }
.mention-item:hover { background: var(--accent-tint); }

/* 班组设置表格 */
.settings-table-wrap { overflow-x: auto; max-width: 100%; }
.settings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.settings-table th {
  background: var(--accent-tint);
  padding: 8px 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  white-space: nowrap;
  text-align: center;
  border-bottom: 2px solid var(--accent-surface);
  position: sticky;
  top: 0;
  z-index: 2;
}
.settings-table td {
  padding: 4px 4px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
  text-align: center;
}
.settings-table td input {
  width: 100%;
  border: 1px solid transparent;
  padding: 5px 4px;
  border-radius: var(--radius-xs);
  background: transparent;
  font-size: var(--font-size-xs);
  text-align: center;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.settings-table td input:focus {
  border-color: var(--accent);
  background: var(--bg-surface);
  outline: none;
  box-shadow: var(--shadow-ring);
}
.settings-table td input::placeholder { color: var(--text-tertiary); font-style: italic; font-size: 10px; }
.settings-num {
  width: 36px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-align: center !important;
}
.settings-row-new td {
  border-top: 1px dashed var(--accent);
  background: var(--accent-tint);
}
.settings-row-new td input { background: var(--bg-surface); border: 1px dashed var(--border-visible); }
.settings-del-btn:hover { background: var(--semantic-red-light) !important; border-color: var(--semantic-red) !important; }

/* === 12. 归档 === */
.archive-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}
.archive-table th {
  background: var(--accent-tint);
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-surface);
}
.archive-table td { padding: 8px 12px; border-top: 1px solid var(--border-subtle); font-size: 13px; color: var(--text-primary); }
.archive-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.archive-badge.completed { background: var(--semantic-green-light); color: var(--semantic-green); }
.archive-badge.closed { background: var(--semantic-gray-light); color: var(--text-secondary); }
.archive-summary { display: flex; gap: 24px; margin-bottom: 16px; }
.archive-stat {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  padding: 16px 24px;
  text-align: center;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.archive-stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.archive-stat .stat-num {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: -0.02em;
}
.archive-stat .stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#archiveMonthFilter {
  padding: 5px 12px;
  border: 1px solid var(--border-visible);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
#archiveMonthFilter:focus { border-color: var(--accent); outline: none; }

/* 侧边面板内可调整高度 */
.side-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  overflow: hidden;
}
.panel-resize-handle {
  height: 5px;
  cursor: row-resize;
  background: transparent;
  transition: background var(--transition-base);
  flex-shrink: 0;
}
.panel-resize-handle:hover,
.panel-resize-handle.active { background: var(--accent); }

/* === 13. 动画 === */
.view.active {
  animation: viewEnter 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes checkPop {
  0%   { transform: scale(0.7); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes todayPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 140, 184, 0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(91, 140, 184, 0); }
}

/* === 14. 滚动条 === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-visible); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
::-webkit-scrollbar-corner { background: transparent; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-visible) transparent;
}

/* === 15. 响应式 === */
@media (max-width: 1024px) {
  .daily-sidebar { width: 280px; min-width: 240px; }
  #mainContent { padding: 20px; }
}
/* === 人力曲线面板 === */
.manpower-panel {
  background: var(--bg-page);
  max-height: 100vh;
  overflow-y: auto;
  padding: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.manpower-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; background: var(--bg-surface); z-index: 10;
  border-radius: var(--radius-md) 0 0 0;
}
.manpower-header h3 { margin: 0; font-size: var(--font-size-lg); color: var(--text-primary); }
.mp-close-btn { font-size: 18px; width: 32px; height: 32px; }

.mp-filter-bar {
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 6px;
}
.mp-filter-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.mp-filter-label {
  font-size: var(--font-size-sm); color: var(--text-secondary);
  min-width: 42px; font-weight: 600;
}
.mp-check-label, .mp-radio-label {
  font-size: var(--font-size-xs); cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--text-secondary); user-select: none;
}
.mp-check-label input, .mp-radio-label input { margin: 0; cursor: pointer; }
.mp-check-all { font-weight: 600; color: var(--text-primary); }
.mp-date-input {
  font-size: var(--font-size-sm); padding: 2px 6px;
  border: 1px solid var(--border-visible); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary);
}

/* 图表 */
.mp-chart-wrap {
  flex-shrink: 0; padding: var(--space-sm) var(--space-lg);
  background: var(--bg-surface);
}
.mp-chart-svg {
  width: 100%; height: auto; display: block;
}
.mp-grid-line {
  stroke: var(--border-subtle); stroke-width: 1;
}
.mp-y-label {
  font-size: 11px; fill: var(--text-tertiary); text-anchor: end;
}
.mp-x-label {
  font-size: 10px; fill: var(--text-secondary); text-anchor: middle;
}
.mp-line {
  fill: none; stroke-width: 2.5;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-point { transition: cy 0.3s ease-out, cx 0.3s ease-out; }
.mp-line-label { font-size: 11px; font-weight: 600; }

/* 数据表格 */
.mp-table-wrap {
  flex: 1; overflow: auto; padding: 0 var(--space-lg) var(--space-sm);
  max-height: 360px;
}
.mp-data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: var(--font-size-sm); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow-xs);
}
.mp-data-table thead th {
  background: var(--accent-tint); padding: 6px 4px;
  border-bottom: 2px solid var(--accent-surface);
  position: sticky; top: 0; z-index: 2;
}
.mp-th-team { min-width: 70px; text-align: left; padding-left: 8px !important; }
.mp-th-date { min-width: 68px; text-align: center; }
.mp-th-date > div { display: flex; align-items: center; justify-content: center; gap: 2px; }
.mp-th-check { display: flex; align-items: center; }
.mp-th-check input { margin: 0; width: 13px; height: 13px; cursor: pointer; }

.mp-data-table tbody td {
  padding: 2px 4px; border-top: 1px solid var(--border-subtle);
  text-align: center; background: var(--bg-surface);
}
.mp-td-team {
  text-align: left !important; padding-left: 6px !important;
  font-weight: 600; color: var(--text-primary);
  position: sticky; left: 0; z-index: 1;
  background: var(--bg-surface) !important;
  display: flex; align-items: center; gap: 4px;
}
.mp-row-check { display: flex; align-items: center; }
.mp-row-check input { margin: 0; width: 13px; height: 13px; cursor: pointer; }

.mp-cell-input {
  width: 56px; text-align: center; font-size: var(--font-size-sm);
  padding: 4px 2px; border: 1px solid transparent; border-radius: var(--radius-xs);
  background: transparent; color: var(--text-primary);
  transition: border-color var(--transition-fast);
  -moz-appearance: textfield;
}
.mp-cell-input::-webkit-inner-spin-button,
.mp-cell-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.mp-cell-input:hover { border-color: var(--border-visible); }
.mp-cell-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--shadow-ring); background: var(--bg-surface);
}

/* 日期列交替颜色 */
.mp-th-date.col-0 { background: var(--accent-tint); }
.mp-th-date.col-1 { background: var(--accent-surface); }
.mp-data-table tbody td.col-0 { background: var(--bg-surface); }
.mp-data-table tbody td.col-1 { background: var(--bg-surface-alt); }

/* 下拉多选班组按钮 */
.mp-dd-wrap { position: relative; }
.mp-dd-btn {
  display: inline-block; min-width: 120px; max-width: 360px;
  padding: 6px 28px 6px 10px; font-size: var(--font-size-xs);
  border: 1px solid var(--border-visible); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary);
  cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: inherit; position: relative;
}
.mp-dd-btn::after { content: "▾"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 10px; }
.mp-dd-btn:hover { border-color: var(--accent); }
.mp-dd-panel {
  position: absolute; top: 100%; left: 0; z-index: 99;
  background: var(--bg-surface); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  min-width: 220px; max-height: 260px; display: flex; flex-direction: column;
}
.mp-dd-list {
  flex: 1; overflow-y: auto; padding: 4px 0;
  max-height: 200px;
  scrollbar-width: thin;
}
.mp-dd-item {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px;
  font-size: var(--font-size-xs); color: var(--text-primary); cursor: pointer; user-select: none;
}
.mp-dd-item:hover { background: var(--accent-tint); }
.mp-dd-item input { margin: 0; cursor: pointer; }
.mp-dd-actions {
  display: flex; gap: 4px; padding: 6px 8px;
  border-top: 1px solid var(--border-subtle);
  justify-content: flex-end;
}

/* 表格：灰色不可编辑行 */
.mp-row-gray .mp-td-team { color: var(--text-tertiary) !important; }
.mp-input-gray {
  color: var(--text-tertiary) !important;
  background: var(--bg-surface-alt) !important;
  cursor: default; user-select: none;
}
.mp-divider td {
  text-align: center; font-size: var(--font-size-xs); color: var(--text-tertiary);
  padding: 8px 0 !important; background: var(--bg-page) !important;
  border-top: 2px solid var(--border-visible);
}

/* 底部栏 */
.mp-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-surface); border-top: 1px solid var(--border-subtle);
  position: sticky; bottom: 0;
}
.mp-sync-hint { font-size: var(--font-size-xs); color: var(--text-tertiary); }
.mp-empty {
  text-align: center; padding: 40px; color: var(--text-tertiary); font-size: var(--font-size-sm);
}

/* 在线填写 QR 弹窗 */
.qr-dialog-content {
  background: var(--bg-surface); border-radius: var(--radius-md);
  padding: var(--space-xl); text-align: center;
  box-shadow: var(--shadow-lg); max-width: 360px; width: 90%;
}
.qr-dialog-content.qr-dual-content { max-width: 600px; }
.qr-dialog-content h3 {
  margin: 0 0 var(--space-md); font-size: var(--font-size-lg); color: var(--text-primary);
}
.qr-dialog-content canvas { border-radius: var(--radius-sm); display: block; margin: 0 auto; }
.qr-dialog-content .qr-hint {
  margin-top: var(--space-md); font-size: var(--font-size-sm); color: var(--text-secondary);
}
.qr-dialog-content .qr-close-btn {
  margin-top: var(--space-md);
}
.qr-url-box {
  display: flex; gap: 6px; align-items: center; margin-top: var(--space-sm);
  background: var(--bg-page); border-radius: var(--radius-sm); padding: 4px;
}
.qr-url-input {
  flex: 1; border: none; background: transparent; font-size: var(--font-size-xs);
  color: var(--text-secondary); padding: 6px 8px; font-family: var(--font-mono);
  outline: none; cursor: text; min-width: 0;
}

/* 双 QR 列 */
.qr-dual-cols {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
}
.qr-col { text-align: center; }
.qr-col h4 {
  margin: 0 0 8px; font-size: var(--font-size-sm); color: var(--accent-deep);
}

/* 签到绿灯 */
.checkin-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--semantic-green); margin-left: 4px; vertical-align: middle;
  box-shadow: 0 0 4px var(--semantic-green);
}

/* === 导出面板 === */
.export-panel {
  background: var(--bg-page); max-width: 520px; width: 94%; max-height: 90vh;
  overflow-y: auto; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.export-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface); border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.export-panel-header h3 { margin: 0; font-size: var(--font-size-lg); color: var(--text-primary); }
.export-section {
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.export-section h4 {
  margin: 0 0 6px; font-size: var(--font-size-sm); color: var(--text-primary);
}
.export-section-hint { font-weight: 400; font-size: var(--font-size-xs); color: var(--text-tertiary); }
.export-check-group {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
}
.export-check {
  font-size: var(--font-size-sm); color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none;
}
.export-check input { margin: 0; cursor: pointer; }
.export-toggle {
  cursor: pointer; user-select: none; color: var(--accent-deep);
  font-size: var(--font-size-sm); margin: 0;
}
.export-toggle:hover { opacity: 0.8; }
.export-settings-body { margin-top: 8px; }
.export-field {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.export-field label {
  font-size: var(--font-size-xs); color: var(--text-secondary);
  min-width: 64px; text-align: right; flex-shrink: 0;
}
.export-field input {
  flex: 1; padding: 6px 10px; font-size: var(--font-size-sm);
  border: 1px solid var(--border-visible); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary); font-family: inherit;
}
.export-field input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-ring); }
.export-panel-footer {
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-surface); border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-align: right;
}

/* 导入弹窗 */
.import-dialog {
  background: var(--bg-surface); border-radius: var(--radius-md);
  padding: var(--space-lg); max-width: 560px; width: 90%;
  box-shadow: var(--shadow-lg);
}
.import-dialog h4 { margin: 0 0 var(--space-sm); font-size: var(--font-size-lg); color: var(--text-primary); }
.import-hint { font-size: var(--font-size-xs); color: var(--text-tertiary); margin-bottom: var(--space-sm); line-height: 1.5; }
.import-textarea {
  width: 100%; padding: 10px; font-size: var(--font-size-sm); font-family: var(--font-mono);
  border: 1px solid var(--border-visible); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary); resize: vertical;
}
.import-textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-ring); }
.import-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: var(--space-sm); }

/* 汇报人信息（会议状态格顶部） */
.meeting-reporter {
  font-size: 11px; color: var(--text-tertiary);
  padding: 2px 0 4px; border-bottom: 1px dashed var(--border-subtle);
  margin-bottom: 4px; user-select: text;
}

@media (max-width: 900px) {
  .daily-layout { flex-direction: column; }
  .daily-sidebar { width: 100%; min-width: unset; }
  .daily-main { min-width: unset; }
  .resize-handle { display: none; }
  .grid-container { min-height: 400px; }
  #sidebar { width: 60px; }
  #sidebar .nav-brand h1 { font-size: 14px; }
  #sidebar .nav-item { padding: 12px 8px; justify-content: center; font-size: 0; gap: 0; }
  #sidebar .nav-icon { font-size: 20px; }
  #mainContent { margin-left: 60px; }
  :root { --sidebar-width: 60px; }
}
