/* ═══════════════════════════════════════════════════════════
   DevFlow Design System — Claude 设计系统规范
   扁平化 · 0.5px 边框 · 8/12px 圆角 · 400/500 字重
   紫/青绿/琥珀/珊瑚 四色体系 · 深色优先
   ═══════════════════════════════════════════════════════════ */

:root {
  /* — Surface — */
  --df-bg:                #0c0e1a;
  --df-bg-raised:         #12152a;
  --df-bg-card:           #171b33;
  --df-bg-card-hover:     #1c2140;
  --df-sidebar-bg:        #090b15;
  --df-sidebar-hover:     rgba(108,99,255,0.06);
  --df-sidebar-active:    rgba(108,99,255,0.12);

  /* — Text — */
  --df-text:              #eef0f6;
  --df-text-secondary:    #8b90a8;
  --df-text-dim:          #4a4f6a;

  /* — Accent: 紫色系（系统功能、互动元素）— */
  --df-accent:            #7b6ff0;
  --df-accent-hover:      #6a5de0;
  --df-accent-soft:       rgba(123,111,240,0.15);
  --df-accent-bg:         rgba(123,111,240,0.08);
  /* — Primary: 品牌主色（历史遗留 token,等价 accent,5 处引用:ConversationSidebar/PlanProgress/ConflictResolver/AdvancedSection 的 border/focus/活跃/link 态）— */
  --df-primary:           #7b6ff0;

  /* — Semantic — */
  /* 青绿：成功/流程 */
  --df-success:           #3ddba0;
  --df-success-bg:        rgba(61,219,160,0.12);
  /* 琥珀：警告/热度 */
  --df-warning:           #f0c75e;
  --df-warning-bg:        rgba(240,199,94,0.12);
  /* 珊瑚：危险/对比 */
  --df-danger:            #f06565;
  --df-danger-bg:         rgba(240,101,101,0.12);
  /* 蓝色：信息 */
  --df-info:              #5eaff0;
  --df-info-bg:           rgba(94,175,240,0.12);

  /* — Border: 统一 0.5px 极细边框 — */
  --df-border:            rgba(255,255,255,0.06);
  --df-border-strong:     rgba(255,255,255,0.10);

  /* — Radius: 2/4/6/8/10 渐进（全站统一走 token）— */
  --df-radius-xs:         2px;
  --df-radius-sm:         4px;
  --df-radius:            6px;
  --df-radius-md:         8px;
  --df-radius-lg:         10px;

  /* — Spacing: 全站间距基准（参考总览紧凑度，回退改值即可）— */
  --df-gap-page:          14px;      /* 页面区块间距：header→主区、区块垂直分隔 */
  --df-gap-grid:          12px;      /* 卡片/网格 gap */
  --df-gap-head:          10px;      /* 面板标题→内容 */
  --df-pad-panel:         14px 16px; /* 面板/卡片内边距 */
  --df-msg-max-width:     90%;       /* AI 气泡/工具卡片最大宽度(对齐不撑满) */

  /* — Typography: 仅 400/500 字重 — */
  --df-font-sans:         -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --df-font-mono:         'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;

  /* — Transition — */
  --df-ease:              cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══ 亮色主题 ═══ */
[data-theme="light"] {
  --df-bg:                #f5f6fa;
  --df-bg-raised:         #ffffff;
  --df-bg-card:           #ffffff;
  --df-bg-card-hover:     #f0f1f5;
  --df-sidebar-bg:        #ffffff;
  --df-sidebar-hover:     rgba(108,99,255,0.06);
  --df-sidebar-active:    rgba(108,99,255,0.10);

  --df-text:              #1a1d2e;
  --df-text-secondary:    #5a5f7a;
  --df-text-dim:          #9a9fba;

  --df-accent:            #6c5ce7;
  --df-accent-hover:      #5b4bd6;
  --df-accent-soft:       rgba(108,92,231,0.15);
  --df-accent-bg:         rgba(108,92,231,0.06);
  --df-primary:           #6c5ce7;

  --df-success:           #00b894;
  --df-success-bg:        rgba(0,184,148,0.10);
  --df-warning:           #e17055;
  --df-warning-bg:        rgba(225,112,85,0.10);
  --df-danger:            #d63031;
  --df-danger-bg:         rgba(214,48,49,0.10);
  --df-info:              #0984e3;
  --df-info-bg:           rgba(9,132,227,0.10);

  --df-border:            rgba(0,0,0,0.08);
  --df-border-strong:     rgba(0,0,0,0.14);
}

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

html, body, #app {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--df-font-sans);
  font-size: 14px;
  font-weight: 400;
  background: var(--df-bg);
  color: var(--df-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

/* — Scrollbar — */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: var(--df-radius-xs); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* — Selection — */
/* 选中态用 accent 实色 + 白字：保证紫底气泡(accent)选中也高对比可读,
   避免 accent-soft(透明紫)叠 accent 紫底导致紫字紫底不可见(深色主题) */
::selection { background: var(--df-accent-hover); color: #fff; }

/* — Animations — */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 var(--df-accent-soft); }
  50%      { box-shadow: 0 0 12px 2px var(--df-accent-soft); }
}

/* ═══════════════════════════════════════════════════════════
   公共组件 — 各功能页复用，避免 scoped 重复定义
   class 名与各页 template 保持一致，零侵入
   ═══════════════════════════════════════════════════════════ */

/* — Page Header（功能内页统一：24px 标题 + 紧凑下间距）— */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--df-gap-page);
}
.page-header h1 { font-size: 24px; font-weight: 500; color: var(--df-text); }
.header-actions { display: flex; gap: 10px; }

/* — Button — */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  line-height: 1;
  border: none;
  border-radius: var(--df-radius-sm);
  font-family: var(--df-font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--df-ease);
  white-space: nowrap;
}
.btn-primary { background: var(--df-accent); color: #fff; }
.btn-primary:hover { background: var(--df-accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--df-text-secondary); border: 0.5px solid var(--df-border); }
.btn-ghost:hover { background: var(--df-bg-card); color: var(--df-text); }
.btn-accent { background: var(--df-success-bg); color: var(--df-success); border: 0.5px solid rgba(61,219,160,0.3); }
.btn-accent:hover { background: rgba(61,219,160,0.22); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-link { background: none; border: none; color: var(--df-accent); font-size: 12px; cursor: pointer; padding: 2px 6px; }
.btn-link:hover { text-decoration: underline; }
.btn-link-danger { color: var(--df-danger); }

/* — Modal — */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-box {
  background: var(--df-bg-card);
  border: 0.5px solid var(--df-border);
  border-radius: var(--df-radius-lg);
  padding: 24px;
  min-width: min(360px, 90vw);
  max-width: 90vw;
}
.modal-title { font-size: 18px; font-weight: 500; color: var(--df-text); margin-bottom: 16px; }
.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: 12px; color: var(--df-text-dim); margin-bottom: 4px; }
.modal-field input,
.modal-field textarea,
.modal-field select {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--df-radius-sm);
  border: 0.5px solid var(--df-border);
  background: var(--df-bg);
  color: var(--df-text);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.modal-field input:focus,
.modal-field textarea:focus,
.modal-field select:focus { outline: none; border-color: var(--df-accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* — Empty State — */
.empty-state { text-align: center; padding: 60px 20px; font-size: 14px; color: var(--df-text-dim); }
.empty-hint { font-size: 13px; color: var(--df-text-dim); padding: 12px 0; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* — Back Link(详情页返回链接)— ProjectDetail / TaskDetail 共享 */
.back-link { font-size: 13px; color: var(--df-accent); text-decoration: none; white-space: nowrap; }
.back-link:hover { text-decoration: underline; }

/* — Filter Bar(列表页筛选 + 搜索)— Ideas / Tasks 共享 */
.filter-bar { display: flex; gap: 8px; margin-bottom: var(--df-gap-page); align-items: center; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 14px;
  border: 0.5px solid var(--df-border);
  border-radius: var(--df-radius-sm);
  background: transparent;
  color: var(--df-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { background: var(--df-bg-card); color: var(--df-text); }
.filter-btn.active {
  background: var(--df-accent);
  color: #fff;
  border-color: var(--df-accent);
}
.search-box { flex: 1; max-width: 300px; }
.search-box input {
  width: 100%;
  padding: 6px 12px;
  border: 0.5px solid var(--df-border);
  border-radius: var(--df-radius-sm);
  background: var(--df-bg);
  color: var(--df-text);
  font-size: 13px;
  box-sizing: border-box;
}
.search-box input:focus {
  outline: none;
  border-color: var(--df-accent);
  background: var(--df-bg-raised);
}
