/* 一件事情的记录卡（业主 2026-11-12，thing_record / _thing_record.html）：浮在页面上的一张，或者自己一页的中间一栏。
   一块底，不画框；金只给「等你看」和主钮，红只给「要改」，绿只给「可以」。深色浅色都走 aimy.css 的那几个量。
   老内核（AGENTS.md）：flex 不用 gap，用边距；不用 min()/clamp()/inset/:has()。带 display 的类都配 [hidden]。 */

/* 浮出来的那一张：比平常的弹窗宽，高了自己滚。 */
.aimy-dialog.is-panel.thing-record-dialog {
  max-width: 560px;
  padding: 28px 28px 22px;
}

/* 自己一页：中间一栏。 */
.thing-record-page {
  box-sizing: border-box;
  width: 100%;
  max-width: 616px;
  margin: 0 auto;
  padding: 40px 28px 56px;
}

.thing-record {
  color: var(--fg);
  font-size: var(--text-base);
  line-height: 1.6;
}

.tr-head {
  display: flex;
  align-items: flex-start;
}

/* 弹窗右上角有一颗「×」：名字和「⋯」给它让开。 */
.thing-record-dialog .tr-head {
  padding-right: 36px;
}

.tr-title {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  font-size: 20px;
  font-weight: var(--weight-semi);
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tr-more {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -2px 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.tr-more[hidden] {
  display: none;
}

.tr-more:hover {
  background: var(--surface-3);
  color: var(--fg);
}

.tr-settled {
  margin: 6px 0 0;
  font-size: var(--text-sm);
  color: var(--faint);
}

.thing-record.is-settled .tr-title {
  color: var(--fg-soft);
}

/* 四样：目标占一整行，另外三样一行排开。 */
.tr-terms {
  display: flex;
  flex-wrap: wrap;
  margin: 20px 0 0;
}

.tr-term {
  box-sizing: border-box;
  width: 33.33%;
  margin: 0 0 16px;
  padding-right: 12px;
}

.tr-term.is-wide {
  width: 100%;
  padding-right: 0;
}

.tr-term > dt,
.tr-label {
  margin: 0 0 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-normal);
  line-height: 18px;
  color: var(--faint);
}

.tr-term > dd {
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tr-none {
  color: var(--faint);
}

.tr-person {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.tr-face {
  flex: none;
  display: inline-block;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--fg-soft);
  font-size: 11px;
  line-height: 22px;
  text-align: center;
  object-fit: cover;
}

.tr-person-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 交付物：一版一块，版和版之间只空开。 */
.tr-versions {
  margin-top: 6px;
}

.tr-version {
  margin: 0 0 18px;
}

.tr-version-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 0;
  font-size: var(--text-sm);
}

.tr-version-no {
  margin-right: 10px;
  font-weight: var(--weight-semi);
  color: var(--fg);
}

.tr-version-by {
  flex: 1 1 0;
  min-width: 0;
  color: var(--faint);
}

.tr-verdict {
  flex: none;
  margin-left: 10px;
  color: var(--muted);
}

.tr-verdict.is-yours {
  color: var(--gold);
}

.tr-verdict.is-approved {
  color: var(--green);
}

.tr-verdict.is-revise {
  color: var(--red-mark);
}

.tr-note,
.tr-text {
  margin: 6px 0 0;
  font-size: var(--text-sm);
  color: var(--fg-soft);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tr-files {
  display: flex;
  flex-wrap: wrap;
  margin: 10px -5px 0;
}

.tr-file {
  display: block;
  box-sizing: border-box;
  width: 116px;
  margin: 0 5px 10px;
  color: var(--fg-soft);
  text-decoration: none;
}

.tr-file:hover {
  color: var(--fg);
  text-decoration: none;
}

.tr-file-thumb {
  display: block;
  box-sizing: border-box;
  width: 116px;
  height: 87px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  object-fit: cover;
}

.tr-file-thumb.is-page {
  object-fit: contain;
}

.tr-file-thumb.is-paper {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}

.tr-file-name {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  font-size: var(--text-xs);
  line-height: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tr-empty {
  margin: 0 0 18px;
  color: var(--faint);
}

/* 能做的那一两颗钮。 */
.tr-acts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}

.tr-acts[hidden] {
  display: none;
}

.tr-act {
  display: inline-flex;
  align-items: center;
  height: 36px;
  margin: 0 8px 8px 0;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--control);
  color: var(--fg);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.tr-act[hidden] {
  display: none;
}

.tr-act > svg {
  margin-right: 6px;
}

.tr-act:hover {
  background: var(--surface-4);
}

.tr-act.is-main {
  background: var(--gold);
  color: var(--on-gold);
  font-weight: var(--weight-semi);
}

.tr-act.is-main:hover {
  background: var(--gold-bright);
}

.tr-act:disabled {
  opacity: 0.5;
  cursor: default;
}

.tr-status {
  margin: 0 0 8px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.tr-origin {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 18px;
  color: var(--faint);
}

.tr-origin > a {
  color: var(--muted);
}

/* 手机：三样各占一行的一半，放不下的自己折。 */
@media (max-width: 640px) {
  .aimy-dialog.is-panel.thing-record-dialog {
    padding: 22px 18px 18px;
  }

  .thing-record-page {
    padding: 24px 18px 40px;
  }

  .tr-term {
    width: 50%;
  }

  /* 时间自己一行，负责人、验收人并排。 */
  .tr-term:nth-child(2) {
    width: 100%;
    padding-right: 0;
  }

  .tr-file,
  .tr-file-thumb {
    width: 96px;
  }

  .tr-file-thumb {
    height: 72px;
  }
}
