/* ===== 看板列 ===== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .kanban-board { grid-template-columns: 1fr; } }

.kanban-col {
  background: white;
  border-radius: 10px;
  padding: 12px;
  min-height: 300px;
}
.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 2px solid;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
}
.kanban-col.col-todo .kanban-col-header { border-color: #e74c3c; color: #e74c3c; }
.kanban-col.col-doing .kanban-col-header { border-color: #f39c12; color: #d68910; }
.kanban-col.col-next .kanban-col-header { border-color: #3498db; color: #2980b9; }
.kanban-col.col-done .kanban-col-header { border-color: #27ae60; color: #229954; }
.kanban-count {
  background: #ecf0f1;
  color: #7f8c8d;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ===== Todo 卡片 ===== */
.todo-card {
  background: #fafbfc;
  border-left: 4px solid #95a5a6;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.todo-card:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.08); }
.todo-card.priority-P0 { border-left-color: #e74c3c; background: #fff5f5; }
.todo-card.priority-P1 { border-left-color: #e67e22; background: #fff9f4; }
.todo-card.priority-P2 { border-left-color: #f39c12; background: #fef9f0; }
.todo-card.priority-P3 { border-left-color: #95a5a6; }
.todo-card.status-done { opacity: 0.65; }
.todo-card.status-done .todo-title { text-decoration: line-through; color: #95a5a6; }
.todo-title { font-weight: 600; font-size: 13px; color: #2c3e50; margin-bottom: 4px; }
.todo-desc { font-size: 12px; color: #5d6d7e; margin-bottom: 6px; }
.todo-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.todo-tag {
  background: white;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10.5px;
  border: 1px solid #e0e6ed;
  color: #7f8c8d;
}
.todo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 10.5px;
  color: #95a5a6;
}
.todo-actions { display: flex; gap: 4px; }
.todo-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #5d6d7e;
}
.todo-actions button:hover { background: rgba(0,0,0,0.05); }
.todo-actions .btn-done { color: #27ae60; }
.todo-actions .btn-delete { color: #e74c3c; }

/* ===== 搜索结果页 ===== */
.search-result-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.search-result-row {
  display: block;
  background: white;
  border-left: 4px solid #bdc3c7;
  border-radius: 6px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.search-result-row:hover {
  border-left-color: #3498db;
  background: #f8fafb;
  transform: translateX(2px);
}
.search-result-title {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
  margin-bottom: 4px;
}
.search-result-desc {
  font-size: 12.5px;
  color: #5d6d7e;
  line-height: 1.5;
  margin-top: 2px;
}
.search-result-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: #7f8c8d;
  margin-top: 6px;
}
.search-result-prio {
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
}
.search-result-prio.priority-P0 { background: #fde0e0; color: #c0392b; }
.search-result-prio.priority-P1 { background: #fef0e0; color: #d68910; }
.search-result-prio.priority-P2 { background: #fef9e7; color: #b7950b; }
.search-result-prio.priority-P3 { background: #ecf0f1; color: #7f8c8d; }
.search-result-status {
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  background: #ecf0f1;
  color: #5d6d7e;
}

/* ===== 仪表盘紧凑列表 ===== */
.dash-todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid #ecf0f1;
  font-size: 13px;
}
.dash-todo-row:last-child { border-bottom: none; }
.dash-todo-priority {
  font-weight: 600;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  min-width: 28px;
  text-align: center;
}
.dash-todo-priority.priority-P0 { background: #fde0e0; color: #c0392b; }
.dash-todo-priority.priority-P1 { background: #fef0e0; color: #d68910; }
.dash-todo-priority.priority-P2 { background: #fef9e7; color: #b7950b; }
.dash-todo-priority.priority-P3 { background: #ecf0f1; color: #7f8c8d; }
.dash-todo-title { flex: 1; }
.dash-todo-overdue { color: #c0392b; }
.dash-todo-status {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 4px;
  color: white;
}
.dash-todo-status.status-todo { background: #e74c3c; }
.dash-todo-status.status-doing { background: #f39c12; }
.dash-todo-status.status-next { background: #3498db; }

.dash-flash-row {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12.5px;
  border-bottom: 1px solid #f5f6f7;
}
.dash-flash-row:last-child { border-bottom: none; }
.dash-flash-time { color: #9b59b6; font-size: 10.5px; min-width: 60px; }
.dash-flash-content { flex: 1; color: #2c3e50; }

.dash-midlong-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 13px;
  border-bottom: 1px solid #f5f6f7;
}
.dash-midlong-row:last-child { border-bottom: none; }
.dash-midlong-title { font-weight: 500; }
.dash-midlong-date { font-size: 11px; color: #7f8c8d; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stat-card {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.stat-num { font-size: 22px; font-weight: 700; color: #2c3e50; }
.stat-label { font-size: 10.5px; color: #7f8c8d; margin-top: 2px; }

/* ===== 快速添加栏 ===== */
.quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.quick-add input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #dde2e8;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.quick-add input:focus { outline: none; border-color: #3498db; }
.quick-add select {
  padding: 8px 10px;
  border: 1px solid #dde2e8;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  font-family: inherit;
}


.navbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.navbar > nav { display: flex; gap: 4px; flex-wrap: wrap; }
.navbar-search {
  position: relative;
  margin-left: auto;
  min-width: 220px;
  max-width: 340px;
  flex: 1;
}
.navbar-search input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid #dde2e8;
  border-radius: 18px;
  font-size: 13px;
  background: #f7f9fb;
  transition: all 0.2s;
  font-family: inherit;
}
.navbar-search input:focus {
  outline: none;
  border-color: #3498db;
  background: white;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 6px 0;
  display: none;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 1000;
  min-width: 300px;
}
.search-results.active { display: block; }
.search-summary {
  font-size: 11px;
  color: #7f8c8d;
  padding: 4px 14px;
  border-bottom: 1px solid #ecf0f1;
  margin-bottom: 4px;
}
.search-module {
  font-size: 11px;
  font-weight: 600;
  color: #3498db;
  padding: 6px 14px 2px;
  margin-top: 4px;
}
.search-item {
  display: block;
  padding: 6px 14px;
  color: #2c3e50;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.1s;
}
.search-item:hover { background: #f0f7fc; color: #2980b9; }
.search-empty {
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
  color: #95a5a6;
}
.search-all {
  display: block;
  padding: 8px 14px;
  background: #f8f9fa;
  color: #2980b9;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-top: 1px solid #ecf0f1;
  margin-top: 4px;
  text-align: center;
}
.search-all:hover { background: #eaf4ff; }

@media (max-width: 720px) {
  .navbar-search { min-width: 100%; max-width: 100%; }
}

/* ===== 拖拽样式 ===== */
.todo-card[draggable="true"] { user-select: none; }
.todo-card.dragging {
  opacity: 0.4;
  transform: rotate(-2deg);
  cursor: grabbing;
}
.todo-card.dropping {
  opacity: 0.5;
  transform: scale(0.98);
  border: 2px dashed #3498db;
}
.kanban-col-body.drag-over {
  background: #eaf4ff;
  border-radius: 8px;
  outline: 2px dashed #3498db;
  outline-offset: -2px;
  min-height: 50px;
}
.kanban-col-body.drag-over::after {
  content: '✋ 放到这里';
  display: block;
  text-align: center;
  font-size: 12px;
  color: #3498db;
  padding: 8px;
  font-weight: 600;
}

/* ===== 闪念卡片 ===== */
.flash-card {
  background: white;
  border-left: 4px solid #9b59b6;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.flash-card.pinned { background: #faf4ff; }
.flash-time {
  display: inline-block;
  background: #9b59b6;
  color: white;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}
.flash-content { font-size: 13.5px; color: #2c3e50; line-height: 1.5; }
.flash-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.flash-tag {
  background: #f4ecf7;
  color: #6c3a7a;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10.5px;
}

/* ===== 仪表盘首页 ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.dashboard-section {
  background: white;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dashboard-section h2 {
  font-size: 15px;
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===== 模态框 ===== */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-bg.active { display: flex; }
.modal {
  background: white;
  border-radius: 10px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal label {
  display: block;
  font-size: 12px;
  color: #7f8c8d;
  margin: 8px 0 4px;
}
.modal input, .modal select, .modal textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #dde2e8;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
}
.modal textarea { min-height: 60px; resize: vertical; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; align-items: center; }

/* ===== 详情/编辑模态框（宽版） ===== */
.modal-lg { max-width: 540px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-header h3 { margin: 0; }
.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #95a5a6;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}
.modal-close:hover { color: #e74c3c; }
.modal-body { padding-top: 4px; }

.detail-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #ecf0f1;
  font-size: 11px;
  color: #95a5a6;
}

.btn-danger {
  background: #e74c3c;
  color: white;
  border: 1px solid #e74c3c;
}
.btn-danger:hover { background: #c0392b; }

/* ===== 可点击卡片悬停效果 ===== */
.todo-card[onclick],
.flash-card[onclick],
.card[onclick] {
  cursor: pointer;
}
.todo-card[data-clickable] { cursor: pointer; }
.todo-card[data-clickable]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

/* ===== 快速记录 v0.2 ===== */
.quick-add-v2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 8px 10px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  flex-wrap: wrap;
}
.quick-add-bucket-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.bucket-tab {
  background: #f4f6f8;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #5d6d7e;
  transition: all 0.15s;
  font-family: inherit;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}
.bucket-tab:hover { background: #eaf0f5; }
.bucket-tab.active {
  background: #3498db;
  color: white;
  border-color: #2980b9;
  box-shadow: 0 2px 6px rgba(52,152,219,0.25);
}
.bucket-icon { font-size: 16px; line-height: 1; }
.bucket-label { font-size: 12.5px; font-weight: 500; }
.quick-add-v2-input {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid #dde2e8;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  min-height: 36px;
}
.quick-add-v2-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}
.quick-add-v2-submit {
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  min-width: 56px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.quick-add-v2-submit:hover { background: #229954; }
.quick-add-v2-submit:disabled { background: #95a5a6; cursor: wait; }
.quick-add-msg {
  font-size: 12px;
  margin: -8px 4px 8px;
  min-height: 16px;
  color: #7f8c8d;
}
.quick-add-msg.ok { color: #27ae60; }
.quick-add-msg.err { color: #e74c3c; }

@media (max-width: 540px) {
  .quick-add-bucket-tabs { width: 100%; }
  .bucket-tab { flex: 1; justify-content: center; padding: 8px 6px; }
  .quick-add-v2-input { width: 100%; flex: none; }
}
