/* ==================== 全局样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #4F6EF7;
  --primary-dark: #3B5BDB;
  --primary-light: #EDF2FF;
  --success: #40C057;
  --warning: #FD7E14;
  --danger: #FA5252;
  --bg: #F8F9FA;
  --card: #FFFFFF;
  --text: #212529;
  --text-secondary: #868E96;
  --border: #DEE2E6;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ==================== 布局 ==================== */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

@media (min-width: 768px) {
  .app-container { 
    max-width: 100%;
    padding: 0;
  }
}

.page { display: none; min-height: 100vh; padding-bottom: 80px; }
.page.active { display: block; }

/* ==================== 顶部导航 ==================== */
.navbar {
  background: var(--card);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.navbar-back {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--primary);
  padding: 4px 8px;
}

.navbar-action {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--primary);
}

/* ==================== 底部 TabBar ==================== */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card);
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  transition: color 0.2s;
  color: var(--text-secondary);
  text-decoration: none;
  border: none;
  background: none;
  font-family: inherit;
}

.tabbar-item.active { color: var(--primary); }
.tabbar-item .tab-icon { font-size: 22px; margin-bottom: 2px; }
.tabbar-item .tab-label { font-size: 11px; }

/* ==================== 登录页 ==================== */
.login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-logo {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 16px;
  color: white;
}

.login-title {
  color: white;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.login-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 15px;
  border: none;
  background: none;
  font-family: inherit;
  transition: all 0.2s;
}

.login-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  margin-bottom: -2px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus { border-color: var(--primary); }

.form-row {
  display: flex;
  gap: 8px;
}

.form-row .form-input { flex: 1; }

.captcha-img {
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  min-width: 100px;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #ADB5BD; cursor: not-allowed; }

.btn-outline {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
  display: inline-block;
}

.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

/* ==================== 首页 ==================== */
.home-header {
  background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
  padding: 32px 20px;
  color: white;
  border-radius: 0 0 24px 24px;
}

.home-greeting { font-size: 14px; opacity: 0.9; }
.home-username { font-size: 22px; font-weight: 600; margin-top: 4px; }

.home-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

.stat-item { text-align: center; }
.stat-num { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; opacity: 0.8; margin-top: 2px; }

.start-meeting-btn {
  margin: -24px 20px 20px;
  padding: 18px;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  border: none;
  width: calc(100% - 40px);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.start-meeting-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,110,247,0.2);
}

.start-meeting-btn .btn-icon { font-size: 28px; }

.section-title {
  padding: 16px 20px 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 20px;
}

.feature-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  border: none;
  font-family: inherit;
}

.feature-card:hover { transform: translateY(-2px); }
.feature-card .feat-icon { font-size: 28px; margin-bottom: 8px; }
.feature-card .feat-name { font-size: 13px; color: var(--text); }

/* ==================== 会议页 ==================== */
.meeting-page { background: var(--bg); }

.meeting-header {
  background: var(--card);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.meeting-timer {
  font-size: 20px;
  font-weight: 600;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 8px;
}

.recording-dot {
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 录音状态栏 */
.recording-status {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.recording-status-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

.empty-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  opacity: 0.7;
}

.transcript-area {
  padding: 16px 20px;
  min-height: 400px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}

.transcript-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.transcript-speaker {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.speaker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.transcript-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.transcript-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.meeting-controls {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
  z-index: 100;
}

.meeting-controls .btn { flex: 1; }

/* ==================== 历史页 ==================== */
.meeting-list {
  padding: 12px 20px;
}

.meeting-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.2s;
}

.meeting-card:hover { transform: translateY(-1px); }

.meeting-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.meeting-card-info {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
}

.meeting-card-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

/* ==================== 纪要页 ==================== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 20px;
}

.template-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.template-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.template-card .tpl-icon { font-size: 32px; margin-bottom: 8px; }
.template-card .tpl-name { font-size: 14px; font-weight: 600; }
.template-card .tpl-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.minutes-preview {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 20px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.8;
  max-height: 500px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

/* ==================== 说话人页 ==================== */
.speaker-list {
  padding: 16px 20px;
}

.speaker-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.speaker-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.speaker-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
}

/* ==================== 通用组件 ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.speaker-colors {
  --spk0: #4F6EF7;
  --spk1: #40C057;
  --spk2: #FD7E14;
  --spk3: #AE3EC9;
  --spk4: #FA5252;
  --spk5: #15AABF;
  --spk6: #F06595;
  --spk7: #20C997;
}

/* ==================== 响应式 ==================== */
@media (min-width: 768px) {
  .tabbar { max-width: 100%; }
  .meeting-controls { max-width: 100%; }
  .template-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ==================== 备案信息底部 ==================== */
.site-footer {
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--border);
  padding: 6px 16px;
  text-align: center;
  z-index: 101;
}
.footer-content {
  font-size: 12px;
  color: var(--text-secondary);
}
.footer-content a {
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-content a:hover {
  color: var(--primary);
  text-decoration: underline;
}
