/* 会议纪要助手 - 高端商务简洁风格 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* 配色方案 - 专业蓝色系 */
  --color-bg: #f5f7fa;
  --color-bg-deep: #e9ecf1;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-surface-darker: #f8f9fb;
  --color-border: #dfe3e8;
  --color-border-light: #edf0f3;
  --color-text: #0d1829;
  --color-text-secondary: #3f4e5f;
  --color-text-muted: #6b7a8f;
  --color-text-placeholder: #9aa5b5;
  
  /* 主色调 - 专业蓝 */
  --color-primary: #1a56db;
  --color-primary-light: #3b72f2;
  --color-primary-dark: #0f3b8a;
  --color-primary-gradient: linear-gradient(135deg, #1e40af 0%, #1a56db 50%, #3b72f2 100%);
  --color-primary-gradient-hover: linear-gradient(135deg, #1e3a8a 0%, #1a4fca 50%, #2563eb 100%);
  
  /* 强调色 */
  --color-accent: #10b981;
  --color-accent-soft: #d1fae5;
  --color-accent-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
  
  /* 成功/警告/错误 */
  --color-success: #10b981;
  --color-success-soft: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-soft: #fef3c7;
  --color-error: #ef4444;
  --color-error-soft: #fee2e2;
  
  /* 金色强调 */
  --color-gold: #f59e0b;
  --color-gold-soft: #fef3c7;
  --color-gold-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  
  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", 
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  
  /* 圆角 */
  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* 阴影 */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  
  /* 过渡 */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--color-bg);
  background-image: 
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(59, 114, 242, 0.06), transparent 70%),
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== Header 头部 ========== */
.header {
  background: var(--color-primary-gradient);
  color: #fff;
  padding: 40px 0 44px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(26, 86, 219, 0.15);
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  opacity: 0.6;
  pointer-events: none;
}

.header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.header .container {
  position: relative;
  z-index: 1;
}

.title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.98);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.subtitle {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  max-width: 580px;
  line-height: 1.5;
}

/* ========== Main 主内容 ========== */
.main {
  padding: 40px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ========== Card 卡片 ========== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.help-text {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 8px 0 0;
  line-height: 1.5;
}

/* ========== Tabs 标签页 ========== */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--color-surface-darker);
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
}

.tab-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  transition: all var(--transition);
  position: relative;
}

.tab-btn:hover {
  background: rgba(26, 86, 219, 0.05);
  color: var(--color-primary);
}

.tab-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-panel.active {
  display: flex;
}

/* ========== File Input 文件输入 ========== */
.file-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-choose-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.btn-choose-file:hover {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.file-name {
  color: var(--color-text-muted);
  font-size: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== Buttons 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--color-primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.25);
}

.btn-primary:hover {
  background: var(--color-primary-gradient-hover);
  box-shadow: 0 6px 20px rgba(26, 86, 219, 0.35);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.btn-delete {
  color: var(--color-error);
}

.btn-delete:hover {
  color: #dc2626;
}

/* ========== Progress Bar 进度条 ========== */
.progress-card {
  background: linear-gradient(135deg, rgba(59, 114, 242, 0.03) 0%, rgba(16, 185, 129, 0.03) 100%);
  border: 1px solid rgba(26, 86, 219, 0.1);
}

.progress-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
}

.progress-segment {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: var(--color-surface);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.progress-segment::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-border);
  transition: all var(--transition);
}

.progress-segment.completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--color-success);
}

.progress-segment.completed::before {
  background: var(--color-accent-gradient);
}

.progress-segment.active {
  background: linear-gradient(135deg, rgba(26, 86, 219, 0.1) 0%, rgba(59, 114, 242, 0.05) 100%);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.progress-segment.active::before {
  background: var(--color-primary-gradient);
  animation: progress-slide 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes progress-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-segment.error {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}

.progress-segment.error::before {
  background: var(--color-error);
}

.progress-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: center;
  min-height: 21px;
  font-weight: 500;
}

/* ========== Layout 响应式布局 ========== */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  position: relative;
  z-index: 1;
  min-height: 65vh;
}

/* 转写结果展开时（默认）：音频播放器横向铺满，转写和纪要并排 */
.layout .card-audio-player {
  grid-column: 1 / -1;
}

.layout .card-transcript {
  grid-column: 1;
}

.layout .card-minutes {
  grid-column: 2;
}

/* 转写结果收起时：音频和转写并排，纪要横向铺满 */
.layout.layout--transcript-collapsed .card-audio-player {
  grid-column: 1;
}

.layout.layout--transcript-collapsed .card-transcript {
  grid-column: 2;
}

.layout.layout--transcript-collapsed .card-minutes {
  grid-column: 1 / -1;
}

.layout .card {
  display: flex;
  flex-direction: column;
}

/* ========== 音频播放器 ========== */
.card-audio-player {
  margin-bottom: 0;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  /* 与转写结果卡片背景一致 */
  background: var(--color-surface);
}

.audio-player-wrap {
  padding: 4px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.audio-player-wrap audio {
  border-radius: var(--radius);
  background: var(--color-surface-darker);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition);
}

.audio-player-wrap audio:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.audio-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.audio-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 下载录音文件：圆角方框、些微高亮 */
.audio-actions .btn-download-recording {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-darker);
  border: 1px solid var(--color-border-light);
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.audio-actions .btn-download-recording:hover {
  background: rgba(26, 86, 219, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(26, 86, 219, 0.15);
}

/* 录音中状态 */
.recording-status {
  text-align: center;
  padding: 48px 24px;
}

.recording-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.recording-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: recording-pulse 1.5s ease-in-out infinite;
}

@keyframes recording-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.recording-text {
  font-size: 18px;
  font-weight: 600;
  color: #ef4444;
  letter-spacing: 0.02em;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.empty-state .help-text {
  margin: 0;
  font-size: 14px;
}

/* 转写收起时，音频播放器调整为紧凑布局 */
.layout.layout--transcript-collapsed .card-audio-player .section-title {
  font-size: 17px;
}

.layout.layout--transcript-collapsed .audio-actions {
  flex-direction: column;
  align-items: flex-start;
}

/* 确保两个卡片高度一致 */
.layout.layout--transcript-collapsed .card-audio-player,
.layout.layout--transcript-collapsed .card-transcript {
  min-height: 200px;
}

.card-transcript {
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

/* ========== 转写结果：标题栏与折叠 ========== */
.card-transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-transcript-toggle {
  padding: 6px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-transcript-toggle:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.card-transcript-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.transcript-export-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--color-surface-darker);
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
}

.export-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-right: 4px;
}

.export-sep {
  color: var(--color-border);
  font-weight: 300;
}

/* ========== 转写结果 ========== */
.segments {
  overflow-y: auto;
  padding: 4px;
  border-radius: var(--radius);
}

.segments::-webkit-scrollbar {
  width: 8px;
}

.segments::-webkit-scrollbar-track {
  background: var(--color-surface-darker);
  border-radius: 4px;
}

.segments::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
  transition: background var(--transition);
}

.segments::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.segment {
  margin-bottom: 8px;
  padding: 10px 14px;
  background: var(--color-surface);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
}

.segment:hover {
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.segment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.badge-time,
.badge-speaker {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.badge-time {
  background: linear-gradient(135deg, rgba(26, 86, 219, 0.08) 0%, rgba(26, 86, 219, 0.05) 100%);
  color: var(--color-primary);
  border: 1px solid rgba(26, 86, 219, 0.15);
}

.badge-speaker {
  background: var(--color-surface-darker);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-light);
}

.segment-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  word-break: break-word;
}

/* 不同说话人的颜色标注 */
.segment--speaker-a { 
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
}
.segment--speaker-a .badge-speaker {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.2);
}

.segment--speaker-b { 
  border-left-color: #10b981;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.04) 0%, transparent 100%);
}
.segment--speaker-b .badge-speaker {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

.segment--speaker-c { 
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.04) 0%, transparent 100%);
}
.segment--speaker-c .badge-speaker {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
}

.segment--speaker-d { 
  border-left-color: #8b5cf6;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.04) 0%, transparent 100%);
}
.segment--speaker-d .badge-speaker {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.2);
}

.segment--speaker-e { 
  border-left-color: #ec4899;
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.04) 0%, transparent 100%);
}
.segment--speaker-e .badge-speaker {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(236, 72, 153, 0.08) 100%);
  color: #db2777;
  border-color: rgba(236, 72, 153, 0.2);
}

.segment--speaker-x { 
  border-left-color: #6b7280;
  background: linear-gradient(90deg, rgba(107, 114, 128, 0.04) 0%, transparent 100%);
}
.segment--speaker-x .badge-speaker {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.12) 0%, rgba(107, 114, 128, 0.08) 100%);
  color: #4b5563;
  border-color: rgba(107, 114, 128, 0.2);
}

/* ========== 会议纪要 ========== */
.minutes-edit-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--color-surface-darker);
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
}

.minutes-preview {
  padding: 28px 32px;
  background: var(--color-surface);
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  min-height: 300px;
  line-height: 1.8;
  color: var(--color-text);
  transition: all var(--transition);
}

.minutes-preview:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.08);
}

.minutes-preview h1,
.minutes-preview h2,
.minutes-preview h3 {
  margin: 0 0 16px;
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.minutes-preview h1:not(:first-child) {
  margin-top: 36px;
}

.minutes-preview h2:not(:first-child) {
  margin-top: 32px;
}

.minutes-preview h3:not(:first-child) {
  margin-top: 24px;
}

.minutes-preview h4:not(:first-child) {
  margin-top: 18px;
}

.minutes-preview h1 {
  font-size: 28px;
  color: var(--color-text);
  border-bottom: 3px solid var(--color-primary);
  padding-bottom: 14px;
  margin-bottom: 24px;
}

.minutes-preview h2 {
  font-size: 20px;
  color: var(--color-primary);
  padding-left: 12px;
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(90deg, rgba(26, 86, 219, 0.08) 0%, rgba(26, 86, 219, 0.02) 50%, transparent 100%);
  padding: 12px 0 12px 18px;
  margin-bottom: 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.minutes-preview h3 {
  font-size: 17px;
  color: var(--color-text);
  font-weight: 700;
  padding-left: 12px;
  border-left: 3px solid var(--color-accent);
  margin-bottom: 12px;
}

.minutes-preview h4 {
  font-size: 15px;
  color: var(--color-text-secondary);
  font-weight: 600;
  padding-left: 10px;
  border-left: 2px solid var(--color-border);
  margin-bottom: 10px;
}

.minutes-preview p {
  margin: 14px 0;
  line-height: 1.8;
  color: var(--color-text);
}

.minutes-preview ul,
.minutes-preview ol {
  margin: 16px 0;
  padding-left: 28px;
}

.minutes-preview ul {
  list-style-type: disc;
}

.minutes-preview ol {
  list-style-type: decimal;
}

.minutes-preview li {
  margin: 10px 0;
  line-height: 1.8;
  color: var(--color-text);
  padding-left: 8px;
}

/* 嵌套列表层级样式 */
.minutes-preview ul ul {
  margin: 10px 0 8px 8px;
  padding-left: 20px;
  list-style-type: circle;
  border-left: 2px solid var(--color-border-light);
}

.minutes-preview ul ul ul {
  margin: 8px 0 6px 8px;
  padding-left: 18px;
  list-style-type: square;
  border-left: 1px solid var(--color-border-light);
}

/* 嵌套列表项样式 */
.minutes-preview li li {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.minutes-preview li li li {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* 第一层列表项保持较大字体 */
.minutes-preview > ul > li,
.minutes-preview h2 + ul > li,
.minutes-preview h3 + ul > li {
  font-size: 15px;
  font-weight: 500;
}

.minutes-preview li strong {
  color: var(--color-text);
  font-weight: 700;
}

.minutes-preview strong {
  font-weight: 700;
  color: var(--color-text);
}

.minutes-preview em {
  font-style: italic;
  color: var(--color-text-secondary);
}

.minutes-preview code {
  background: var(--color-surface-darker);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-text);
  border: 1px solid var(--color-border-light);
}

/* 会议纪要表格样式 */
.minutes-preview .minutes-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.minutes-preview .minutes-table thead {
  background: linear-gradient(135deg, rgba(26, 86, 219, 0.08) 0%, rgba(26, 86, 219, 0.05) 100%);
}

.minutes-preview .minutes-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  white-space: nowrap;
}

.minutes-preview .minutes-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
}

.minutes-preview .minutes-table tbody tr:last-child td {
  border-bottom: none;
}

.minutes-preview .minutes-table tbody tr:hover {
  background: rgba(26, 86, 219, 0.03);
}

/* 表格内的优先级标签样式 */
.minutes-preview .priority-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.minutes-preview .priority-high {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.minutes-preview .priority-medium {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
  border: 1px solid #fcd34d;
}

.minutes-preview .priority-low {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
  border: 1px solid #93c5fd;
}

.minutes-preview .priority-default {
  background: var(--color-surface-darker);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.minutes-markdown {
  width: 100%;
  padding: 20px;
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition);
}

.minutes-markdown:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.08);
}

/* ========== 历史纪要列表 ========== */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(26, 86, 219, 0.02) 0%, transparent 100%);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  cursor: pointer;
}

.note-item:hover {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.note-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.note-date {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  font-family: var(--font-mono);
}

/* ========== Footer 页脚 ========== */
.footer {
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
  margin-top: 40px;
}

.footer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ========== 移动端响应式 ========== */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .header {
    padding: 28px 0 32px;
  }

  .title {
    font-size: 24px;
  }

  .title-icon svg {
    width: 30px;
    height: 30px;
  }

  .subtitle {
    font-size: 14px;
  }

  .main {
    padding: 24px 0 48px;
    gap: 20px;
  }

  .card {
    padding: 20px 20px;
    border-radius: var(--radius);
  }

  .section-title {
    font-size: 17px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .layout .card-audio-player,
  .layout .card-transcript,
  .layout .card-minutes {
    grid-column: 1;
  }

  .tabs {
    gap: 6px;
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .file-input-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-choose-file {
    width: 100%;
    justify-content: center;
  }

  .progress-bar {
    flex-wrap: wrap;
  }

  .progress-segment {
    flex: 1 1 calc(50% - 4px);
    min-width: calc(50% - 4px);
    padding: 12px 8px;
    font-size: 12px;
  }

  .segments {
    max-height: 500px;
  }

  .segment {
    padding: 10px 14px;
  }

  .segment-text {
    font-size: 13px;
  }

  .minutes-preview {
    padding: 20px;
    min-height: 250px;
  }

  /* 移动端表格自适应 */
  .minutes-preview .minutes-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .minutes-preview .minutes-table th,
  .minutes-preview .minutes-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .note-item {
    padding: 16px 18px;
  }

  .note-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .note-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .title {
    font-size: 22px;
  }

  .card {
    padding: 18px 16px;
  }

  .progress-segment {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

/* ========== 打印样式 ========== */
@media print {
  body {
    background: white;
  }

  .header,
  .footer,
  .btn,
  .tabs,
  .transcript-export-bar,
  .minutes-edit-bar,
  .note-actions {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* ========== 搜索和替换工具栏 ========== */
.search-replace-toolbar {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-replace-row,
.replace-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.replace-row {
  margin-top: 8px;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-search,
.btn-replace,
.btn-toggle-replace,
.btn-close-search {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: white;
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-search:hover,
.btn-replace:hover,
.btn-toggle-replace:hover {
  background: var(--color-bg-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-close-search {
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
  color: var(--color-text-muted);
}

.btn-close-search:hover {
  background: var(--color-error);
  border-color: var(--color-error);
  color: white;
}

.btn-search:active,
.btn-replace:active,
.btn-toggle-replace:active {
  transform: translateY(1px);
}

.btn-search:disabled,
.btn-replace:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.search-count {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  min-width: 60px;
}

/* 高亮搜索结果 - 所有匹配项 */
.search-highlight {
  background-color: rgba(255, 235, 59, 0.55);
  padding: 1px 2px;
  border-radius: 2px;
}

/* 当前匹配项 - 更醒目 */
.search-highlight-current {
  background-color: rgba(255, 152, 0, 0.75);
  padding: 1px 2px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.3);
}

/* ========== 辅助动画 ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.4s ease-out;
}

/* ========== 深色模式支持（预留） ========== */
@media (prefers-color-scheme: dark) {
  /* 可以在这里添加深色模式样式 */
}
