/* ============================================================
   detective.css — 项目任务图 = 侦探板
   软木板上钉着任务便笺；依赖是红色牵丝（两端图钉）；
   为任务提交的文件像包裹/照片一样钉在任务旁，用麻绳连到任务卡。
   只改外观，交互与数据逻辑沿用 boarddeps.js。
   ============================================================ */
.tg-board {
  --tg-canvas: #6E4E33;
  --tg-grid: rgba(255, 240, 210, .10);
  --tg-boundary: rgba(255, 238, 205, .55);
  --dv-paper: #FBF6EA;
  --dv-ink: #1E1B16;
  --dv-red: #C2271F;
  --dv-twine: #8A6A3E;
  font-size: 14px;
}

/* 软木板：暖棕底 + 细颗粒 + 四角暗角 */
.tg-board .tg-viewport {
  background-color: #7A5737;
  background-image:
    radial-gradient(ellipse at 50% 40%, rgba(255, 220, 160, .10), transparent 60%),
    radial-gradient(rgba(40, 22, 8, .20) 1.2px, transparent 1.3px),
    radial-gradient(rgba(255, 230, 180, .08) 1px, transparent 1.1px),
    linear-gradient(180deg, #84603F, #6B4B2F);
  background-size: 100% 100%, 9px 9px, 13px 13px, 100% 100%;
  background-position: 0 0, 0 0, 4px 6px, 0 0;
  box-shadow: inset 0 0 0 10px #3B2A1C, inset 0 0 0 12px #241912, inset 0 0 80px rgba(20, 10, 0, .45);
  border-radius: 10px;
}
.tg-board .tg-canvas-caption {
  color: #F3E6CF; background: rgba(30, 20, 10, .55); border-radius: 6px; padding: 4px 10px;
  font-size: 12.5px; letter-spacing: .02em;
}

/* 模块区域：粉笔圈出来的分区 */
.tg-board .tg-engineering {
  border: 2px dashed rgba(255, 240, 215, .45); border-radius: 14px;
  background: rgba(255, 240, 215, .04);
}
.tg-board .tg-engineering header,
.tg-board .tg-engineering header .tg-group-name { color: #FFF3DC; }
.tg-board .tg-engineering header .tg-group-name { font-family: var(--case-serif); font-size: 17px; font-weight: 700; }
.tg-board .tg-engineering header span, .tg-board .tg-engineering header small { color: rgba(255, 243, 220, .78); }
.tg-board .tg-engineering header button { color: #FFF3DC; border-color: rgba(255, 240, 215, .45); background: rgba(30, 20, 10, .35); }
.tg-board .tg-day { border-top: 1px dashed rgba(255, 240, 215, .22); background: rgba(255, 240, 215, .03); }
.tg-board .tg-day span {
  color: #2A1F14; background: #F1E3C4; font-family: var(--case-mono); font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 2px; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); transform: rotate(-2deg); display: inline-block;
}

/* 任务卡：钉在板上的便笺纸 */
.tg-board .tg-task {
  padding: 16px 13px 10px; gap: 7px;
  background: var(--dv-paper);
  border: 0; border-top: 5px solid var(--tg-owner);
  border-radius: 2px 2px 4px 4px;
  color: var(--dv-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 6px 12px rgba(25, 12, 0, .35), 0 1px 2px rgba(25, 12, 0, .3);
  transform: rotate(var(--dv-tilt, 0deg));
}
.tg-board .tg-task:nth-of-type(3n) { --dv-tilt: -.9deg; }
.tg-board .tg-task:nth-of-type(3n+1) { --dv-tilt: .7deg; }
.tg-board .tg-task:nth-of-type(5n+2) { --dv-tilt: -.4deg; }
.tg-board .tg-task::before { /* 图钉 */
  content: ''; position: absolute; left: 50%; top: -7px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FF8B80, var(--dv-red) 55%, #6E0F0A);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .45);
}
.tg-board .tg-task:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 12px 22px rgba(25, 12, 0, .42); transform: rotate(0deg) translateY(-2px); z-index: 4; }
.tg-board .tg-task.selected { outline: 3px solid #FFD36B; outline-offset: 5px; transform: rotate(0deg); z-index: 5; }
.tg-board .tg-task > strong { font-size: 15px; line-height: 1.45; font-weight: 700; -webkit-line-clamp: 3; }
.tg-board .tg-node-top { font-size: 12px; font-family: var(--case-mono); color: #6A5E4D; }
.tg-board .tg-node-time, .tg-board .tg-node-span { font-size: 12.5px; color: #4E4639; }
.tg-board .tg-node-span { font-family: var(--case-mono); }
.tg-board .tg-person { font-size: 12.5px; }
.tg-board .tg-overdue { color: var(--dv-red) !important; font-weight: 700; }
.tg-board .tg-task.dimmed { opacity: .28; }
.tg-ev-count {
  font-family: var(--case-mono); font-size: 11.5px; padding: 0 6px; border-radius: 3px;
  background: #E3CFA6; color: #4A3416; margin-left: auto; margin-right: 6px;
}

/* 依赖：红色牵丝 + 图钉 */
.tg-board .tg-edge { stroke: var(--dv-red); stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 2px 1.5px rgba(20, 8, 0, .45)); }
.tg-board .tg-edge.highlight { stroke: #FF5A4B; stroke-width: 3.4; }
.tg-board .tg-edge.tg-edge-severe { stroke: #FF2E1F; stroke-dasharray: 7 4; }
.tg-board .tg-edge.tg-edge-overlap { stroke: #E79A2A; stroke-dasharray: 7 4; }
.tg-board .tg-edge-dim .tg-edge, .tg-board .tg-edge-dim .tg-pin { opacity: .2; }
.tg-pin { fill: #D9D2C3; stroke: #3A2E20; stroke-width: 1.2; filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, .5)); }
.tg-board .tg-edge-label { fill: #FFF3DC; stroke: #3B2A1C; }

/* 证物：麻绳把包裹/照片连到任务卡 */
.ev-twine { fill: none; stroke: var(--dv-twine); stroke-width: 1.6; stroke-dasharray: 1 0; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.ev-pin { position: absolute; z-index: 3; width: 116px; transform: rotate(var(--tilt, 0deg)); transition: transform .15s; }
.ev-pin:hover { transform: rotate(0deg) scale(1.06); z-index: 6; }
.ev-pin.dimmed { opacity: .28; }
.ev-pin::before { /* 别针 */
  content: ''; position: absolute; left: 8px; top: -5px; width: 9px; height: 9px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 35%, #F2F0EA, #9B968B 60%, #4E4A43); box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.ev-parcel {
  position: relative; display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: #2E2214; padding: 7px 8px 6px; border: 0; border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 46%, rgba(120, 85, 40, .35) 46% 54%, transparent 54%),
    linear-gradient(180deg, #D8BC8A, #C7A570);
  box-shadow: 0 4px 8px rgba(20, 8, 0, .4), inset 0 0 0 1px rgba(90, 60, 25, .25);
}
.ev-parcel:focus-visible { outline: 3px solid #FFD36B; outline-offset: 2px; }
.ev-tag {
  align-self: flex-start; font-family: var(--case-mono); font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 2px; background: #FBF6EA; color: #6E1C12; box-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.ev-name { font-size: 12.5px; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; background: rgba(251, 246, 234, .82); padding: 1px 4px; border-radius: 2px; }
.ev-kind { font-size: 10.5px; color: #5C4422; }
/* 不同类型：包裹封签颜色区分 */
.ev-pdf .ev-tag { background: #C2271F; color: #FFF; }
.ev-doc .ev-tag { background: #2C5D86; color: #FFF; }
.ev-slides .ev-tag { background: #C46A1A; color: #FFF; }
.ev-sheet .ev-tag { background: #2F7A4C; color: #FFF; }
.ev-archive .ev-tag { background: #4C3D2E; color: #FFF; }
.ev-link .ev-tag { background: #5B3F7A; color: #FFF; }
.ev-note .ev-tag { background: #FBF6EA; color: #3A2E20; }
/* 图片：拍立得照片 */
.ev-photo-card { background: #FDFBF6; padding: 5px 5px 4px; box-shadow: 0 5px 10px rgba(20, 8, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .06); }
.ev-shot { position: relative; display: block; height: 38px; background: #2B2622; overflow: hidden; border-radius: 1px; }
.ev-shot img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.ev-loaded .ev-shot img { opacity: 1; }
.ev-shot i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; color: rgba(255, 255, 255, .7); }
.ev-loaded .ev-shot i { display: none; }
.ev-photo-card .ev-name { background: none; padding: 2px 1px 0; font-size: 12px; -webkit-line-clamp: 1; }
.ev-photo-card .ev-kind { display: none; }
.ev-bundle {
  position: absolute; z-index: 3; width: 116px; padding: 3px 8px; border: 1px dashed rgba(255, 238, 205, .7); border-radius: 3px;
  background: rgba(40, 26, 12, .6); color: #FFF3DC; font: inherit; font-size: 12px; text-align: center; cursor: pointer;
}
.ev-bundle:hover { background: rgba(40, 26, 12, .85); }
.ev-bundle.dimmed { opacity: .28; }

/* 模块总览：牛皮纸档案夹 */
.tg-board .tg-module-tile {
  border: 0; border-radius: 3px 10px 6px 6px; background: #EBD9B4; color: #2E2214;
  box-shadow: 0 8px 18px rgba(20, 8, 0, .45), inset 0 0 0 1px rgba(90, 60, 25, .25);
  overflow: visible;
}
.tg-board .tg-module-tile::before { /* 档案夹耳 */
  content: ''; position: absolute; left: 14px; top: -12px; width: 46%; height: 14px; border-radius: 6px 6px 0 0; background: #E2CC9E;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}
.tg-board .tg-tile-head strong { font-family: var(--case-serif); font-size: 18px; }
.tg-board .tg-tile-head span { color: #5C4422; }
.tg-board .tg-tile-tasks { background: #FBF6EA; margin: 0 10px; border-radius: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.tg-board .tg-tile-tasks button span { font-size: 13.5px; }
.tg-board .tg-tile-open { color: #6E1C12; font-weight: 700; }
.tg-tile-ev { font-family: var(--case-mono); font-size: 12px; color: #6E1C12 !important; }

/* 顶部工具区与筛选：纸面 */
.tg-board .tg-summary strong { font-family: var(--case-serif); font-size: 22px; }
.tg-ev-total { color: #6E1C12; font-weight: 600; }
.tg-board .tg-chip.active, .tg-board .tg-chip[aria-pressed="true"] { background: var(--case-night); color: #F1EDE4; border-color: var(--case-night); }
.tg-board .tg-minimap { background: rgba(251, 246, 234, .92); }
.tg-board .tg-camera { background: rgba(251, 246, 234, .94); }

/* 列表视图：每条任务下列出它的证物 */
.tg-list-ev { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.tg-list-ev-item {
  display: inline-flex; align-items: center; gap: 5px; max-width: 240px; padding: 2px 8px 2px 3px; border-radius: 3px;
  background: #EAD6AE; color: #2E2214; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.tg-list-ev-item b { font-family: var(--case-mono); font-size: 11px; padding: 0 4px; border-radius: 2px; background: #FBF6EA; color: #6E1C12; }
.tg-list-ev-item.ev-image b { background: #2B2622; color: #FFF; }
.tg-list-ev-more { font-size: 12.5px; color: var(--text-2); align-self: center; }

/* 侧栏“执行与交付”：证物墙 */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 8px 0 10px; padding: 14px; border-radius: 8px;
  background: linear-gradient(180deg, #84603F, #6B4B2F); box-shadow: inset 0 0 30px rgba(20, 10, 0, .4); }
.ev-grid .ev-parcel { min-height: 64px; }
.ev-grid .ev-photo-card .ev-shot { height: 72px; }

/* 证物查看弹窗 */
.ev-view .ev-photo { display: flex; justify-content: center; align-items: center; min-height: 220px; background: #1C1915; border-radius: 6px; padding: 10px; }
.ev-view .ev-photo img { max-width: 100%; max-height: 70vh; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); border: 8px solid #FDFBF6; border-bottom-width: 28px; }
.ev-view .ev-photo { position: relative; }
.ev-view .ev-photo img.ev-preview { filter: blur(1.5px); width: min(100%, 640px); max-height: 70vh; object-fit: contain; }
.ev-view .ev-loading { position: absolute; right: 16px; bottom: 12px; color: #EDE3CE; font-size: 12.5px; background: rgba(0, 0, 0, .5); padding: 2px 8px; border-radius: 3px; }
.ev-parcel-big { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px; border-radius: 6px;
  background: linear-gradient(90deg, transparent 47%, rgba(120, 85, 40, .35) 47% 53%, transparent 53%), linear-gradient(180deg, #D8BC8A, #C7A570); }
.ev-parcel-big b { font-family: var(--case-mono); font-size: 22px; padding: 4px 14px; background: #FBF6EA; color: #6E1C12; border-radius: 3px; }
.ev-parcel-big span { color: #3E2D17; font-weight: 600; }
.ev-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 16px 0 4px; font-size: 14px; }
.ev-meta dt { color: var(--text-2); }
.ev-meta dd { margin: 0; word-break: break-all; }

@media (max-width: 768px) {
  .ev-pin, .ev-bundle { width: 112px; }
  .tg-board .tg-task > strong { font-size: 14.5px; }
  .ev-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-board .tg-task, .ev-pin { transform: none !important; }
}

/* 档案夹表头与行高与布局常量（TIME.tileHead 118 / tileLine 24）一致 */
.tg-board .tg-tile-head { height: 114px; flex: 0 0 114px; gap: 4px; padding: 14px 16px 8px; }
.tg-board .tg-tile-head > span { font-size: 12.5px; }
.tg-board .tg-tile-tasks > li, .tg-board .tg-tile-tasks button { height: 24px; }
.tg-board .tg-tile-tasks button { font-size: 13.5px; }
