:root {
  --brand: #2f6bff;
  --brand-dark: #1f56de;
  --brand-soft: #eaf0ff;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e6eaf2;
  --text: #18202f;
  --muted: #77839a;
  --muted-2: #9aa5b8;
  --green: #12a150;
  --green-soft: #e6f7ee;
  --red: #e5484d;
  --red-soft: #ffecec;
  --amber: #e08a00;
  --amber-soft: #fff5e0;
  --violet: #7a5af8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(24, 32, 47, 0.04), 0 8px 24px rgba(24, 32, 47, 0.06);
  --shadow-lg: 0 12px 48px rgba(24, 32, 47, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
p { margin: 0; }

.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.boot-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #6a8dff);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(47, 107, 255, 0.35);
}

/* ---------------- 布局 ---------------- */

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #6a8dff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--muted-2); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #4a5568;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
.nav-item:hover { background: #f5f7fb; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item .ico { width: 20px; text-align: center; font-size: 16px; }
.nav-item .count {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  padding: 1px 6px;
  font-weight: 600;
}

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.me-row:hover { background: #f5f7fb; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dfe8ff, #c9d8ff);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-name { font-weight: 600; font-size: 13px; }
.me-role { font-size: 11px; color: var(--muted-2); }

.main {
  margin-left: 232px;
  padding: 26px 32px 60px;
  max-width: 1180px;
}

.topbar { display: none; }
.bottom-nav { display: none; }

/* ---------------- 通用组件 ---------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.hello { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.15s;
}
.btn:hover { border-color: #cfd7e6; background: #fafbfe; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(47, 107, 255, 0.28); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f0f3f9; color: var(--text); }
.btn.danger { color: var(--red); border-color: #f3c9ca; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.card-title .more { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; cursor: pointer; }
.card-title .more:hover { color: var(--brand); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

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

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12); }
.textarea { min-height: 84px; resize: vertical; }
/* 可搜索的成员选择器 */
.combo { position: relative; min-width: 0; }
.combo-input { padding-right: 26px; }
.combo-pop {
  position: absolute;
  z-index: 70;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-width: 300px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.combo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.combo-item:hover, .combo-item.active { background: var(--brand-soft); }
.combo-item .avatar { width: 24px; height: 24px; font-size: 11px; }
.combo-name { font-weight: 550; }
.combo-dept {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo-empty { padding: 10px; text-align: center; color: var(--muted); font-size: 12px; }
.meta-box .combo-input { border: none; padding: 2px 0; font-weight: 550; background: transparent; }
.meta-box .combo-input:focus { box-shadow: none; }
.combo-filter { min-width: 132px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .req { color: var(--red); margin-left: 2px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  background: #f0f3f9;
  color: #5b6678;
  white-space: nowrap;
}
.chip.blue { background: var(--brand-soft); color: var(--brand-dark); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
}
.empty .emoji { font-size: 34px; margin-bottom: 8px; opacity: 0.8; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat b { font-size: 24px; letter-spacing: -0.5px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.red b { color: var(--red); }
.stat.blue b { color: var(--brand); }
.stat.green b { color: var(--green); }

/* ---------------- 任务行 ---------------- */

.task-list { display: flex; flex-direction: column; }
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid #f1f4f9;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: #fafbfe; }
.task-row.done .task-title { color: var(--muted-2); text-decoration: line-through; }

.check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.6px solid #c3ccdb;
  flex: none;
  margin-top: 1px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: transparent;
  transition: 0.15s;
}
.check:hover { border-color: var(--brand); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }

.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 550; font-size: 14px; line-height: 1.45; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; color: var(--muted-2); font-size: 12px; }
.task-meta .owner { color: var(--muted); }
.prio { width: 6px; height: 6px; border-radius: 50%; }
.prio.p0 { background: #b6c0d0; }
.prio.p1 { background: #8aa4d8; }
.prio.p2 { background: #f0a020; }
.prio.p3 { background: var(--red); }

/* ---------------- 应用卡片 ---------------- */

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.app-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
}
.app-card:hover { border-color: #cbd7f5; box-shadow: var(--shadow); transform: translateY(-1px); }
.app-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
}
.app-name { font-weight: 650; font-size: 15px; }
.app-desc { color: var(--muted); font-size: 12px; line-height: 1.5; flex: 1; }
.app-foot { display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 12px; }
.app-new {
  border: 1.5px dashed #ccd6e8;
  background: transparent;
  border-radius: var(--radius);
  min-height: 132px;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
}
.app-new:hover { border-color: var(--brand); color: var(--brand); background: #f8faff; }

/* ---------------- 应用详情 ---------------- */

.app-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.app-head .app-icon { width: 46px; height: 46px; font-size: 23px; }
.app-head h2 { font-size: 20px; }
.app-head .desc { color: var(--muted); font-size: 12px; margin-top: 3px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .grow { flex: 1; }
.toolbar .search { position: relative; min-width: 200px; flex: 1; max-width: 320px; }
.toolbar .search .input { padding-left: 34px; }
.toolbar .search .ico { position: absolute; left: 11px; top: 9px; color: var(--muted-2); font-size: 13px; }

.segmented { display: inline-flex; background: #eef1f7; border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.segmented button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fafbfe;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid #f1f4f9; font-size: 13px; vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: #fafbfe; }
.cell-title { font-weight: 550; }
.cell-sub { color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col { background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; width: 260px; flex: none; padding: 10px; }
.kanban-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-weight: 600; font-size: 13px; }
.kanban-head .n { margin-left: auto; color: var(--muted-2); font-weight: 400; font-size: 12px; }
.kanban-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: 0.12s;
}
.kanban-card:hover { border-color: #cbd7f5; box-shadow: 0 2px 8px rgba(24, 32, 47, 0.07); }
.kanban-card .t { font-size: 13px; font-weight: 550; line-height: 1.4; }
.kanban-card .m { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; align-items: center; }

.calendar { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted-2); padding: 8px 0; background: #fafbfe; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 92px; border-right: 1px solid #f1f4f9; border-bottom: 1px solid #f1f4f9; padding: 6px; font-size: 11px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.out { background: #fbfcfe; color: var(--muted-2); }
.cal-cell.today { background: #f5f8ff; }
.cal-day { font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.cal-cell.today .cal-day { color: var(--brand); }
.cal-item {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 5px;
  padding: 2px 5px;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.cal-item.overdue { background: var(--red-soft); color: var(--red); }
.cal-item.done { background: #eef1f6; color: var(--muted-2); text-decoration: line-through; }

/* ---------------- 抽屉 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.42);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.18s;
}
.overlay.show { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: #fff;
  z-index: 90;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
.drawer.show { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head .t { font-weight: 650; font-size: 15px; flex: 1; min-width: 0; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-hero { padding: 2px 0 0; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.hero-label { font-size: 11px; color: var(--muted-2); font-weight: 600; letter-spacing: 0.4px; margin-bottom: 4px; }
.drawer-title-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  padding: 2px 0 8px;
  outline: none;
}
.drawer-title-input::placeholder { color: #c3cad8; font-weight: 600; }
.drawer-title-input:disabled { color: var(--text); }
.status-line { display: flex; align-items: center; gap: 10px; padding: 8px 0 14px; }
.status-line-label { font-size: 11px; color: var(--muted-2); font-weight: 600; }
.status-line .status-pills { margin-bottom: 0; }
.d-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 24px 0 12px;
  letter-spacing: 0.3px;
}
.d-section-head .ico { font-size: 14px; }
.d-section-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.field-note { background: #f8faff; border: 1px solid #e6ecf7; border-radius: 12px; padding: 12px; }
.field-note label { color: var(--text); font-weight: 600; }
.field-note .textarea { min-height: 120px; background: #fff; border-color: #e2e8f4; line-height: 1.75; }
.url-input-row { display: flex; gap: 8px; align-items: center; }
.url-input-row .input { flex: 1; min-width: 0; }
.url-view { font-size: 13px; line-height: 1.6; word-break: break-all; }
.field-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.field-link:hover { text-decoration: underline; }
.meta-box { background: #fbfcfe; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; background: #fff; }
.drawer-foot .grow { flex: 1; }
.close-btn { border: none; background: #f2f4f9; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 16px; }

.status-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.status-pill {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
}
.status-pill.active { font-weight: 600; border-color: currentColor; background: #f7f9ff; }
.status-pill.active.todo { color: #5b6678; background: #f0f3f9; }
.status-pill.active.doing { color: var(--brand); background: var(--brand-soft); }
.status-pill.active.blocked { color: var(--red); background: var(--red-soft); }
.status-pill.active.done { color: var(--green); background: var(--green-soft); }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.meta-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.meta-box .k { font-size: 11px; color: var(--muted-2); margin-bottom: 3px; }
.meta-box .v { font-size: 13px; font-weight: 550; }

.section-label { font-size: 12px; color: var(--muted); font-weight: 600; margin: 20px 0 10px; letter-spacing: 0.3px; }

.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .body { flex: 1; }
.comment .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.comment .txt { font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

.timeline { border-left: 2px solid #eef1f7; margin-left: 6px; padding-left: 14px; }
.timeline-item { position: relative; padding-bottom: 14px; font-size: 12px; color: var(--muted); }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d7deec;
  border: 2px solid #fff;
}
.timeline-item b { color: var(--text); font-weight: 550; }

/* ---------------- 弹窗 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 16px;
  width: min(520px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head { padding: 18px 20px 6px; font-weight: 650; font-size: 16px; }
.modal-body { padding: 12px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------- 登录页 ---------------- */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, #e6eeff, #f4f6fa); }
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 34px 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card h1 { font-size: 20px; margin: 16px 0 8px; }
.login-card .boot-logo { margin: 0 auto; }
.user-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  margin-top: 10px;
  text-align: left;
}
.user-pick:hover { border-color: var(--brand); background: #f8faff; }

/* ---------------- 设计器 ---------------- */

.designer-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.field-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.field-item .grip { color: #c3ccdb; cursor: grab; }
.field-item .info { flex: 1; min-width: 0; }
.field-item .label { font-size: 13px; font-weight: 550; }
.field-item .type { font-size: 11px; color: var(--muted-2); }
.field-item .ops { display: flex; gap: 2px; }

/* ---------------- 统计 ---------------- */

.bar-row { display: grid; grid-template-columns: 90px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 12px; }
.bar-track { height: 8px; background: #eef1f7; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand); }
.bar-fill.green { background: var(--green); }
.bar-fill.amber { background: var(--amber); }
.bar-fill.red { background: var(--red); }
.bar-num { text-align: right; color: var(--muted); }

.ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none; }
.ring::after { content: ""; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.ring .val { position: relative; z-index: 1; font-weight: 700; font-size: 20px; }

/* ---------------- 我的 / 设置 ---------------- */

.profile-card { display: flex; align-items: center; gap: 14px; padding: 20px; }
.profile-card .avatar { width: 54px; height: 54px; font-size: 20px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f1f4f9; }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-size: 13px; font-weight: 550; }
.list-row .s { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; word-break: break-all; }

/* 参与人：字段内直接搜索 */
.multi-combo {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
}
.multi-combo:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12); }
.multi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.multi-input { border: none; padding: 4px 2px; flex: 1; min-width: 140px; box-shadow: none; background: transparent; }
.multi-input:focus { box-shadow: none; }
.multi-x { margin-left: 4px; cursor: pointer; font-weight: 400; color: var(--muted); }
.multi-pop {
  position: absolute;
  z-index: 70;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}
.multi-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.multi-item:hover, .multi-item.on { background: var(--brand-soft); }
.multi-check { width: 16px; text-align: center; color: var(--brand); }

/* 统一人员选择器：负责人 / 参与人 / 成员字段 / 筛选 */
.person-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
}
.person-picker:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-input {
  border: none;
  flex: 1;
  min-width: 140px;
  padding: 4px 2px;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 14px;
  box-shadow: none;
}
.pp-x { margin-left: 4px; cursor: pointer; font-weight: 400; color: var(--muted); }
.pp-pop {
  position: absolute;
  z-index: 70;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}
.pp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.pp-item:hover { background: var(--brand-soft); }
.pp-check { width: 16px; text-align: center; color: var(--brand); }
.pp-name { flex: 1; }
.pp-filter { min-width: 132px; }
.meta-box .person-picker { border: none; padding: 0; background: transparent; }
.meta-box .pp-input { padding: 2px 0; font-weight: 550; }

.weekly-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.8;
  background: var(--bg-2);
  border-radius: 10px;
  padding: 14px;
  margin: 0;
  max-height: 60vh;
  overflow: auto;
  font-family: inherit;
}

.danger-zone { margin-top: 16px; border-color: #f3d6d6; background: #fffafa; }
.danger-title { font-weight: 700; color: var(--red); margin-bottom: 8px; }
.delete-warn {
  background: var(--red-soft);
  border: 1px solid #f3d6d6;
  color: #8a2c2c;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
}
.archive-banner {
  background: #fff8e6;
  border: 1px solid #f2dfae;
  color: #8a6a1f;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.app-card.archived { opacity: 0.72; }
.app-card.archived:hover { opacity: 1; }

/* ---------------- 子任务 / 树 ---------------- */

.parent-link { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.parent-link a { color: var(--brand); cursor: pointer; }
.subtask-list { margin-bottom: 10px; }
.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress-row .bar-track { flex: 1; }
.parent-picker {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
}
.parent-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.parent-option:hover { background: #f7f9fd; }
.po-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-owner { color: var(--muted-2); font-size: 11px; }
.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
}
.subtask-row:hover { background: #fafbfe; }
.subtask-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-toggle {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  padding: 0 4px 0 0;
  line-height: 1;
}
.tree-dot { color: var(--muted-2); font-size: 11px; margin-right: 2px; }

/* ---------------- 通讯录 ---------------- */

.contact-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 10px;
  overflow: hidden;
}
.contact-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.contact-group-head:hover { background: #fafbfe; }
.contact-group-head .chev {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted-2);
  transition: transform 0.15s;
  flex: none;
}
.contact-group-head .chev.closed { transform: rotate(-90deg); }
.contact-group.nested { border: none; background: transparent; border-radius: 0; margin: 0; }
.contact-children { margin-left: 22px; border-left: 1px solid #eef1f7; padding-left: 4px; }
.contact-children .contact-group { border: none; background: transparent; margin: 0; }
.contact-children .contact-group-head { padding-top: 9px; padding-bottom: 9px; }
.contact-children .contact-list { border-top: none; }
.contact-group-head .gname { font-weight: 600; font-size: 14px; }
.mini-link { color: var(--brand); font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.mini-link:hover { background: var(--brand-soft); }
.contact-list { border-top: 1px solid #f1f4f9; }
.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #f6f8fc;
}
.contact-row:last-child { border-bottom: none; }
.contact-row .c-main { flex: 1; min-width: 0; }
.contact-row .c-name { font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.contact-row .c-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.c-role { width: auto; padding: 4px 8px; font-size: 12px; }
.contact-empty { padding: 14px 16px; color: var(--muted-2); font-size: 12px; }

.group-picker {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.pick-row:hover { background: #f7f9fd; }
.pick-row input { margin: 0; }
.pick-name { font-weight: 550; }
.pick-dept { margin-left: auto; color: var(--muted-2); font-size: 11px; }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 12px);
  background: rgba(24, 32, 47, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 200;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 移动端 ---------------- */

@media (max-width: 880px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 0 14px calc(84px + env(safe-area-inset-bottom)); }

  .topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(244, 246, 250, 0.92);
    backdrop-filter: blur(12px);
    padding: 12px 2px 10px;
    align-items: center;
    gap: 10px;
  }
  .topbar .title { font-size: 17px; font-weight: 700; flex: 1; }
  .topbar .btn { padding: 6px 10px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    z-index: 50;
  }
  .bottom-nav button {
    flex: 1;
    border: none;
    background: none;
    color: var(--muted-2);
    font-size: 10.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
    cursor: pointer;
    position: relative;
  }
  .bottom-nav button .ico { font-size: 19px; }
  .bottom-nav button.active { color: var(--brand); }
  .bottom-nav .count {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: 6px;
    background: var(--red);
    color: #fff;
    border-radius: 99px;
    font-size: 10px;
    padding: 0 5px;
    min-width: 15px;
  }

  .hello { font-size: 20px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 11px 13px; }
  .stat b { font-size: 20px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .designer-grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .app-card { padding: 14px; min-height: 118px; }
  .app-new { min-height: 118px; }
  .app-head h2 { font-size: 18px; }

  .drawer { top: auto; height: 92vh; width: 100%; border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .drawer.show { transform: none; }
  .drawer-head { padding: 12px 16px; }
  .drawer-body { padding: 16px; }
  .drawer-title-input { font-size: 19px; }
  .d-section-head { margin: 20px 0 10px; }
  .field-note { padding: 10px; }
  .drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }

  .kanban-col { width: 78vw; }
  .cal-cell { min-height: 64px; }
  .cal-item { font-size: 10px; }

  .toast { bottom: 96px; }
}

@media (min-width: 881px) {
  .show-mobile { display: none !important; }
}
@media (max-width: 880px) {
  .hide-mobile { display: none !important; }
}

/* 打印/动效 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
