/* site/wkd.css — 领域页与统一组件样式（iPhone6 375px 底线，深色模式，零 gap/dvh/aspect-ratio） */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #0a0a0a;
  color: #e5e5e5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  overflow-x: hidden;
}

/* 顶部 Fixed 导航 */
.wkd-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background-color: #121212;
  border-bottom: 1px solid #222222;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
}

.wkd-header-left, .wkd-header-right {
  display: flex;
  align-items: center;
}

.wkd-icon-btn {
  background: none;
  border: none;
  color: #e5e5e5;
  font-size: 20px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.wkd-icon-btn:active {
  opacity: 0.7;
}

.wkd-header-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
}

.wkd-header-sub {
  font-size: 11px;
  color: #888888;
  font-weight: normal;
  margin-left: 6px;
}

/* 页面滚动内容区 */
.wkd-body {
  position: absolute;
  top: 48px;
  bottom: 64px;
  left: 0;
  right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 20px 14px;
}

/* 区块与卡片 */
.wkd-section {
  margin-bottom: 16px;
}

.wkd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.wkd-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  border-left: 3px solid #3b82f6;
  padding-left: 8px;
  line-height: 1.2;
}

.wkd-section-count {
  font-size: 12px;
  color: #888888;
}

.wkd-card {
  background-color: #161616;
  border: 1px solid #262626;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

/* 1. 目标卡片 */
.wkd-goal-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.wkd-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.wkd-goal-title {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
}

.wkd-goal-target {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.wkd-goal-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

/* 进度条 */
.wkd-progress-wrap {
  width: 100%;
  height: 6px;
  background-color: #334155;
  border-radius: 3px;
  overflow: hidden;
}

.wkd-progress-bar {
  height: 100%;
  background-color: #3b82f6;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* 2. 项目卡片 */
.wkd-project-card {
  background-color: #161616;
  border: 1px solid #262626;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  transition: background-color 0.5s ease;
}

.wkd-project-card.highlight {
  background-color: #1e3a8a;
  border-color: #3b82f6;
}

.wkd-project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.wkd-project-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.wkd-project-stage {
  font-size: 11px;
  background-color: #1e293b;
  color: #60a5fa;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #1d4ed8;
}

.wkd-project-next {
  font-size: 12px;
  color: #a3a3a3;
  margin-bottom: 8px;
}

.wkd-project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666666;
  margin-bottom: 4px;
}

/* 3. 今日三件事列表 */
.wkd-task-list {
  background-color: #161616;
  border: 1px solid #262626;
  border-radius: 10px;
  overflow: hidden;
}

.wkd-task-item {
  padding: 10px 12px;
  border-bottom: 1px solid #222222;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wkd-task-item:last-child {
  border-bottom: none;
}

.wkd-task-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}

.wkd-task-priority {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #666;
  margin-right: 8px;
  flex-shrink: 0;
}

.wkd-task-priority.high {
  background-color: #ef4444;
}

.wkd-task-priority.medium {
  background-color: #f59e0b;
}

.wkd-task-title {
  font-size: 13px;
  color: #e5e5e5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wkd-task-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.wkd-act-btn {
  background: #222222;
  border: 1px solid #333333;
  color: #d4d4d4;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 44px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  cursor: pointer;
}

.wkd-act-btn:active {
  background-color: #333333;
}

.wkd-act-btn.done {
  color: #10b981;
  border-color: #065f46;
}

/* 4. 等待处理（4分组） */
.wkd-pending-box {
  background-color: #161616;
  border: 1px solid #262626;
  border-radius: 10px;
  padding: 10px 12px;
}

.wkd-group-row {
  margin-bottom: 12px;
}

.wkd-group-row:last-child {
  margin-bottom: 0;
}

.wkd-group-head {
  font-size: 12px;
  font-weight: 600;
  color: #a3a3a3;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.wkd-group-subitem {
  font-size: 12px;
  color: #d4d4d4;
  padding: 4px 0;
  border-bottom: 1px dashed #222222;
  display: flex;
  justify-content: space-between;
}

.wkd-group-subitem:last-child {
  border-bottom: none;
}

/* 5. 最近记录 */
.wkd-recent-list {
  background-color: #161616;
  border: 1px solid #262626;
  border-radius: 10px;
  overflow: hidden;
}

.wkd-recent-item {
  padding: 10px 12px;
  border-bottom: 1px solid #222222;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wkd-recent-item:last-child {
  border-bottom: none;
}

.wkd-type-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
  flex-shrink: 0;
  background-color: #262626;
  color: #a3a3a3;
}

.wkd-type-tag.task { background-color: #1e3a8a; color: #93c5fd; }
.wkd-type-tag.project { background-color: #312e81; color: #c7d2fe; }
.wkd-type-tag.note { background-color: #1f2937; color: #d1d5db; }
.wkd-type-tag.idea { background-color: #701a75; color: #f5d0fe; }
.wkd-type-tag.decision { background-color: #831843; color: #fbcfe8; }
.wkd-type-tag.question { background-color: #7c2d12; color: #ffedd5; }
.wkd-type-tag.record { background-color: #064e3b; color: #a7f3d0; }
.wkd-type-tag.goal { background-color: #78350f; color: #fde68a; }

.wkd-recent-title {
  font-size: 13px;
  color: #e5e5e5;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.wkd-recent-time {
  font-size: 11px;
  color: #666666;
  flex-shrink: 0;
}

/* 空态文案 */
.wkd-empty-tip {
  color: #666666;
  font-size: 12px;
  text-align: center;
  padding: 16px;
}

/* 底部固定统一输入框 */
.wkd-input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #121212;
  border-top: 1px solid #222222;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.wkd-input-row {
  display: flex;
  align-items: flex-end;
}

.wkd-textarea {
  flex: 1;
  background-color: #1c1c1c;
  border: 1px solid #333333;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  padding: 8px 10px;
  resize: none;
  max-height: 100px;
  outline: none;
  margin-right: 8px;
}

.wkd-textarea:focus {
  border-color: #3b82f6;
}

.wkd-send-btn {
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 0 14px;
  height: 38px;
  min-width: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.wkd-send-btn:disabled {
  background-color: #2563eb;
  opacity: 0.6;
}

.wkd-input-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
  color: #666666;
  padding: 0 2px;
}

/* 解析确认卡 Sheet (Modal / Bottom Sheet) */
.wkd-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.wkd-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.wkd-sheet-card {
  background-color: #1a1a1a;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-top: 1px solid #333333;
  padding: 16px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.wkd-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 8px;
}

.wkd-sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.wkd-sheet-via {
  font-size: 11px;
  color: #888888;
  background-color: #262626;
  padding: 2px 6px;
  border-radius: 4px;
}

.wkd-sheet-field {
  margin-bottom: 10px;
}

.wkd-sheet-label {
  font-size: 12px;
  color: #888888;
  margin-bottom: 4px;
}

.wkd-chips-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.wkd-chip {
  background-color: #262626;
  color: #aaaaaa;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  margin-right: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid #333333;
}

.wkd-chip.selected {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

.wkd-sheet-input {
  width: 100%;
  background-color: #242424;
  border: 1px solid #333333;
  border-radius: 6px;
  color: #ffffff;
  font-size: 13px;
  padding: 8px;
  outline: none;
}

.wkd-sheet-input:focus {
  border-color: #3b82f6;
}

.wkd-sheet-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.wkd-btn-cancel {
  background-color: #262626;
  color: #cccccc;
  border: 1px solid #333333;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  min-height: 40px;
  margin-right: 8px;
}

.wkd-btn-save {
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
}

/* Toast 提示 */
.wkd-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #10b981;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.wkd-toast.show {
  opacity: 1;
}
