/* 引入字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* 调整配色增加对比度 */
  --bg-body: #f1f5f9;       
  --bg-surface: #ffffff;    
  --bg-hover: #f8fafc;      
  
  --primary: #4f46e5;       
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.1);
  
  --text-main: #0f172a;     
  --text-secondary: #475569; 
  --text-light: #94a3b8;    
  
  --border: #e2e8f0;        
  
  --status-pending: #94a3b8;
  --status-progress: #3b82f6;
  --status-testing: #a855f7;
  --status-completed: #10b981;
  --status-released: #06b6d4;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  touch-action: manipulation;
}

body.auth-locked .app-container {
  filter: blur(14px);
  pointer-events: none;
  user-select: none;
}
body.auth-locked .bg-animation {
  opacity: 0.18;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.46), rgba(79, 70, 229, 0.28));
  backdrop-filter: blur(20px);
}
.auth-gate.active {
  display: flex;
}
.auth-gate-panel {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
  gap: 24px;
  align-items: stretch;
}
.auth-gate-hero,
.auth-gate-card {
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
}
.auth-gate-hero {
  padding: 40px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.24), transparent 38%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.84));
  color: #e2e8f0;
}
.auth-gate-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #c7d2fe;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.auth-gate-hero h1 {
  margin-top: 18px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.08;
  color: #fff;
}
.auth-gate-hero p {
  margin-top: 16px;
  max-width: 520px;
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(226, 232, 240, 0.9);
}
.auth-gate-highlights {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}
.auth-gate-highlight {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
}
.auth-gate-highlight strong {
  display: block;
  font-size: 0.96rem;
  color: #fff;
}
.auth-gate-highlight span {
  display: block;
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.82);
}
.auth-gate-card {
  padding: 26px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(18px);
}
.auth-gate-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: #eef2ff;
}
.auth-gate-tab {
  border: none;
  border-radius: 14px;
  padding: 12px;
  background: transparent;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.auth-gate-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
}
.auth-gate-message {
  margin: 18px 4px 10px;
  min-height: 22px;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.6;
}
.auth-gate-form {
  display: none;
}
.auth-gate-form.active {
  display: block;
}
.auth-gate-submit {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}
.auth-gate-switch {
  width: 100%;
  justify-content: center;
}

/* --- 背景纹理动画 --- */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: #f1f5f9;
  background-image: 
    radial-gradient(#e2e8f0 1.5px, transparent 1.5px),
    radial-gradient(#e2e8f0 1.5px, transparent 1.5px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  opacity: 0.5;
}

.bg-blob {
  position: absolute;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: move 30s infinite alternate;
}

@keyframes move {
  from { transform: translate(-10%, -10%); }
  to { transform: translate(10%, 10%); }
}

.app-container { display: flex; height: 100vh; position: relative; z-index: 1; }

/* 侧边栏 */
.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 10px 0 30px rgba(0,0,0,0.02);
}

.sidebar-header {
  min-height: 80px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.2rem; }
.logo-icon { width: 36px; height: 36px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; }

/* 模式切换按钮 */
.mode-toggle {
  display: flex;
  background: var(--bg-body);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.mode-btn {
  padding: 5px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  position: relative;
  overflow: visible;
}
.mode-btn:hover { color: var(--text-secondary); }
.mode-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* 认证弹窗 */
.modal-sm { max-width: 420px; }
.form-error { color: #ef4444; font-size: 0.82rem; padding: 6px 0; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 0.82rem; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }

.avatar-upload-area { display: flex; align-items: center; gap: 12px; }
.avatar-preview {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--bg-body); border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; flex-shrink: 0;
  transition: border-color 0.2s;
}
.avatar-preview:hover { border-color: var(--primary); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.mobile-project-btn {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.mobile-project-btn .svg-icon {
  width: 14px;
  height: 14px;
}

.sidebar-content { flex: 1; overflow-y: auto; padding: 24px 16px; }
.sidebar-section-title { font-size: 0.75rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; margin: 20px 12px 12px; }

.project-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.project-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md);
  cursor: pointer; transition: 0.2s; color: var(--text-secondary);
}
.project-item:hover { background: var(--bg-hover); transform: translateX(4px); }
.project-item.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }

.add-project-btn {
  margin: 16px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 600;
}

.add-project-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* 主内容区 */
.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }

.main-header { 
  padding: 32px 40px 24px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.main-header .header-actions {
  display: flex;
  gap: 12px;
  background: white;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.main-header .header-actions .btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-header .header-actions .btn-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
}

.main-header .header-actions .btn-danger:hover {
  background: #fef2f2;
  color: #ef4444;
  transform: translateY(-2px);
}

.main-header .header-actions .svg-icon {
  width: 20px;
  height: 20px;
}

.project-title h1 { font-size: 1.75rem; font-weight: 800; }

.tabs { 
  margin: 0;
  padding: 8px 40px 0;
  display: flex; 
  gap: 32px; 
  border-bottom: 1px solid var(--border); 
  position: sticky; 
  top: 0; 
  background: transparent; 
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10; 
}
.tab { padding: 16px 0; background: none; border: none; border-bottom: 3px solid transparent; color: var(--text-secondary); font-weight: 600; cursor: pointer; font-size: 1rem; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.scroll-container { padding: 32px 40px; }

/* 统计卡片 */
.stats-grid { display: flex; gap: 20px; margin-bottom: 32px; }
.stat-card {
  flex: 1; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); border-radius: var(--radius-lg); padding: 24px;
  border: 1px solid white; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.04), inset 0 0 0 1px rgba(255,255,255,0.5); transition: 0.3s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card .label { font-size: 0.75rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; margin-bottom: 8px; }
.stat-card .value { font-size: 2rem; font-weight: 800; }

/* 进度条 */
.progress-section { margin-bottom: 32px; }
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); transition: width 0.6s ease; }
.progress-text { font-size: 0.85rem; color: var(--text-secondary); margin-top: 8px; text-align: right; }

/* 业务模块 */
.module-card { background: white; border-radius: var(--radius-lg); border: 1px solid white; margin-bottom: 24px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.04); overflow: hidden; }
.module-header { padding: 20px 24px; display: flex; align-items: center; gap: 16px; cursor: pointer; background: white; }
.module-header:hover { background: var(--bg-hover); }
.module-drag-handle { color: var(--text-light); cursor: grab; font-size: 1.2rem; }
.module-expand-icon { transition: transform 0.3s; color: var(--text-light); }
.module-card.expanded .module-expand-icon { transform: rotate(90deg); color: var(--primary); }
.module-card.expanded .module-header { background: var(--bg-hover); }
.module-name { flex: 1; font-size: 1.1rem; font-weight: 700; }
.module-info { min-width: 0; flex: 1; }
.module-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
}
.module-mini-progress {
  width: 84px;
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.module-mini-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1 0%, #22c55e 100%);
}

.module-actions { 
  display: flex; 
  gap: 8px; 
  opacity: 1; 
  transition: 0.2s; 
  background: white;
  margin-left: auto;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.module-actions .btn-icon { width: 32px; height: 32px; border-radius: 8px; }

.module-requirements { padding: 0 24px 24px 60px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #f8fafc; padding-top: 16px; }

/* 需求项 */
.requirement-item {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  background: white; border-radius: var(--radius-md); border: 1px solid rgba(0,0,0,0.05); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.requirement-item:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.requirement-item.completed { opacity: 0.8; background: #f0fdf4; }
.requirement-item.released { opacity: 0.7; background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%); border-color: #99f6e4; }
.requirement-item.released .req-title { text-decoration: line-through; color: var(--text-light); }
.requirement-item.pinned { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-color: #fbbf24; }
.requirement-item.pinned:hover { border-color: #f59e0b; }

.requirement-item.deep-linked {
  animation: requirementPulse 2s ease;
}

@keyframes requirementPulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.28); border-color: rgba(79, 70, 229, 0.55); }
  60% { box-shadow: 0 0 0 14px rgba(79, 70, 229, 0); border-color: rgba(79, 70, 229, 0.9); }
  100% { box-shadow: var(--shadow-md); border-color: rgba(0,0,0,0.05); }
}

.pin-icon, .released-icon { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: middle;
}

.pin-icon svg, .released-icon svg {
  width: 100%;
  height: 100%;
}

.pin-icon.active svg { color: #f59e0b; animation: pinPulse 0.3s ease; }
.released-icon svg { color: #06b6d4; }

@keyframes pinPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }

.btn-warning { background: #fff7ed; color: #f59e0b; border: 1px solid #ffedd5 !important; }
.btn-warning:hover { background: #ffedd5; color: #d97706; border-color: #fed7aa !important; }

.btn-released { background: #ecfeff; color: #06b6d4; border: 1px solid #cffafe !important; }
.btn-released:hover { background: #cffafe; color: #0891b2; border-color: #a5f3fc !important; }

.tag-released { background: #ecfeff; color: #0891b2; font-weight: 700; border: 1px solid #cffafe; }

.req-checkbox {
  width: 24px; height: 24px; border: 2px solid var(--border); border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
}
.req-checkbox:hover { border-color: var(--primary); background: var(--primary-light); transform: scale(1.1); }
.req-checkbox.checked { background: var(--status-completed); border-color: var(--status-completed); color: white; }
.req-checkbox.checked:hover { background: #059669; border-color: #059669; }

.req-drag-handle {
  color: var(--text-light);
  cursor: grab;
  user-select: none;
}

.req-content { flex: 1; cursor: pointer; }
.req-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.req-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.45;
}
.req-desc:empty { display: none; }

.req-actions { 
  opacity: 0; 
  transition: 0.2s; 
  display: flex;
  gap: 4px;
  background: white;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.requirement-item:hover .req-actions { opacity: 1; }

.req-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

/* 标签 */
.tag { padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tag-priority { min-width: 32px; justify-content: center; }
.tag-priority.high { background: #fee2e2; color: #ef4444; border: 1px solid #fecaca; }
.tag-priority.medium { background: #fff7ed; color: #d97706; border: 1px solid #ffedd5; }
.tag-priority.low { background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }

.tag-status {
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-size: 0.75rem;
}

.tag-status.in_progress { color: #2563eb; background: #eff6ff; border-color: #dbeafe; }
.tag-status.testing { color: #9333ea; background: #faf5ff; border-color: #f3e8ff; }
.tag-status.completed { color: #16a34a; background: #f0fdf4; border-color: #dcfce7; }

/* 筛选与搜索 */
.requirements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 24px;
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-left: auto;
}

.status-filter { 
  display: flex; 
  gap: 4px; 
  background: rgba(241, 245, 249, 0.8); 
  padding: 6px; 
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.filter-btn { 
  padding: 8px 18px; 
  border: none; 
  background: none; 
  border-radius: 10px; 
  font-size: 0.85rem; 
  font-weight: 600; 
  color: var(--text-secondary); 
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.6); }
.filter-btn.active { background: white; color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.search-box { position: relative; display: flex; align-items: center; }
.search-input { padding: 10px 40px 10px 40px; border-radius: var(--radius-md); border: 1px solid var(--border); width: 240px; font-size: 0.9rem; transition: all 0.2s; }
.search-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-light); width: 280px; }

.search-clear {
  position: absolute;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--bg-body);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: all 0.2s;
}

.search-clear:hover {
  background: var(--border);
  color: var(--text-secondary);
  transform: scale(1.1);
}

.search-clear svg {
  width: 100%;
  height: 100%;
}

/* 按钮样式优化 */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  user-select: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: white;
  border-color: var(--border);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-light); color: var(--text-main); }

/* 导出按钮优化 */
.btn-export {
  background: white !important;
  border: 1.5px solid var(--border) !important;
  color: var(--text-secondary) !important;
  padding: 8px 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-weight: 600 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-export:hover {
  background: #f8fafc !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.btn-export svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.btn-export:hover svg {
  transform: translateY(2px);
}

.btn-danger { background: #fff; border-color: #fecaca; color: var(--status-cancelled); }
.btn-danger:hover { background: #fef2f2; border-color: var(--status-cancelled); }

.btn-icon { width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; flex-shrink: 0; }
.btn-icon svg { width: 18px; height: 18px; }

.btn-icon-only { width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; }
.btn-icon-only svg { width: 20px; height: 20px; margin: 0; }

/* 轻量提示文案 */
.tooltip { position: relative; }

@media (hover: hover) and (pointer: fine) {
  .tooltip::before,
  .tooltip::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    z-index: 40;
  }

  .tooltip::before {
    content: attr(data-tooltip);
    top: calc(100% + 10px);
    transform: translate(-50%, -6px);
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.94);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  }

  .tooltip::after {
    content: '';
    top: calc(100% + 4px);
    transform: translate(-50%, -6px);
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.94) transparent;
  }

  .tooltip:hover::before,
  .tooltip:hover::after,
  .tooltip:focus-visible::before,
  .tooltip:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

/* 模态框整体优化 */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.4); 
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header { padding: 20px 24px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-header h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-main); }

.modal-close {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: none;
  background: var(--bg-hover); color: var(--text-light); cursor: pointer; transition: all 0.2s; font-size: 1.2rem;
}
.modal-close:hover { background: #fee2e2; color: var(--status-cancelled); }

.modal-body { padding: 20px 24px; flex: 1; overflow-y: auto; }
.modal-footer { padding: 16px 24px; background: #f8fafc; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; gap: 12px; flex-shrink: 0; }

.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}
.form-row .form-group { margin-bottom: 0; }
.form-row .flex-1 { flex: 1; }
.form-row .flex-2 { flex: 2; }

.btn-group.compact { gap: 4px; flex-wrap: nowrap; }
.btn-group.compact .btn-option { padding: 6px 8px; font-size: 0.75rem; white-space: nowrap; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }

.form-input, .form-textarea, .form-select {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-md); border: 2px solid var(--border); background: white;
  font-size: 0.95rem; font-weight: 500; transition: all 0.2s; color: var(--text-main);
}
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }

.form-textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
.form-textarea.auto-expand { 
  min-height: 72px; 
  max-height: 240px; /* 约10行 */
  overflow-y: auto;
  resize: none;
}

.btn-group { display: flex; gap: 8px; background: var(--bg-hover); padding: 6px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.btn-option { flex: 1; padding: 8px 12px; border: none; border-radius: 8px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); text-align: center; }
.btn-option:hover { color: var(--text-main); }
.btn-option.priority.high.active { background: #ef4444; color: white; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.btn-option.priority.medium.active { background: #f59e0b; color: white; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
.btn-option.priority.low.active { background: #10b981; color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.btn-option.status.active { background: white; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.input-with-prefix { display: flex; align-items: center; border: 2px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: all 0.2s; }
.input-with-prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.input-prefix { padding: 12px 16px; background: var(--bg-hover); color: var(--text-secondary); font-weight: 700; border-right: 2px solid var(--border); font-size: 0.95rem; }
.input-with-prefix .form-input { border: none; box-shadow: none; }

.form-hint { font-size: 0.75rem; color: var(--text-light); margin-top: 8px; font-weight: 500; }

.svg-icon { width: 18px; height: 18px; stroke-width: 2; stroke: currentColor; fill: none; }

.welcome-page { text-align: center; padding: 80px 40px; background: white; max-width: 600px; margin: 100px auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid white; }
.welcome-icon { margin-bottom: 32px; display: inline-flex; padding: 24px; background: var(--primary-light); border-radius: 30px; color: var(--primary); font-size: 4rem; }
.welcome-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.welcome-actions .btn {
  justify-content: center;
}

.btn-project-picker {
  min-width: 144px;
  font-weight: 700;
}

.btn-project-picker.is-active {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-color: rgba(79, 70, 229, 0.28);
  color: var(--primary);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.14);
}

.btn-project-switch {
  display: none;
}

.mobile-project-backdrop {
  display: none;
}

/* 备注卡片优化 */
.notes-grid {
  width: 100%;
}

.note-card {
  width: calc(33.333% - 14px); /* 三列布局，考虑 gutter */
  margin-bottom: 20px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* 响应式：中等屏幕两列 */
@media (max-width: 1200px) {
  .note-card {
    width: calc(50% - 10px);
  }
}

/* 响应式：小屏幕单列 */
@media (max-width: 768px) {
  .note-card {
    width: 100%;
  }
}

.note-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.note-card.pinned {
  border-color: #fcd34d;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.12);
}

.note-card.pinned::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #f59e0b, #fbbf24);
}

.note-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
}

.note-title-group {
  flex: 1;
  min-width: 0;
}

.note-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-word;
}

.note-title .svg-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.note-type-tag {
  display: inline-flex;
  padding: 2px 8px;
  background: var(--bg-body);
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
}

.note-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.note-card:hover .note-actions {
  opacity: 1;
}

.note-actions .btn-icon {
  width: 28px;
  height: 28px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.note-actions .btn-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.note-actions .btn-danger:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

.note-content {
  padding: 12px 16px 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 内容为空时隐藏整个区域 */
.note-content:empty {
  display: none;
}

.note-text {
  margin-bottom: 0;
}

.note-content a {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.note-content a:hover {
  text-decoration: underline;
}

.dragging { opacity: 0.4; border: 2px dashed var(--primary); }
.highlight { background: #fef3c7; color: #92400e; padding: 0 2px; border-radius: 2px; }

/* ==================== 图片上传区域 ==================== */
.image-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  transition: all 0.3s ease;
  overflow: hidden;
}

.image-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  transition: all 0.3s ease;
  overflow: hidden;
}

.file-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
}

.upload-label:hover {
  color: var(--primary);
}

.upload-label svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0;
}

.image-upload-zone.compact {
  min-height: 0;
  border: none;
  background: transparent;
  padding: 0;
}

.file-upload-zone.compact {
  min-height: 0;
  border: none;
  background: transparent;
  padding: 0;
}

.image-upload-zone.compact .image-preview-list {
  padding: 0;
}

.file-upload-zone.compact .file-preview-list {
  padding: 0;
}

.image-upload-zone.compact:empty,
.image-upload-zone.compact .image-preview-list:empty {
  display: none;
}

.file-upload-zone.compact:empty,
.file-upload-zone.compact .file-preview-list:empty {
  display: none;
}

.form-group-compact {
  margin-bottom: 8px;
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
}

.file-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.image-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.image-preview-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  line-height: 1;
}

.image-preview-item:hover .image-remove-btn {
  opacity: 1;
}

.image-remove-btn:hover {
  background: #dc2626;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
}

.file-preview-info {
  min-width: 0;
  flex: 1;
}

.file-preview-name {
  display: block;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.file-preview-name:hover {
  color: var(--primary);
}

.file-preview-meta {
  margin-top: 2px;
  color: var(--text-light);
  font-size: 0.75rem;
}

.file-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
}

.file-download-btn:hover {
  color: var(--primary);
  border-color: #c7d2fe;
  background: #eef2ff;
}

.file-remove-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.file-remove-btn:hover {
  background: #dc2626;
}

/* ==================== 备注中的图片展示 ==================== */
.note-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* 没有文字内容时，图片直接显示无需分隔线 */
.note-images.no-text {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.note-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.note-attachments.no-text {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.note-attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-attachment-link {
  display: block;
  flex: 1;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  word-break: break-all;
}

.note-attachment-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.note-attachment-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  color: var(--text-secondary);
  background: #ffffff;
  text-decoration: none;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.note-attachment-download:hover {
  color: var(--primary);
  border-color: #c7d2fe;
  background: #eef2ff;
}

.note-image-item {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  flex-shrink: 0;
  background: #f8fafc;
}

.note-image-item:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.note-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ==================== 需求图片展示 ==================== */
.req-images {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.req-attachments {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.req-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.75rem;
}

.req-attachment-chip:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.req-attachment-name {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.req-attachment-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.req-attachment-download:hover {
  color: var(--primary);
  border-color: #c7d2fe;
  background: #eef2ff;
}

.req-attachment-more {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
}

.req-image-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.req-image-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.req-image-thumb img,
.req-video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.req-video-thumb {
  position: relative;
  background: #0f172a;
}

.req-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.28);
}

.req-image-more {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
}

/* ==================== 团队成员 ==================== */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.member-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.member-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.member-tasks {
  font-size: 0.8rem;
  color: var(--text-light);
}

.member-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.member-card:hover .member-actions {
  opacity: 1;
}

/* 颜色选择器 */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  border: 3px solid transparent;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.active {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text-main);
}

/* 负责人选择器 */
.assignee-selector {
  margin-top: 4px;
}

.assignee-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignee-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.assignee-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.assignee-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.assignee-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

.assignee-avatar.empty {
  background: var(--border);
  color: var(--text-light);
}

.no-members {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* 需求中的负责人头像组 */
.assignee-avatars {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: -8px;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s;
  cursor: default;
}

.mini-avatar:hover {
  transform: translateY(-2px) scale(1.1);
  z-index: 10;
}

.mini-avatar:first-child {
  margin-left: 0;
}

.mini-avatar.more {
  background: #f1f5f9;
  color: #64748b;
  border-color: white;
  font-size: 0.6rem;
}

/* 负责人状态显示 */
.assignee-status {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 10px;
  background: #f8fafc;
  color: var(--text-light);
  border: 1px dashed var(--border);
}

.assignee-status.has-selection {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* 多选提示 */
.assignee-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 6px;
}

.assignee-options.multi .assignee-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* ==================== 图片预览弹窗 ==================== */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}

.image-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.image-lightbox img,
.image-lightbox video {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  cursor: default;
}

.image-lightbox video {
  background: #000;
}

.image-lightbox.active img,
.image-lightbox.active video {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* 同步提示 */
.sync-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-notice svg {
  width: 18px;
  height: 18px;
  animation: syncRotate 2s linear infinite;
}

@keyframes syncRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sync-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* 导出进度 */
.export-progress {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  padding: 24px 32px;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.export-progress.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.export-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== 确认对话框 ==================== */
.confirm-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.confirm-dialog-overlay.active {
  opacity: 1;
  visibility: visible;
}

.confirm-dialog {
  background: white;
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.confirm-dialog-overlay.active .confirm-dialog {
  transform: scale(1) translateY(0);
}

.confirm-dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  background: var(--primary-light);
  color: var(--primary);
}

.confirm-dialog-icon svg {
  width: 32px;
  height: 32px;
}

.confirm-dialog.danger .confirm-dialog-icon {
  background: #fef2f2;
  color: #ef4444;
}

.confirm-dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.confirm-dialog-message {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.confirm-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-dialog-actions .btn {
  min-width: 100px;
  justify-content: center;
}

.btn-danger-solid {
  background: #ef4444;
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ==================== 响应式适配（手机重构） ==================== */
@media (max-width: 768px) {
  body {
    overflow: auto;
    min-height: 100dvh;
  }

  .bg-animation {
    opacity: 0.32;
    background-size: 28px 28px;
  }

  .app-container {
    flex-direction: column;
    min-height: 100dvh;
    height: auto;
  }

  .sidebar {
    width: 100%;
    height: 64px;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 80;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  }

  .sidebar-header {
    height: 64px;
    padding: 0 14px;
  }

  .logo {
    font-size: 1.04rem;
    gap: 10px;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .mobile-project-btn {
    display: none;
  }

  body.requirements-mode.mobile-project-inline-actions .mobile-project-btn {
    display: none;
  }

  .mobile-project-btn:active {
    transform: scale(0.98);
  }

  .sidebar-content {
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    z-index: 82;
    padding: 8px 12px 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid rgba(15, 23, 42, 0.04);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    transform-origin: top center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
  }

  .mobile-project-backdrop {
    display: block;
    position: fixed;
    inset: 64px 0 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.mobile-project-open .mobile-project-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-project-open .sidebar-content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .sidebar-section-title {
    margin: 0 0 8px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .project-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 2px;
  }

  .project-item {
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    transform: none;
  }

  .project-item:hover {
    transform: none;
  }

  .project-item.active {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border-color: transparent;
  }

  .project-item .icon {
    font-size: 0;
  }

  .project-item .count {
    font-size: 0.75rem;
    opacity: 0.9;
  }

  .add-project-btn {
    margin: 8px 0 0;
    width: 100%;
    border-style: solid;
    border-width: 1px;
    background: #ffffff;
    padding: 9px 12px;
    font-size: 0.82rem;
  }

  .main-content {
    overflow: visible;
  }

  .main-header {
    padding: 14px 12px 10px;
    gap: 8px;
    align-items: center;
  }

  .welcome-page {
    margin: 32px auto;
    padding: 52px 24px;
    max-width: min(100%, 620px);
  }

  .welcome-actions.compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .welcome-actions.compact .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 16px;
  }

  .btn-project-picker {
    background: #f8fafc;
  }

  .btn-project-switch {
    display: inline-flex;
    min-width: 0;
    padding: 9px 12px;
    gap: 6px;
  }

  .btn-project-switch span {
    white-space: nowrap;
  }

  .project-title {
    min-width: 0;
    flex: 1;
  }

  .project-title h1 {
    font-size: 1.12rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .main-header .header-actions {
    gap: 6px;
    padding: 4px;
  }

  .main-header .header-actions .btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .welcome-actions.compact .btn {
    font-size: 0.9rem;
  }

  .tabs {
    padding: 2px 12px 0;
    gap: 8px;
    border-bottom: none;
    top: 64px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tab {
    flex: 1;
    min-width: 84px;
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #eef2f7;
    font-size: 0.82rem;
    font-weight: 700;
  }

  .tab.active {
    border-color: #d1d5db;
    border-bottom-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  }

  .scroll-container {
    padding: 12px;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 12px 12px 10px;
    border-radius: 14px;
  }

  .stat-card .label {
    margin-bottom: 4px;
    font-size: 0.68rem;
  }

  .stat-card .value {
    font-size: 1.25rem;
  }

  .progress-section {
    margin-bottom: 16px;
  }

  .requirements-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .requirements-header h3 {
    font-size: 0.95rem;
  }

  .header-right {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
  }

  .status-filter {
    width: 100%;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 4px;
    background: #eef2f7;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 0.74rem;
    border-radius: 8px;
    white-space: nowrap;
  }

  .header-right .btn-export {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    min-height: 34px;
    padding: 7px 10px !important;
    border-radius: 10px !important;
    font-size: 0.8rem !important;
  }

  .header-right .btn-icon-only {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    padding: 0;
  }

  .header-right .btn-icon-only .svg-icon {
    width: 16px;
    height: 16px;
  }

  .module-card {
    margin-bottom: 10px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
  }

  .module-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 10px;
  }

  .module-drag-handle {
    font-size: 0.95rem;
    line-height: 1;
    padding-top: 1px;
  }

  .module-expand-icon {
    padding-top: 1px;
  }

  .module-info {
    min-width: 0;
    margin-right: auto;
  }

  .module-name {
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .module-meta {
    margin-top: 2px;
    font-size: 0.72rem;
    gap: 6px;
  }

  .module-mini-progress {
    display: none;
  }

  .module-actions {
    margin-top: 0;
    margin-left: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    justify-content: flex-end;
    gap: 5px;
  }

  .module-actions .btn {
    min-height: 30px;
    border-radius: 9px;
  }

  .module-actions .btn-primary {
    padding: 0 9px;
    font-size: 0.76rem;
    box-shadow: none;
  }

  .module-actions .btn-primary .svg-icon {
    width: 14px;
    height: 14px;
  }

  .module-actions .btn-icon {
    width: 30px;
    height: 30px;
  }

  .module-requirements {
    padding: 8px 8px 9px;
    border-top: 1px solid #f1f5f9;
    gap: 6px;
  }

  .requirement-item {
    display: grid;
    grid-template-columns: 10px 22px minmax(0, 1fr) auto;
    grid-template-areas:
      "drag check content actions"
      ". . tags actions";
    row-gap: 6px;
    column-gap: 7px;
    padding: 10px;
    border-radius: 12px;
  }

  .req-drag-handle {
    grid-area: drag;
    line-height: 1;
    padding-top: 4px;
    color: var(--text-light);
  }

  .req-checkbox {
    grid-area: check;
    width: 22px;
    height: 22px;
  }

  .req-content {
    grid-area: content;
    min-width: 0;
  }

  .req-title {
    font-size: 0.86rem;
    line-height: 1.25;
    margin-bottom: 0;
  }

  .req-desc {
    font-size: 0.76rem;
    line-height: 1.35;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .req-tags {
    grid-area: tags;
    margin-left: 0;
    width: auto;
    gap: 5px;
    flex-wrap: wrap;
  }

  .req-actions {
    grid-area: actions;
    opacity: 1;
    width: auto;
    justify-content: flex-end;
    align-items: flex-start;
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
    display: grid;
    grid-template-columns: repeat(2, 28px);
    gap: 4px;
  }

  .req-actions .btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    padding: 0;
  }

  .req-images {
    gap: 4px;
    margin-top: 6px;
  }

  .req-image-thumb,
  .req-image-more {
    width: 30px;
    height: 30px;
  }

  .req-attachments {
    margin-top: 5px;
    gap: 4px;
  }

  .req-attachments .req-attachment-chip:nth-child(n+2) {
    display: none;
  }

  .req-attachment-chip {
    max-width: 160px;
    padding: 2px 4px 2px 7px;
    gap: 5px;
    font-size: 0.68rem;
  }

  .req-attachment-download {
    min-width: 32px;
    height: 18px;
    font-size: 0.64rem;
  }

  .assignee-avatars .mini-avatar {
    width: 20px;
    height: 20px;
    font-size: 0.62rem;
    margin-left: -4px;
  }

  .tag {
    padding: 3px 7px;
    font-size: 0.68rem;
  }

  .notes-grid {
    display: block;
  }

  .note-card {
    width: 100%;
    margin-bottom: 12px;
    border-radius: 14px;
  }

  .note-header {
    padding: 12px 12px 10px;
  }

  .note-title {
    font-size: 0.9rem;
  }

  .note-actions {
    opacity: 1;
    gap: 6px;
  }

  .note-actions .btn-icon {
    width: 30px;
    height: 30px;
  }

  .note-content {
    padding: 10px 12px 10px;
    font-size: 0.82rem;
  }

  .note-image-item {
    width: 64px;
    height: 64px;
  }

  .members-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .member-card {
    padding: 12px;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: 88dvh;
    border-radius: 18px 18px 0 0;
    margin: 0;
    transform: translateY(24px);
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 14px 16px;
  }

  .modal-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .btn-group.compact {
    overflow-x: auto;
    padding: 4px;
  }

  .confirm-dialog {
    width: calc(100% - 24px);
    max-width: 360px;
    padding: 20px 18px;
    border-radius: 16px;
  }
}

@media (max-width: 420px) {
  .project-item {
    min-width: 140px;
  }

  .module-actions .btn-sm {
    padding: 6px 8px;
    font-size: 0.76rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}


@media (max-width: 900px) {
  .auth-gate {
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .auth-gate-panel {
    width: 100%;
    min-height: calc(100dvh - max(32px, env(safe-area-inset-top)) - max(32px, env(safe-area-inset-bottom)));
    grid-template-columns: 1fr;
    gap: 14px;
    align-content: start;
  }
  .auth-gate-card {
    order: 1;
  }
  .auth-gate-hero {
    order: 2;
  }
  .auth-gate-hero,
  .auth-gate-card {
    border-radius: 24px;
    padding: 22px;
  }
  .auth-gate-hero h1 {
    margin-top: 14px;
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }
  .auth-gate-hero p {
    margin-top: 12px;
    font-size: 0.92rem;
    line-height: 1.7;
  }
  .auth-gate-highlights {
    margin-top: 18px;
    gap: 10px;
  }
  .auth-gate-highlight {
    padding: 13px 14px;
    border-radius: 16px;
  }
}

@media (max-width: 640px) {
  .auth-gate {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }
  .auth-gate-panel {
    min-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
    gap: 12px;
  }
  .auth-gate-card,
  .auth-gate-hero {
    border-radius: 20px;
    padding: 18px;
  }
  .auth-gate-tabs {
    gap: 6px;
    padding: 4px;
    border-radius: 14px;
  }
  .auth-gate-tab {
    padding: 10px 8px;
    font-size: 0.9rem;
    border-radius: 12px;
  }
  .auth-gate-message {
    margin: 14px 2px 8px;
    min-height: 0;
    font-size: 0.82rem;
    line-height: 1.5;
  }
  .auth-gate-hero {
    background:
      radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 34%),
      linear-gradient(160deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.88));
  }
  .auth-gate-badge {
    padding: 6px 10px;
    font-size: 0.7rem;
  }
  .auth-gate-hero h1 {
    font-size: 1.45rem;
    line-height: 1.18;
  }
  .auth-gate-hero p {
    font-size: 0.86rem;
    line-height: 1.6;
  }
  .auth-gate-highlights {
    display: none;
  }
  .auth-gate-card .form-group {
    margin-bottom: 12px;
  }
  .auth-gate-submit {
    min-height: 46px;
    margin-top: 8px;
  }
  .auth-gate-switch {
    margin-top: 2px;
    font-size: 0.84rem;
  }
}

@media (max-height: 760px) and (max-width: 900px) {
  .auth-gate-hero {
    display: none;
  }
  .auth-gate-panel {
    min-height: auto;
  }
  .auth-gate-card {
    min-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  }
}

@media (max-width: 420px) {
  .welcome-actions.compact {
    grid-template-columns: 1fr;
  }
}
