/* ========================================
   任务看板 H5 应用样式
   移动端优先设计
   ======================================== */

/* === CSS 变量 - 主题色 === */
:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --bg: #f8f9fb;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --info: #2563eb;
  --info-bg: #dbeafe;
  --gray-bg: #f3f4f6;
  --gray-text: #6b7280;

  /* 优先级颜色 */
  --priority-a-bg: #fee2e2;
  --priority-a-text: #dc2626;
  --priority-b-bg: #dbeafe;
  --priority-b-text: #2563eb;
  --priority-c-bg: #fef3c7;
  --priority-c-text: #d97706;
  --priority-d-bg: #f3f4f6;
  --priority-d-text: #6b7280;

  /* 状态颜色 */
  --status-inbox: #6b7280;
  --status-pending: #2563eb;
  --status-in-progress: #d97706;
  --status-pending-review: #7c3aed;
  --status-completed: #16a34a;

  /* 尺寸 */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-fab: 0 4px 12px rgba(37, 99, 235, 0.4);
  --header-height: 56px;
  --tab-height: 48px;
  --max-width: 480px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
}

/* === 基础重置 === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

img {
  max-width: 100%;
}

/* === 加载屏 === */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 9999;
}

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

.loading-text {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

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

/* === 主内容区 === */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* === 顶部头部 === */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

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

.app-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

/* === 顶部Tab导航 === */
.tab-nav {
  position: sticky;
  top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  z-index: 99;
  display: flex;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  height: var(--tab-height);
}

.tab-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.2s;
  padding: 0 4px;
}

.tab-item.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === 视图切换栏 === */
.view-switcher {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.view-btn {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--gray-bg);
  transition: all 0.2s;
}

.view-btn.active {
  background: var(--primary);
  color: #fff;
}

/* === 内容区 === */
.content-area {
  padding: 12px 16px 100px;
}

/* === 统计卡片 === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.info .stat-value { color: var(--info); }

/* === 看板列 === */
.board-column {
  margin-bottom: 16px;
}

.board-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.board-column-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.inbox { background: var(--status-inbox); }
.status-dot.pending { background: var(--status-pending); }
.status-dot.in_progress { background: var(--status-in-progress); }
.status-dot.pending_review { background: var(--status-pending-review); }
.status-dot.completed { background: var(--status-completed); }

.board-column-count {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--gray-bg);
  padding: 1px 8px;
  border-radius: 10px;
}

/* === 任务卡片 === */
.task-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}

.task-card:active {
  transform: scale(0.98);
}

.task-card.overdue {
  border-color: var(--danger);
  border-width: 2px;
}

.task-card-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.task-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* 超期徽章 */
.overdue-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--danger);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.task-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

/* 任务描述（截断1行） */
.task-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-bottom: 4px;
  padding-left: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 快捷操作栏 */
.task-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  gap: 6px;
}

.quick-add-log-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 22px;
  white-space: nowrap;
}

.quick-add-log-btn:active {
  transform: scale(0.95);
}

.quick-add-log-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* 快捷节点输入区 */
.quick-log-input-wrap {
  margin-top: 6px;
  padding: 6px 0;
  border-top: 1px dashed var(--border);
}

.quick-log-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  outline: none;
  transition: border-color 0.15s;
}

.quick-log-input:focus {
  border-color: var(--primary);
}

.quick-log-input::placeholder {
  color: var(--text-tertiary);
  font-size: 12px;
}

.task-card-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.task-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-meta-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.task-due-date.overdue-text {
  color: var(--danger);
  font-weight: 500;
}

.task-due-date.near-due {
  color: var(--warning);
  font-weight: 500;
}

/* === 优先级徽章 === */
.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.priority-badge.A {
  background: var(--priority-a-bg);
  color: var(--priority-a-text);
}

.priority-badge.B {
  background: var(--priority-b-bg);
  color: var(--priority-b-text);
}

.priority-badge.C {
  background: var(--priority-c-bg);
  color: var(--priority-c-text);
}

.priority-badge.D {
  background: var(--priority-d-bg);
  color: var(--priority-d-text);
}

/* === 分组标题 === */
.group-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 12px 4px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-header .group-count {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--gray-bg);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 400;
}

/* === 浮动按钮 === */
.fab {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 90;
  transition: transform 0.2s;
}

.fab:active {
  transform: translateX(-50%) scale(0.92);
}

/* === 模态框 === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--card-bg);
  width: 100%;
  max-width: var(--max-width);
  max-height: 90vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  -webkit-overflow-scrolling: touch;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 10;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-secondary);
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-close:active {
  background: var(--gray-bg);
}

.modal-body {
  padding: 16px;
}

/* === 创建任务表单 === */
.create-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.create-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--bg);
}

.create-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.create-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
  resize: none;
}

.create-textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.create-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* === 模板区 === */
.template-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.template-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-loading {
  font-size: 12px;
  color: var(--text-tertiary);
}

.template-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 20px;
  font-size: 13px;
  transition: all 0.2s;
}

.template-btn:active {
  transform: scale(0.95);
}

.template-btn:disabled {
  opacity: 0.5;
}

/* === 表单通用 === */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
}

.form-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.priority-selector {
  display: flex;
  gap: 8px;
}

.priority-option {
  flex: 1;
  height: 40px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.priority-option.active.A {
  border-color: var(--priority-a-text);
  background: var(--priority-a-bg);
  color: var(--priority-a-text);
}

.priority-option.active.B {
  border-color: var(--priority-b-text);
  background: var(--priority-b-bg);
  color: var(--priority-b-text);
}

.priority-option.active.C {
  border-color: var(--priority-c-text);
  background: var(--priority-c-bg);
  color: var(--priority-c-text);
}

.priority-option.active.D {
  border-color: var(--priority-d-text);
  background: var(--priority-d-bg);
  color: var(--priority-d-text);
}

/* === 按钮 === */
.btn-primary {
  height: 44px;
  min-width: 80px;
  padding: 0 20px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.btn-primary:active {
  opacity: 0.85;
}

.btn-primary:disabled {
  opacity: 0.5;
}

.btn-secondary {
  height: 44px;
  min-width: 80px;
  padding: 0 20px;
  background: var(--gray-bg);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn-secondary:active {
  opacity: 0.7;
}

.btn-text {
  height: 44px;
  padding: 0 12px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
}

.btn-danger {
  height: 44px;
  min-width: 80px;
  padding: 0 20px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}

.btn-block {
  width: 100%;
}

/* === 任务详情 === */
.detail-modal-content {
  max-height: 92vh;
}

.detail-header {
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px 0;
}

.detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.detail-title-input {
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  border: none;
  border-bottom: 2px solid var(--primary);
  padding: 4px 0;
  margin-bottom: 12px;
  background: transparent;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.detail-info-label {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.detail-info-value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

/* 状态流转按钮 */
.status-flow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.status-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.status-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.status-btn:active {
  transform: scale(0.95);
}

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
}

.timeline-content {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
  word-break: break-word;
}

.timeline-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.progress-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.progress-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
}

.progress-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.progress-submit {
  height: 40px;
  width: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 链接列表 */
.link-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--primary);
  word-break: break-all;
}

.link-item a {
  color: var(--primary);
  text-decoration: none;
}

/* 执行人/观察者标签 */
.person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.person-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--gray-bg);
  border-radius: 16px;
  font-size: 12px;
  color: var(--text);
}

.person-tag .person-role {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* === 周报页面 === */
.report-date-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.report-date-input {
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
}

.report-nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gray-bg);
  color: var(--text-secondary);
  font-size: 16px;
}

.report-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.report-stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  text-align: center;
}

.report-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.report-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.report-stat-card.success .report-stat-value { color: var(--success); }
.report-stat-card.warning .report-stat-value { color: var(--warning); }
.report-stat-card.danger .report-stat-value { color: var(--danger); }
.report-stat-card.info .report-stat-value { color: var(--info); }

/* 完成率进度条 */
.completion-bar-wrapper {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.completion-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.completion-bar-label {
  font-size: 14px;
  font-weight: 600;
}

.completion-bar-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.completion-bar {
  width: 100%;
  height: 10px;
  background: var(--gray-bg);
  border-radius: 5px;
  overflow: hidden;
}

.completion-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 5px;
  transition: width 0.5s ease-out;
}

/* 周报Tab */
.report-tabs {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.report-tab {
  flex: 1;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.report-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* 团队排名 */
.member-ranking {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.ranking-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--gray-bg);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.ranking-rank.top1 { background: #fde68a; color: #92400e; }
.ranking-rank.top2 { background: #e5e7eb; color: #4b5563; }
.ranking-rank.top3 { background: #fed7aa; color: #9a3412; }

.ranking-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.ranking-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.ranking-rate {
  font-weight: 600;
  color: var(--primary);
}

/* 四象限分布 */
.quadrant-dist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.quadrant-dist-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid;
}

.quadrant-dist-item.A { border-top-color: var(--priority-a-text); }
.quadrant-dist-item.B { border-top-color: var(--priority-b-text); }
.quadrant-dist-item.C { border-top-color: var(--priority-c-text); }
.quadrant-dist-item.D { border-top-color: var(--priority-d-text); }

.quadrant-dist-value {
  font-size: 22px;
  font-weight: 700;
}

.quadrant-dist-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* === 四象限视图 === */
.quadrant-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  min-height: calc(100vh - 200px);
}

.quadrant-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  border-top: 3px solid;
  display: flex;
  flex-direction: column;
}

.quadrant-box.A {
  border-top-color: var(--priority-a-text);
  background: linear-gradient(180deg, var(--priority-a-bg) 0%, var(--card-bg) 30%);
}

.quadrant-box.B {
  border-top-color: var(--priority-b-text);
  background: linear-gradient(180deg, var(--priority-b-bg) 0%, var(--card-bg) 30%);
}

.quadrant-box.C {
  border-top-color: var(--priority-c-text);
  background: linear-gradient(180deg, var(--priority-c-bg) 0%, var(--card-bg) 30%);
}

.quadrant-box.D {
  border-top-color: var(--priority-d-text);
  background: linear-gradient(180deg, var(--priority-d-bg) 0%, var(--card-bg) 30%);
}

.quadrant-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.quadrant-box-title {
  font-size: 13px;
  font-weight: 700;
}

.quadrant-box-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.quadrant-task-item {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.3;
}

.quadrant-task-item:active {
  background: rgba(255, 255, 255, 0.9);
}

.quadrant-task-item .quadrant-task-title {
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quadrant-task-item .quadrant-task-meta {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* === 空状态 === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gray-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-tertiary);
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 46, 0.9);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 300;
  white-space: nowrap;
  animation: toastIn 0.3s;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* === 下拉刷新指示器 === */
.pull-refresh-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.2s;
}

.pull-refresh-indicator.visible {
  height: 50px;
}

.pull-refresh-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* === 加载更多 === */
.loading-more {
  text-align: center;
  padding: 16px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.loading-more .loading-spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

/* === 进度指示器 === */
.inline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.inline-loading .loading-spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

/* === PC端适配 === */
@media (min-width: 481px) {
  body {
    background: #e5e7eb;
  }

  .main-content {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
  }

  .modal-overlay {
    align-items: center;
  }

  .modal-content {
    border-radius: var(--radius-lg);
    max-height: 85vh;
  }
}

/* === 任务卡片进度条 === */
.task-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--gray-bg);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.task-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s;
}

/* === 子任务标记 === */
.subtask-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* === 详情页编辑模式 === */
.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* === 滚动条隐藏 === */
.modal-content::-webkit-scrollbar {
  width: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* === 状态标签 === */
.status-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.status-tag.inbox { background: var(--gray-bg); color: var(--status-inbox); }
.status-tag.pending { background: var(--info-bg); color: var(--status-pending); }
.status-tag.in_progress { background: var(--warning-bg); color: var(--status-in-progress); }
.status-tag.pending_review { background: #f3e8ff; color: var(--status-pending-review); }
.status-tag.completed { background: var(--success-bg); color: var(--status-completed); }
