* { box-sizing: border-box; }
body {
  background: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
}

/* ===================== 顶部导航 ===================== */
.top-navbar {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.top-navbar .brand { font-weight: 600; font-size: 16px; display:flex; align-items:center; gap:8px; }
.top-navbar .user-chip {
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.icon-btn {
  background: none; border: none; color: #fff; font-size: 20px;
  width: 36px; height: 36px; display:flex; align-items:center; justify-content:center;
  border-radius: 50%;
}
.icon-btn:active { background: rgba(255,255,255,.2); }

/* ===================== 侧边抽屉（移动端） ===================== */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 1040; opacity:0; pointer-events:none; transition: opacity .25s;
}
.drawer-backdrop.show { opacity:1; pointer-events:auto; }

.drawer {
  position: fixed; top:0; left:0; bottom:0; width: 78%; max-width: 300px;
  background: #1e293b; color:#fff; z-index:1050;
  transform: translateX(-100%); transition: transform .28s ease;
  display:flex; flex-direction:column; padding: 20px 16px;
  box-shadow: 4px 0 20px rgba(0,0,0,.2);
  overflow-y: auto;
}
.drawer.show { transform: translateX(0); }
.drawer .drawer-header { display:flex; align-items:center; gap:10px; margin-bottom: 24px; padding-bottom:16px; border-bottom:1px solid rgba(255,255,255,.1); }
.drawer .avatar {
  width:44px; height:44px; border-radius:50%; background:#2563eb;
  display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:600;
  flex-shrink: 0;
}
.drawer-nav { display:flex; flex-direction:column; gap:4px; }
.drawer-nav a {
  color:#cbd5e1; text-decoration:none; padding:12px 14px; border-radius:10px;
  display:flex; align-items:center; gap:10px; font-size:15px; cursor:pointer;
}
.drawer-nav a.active, .drawer-nav a:active { background:#334155; color:#fff; }
.drawer-footer { margin-top:auto; padding-top:16px; border-top:1px solid rgba(255,255,255,.1); }

/* ===================== 底部Tab导航（移动端主导航） ===================== */
.bottom-tabbar {
  position: fixed; left:0; right:0; bottom:0; z-index:1030;
  background:#fff; display:flex; border-top:1px solid #e5e7eb;
  box-shadow: 0 -2px 10px rgba(0,0,0,.05);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-tabbar a {
  flex:1; text-align:center; padding:8px 0 6px; text-decoration:none;
  color:#94a3b8; font-size:11px; display:flex; flex-direction:column; align-items:center; gap:2px;
  cursor:pointer;
}
.bottom-tabbar a .tab-icon { font-size:20px; }
.bottom-tabbar a.active { color:#2563eb; }

/* 桌面端侧边栏 */
.desktop-sidebar { display:none; }
@media (min-width: 992px) {
  .bottom-tabbar { display:none; }
  .top-navbar .mobile-menu-btn { display:none; }
  .desktop-sidebar {
    display:flex; flex-direction:column; width:220px; min-height:calc(100vh - 56px);
    background:#1e293b; padding:20px 14px; flex-shrink:0;
  }
  .desktop-sidebar .nav-link { color:#cbd5e1; padding:10px 14px; border-radius:8px; margin-bottom:4px; font-size:14px; cursor:pointer; text-decoration:none; }
  .desktop-sidebar .nav-link.active, .desktop-sidebar .nav-link:hover { color:#fff; background:#334155; }
  .layout-wrap { display:flex; }
}

.page-content {
  padding: 14px;
  padding-bottom: 76px;
}
@media (min-width: 992px) {
  .page-content { padding: 20px; padding-bottom:20px; width:100%; }
}

/* ===================== 通用卡片/状态样式 ===================== */
.task-completed { text-decoration: line-through; color:#9ca3af; }
.badge-urgent { background:#dc2626; }
.badge-high { background:#f97316; }
.badge-medium { background:#2563eb; }
.badge-low { background:#64748b; }
.overdue-row { background:#fef2f2 !important; }
.card-stat { border-left:4px solid #2563eb; border-radius:12px; }

/* ===================== 任务卡片（移动端列表） ===================== */
.task-card {
  background:#fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); border-left: 4px solid #2563eb; cursor:pointer;
}
.task-card.priority-urgent { border-left-color:#dc2626; }
.task-card.priority-high { border-left-color:#f97316; }
.task-card.priority-medium { border-left-color:#2563eb; }
.task-card.priority-low { border-left-color:#64748b; }
.task-card.overdue { background:#fff7f7; }
.task-card .tc-title { font-size:15px; font-weight:600; color:#1e293b; margin-bottom:4px; }
.task-card .tc-meta { font-size:12.5px; color:#64748b; display:flex; flex-wrap:wrap; gap:4px 10px; margin-bottom:6px; }
.task-card .tc-footer { display:flex; justify-content:space-between; align-items:center; font-size:12.5px; flex-wrap:wrap; gap:6px; }
.task-card .tc-assignee { color:#2563eb; font-weight:600; }

.desktop-table { display:none; }
.mobile-cards { display:block; }
@media (min-width: 992px) {
  .desktop-table { display:block; }
  .mobile-cards { display:none; }
}

/* 筛选栏移动端优化：横向滚动 */
.filter-scroll {
  display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; -webkit-overflow-scrolling:touch;
}
.filter-scroll::-webkit-scrollbar { display:none; }
.filter-scroll select, .filter-scroll input { min-width:120px; flex-shrink:0; }

/* 浮动新建按钮（移动端） */
.fab-btn {
  position: fixed; right:18px; bottom:84px; z-index:1025;
  width:52px; height:52px; border-radius:50%; background:#2563eb; color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:26px; border:none;
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}
@media (min-width: 992px) { .fab-btn { display:none; } }

/* ===================== 任务详情页 ===================== */
.detail-header-card {
  background:#fff; border-radius:14px; padding:16px; margin-bottom:14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.detail-header-card h5 { font-size:17px; margin-bottom:10px; word-break:break-all; }
.detail-meta-grid {
  display:grid; grid-template-columns: 1fr 1fr; gap:8px 12px;
  font-size:13px; color:#64748b; margin:12px 0;
}
.detail-meta-grid .full { grid-column: span 2; }
.detail-meta-grid b { color:#334155; }
.detail-desc {
  background:#f8fafc; border-radius:10px; padding:12px; font-size:13.5px; color:#475569;
  white-space:pre-wrap; margin-bottom:0;
}

/* 操作按钮区：移动端横向滚动，桌面端正常排列 */
.action-scroll {
  display:flex; gap:8px; overflow-x:auto; padding:2px 2px 8px; -webkit-overflow-scrolling:touch;
}
.action-scroll::-webkit-scrollbar { display:none; }
.action-scroll .btn { flex-shrink:0; white-space:nowrap; }

/* Tab 切换（备注/照片/日志） */
.detail-tabs {
  display:flex; background:#fff; border-radius:12px; padding:4px; margin-bottom:12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.detail-tabs a {
  flex:1; text-align:center; padding:9px 0; border-radius:9px; font-size:13.5px;
  color:#64748b; cursor:pointer; text-decoration:none;
}
.detail-tabs a.active { background:#2563eb; color:#fff; font-weight:600; }

.tab-panel { background:#fff; border-radius:12px; padding:14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }

/* 备注列表 */
.comment-item { padding:10px 0; border-bottom:1px solid #f1f5f9; }
.comment-item:last-child { border-bottom:none; }
.comment-item .c-name { font-weight:600; font-size:13.5px; color:#1e293b; }
.comment-item .c-time { font-size:11.5px; color:#94a3b8; margin-left:8px; }
.comment-item .c-content { font-size:14px; color:#334155; margin-top:4px; }

/* 照片网格 */
.photo-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:8px; }
.photo-grid .photo-item img { width:100%; height:100px; object-fit:cover; border-radius:8px; border:1px solid #e5e7eb; }
.photo-grid .photo-item .p-meta { font-size:10.5px; color:#94a3b8; text-align:center; margin-top:2px; }
.upload-btn-wrap {
  border: 2px dashed #cbd5e1; border-radius:10px; padding:20px; text-align:center;
  color:#94a3b8; font-size:13px; margin-bottom:12px; position:relative; cursor:pointer;
}
.upload-btn-wrap input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; }

/* 日志列表 */
.log-item { display:flex; gap:10px; padding:10px 0; border-bottom:1px solid #f1f5f9; font-size:13px; }
.log-item:last-child { border-bottom:none; }
.log-item .log-dot { width:8px; height:8px; border-radius:50%; background:#2563eb; margin-top:5px; flex-shrink:0; }
.log-item .log-time { color:#94a3b8; font-size:11.5px; }
.log-item .log-content { color:#334155; }

/* 移动端全屏Modal */
@media (max-width: 991px) {
  .modal.show { padding:0 !important; }
  .modal-dialog { margin:0; max-width:100%; height:100vh; display:flex; align-items:flex-end; }
  .modal-content { width:100%; max-height:92vh; border-radius:16px 16px 0 0; overflow-y:auto; }
}

/* 评论输入固定底部 */
.comment-input-bar {
  position: sticky; bottom:-14px; background:#fff; padding:10px 0 2px; margin-top:10px;
  display:flex; gap:8px; border-top:1px solid #f1f5f9;
}

/* 表单label */
.form-label { font-size:13px; font-weight:600; color:#475569; margin-bottom:4px; }