:root {
  --bg: #0b0f17;
  --card: #121826;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --success: #10b981;
  --border: #1f2937;
  --header-height: 60px;
  --footer-height: 40px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  background: var(--bg);
  color: var(--text);
  /* V2.2 整体页面布局：头部+主内容+页脚 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

/* V2.2 主内容容器 - 适中的宽度 */
.main.container {
  max-width: 1400px; /* 设置合适的最大宽度，不会过于宽 */
  width: 100%; 
  padding: 20px 2rem; /* 合适的左右边距 */
}

.app-header {
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
  z-index: 10;
  /* 预留空间，避免在头部动态注入前产生布局跳动 */
  min-height: var(--header-height);
}

/* V2.2 头部内容对齐 - 与主内容保持一致 */
.header-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 14px 0;
  max-width: 1400px; /* 与主内容保持一致 */
  margin: 0 auto; /* 居中对齐 */
  padding-left: 2rem; /* 与主内容左边距一致 */
  padding-right: 2rem; /* 与主内容右边距一致 */
  min-height: var(--header-height);
}
.app-title { margin: 0; font-size: 20px; letter-spacing: 0.5px; }
.nav { display: flex; gap: 12px; align-items: center; }
.nav-link { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; display: inline-flex; align-items: center; line-height: 1; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-link.active { color: var(--text); background: rgba(59,130,246,0.18); }

.user-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info {
  color: var(--text);
  font-size: 14px;
}

/* V2.2 主内容区域 - 填充剩余空间 */
.main { 
  flex: 1; /* 填充头部和页脚之间的所有空间 */
  display: flex;
  flex-direction: column;
}

/* —— 单页面应用样式 —— */
.page-content { 
  display: none !important; 
  opacity: 0;
  visibility: hidden;
  flex: 1;
  min-height: calc(100vh - var(--header-height) - var(--footer-height) - 80px);
  flex-direction: column;
}
.page-content.active { 
  display: flex !important; 
  opacity: 1;
  visibility: visible;
}

/* 页面内容容器 - 确保全宽度 */
.page-content > .container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 2rem;
}

/* 页面头部固定高度 */
.page-header { 
  margin-bottom: 1.5rem; 
  flex-shrink: 0;
}

/* 页面主体内容区域 */
.page-content > .container > *:not(.page-header) {
  flex: 1;
  min-height: 0;
}

.page-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.banner-left { display: flex; flex-direction: column; gap: 6px; }
.banner-title { font-size: 18px; font-weight: 600; color: var(--text); }
.banner-subtitle { font-size: 14px; color: var(--muted); }
.banner-right { display: flex; align-items: center; gap: 1rem; }
.date-picker { display: flex; flex-direction: column; gap: 4px; }
.date-picker label { font-size: 12px; color: var(--muted); }

/* 响应式调整 */
@media (max-width: 768px) {
  .page-banner { flex-direction: column; align-items: stretch; }
  .banner-right { justify-content: space-between; }
}

.section-title { margin: 0 0 12px 0; font-size: 18px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

/* V2.2 表单行样式 - 三块内容平分 */
.form-row { 
  display: flex; 
  flex-direction: column; 
  flex: 1;
  justify-content: center;
  gap: 6px; 
  margin-bottom: 0; /* 移除margin，交给flex布局控制 */
}

/* 三个问题区域 */
.form-row:nth-child(2),
.form-row:nth-child(3),
.form-row:nth-child(4) {
  flex: 2; /* 三个问题平分主要空间 */
}
label { color: var(--muted); font-size: 14px; }
input[type="date"], textarea {
  width: 100%;
  background: #0e1625;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

/* V2.2 textarea样式 - 自动拉伸高度 */
.form-row textarea {
  flex: 1;
  min-height: 120px; /* 保证最小可用高度 */
  resize: none; /* 禁用手动调整，交给布局控制 */
}

/* 认证页面输入框样式 */
.auth-card input[type="text"],
.auth-card input[type="password"] {
  width: 100%;
  background: #0e1625;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 12px;
  outline: none;
  font-size: 16px;
  min-height: 48px;
}
/* V2.2 默认textarea样式已在下方重新定义 */

/* V2.2 按钮行样式 - 占据固定空间 */
.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.button-row .btn {
  flex: 0 0 auto;
}
.btn {
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn.primary { background: var(--primary); border-color: transparent; }
.btn.success { background: var(--success); border-color: transparent; }
.btn.outline { background: transparent; }
/* 统一按钮变体与尺寸 */
.btn.danger { background: #ef4444; border-color: transparent; }
.btn-danger { background: #ef4444; border-color: transparent; }
.btn.sm { padding: 6px 10px; border-radius: 6px; }
.btn.lg { padding: 12px 16px; border-radius: 10px; }

.preview-wrap { position: relative; }
.preview {
  width: 100%;
  background: #0e1625;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.preview-wrap .btn { position: absolute; right: 8px; bottom: 8px; }

.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.entry { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #0e1625; }
.entry-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.entry-date { color: var(--muted); font-size: 14px; }
.entry-text { white-space: pre-wrap; line-height: 1.6; }

.empty-state {
  color: var(--muted);
  background: #0e1625;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.test-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

/* 认证页面样式 */
.auth-container {
  max-width: 900px;
  margin: 0 auto;
  padding-top: 2rem;
}

.auth-card {
  width: 100%;
}

.auth-card .button-row {
  justify-content: space-between;
}

/* 登录页 - 功能说明（独立小卡片） */
.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feature-item {
  background: #0e1625;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.feature-item-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(59,130,246,0.18);
  border: 1px solid rgba(59,130,246,0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 14px;
  flex: 0 0 22px;
}

.feature-item-text {
  color: var(--muted);
  line-height: 1.8;
}

/* 登录页功能说明响应式 */
@media (max-width: 900px) {
  .feature-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .feature-list { grid-template-columns: 1fr; }
}

/* V2.2 主页面布局 - 左侧三块内容平分屏幕 */
.main-container {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 2rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.form-section {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.form-section .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0; /* 移除间距，让内容真正平分 */
  padding: 1rem;
}

.history-section {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.history-section .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* V2.2 历史记录列表 - 固定高度，无滚动 */
.history-list {
  flex: 1;
  overflow: hidden; /* 禁用滚动，超出部分直接隐藏 */
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0; /* 重要：允许flex子项收缩到内容以下 */
}

/* 历史记录头部 */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-shrink: 0; /* 头部不允许收缩 */
}

.view-all-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.view-all-link:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* V2.2 历史记录条目 - 前面的完整显示 */
.history-item {
  background: #0e1625;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 0; /* 允许flex子项收缩 */
  flex-shrink: 0; /* 前面的条目不收缩，保证完整显示 */
  /* 移除max-height限制，让前面的卡片完整显示 */
}

/* 最后一条记录可以被部分遮盖 */
.history-item.last-item {
  flex-shrink: 1; /* 允许最后一条被压缩和截断 */
  overflow: hidden; /* 最后一条超出部分隐藏 */
  min-height: 60px; /* 确保最后一条至少显示60px */
}

.history-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.history-item-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.history-item-actions {
  display: flex;
  gap: 0.5rem;
}

.history-item-actions .btn {
  padding: 2px 6px;
  font-size: 12px;
  min-width: auto;
}

/* V2.2 历史记录内容 - 适应容器高度 */
.history-item-content {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden; /* 超出部分隐藏，不显示滚动条 */
  flex: 1; /* 自动填充剩余空间 */
}

/* 移除渐变遮罩，因为整体不再滚动 */

/* 空状态 */
.history-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.history-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.history-empty-text {
  font-size: 14px;
}

/* 动画效果 */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* V2.2 响应式设计 */
@media (max-width: 768px) {
  .main-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    /* 移动端保持flex:1，确保填充剩余空间 */
  }
  
  /* 移动端恢复原有的表单样式 */
  .form-section .card {
    gap: 1rem; /* 恢复间距 */
  }
  
  .form-row { 
    margin-bottom: 12px; /* 恢复margin */
    flex: none; /* 取消flex拉伸 */
  }
  
  .form-row:nth-child(2),
  .form-row:nth-child(3),
  .form-row:nth-child(4) {
    flex: none; /* 取消flex拉伸 */
  }
  
  .form-row textarea {
    flex: none; /* 取消flex拉伸 */
    min-height: 80px; /* 移动端使用较小的高度 */
    resize: vertical; /* 恢复手动调整 */
  }
  
  .button-row {
    flex: none; /* 取消flex拉伸 */
    margin-top: 1rem; /* 恢复margin */
  }
  
  .history-section {
    position: static;
  }
  
  .history-header {
    margin-bottom: 0.75rem;
  }
  
  .history-list {
    gap: 0.5rem;
    overflow: hidden; /* 移动端也禁用滚动 */
  }
  
  .history-item {
    padding: 0.75rem;
  }
}

/* 用户信息显示 */
.user-info {
  color: var(--muted);
  font-size: 14px;
  margin-right: 12px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* 登出按钮 */
.btn-logout {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.btn-logout:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* V2.2 页脚 - 固定在底部，居中对齐 */
.app-footer { 
  border-top: 1px solid var(--border); 
  color: var(--muted); 
  flex-shrink: 0; /* 不允许收缩 */
  background: var(--bg); /* 确保有背景色 */
  text-align: center; /* 页脚内容居中 */
  min-height: var(--footer-height);
}
.app-footer .container { 
  padding: 14px 0; 
  font-size: 14px; 
}

/* —— 今日安排（看板）样式 —— */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.kanban-column {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}

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

.kanban-column-title { font-weight: 600; }
.kanban-column-count { color: var(--muted); font-size: 12px; }

.kanban-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 200px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.kanban-card {
  background: #0e1625;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  cursor: grab;
  user-select: none;
}

.kanban-card .title { 
  font-weight: 600; 
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
  max-width: 100%;
}
.kanban-card .desc { color: var(--muted); font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.kanban-card .meta { margin-top: 8px; color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.kanban-card .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.kanban-card.add-card { cursor: pointer; border-style: dashed; background: transparent; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.kanban-card.add-card:hover { background: rgba(255,255,255,0.05); }
.add-card-inner { padding: 8px 0; }

.kanban-card.more-card { 
  cursor: default; 
  border-style: dashed; 
  background: rgba(255,255,255,0.02); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: var(--muted); 
  min-height: 60px;
}
.more-card-inner { 
  text-align: center; 
  padding: 8px 0; 
}
.more-text { 
  font-size: 14px; 
  font-weight: 500; 
  margin-bottom: 4px; 
}
.more-hint { 
  font-size: 12px; 
  opacity: 0.7; 
}

/* 编辑态 */
.kanban-editor { display: flex; flex-direction: column; gap: 8px; }
.kanban-editor input[type="text"],
.kanban-editor textarea,
.kanban-editor select {
  width: 100%;
  background: #0e1625;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.kanban-editor textarea { min-height: 80px; resize: vertical; }
.kanban-editor .editor-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* 响应式 */
@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: 1fr; }
}

/* —— 长期目标样式 —— */
.goals-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.goals-banner-left { display: flex; flex-direction: column; gap: 6px; }
.banner-title { font-size: 18px; font-weight: 600; }
.banner-subtitle { color: var(--muted); font-size: 14px; }

/* 今日任务看板布局 */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

/* 每日复盘布局 */
.main-container {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 2rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

/* 长期目标网格布局 */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

/* 随想感悟列表布局 */
.reflections-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
}

/* 激励列表布局 */
.incentive-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.incentive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.incentive-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.incentive-item.completed {
  opacity: 0.6;
  background: var(--bg);
  color: var(--muted);
}

.incentive-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.incentive-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.incentive-content {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
}

.incentive-item.completed .incentive-content {
  text-decoration: line-through;
  color: var(--muted);
}

.incentive-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 空状态在目标栅格中占满整行 */
.goals-grid .empty-state {
  grid-column: 1 / -1;
}

.goal-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; height: 220px; position: relative; }
.goal-title { font-weight: 600; margin-bottom: 6px; }
.goal-desc { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.goal-quick-update { display: flex; gap: 8px; margin-top: auto; }
.goal-quick-update input { flex: 1; background: #0e1625; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.goal-latest { color: var(--muted); font-size: 12px; margin-top: 8px; }
.goal-actions { display: flex; gap: 8px; margin-top: 10px; }
/* 使更多菜单固定在卡片右上角 */
.goal-card .more-wrap { position: absolute; top: 8px; right: 8px; }

.progress-bar { height: 8px; background: #0e1625; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.progress-bar-inner { height: 100%; background: var(--primary); width: 0%; transition: width .2s ease; }

/* modal */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 100; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.modal:not(.hidden) .modal-backdrop { background: linear-gradient(180deg, rgba(2,6,23,0.7), rgba(2,6,23,0.4)); }

/* 让内容宽度与主页面一致（容器最大宽度一致），上下各留 50px 间距 */
.modal-fullscreen {
  width: calc(100% - 32px);
  max-width: 1400px; /* 与 .container 一致 */
  height: calc(100vh - 20px);
  margin: 10px auto;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.modal .modal-content { opacity: 0; transform: translateY(8px); transition: all .2s ease; }
.modal:not(.hidden) .modal-content { opacity: 1; transform: translateY(0); }

.modal-content { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 12px; width: min(800px, 90vw); max-height: 80vh; display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 12px 16px; overflow: auto; }

/* —— 全局消息 —— */
#ui-root { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.ui-toast-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; gap: 8px; }
.ui-toast { background: rgba(30,41,59,0.95); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; opacity: 0; transform: translateY(-6px); transition: all .2s ease; pointer-events: auto; }
.ui-toast.show { opacity: 1; transform: translateY(0); }
.ui-toast-success { border-color: rgba(16,185,129,0.5); }
.ui-toast-error { border-color: rgba(239,68,68,0.5); }
.ui-toast-info { border-color: rgba(59,130,246,0.5); }
.modal-goal-info { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.progress-list { display: grid; gap: 10px; }
.progress-item { background: #0e1625; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }

/* 表单控件统一风格（modal内） */
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content input[type="date"],
.modal-content textarea,
.modal-content select {
  width: 100%;
  background: #0e1625;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.modal-content textarea { min-height: 100px; resize: vertical; }

@media (max-width: 1024px) {
  .goals-grid { grid-template-columns: 1fr; }
}

/* —— 激励列表（单行列表） —— */
.incentive-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}
.incentive-content { 
  flex: 1; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  font-size: 14px;
}
.incentive-actions { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}
.incentive-check { 
  width: 24px; 
  height: 24px; 
  accent-color: #3b82f6;
  cursor: pointer;
  border-radius: 4px;
  filter: hue-rotate(0deg) saturate(1.2);
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--card);
  border: 2px solid var(--border);
  position: relative;
  transition: all 0.2s ease;
}

.incentive-check:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.incentive-check:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.incentive-check:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.incentive-item.completed { 
  opacity: 0.6; 
  background: var(--bg);
  color: var(--muted);
}

/* 已完成区域标题 */
.completed-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 16px 0 8px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.completed-section-header:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--primary);
}

.completed-section-header span:first-child {
  font-weight: 600;
  color: var(--muted);
}

.toggle-icon {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}

/* 已完成项目容器 */
.completed-incentives {
  display: block;
}

/* —— 随想感悟样式 —— */
.reflection-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.reflection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.reflection-title {
  font-weight: 600;
  font-size: 16px;
}
.reflection-actions {
  display: flex;
  gap: 8px;
}
.reflection-content {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
  font-size: 14px;
  max-height: 105px; /* 约5行的高度（14px * 1.5 * 5 ≈ 105） */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.reflection-meta {
  color: var(--muted);
  font-size: 12px;
}

/* 内联编辑卡片样式 */
.edit-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

/* 让“新建计划”的编辑卡片与列同宽，并内容铺满 */
.kanban-card.edit-card {
  align-items: stretch;
  justify-content: flex-start;
}
.kanban-card.edit-card .edit-card-content { width: 100%; }

.edit-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-task-title {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 40px;
  resize: vertical;
}

.edit-task-title:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.edit-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.edit-card-actions .btn {
  padding: 8px 16px;
  font-size: 14px;
}

/* 历史复盘全屏列表 */
#page-entries .card { padding: 16px; }
.entries-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.entries-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.entries-item-date { font-weight: 600; }
.entries-item-content { color: var(--text); line-height: 1.6; white-space: pre-wrap; }

/* 全屏弹层 */
.modal-backdrop { background: rgba(0,0,0,0.4); backdrop-filter: blur(2px); }
.modal:not(.hidden) .modal-backdrop { background: linear-gradient(180deg, rgba(2,6,23,0.7), rgba(2,6,23,0.4)); }

/* 让内容宽度与主页面一致（容器最大宽度一致），上下各留 50px 间距 */
.modal-fullscreen {
  width: calc(100% - 32px);
  max-width: 1400px; /* 与 .container 一致 */
  height: calc(100vh - 100px);
  margin: 50px auto;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.modal .modal-content { opacity: 0; transform: translateY(8px); transition: all .2s ease; }
.modal:not(.hidden) .modal-content { opacity: 1; transform: translateY(0); }

.entries-modal-body { flex: 1; overflow: auto; }
#entriesModalList { padding: 12px 16px; }
.entries-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.entries-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.entries-item-date { font-weight: 600; }
.entries-item-content { color: var(--text); line-height: 1.6; white-space: pre-wrap; }

/* 通用更多菜单（低干扰删除入口） */
.more-wrap { position: relative; }
.more-trigger { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 2px 8px; line-height: 1; cursor: pointer; }
.more-trigger:hover { color: #ef4444; border-color: rgba(239,68,68,0.4); }
.more-menu { position: absolute; right: 0; top: 28px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; min-width: 120px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); display: none; z-index: 10; }
.more-menu .menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--muted); cursor: pointer; }
.more-menu .menu-item:hover { background: rgba(255,255,255,0.04); color: #ef4444; }

/* 仅在卡片悬停时显示更多按钮（降噪） */
.kanban-card .more-wrap, .goal-card .more-wrap, .reflection-item .more-wrap, .incentive-item .more-wrap { opacity: 0; transition: opacity .15s ease; }
.kanban-card:hover .more-wrap, .goal-card:hover .more-wrap, .reflection-item:hover .more-wrap, .incentive-item:hover .more-wrap, .entries-item:hover .more-wrap { opacity: 1; }

.kanban-card .more-wrap { position: absolute; top: 8px; right: 8px; z-index: 10; }
.kanban-card .more-menu { position: absolute; top: 100%; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 80px; display: none; }
.kanban-card .more-menu .menu-item { padding: 8px 12px; cursor: pointer; transition: background-color 0.2s; border-bottom: 1px solid var(--border); }
.kanban-card .more-menu .menu-item:last-child { border-bottom: none; }
.kanban-card .more-menu .menu-item:hover { background-color: var(--hover); }
.kanban-card .more-menu .menu-item.btn-delete { color: var(--danger); }
.kanban-card .more-menu .menu-item.btn-delete:hover { background-color: var(--danger); color: white; }

/* 拖拽样式 */
.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
  transition: all 0.2s ease;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-list.drag-over {
  background-color: rgba(59, 130, 246, 0.1);
  border: 2px dashed var(--primary);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.kanban-list.drag-over .add-card {
  opacity: 0.3;
}

/* V8.0 模板系统样式 */

/* 复盘编辑器样式 */
.review-editor {
  margin-bottom: 2rem;
}

.review-header {
  margin-bottom: 1.5rem;
}

.review-date-section {
  max-width: 200px;
}

.review-date-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.review-date-section input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}

/* 模板区域样式 */
.template-sections {
  margin-bottom: 1.5rem;
}

.template-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.template-section-header {
  background: rgba(59, 130, 246, 0.1);
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.template-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.template-section-actions {
  display: flex;
  gap: 0.5rem;
}

.template-section-body {
  padding: 1.5rem;
}

.template-section-body.collapsed {
  display: none;
}

/* 模板字段样式 */
.template-field {
  margin-bottom: 1.5rem;
}

.template-field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.field-label .required {
  color: #ef4444;
  margin-left: 0.25rem;
}

.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

/* 移除不需要的form-number和field-unit样式 */

/* 移除不需要的复选框样式 */

/* 复盘总结样式 */
.review-summary-section {
  margin-bottom: 1.5rem;
}

.review-summary-section textarea {
  min-height: 120px;
}

/* 操作按钮样式 */
.review-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

/* 加载状态样式 */
.template-loading {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 0.5rem;
}

.loading-text {
  font-size: 14px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 模板设置弹窗样式 */
.template-settings-content {
  max-width: 600px;
}

.settings-section h3 {
  margin: 0 0 1rem 0;
  color: var(--text);
  font-size: 16px;
}

.template-list {
  max-height: 400px;
  overflow-y: auto;
}

.template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: var(--card);
}

.template-item:last-child {
  margin-bottom: 0;
}

.template-item-info {
  flex: 1;
}

.template-item-name {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.template-item-description {
  font-size: 12px;
  color: var(--muted);
}

.template-item-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.template-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.template-toggle.active {
  background: var(--primary);
}

.template-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.template-toggle.active::after {
  transform: translateX(20px);
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* 复盘预览样式 */
.review-preview {
  max-width: 800px;
  margin: 0 auto;
}

.preview-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.preview-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.preview-date {
  color: var(--muted);
  font-size: 14px;
}

.preview-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.preview-summary h3 {
  margin: 0 0 1rem 0;
  color: var(--text);
  font-size: 16px;
}

.preview-summary p {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
}

.preview-template {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.preview-template-header {
  background: rgba(59, 130, 246, 0.1);
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.preview-template-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.preview-template-content {
  padding: 1.5rem;
}

.template-content-item {
  margin-bottom: 1rem;
}

.template-content-item:last-child {
  margin-bottom: 0;
}

.content-label {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
  font-size: 14px;
}

.content-value {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  /* 移除不需要的review-header响应式样式 */
  
  .review-actions {
    flex-direction: column;
  }
  
  .review-actions .btn {
    width: 100%;
  }
  
  /* 移除不需要的复选框响应式样式 */
  
  .template-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .template-item-controls {
    width: 100%;
    justify-content: space-between;
  }
}
