* { box-sizing: border-box; margin: 0; padding: 0; }

/* display:flex 等类规则会盖过 UA 的 [hidden] 样式，这里强制兜底 */
[hidden] { display: none !important; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #1f2329;
  min-height: 100vh;
}

header {
  background: #fff;
  border-bottom: 1px solid #e5e6eb;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.user-box { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #4e5969; }

.auth-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(31, 35, 41, .45);
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  background: #fff; border-radius: 14px; padding: 32px;
  width: 340px; display: flex; flex-direction: column; gap: 12px;
}
.auth-card h2 { font-size: 18px; text-align: center; margin-bottom: 4px; }
.auth-card input {
  border: 1px solid #c9cdd4; border-radius: 6px;
  padding: 10px 12px; font-size: 14px;
}
.auth-card input:focus { outline: none; border-color: #3370ff; }
.auth-error { color: #f53f3f; font-size: 12px; min-height: 16px; }
.btn.primary { background: #3370ff; color: #fff; border-color: #3370ff; padding: 10px; }
.btn.primary:hover { background: #2860e0; color: #fff; }
.auth-switch { font-size: 13px; color: #86909c; text-align: center; }
header h1 { font-size: 22px; }
header .sub { color: #86909c; font-size: 13px; margin-top: 4px; }

main { max-width: 1100px; margin: 24px auto; padding: 0 24px; }

.dropzone {
  background: #fff;
  border: 2px dashed #c9cdd4;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: #3370ff; background: #f0f5ff; }
.dz-icon { font-size: 28px; margin-bottom: 8px; }
.dz-hint { color: #86909c; font-size: 12px; margin-top: 6px; }
.link-btn {
  background: none; border: none; color: #3370ff;
  font-size: inherit; cursor: pointer; padding: 0 2px;
}
.link-btn:hover { text-decoration: underline; }

.layout { display: flex; gap: 20px; margin-top: 24px; align-items: flex-start; }
.list-panel { flex: 0 0 340px; }
.detail-panel {
  flex: 1; background: #fff; border-radius: 12px; padding: 24px;
  min-height: 300px; position: sticky; top: 16px;
}

.list-panel h2 { font-size: 15px; color: #4e5969; margin-bottom: 10px; }
#record-list { list-style: none; }

.record-item {
  background: #fff; border-radius: 10px; padding: 14px 16px;
  margin-bottom: 10px; cursor: pointer;
  border: 1px solid transparent;
  transition: border-color .15s;
}
.record-item:hover { border-color: #c9cdd4; }
.record-item.active { border-color: #3370ff; }
.record-item .title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-item .meta { font-size: 12px; color: #86909c; margin-top: 4px; display: flex; gap: 8px; align-items: center; }

.badge { font-size: 11px; border-radius: 4px; padding: 1px 6px; }
.badge.transcribing { background: #e8f3ff; color: #3370ff; }
.badge.analyzing { background: #fff3e8; color: #ff7d00; }
.badge.done { background: #e8ffea; color: #00b42a; }
.badge.failed { background: #ffece8; color: #f53f3f; }

.progress-bar { height: 4px; background: #e5e6eb; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress-bar > div { height: 100%; background: #3370ff; transition: width .5s; }

.empty-tip { color: #86909c; text-align: center; padding: 40px 0; font-size: 13px; }

.detail-panel h2 { font-size: 18px; margin-bottom: 4px; }
.detail-panel .file-meta { font-size: 12px; color: #86909c; margin-bottom: 14px; }
.detail-panel audio { width: 100%; margin-bottom: 16px; }

.detail-section { margin-bottom: 18px; }
.detail-section h3 { font-size: 13px; color: #4e5969; margin-bottom: 6px; }
.detail-section p, .detail-section li { font-size: 14px; line-height: 1.7; }
.detail-section ul { padding-left: 20px; }

.tags span {
  display: inline-block; background: #f2f3f5; border-radius: 4px;
  padding: 2px 10px; font-size: 12px; margin-right: 6px; color: #4e5969;
}

.transcript {
  background: #f7f8fa; border-radius: 8px; padding: 14px;
  font-size: 13px; line-height: 1.8; white-space: pre-wrap;
  max-height: 320px; overflow-y: auto; color: #4e5969;
}
.transcript.cleaned {
  background: #fff; border: 1px solid #e5e6eb;
  font-size: 14px; color: #1f2329; max-height: 480px;
}
details summary { font-size: 13px; color: #86909c; cursor: pointer; margin-bottom: 8px; }

.dialogue {
  background: #fff; border: 1px solid #e5e6eb; border-radius: 8px;
  padding: 8px 14px; max-height: 480px; overflow-y: auto;
}
.dlg-row {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px dashed #f2f3f5;
  font-size: 14px; line-height: 1.7;
}
.dlg-row:last-child { border-bottom: none; }
.dlg-time {
  flex: 0 0 44px; font-size: 12px; color: #86909c;
  font-variant-numeric: tabular-nums; text-align: right;
}
.dlg-speaker {
  flex: 0 0 auto; font-size: 12px; border-radius: 4px;
  padding: 1px 8px; white-space: nowrap;
}
.dlg-speaker.s0 { background: #e8f3ff; color: #3370ff; }
.dlg-speaker.s1 { background: #fff3e8; color: #ff7d00; }
.dlg-speaker.s2 { background: #e8ffea; color: #00b42a; }
.dlg-speaker.s3 { background: #ffece8; color: #f53f3f; }
.dlg-speaker.s4 { background: #f5e8ff; color: #8d4eda; }
.dlg-speaker.s5 { background: #e8fffb; color: #0fc6c2; }
.dlg-text { flex: 1; }

.error-box {
  background: #ffece8; color: #f53f3f; border-radius: 8px;
  padding: 12px 14px; font-size: 13px; margin-bottom: 14px;
}

.actions { margin-top: 18px; display: flex; gap: 10px; }
.btn {
  border: 1px solid #c9cdd4; background: #fff; border-radius: 6px;
  padding: 6px 16px; font-size: 13px; cursor: pointer; color: #1f2329;
}
.btn:hover { border-color: #3370ff; color: #3370ff; }
.btn.danger:hover { border-color: #f53f3f; color: #f53f3f; }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .list-panel { flex: none; width: 100%; }
  .detail-panel { position: static; width: 100%; }
}
