/* 會議記錄模塊私有樣式。
   佈局：頂部流程條 + 上傳區/記錄列表兩欄 + 下區四分頁詳情。
   共用配色/卡片/按鈕沿用 styles.css（.panel/.panel-title/.button/.tabs/.tab-button/.input/.muted/.hint.danger），
   本文件只放 mm- 前綴的模塊私有樣式。 */

.mm-workbench {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- 頂部流程條：上傳錄音→語音轉文字→AI重點提取→人工覆核→歸檔 ---- */
.mm-flow-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: var(--panel-bg, #fff);
  border: 1px solid var(--border-color, #d8d4c8);
  border-radius: 8px;
}

.mm-flow-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f4f1e9;
  color: #6b675c;
  font-size: 13px;
  white-space: nowrap;
}

.mm-flow-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dcd8cc;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.mm-flow-step.active {
  background: #e8f0fe;
  color: #1a56b0;
  font-weight: 600;
}

.mm-flow-step.active .mm-flow-dot {
  background: #1a56b0;
}

.mm-flow-step.done {
  color: #2c7a4b;
}

.mm-flow-step.done .mm-flow-dot {
  background: #2c7a4b;
}

.mm-flow-arrow {
  color: #b5b0a2;
  font-size: 12px;
}

/* ---- 上區兩欄：上傳 + 列表 ---- */
.mm-top-grid {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(340px, 3fr);
  gap: 10px;
  align-items: start;
}

@media (max-width: 960px) {
  .mm-top-grid {
    grid-template-columns: 1fr;
  }
}

/* 上傳區 */
.mm-upload-hint {
  margin: 4px 0 10px;
  line-height: 1.5;
}

.mm-form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 160px;
  font-size: 13px;
}

.mm-field-wide {
  flex-basis: 100%;
}

.mm-dropzone {
  margin-top: 10px;
  border: 2px dashed #b5b0a2;
  border-radius: 8px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mm-dropzone:hover,
.mm-dropzone:focus-visible,
.mm-dropzone.drag-over {
  border-color: #1a56b0;
  background: #f0f5ff;
}

.mm-dropzone.has-file {
  border-style: solid;
  border-color: #2c7a4b;
  cursor: default;
}

.mm-dropzone-icon {
  font-size: 26px;
  margin-bottom: 4px;
}

.mm-dropzone-inner > div {
  font-size: 14px;
  margin-bottom: 2px;
}

.mm-dropzone-file {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mm-file-name {
  font-weight: 600;
  word-break: break-all;
}

.mm-file-meta {
  color: #6b675c;
  font-size: 13px;
}

.mm-upload-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* 上傳後：內嵌 audio 播放器 + 開始轉寫按鈕 */
.mm-uploaded-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d8d4c8;
}

.mm-uploaded-audio audio {
  width: min(280px, 100%);
  height: 36px;
}

/* 記錄列表 */
.mm-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.mm-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #6b675c;
}

.mm-stat b {
  font-size: 15px;
}

.mm-stat-pending {
  color: #9a6700;
}

.mm-stat-processing {
  color: #1a56b0;
}

.mm-filters {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.mm-filter {
  border: 1px solid #d8d4c8;
  background: #f4f1e9;
  color: #524e44;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
  cursor: pointer;
}

.mm-filter.active {
  background: #1a56b0;
  border-color: #1a56b0;
  color: #fff;
}

.mm-record-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mm-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #d8d4c8;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.mm-record:hover {
  background: #f7f5ef;
}

.mm-record.selected {
  border-color: #1a56b0;
  background: #f0f5ff;
}

.mm-record-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.mm-record-name {
  font-weight: 600;
  font-size: 14px;
  word-break: break-all;
}

.mm-record-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #6b675c;
}

.mm-type-chip {
  border: 1px solid #d8d4c8;
  border-radius: 4px;
  padding: 0 6px;
  background: #f4f1e9;
}

.mm-record-error {
  font-size: 12px;
  color: #b3372f;
}

.mm-empty {
  padding: 18px 10px;
  text-align: center;
  color: #8a8577;
  font-size: 13px;
}

/* 狀態燈：處理中藍、待覆核黃、已歸檔綠 */
.mm-status-light {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #b5b0a2;
}

.mm-status-draft_transcribing,
.mm-status-draft_extracting {
  background: #1a56b0;
  box-shadow: 0 0 0 3px rgba(26, 86, 176, 0.15);
  animation: mm-pulse 1.2s ease-in-out infinite;
}

.mm-status-pending_review {
  background: #d4a017;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.18);
}

.mm-status-archived {
  background: #2c7a4b;
  box-shadow: 0 0 0 3px rgba(44, 122, 75, 0.15);
}

@keyframes mm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* 長錄音處理進度（不確定進度條） */
.mm-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.mm-progress-bar {
  flex: 0 0 90px;
  height: 5px;
  border-radius: 3px;
  background: #e4e0d4;
  overflow: hidden;
  position: relative;
}

.mm-progress-indeterminate {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 3px;
  background: #1a56b0;
  animation: mm-slide 1.4s ease-in-out infinite;
}

@keyframes mm-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ---- 下區詳情四分頁 ---- */
.mm-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mm-detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mm-status-text {
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 8px;
  vertical-align: middle;
}

.mm-status-text-draft_transcribing,
.mm-status-text-draft_extracting {
  background: #e8f0fe;
  color: #1a56b0;
}

.mm-status-text-pending_review {
  background: #fdf3d7;
  color: #9a6700;
}

.mm-status-text-archived {
  background: #e3f2e8;
  color: #2c7a4b;
}

.mm-audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mm-audio-row audio {
  width: min(480px, 100%);
  height: 36px;
}

.mm-tabs {
  margin-bottom: 8px;
}

.mm-tab-empty {
  padding: 22px 10px;
  text-align: center;
}

/* 逐字稿 */
.mm-transcript {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mm-transcript-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 4px;
}

.mm-transcript-row:hover {
  background: #f7f5ef;
}

.mm-timecode {
  flex: 0 0 auto;
  border: 1px solid #d8d4c8;
  border-radius: 4px;
  background: #f4f1e9;
  color: #1a56b0;
  font-family: inherit;
  font-size: 12px;
  padding: 1px 6px;
  cursor: pointer;
}

.mm-timecode:hover {
  background: #e8f0fe;
}

.mm-transcript-text {
  line-height: 1.6;
  word-break: break-word;
}

/* 重點提取四卡片 */
.mm-extract-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.mm-extract-card {
  border: 1px solid #d8d4c8;
  border-top: 3px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffdf8;
}

.mm-extract-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.mm-extract-card ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
  font-size: 13px;
}

.mm-extract-red { border-top-color: #b3372f; }
.mm-extract-red h3 { color: #b3372f; }
.mm-extract-blue { border-top-color: #1a56b0; }
.mm-extract-blue h3 { color: #1a56b0; }
.mm-extract-green { border-top-color: #2c7a4b; }
.mm-extract-green h3 { color: #2c7a4b; }
.mm-extract-yellow { border-top-color: #d4a017; }
.mm-extract-yellow h3 { color: #9a6700; }

.mm-extract-note {
  margin-top: 8px;
  font-size: 12px;
}

/* 會議記錄正式格式 */
.mm-minutes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mm-minutes-field {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  align-items: start;
}

.mm-minutes-label {
  font-weight: 600;
  font-size: 13px;
  color: #524e44;
  padding-top: 2px;
}

.mm-minutes-value {
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.mm-readonly {
  opacity: 0.85;
}

/* 覆核 */
.mm-review-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mm-review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mm-review-archived {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 10px;
  color: #2c7a4b;
  font-size: 14px;
}
