/* 板块 72 · JD 截图 / 文件当附件（docs/板块72_JD截图当附件.md；行为在 public/start.js，附件条由 lib/views/start69.js 画）
   - JD 框上面一条附件条：截图是 64×64 圆角缩略图，PDF / Word 是一张文件卡（类型 + 文件名）；进来时轻轻弹一下
   - 读的时候：缩略图上盖一层淡色 + 一个青色小圈，不写字；没读出来：红框 + 整张可点的重试；× 在右上角（电脑上悬停出现，手机上一直露着）
   - 有附件时 JD 框矮一点；拖着文件悬停整块 JD 区域：虚线青框盖住，中间一句「松手添加 JD 截图或文件」（data-jd-drop）
   - 提交时附件还没读完：按钮上的箭头换成小圈（.is-wait），字不变 */
.v3 .jdtray { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 22px 0; }
.v3 .jdtray[hidden] { display: none; }
.v3 .newbox__jd .jdtray { padding: 12px 12px 0; }

.v3 .jdchip { position: relative; flex: none; width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--rule); background: var(--paper-2); animation: jdchip-in .22s var(--ease) both; }
.v3 .jdchip img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: 11px; }
.v3 .jdchip.is-doc { width: auto; min-width: 150px; max-width: 230px; display: flex; align-items: center; padding: 0 14px 0 10px; background: var(--sheet); }
.v3 .jdchip__doc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v3 .jdchip__doc b { flex: none; display: grid; place-items: center; width: 38px; height: 42px; border-radius: 8px; background: var(--pen-soft); color: var(--pen); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.v3 .jdchip__doc span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--ink-2); }

/* 读的时候：一层淡色 + 小圈 */
.v3 .jdchip__ring { position: absolute; inset: 0; display: none; border-radius: 11px; pointer-events: none; }
.v3 .jdchip.is-pending .jdchip__ring { display: grid; place-items: center; background: color-mix(in srgb, var(--sheet) 58%, transparent); }
.v3 .jdchip.is-pending .jdchip__ring::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--pen) 22%, transparent); border-top-color: var(--pen); animation: jdchip-spin .8s linear infinite; }

/* 没读出来：红框，整张是重试 */
.v3 .jdchip.is-bad { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.v3 .jdchip__retry { position: absolute; inset: 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px; background: color-mix(in srgb, var(--sheet) 72%, transparent); color: var(--red); font-size: 20px; line-height: 1; cursor: pointer; }
.v3 .jdchip__retry[hidden] { display: none; }
.v3 .jdchip__retry:hover, .v3 .jdchip__retry:focus-visible { background: color-mix(in srgb, var(--sheet) 55%, transparent); }

/* × 右上角 */
.v3 .jdchip__x { position: absolute; top: -7px; right: -7px; z-index: 1; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); opacity: 0; transform: scale(.85); transition: opacity .14s, transform .14s; }
.v3 .jdchip:hover .jdchip__x, .v3 .jdchip:focus-within .jdchip__x, .v3 .jdchip.is-bad .jdchip__x { opacity: 1; transform: none; }
@media (hover: none) { .v3 .jdchip__x { opacity: 1; transform: none; } }

/* 有附件时 JD 框矮一点：主角是附件 */
.v3 .composer.has-jd-att textarea { min-height: 84px; padding-top: 14px; }
.v3 .newbox__f.has-jd-att .newbox__jd textarea { min-height: 96px; }

/* 拖着文件悬停：整块盖一层虚线青框 + 一句松手添加；不挡放下（pointer-events: none） */
.v3 .composer.is-jd-drag::after, .v3 .newbox__jd.is-jd-drag::after { content: attr(data-jd-drop); position: absolute; inset: 6px; z-index: 2; display: grid; place-items: center; padding: 0 16px; border: 2px dashed var(--pen); border-radius: 16px; background: color-mix(in srgb, var(--pen-soft) 86%, transparent); color: var(--pen); font-size: 15px; font-weight: 600; text-align: center; pointer-events: none; animation: jdchip-in .16s var(--ease) both; }
.v3 .newbox__jd.is-jd-drag::after { inset: 4px; border-radius: 11px; }

/* 提交时附件还没读完：箭头换成小圈，字不变 */
.v3 button.is-wait { cursor: progress; }
.v3 button.is-wait .arrow { transform: none; }
.v3 button.is-wait .arrow svg { display: none; }
.v3 button.is-wait .arrow::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; animation: jdchip-spin .8s linear infinite; }

@keyframes jdchip-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes jdchip-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .v3 .jdtray { gap: 8px; padding: 14px 16px 0; }
  .v3 .jdchip { width: 56px; height: 56px; }
  .v3 .jdchip.is-doc { height: 56px; min-width: 132px; }
}
@media (prefers-reduced-motion: reduce) {
  .v3 .jdchip, .v3 .composer.is-jd-drag::after, .v3 .newbox__jd.is-jd-drag::after { animation: none; }
  .v3 .jdchip.is-pending .jdchip__ring::after, .v3 button.is-wait .arrow::after { animation-duration: 2.4s; }
}
