/* 企业与律师的沟通（matters.js）：企业端“律师沟通”、律所端“企业沟通”，两边同一套样子。
   左边事项列表（当前 / 历史 + 筛选），右边一件事的完整往来。颜色、字体沿用 style.css 里的变量。 */

.page.mt-page { max-width: 1360px; }
/* 两栏的高度跟着窗口走（减掉上面的标题和说明），各自在里面滚动，输入框一直在右栏底下，不用滚整个页面 */
.mt-wrap { display: grid; grid-template-columns: 348px minmax(0, 1fr); gap: 22px; align-items: stretch; height: calc(100vh - 200px); min-height: 480px; }
body.super-acting .mt-wrap { height: calc(100vh - 238px); }

/* ---------- 左边 ---------- */
.mt-side { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mt-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); flex: none; }
.mt-tab { border: 0; background: transparent; padding: 11px 0 9px; font: inherit; font-family: var(--serif); font-size: 15.5px; letter-spacing: 3px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.mt-tab small { margin-left: 6px; font-family: Georgia, var(--serif); font-size: 14px; letter-spacing: 0; }
.mt-tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--gold); }
.mt-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 8px; flex: none; }
.mt-filters select, .mt-filters input { padding: 5px 9px; font-size: 13.5px; }
.mt-filters select { flex: 1 1 130px; min-width: 0; }
.mt-filters input[type="text"] { flex: 1 1 100%; }
.mt-dates { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; font-size: 13.5px; color: var(--muted); }
.mt-dates input { flex: 1; min-width: 0; }
.mt-only { margin: 0 12px 8px; padding: 3px 10px; font-size: 13.5px; align-self: flex-start; flex: none; }
.mt-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; border-top: 1px solid var(--line); }
.mt-list .empty { padding: 26px 18px; font-size: 13.5px; line-height: 1.8; }
.mt-item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; background: transparent; padding: 10px 12px 10px 11px; font: inherit; color: var(--text); cursor: pointer; }
.mt-item:hover { background: #fbf8f0; }
.mt-item.on { background: var(--gold-soft); border-left-color: var(--gold); }
.mt-item.att { border-left-color: #c8372d; }
.mt-item > span { display: block; }
.mt-item-top { display: flex !important; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--muted); }
.mt-item-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-item-top time { flex: none; }
.mt-item-title { margin: 2px 0 5px; font-size: 14px; line-height: 1.55; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-item.att .mt-item-title { font-weight: 600; color: var(--ink); }
.mt-item-sub { display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.mt-item-lawyer { margin-left: auto; }
.mt-item-last { margin-top: 5px; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 要我看、要我办的小红标；“请补充”用琥珀色 */
.mt-dot { background: #c8372d; color: #fff; border-radius: 2px; padding: 0 6px; font-size: 12.5px; line-height: 19px; font-weight: 600; }
.mt-dot.need { background: #c8372d; } /* “请补充”也是要我处理的，同一种红（D-022 A3） */
.badge.need { background: #f7dfb4; color: #6b4300; border-color: #e3b96b; font-weight: 600; }

/* ---------- 右边 ---------- */
.mt-pane { min-width: 0; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.mt-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding: 14px 22px 8px; }
.mt-pane > .empty { margin: auto; padding: 60px 20px; }
.mt-back { display: none; margin: 12px 0 0 16px; align-self: flex-start; }
.mt-head { flex: none; padding: 14px 22px 12px; border-bottom: 1px solid var(--line); }
.mt-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.mt-state { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: 2px; padding: 2px 12px; border-radius: 3px; }
/* 三种颜色，只表示轮到谁（D-022 A3）：要我处理（实底红）、等对方（灰色描边）、已完成（绿） */
.mt-state { border: 1px solid transparent; }
.mt-state.todo { background: #c8372d; color: #fff; }
.mt-state.wait { background: transparent; color: #586070; border-color: #b3ad9f; }
.mt-state.done { background: var(--ok-soft); color: var(--ok); border-color: #c9dfd0; }
.mt-lawyer { font-size: 14px; color: var(--muted); }
.mt-lawyer b { color: var(--ink); font-weight: 600; }
.mt-lawyer small { margin-left: 4px; font-size: 13.5px; }
.mt-assign { display: flex; align-items: center; gap: 8px; }
.mt-assign select { width: auto; min-width: 140px; padding: 4px 10px; font-size: 13.5px; }
.mt-head-actions { margin-left: auto; display: flex; gap: 8px; }
.notice.need { background: #fbe8c3; color: #5a3a00; border: 1px solid #e3b96b; font-weight: 600; margin: 12px 0 0; }
.mt-head > .notice.warn { margin: 12px 0 0; }
.mt-origin { padding: 12px 14px; background: #faf7f0; border: 1px solid var(--line); border-radius: 4px; }
.mt-origin-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; color: var(--ink); }
.mt-origin-meta { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.mt-origin-q { margin-top: 8px; font-size: 13.5px; line-height: 1.75; color: var(--text); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mt-conv { margin-top: 12px; background: var(--bg); }
.mt-conv .thread { margin: 0; }

.mt-msgs { padding: 16px 0 8px; display: flex; flex-direction: column; gap: 12px; }
.mt-msg { border: 1px solid var(--line); border-left: 3px solid var(--ink); border-radius: 4px; padding: 10px 14px 12px; background: #fff; max-width: 92%; }
.mt-msg.company { align-self: flex-start; }
.mt-msg.firm { align-self: flex-end; border-left-color: #47705c; background: #f3f8f4; }
.mt-msg.request { border-left-color: #c9821a; background: #fdf3dd; }
.mt-msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13.5px; color: var(--muted); }
.mt-msg-head b { font-size: 14px; color: var(--ink); }
.mt-msg-head time { margin-left: auto; padding-left: 12px; }
.mt-me { border: 1px solid var(--line-strong); border-radius: 2px; padding: 0 5px; font-size: 12.5px; line-height: 17px; }
.mt-kind { color: var(--gold-deep); letter-spacing: 1px; }
.mt-msg.request .mt-kind { background: #c9821a; color: #fff; border-radius: 2px; padding: 0 6px; letter-spacing: 0; }
.mt-msg-body { margin-top: 6px; font-size: 14.5px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.mt-msg-body.none { color: var(--muted); }
/* 办结、重新打开、指派：居中的小字 */
.mt-sys { align-self: center; font-size: 13.5px; color: var(--muted); padding: 2px 0; }
.mt-sys time { margin-left: 8px; }

.mt-compose { flex: none; padding: 12px 22px 14px; background: var(--card); border-top: 1px solid var(--line); }
.mt-compose textarea { min-height: 76px; max-height: 30vh; }
.mt-compose-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.mt-compose-row .hf-tip { margin-right: auto; }
.mt-closed { flex: none; padding: 14px 22px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }

/* 窗口窄：先看列表，点一件再看往来，上面有“返回列表” */
@media (max-width: 1000px) {
  .mt-wrap, body.super-acting .mt-wrap { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .mt-pane { overflow: visible; }
  .mt-scroll, .mt-list { overflow: visible; }
  .mt-page:not(.has-sel) .mt-pane { display: none; }
  .mt-page.has-sel .mt-side { display: none; }
  .mt-back { display: inline-flex; }
  .mt-msg { max-width: 100%; }
}

/* 手机版面：一件事的往来占满整屏，输入框固定在底部四个按钮的上方 */
@media (max-width: 760px) {
  .mt-head { padding: 12px 14px 10px; }
  .mt-head-row { gap: 8px 12px; }
  .mt-scroll { padding: 12px 14px 8px; }
  .mt-compose { position: sticky; bottom: 58px; padding: 10px 14px 12px; }
  .mt-compose textarea { min-height: 60px; }
  .mt-compose-row .hf-tip { display: none; }
  .mt-closed { padding: 12px 14px 16px; }
  .mt-back { margin: 10px 0 0 14px; }
  .mt-pane { overflow: visible; }
}
