* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(160deg, #f0f4ff 0%, #fdf2f8 50%, #fff7ed 100%);
  min-height: 100vh;
  color: #333;
  -webkit-user-select: none;
  user-select: none;
  padding-bottom: 100px;
}

/* 顶部栏 */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header h1 { font-size: 20px; }
.header-actions { display: flex; gap: 8px; }

.icon-btn {
  background: #e0e7ff;
  border: none;
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  cursor: pointer;
}

/* 拍照按钮 */
.camera-area {
  display: flex;
  justify-content: center;
  padding: 60px 20px 20px;
}

.big-capture-btn {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px dashed #a5b4fc;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #4f46e5;
  cursor: pointer;
  transition: transform 0.15s;
}
.big-capture-btn:active { transform: scale(0.95); }
.camera-icon { font-size: 56px; }

/* 加载 */
.loading { text-align: center; padding: 40px 20px; }
.spinner {
  width: 44px; height: 44px;
  border: 5px solid #e0e7ff;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar {
  width: 240px; height: 6px;
  background: #e0e7ff;
  border-radius: 3px;
  margin: 16px auto 0;
  overflow: hidden;
}
#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #818cf8, #4f46e5);
  transition: width 0.3s;
}

/* 结果区域 */
.result-area {
  margin: 0 16px 100px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #f8fafc;
  font-weight: 700;
  font-size: 15px;
  color: #475569;
}

.close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 10px;
}

/* 句子列表 */
.sentence-list {
  max-height: 460px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sentence-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.sentence-item .text {
  flex: 1;
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
  color: #1e293b;
  word-break: break-word;
}
.sentence-item .text:active { color: #4f46e5; }

.item-btns {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.mini-btn {
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 7px 9px;
  line-height: 1;
}

.mini-btn.eval {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #16a34a;
}
.mini-btn.eval:active { background: #dcfce7; }

.mini-btn.edit {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  color: #2563eb;
}
.mini-btn.edit:active { background: #dbeafe; }

.mini-btn.del {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #dc2626;
}
.mini-btn.del:active { background: #fee2e2; }

/* 操作栏 */
.action-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 100px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.action-btn.primary { background: #4f46e5; color: #fff; }
.action-btn.secondary { background: #f1f5f9; color: #475569; }

/* 面板通用 */
.panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #fff;
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

/* 编辑面板 */
.edit-content { padding: 20px; }

.edit-content textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  font-size: 17px;
  line-height: 1.5;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  resize: vertical;
  font-family: inherit;
  color: #1e293b;
  -webkit-user-select: text;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
}
.edit-content textarea:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.15);
}

.edit-btns {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* 播放清单 */
.lists-content { padding: 12px 20px; }

.list-item {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.list-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.list-title {
  flex: 1;
  font-weight: 600;
  color: #1e293b;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 0;
  word-break: break-all;
}
.list-title::before {
  content: '▶ ';
  display: inline-block;
  transition: transform 0.2s;
  color: #94a3b8;
  font-size: 12px;
  margin-right: 4px;
}
.list-item.expanded .list-title::before {
  transform: rotate(90deg);
}

.list-item .item-btns { flex-shrink: 0; }

.list-sentences {
  display: none;
  margin-top: 8px;
  padding-left: 14px;
  border-left: 3px solid #e0e7ff;
}
.list-item.expanded .list-sentences {
  display: block;
}

.list-sentence {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 15px;
  color: #475569;
  border-bottom: 1px dashed #f1f5f9;
}
.list-sentence:last-child { border-bottom: none; }

.list-sentence .text {
  flex: 1;
  cursor: pointer;
  line-height: 1.4;
  word-break: break-word;
}
.list-sentence .text:active { color: #4f46e5; }

/* 播放控制栏 */
.player-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  z-index: 150;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.player-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
}
.player-btn.play { font-size: 26px; }
.player-status {
  flex: 1;
  color: #cbd5e1;
  font-size: 13px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 评测面板 */
.eval-content { padding: 20px; text-align: center; }

/* 上下句导航 */
.eval-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.nav-btn {
  background: #eef2ff;
  border: 1.5px solid #c7d2fe;
  color: #4f46e5;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.nav-btn:active { background: #e0e7ff; }
.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
}

.eval-counter {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  flex: 1;
  text-align: center;
}

.eval-target {
  font-size: 19px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.5;
  padding: 0 8px;
}

.eval-heard {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
  min-height: 20px;
}

.eval-score-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 6px solid #e0e7ff;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.eval-score-ring #evalScore {
  font-size: 40px;
  font-weight: 800;
  color: #4f46e5;
  line-height: 1;
}
.eval-score-ring span:last-child {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 4px;
}

.eval-stars {
  font-size: 26px;
  margin-bottom: 10px;
  letter-spacing: 3px;
}

.eval-feedback {
  font-size: 16px;
  color: #475569;
  margin-bottom: 24px;
  font-weight: 600;
}

.big-btn {
  padding: 16px !important;
  font-size: 17px !important;
  border-radius: 16px !important;
  margin-bottom: 10px;
  width: 100%;
}

#btnStopRecord {
  background: #ef4444 !important;
  color: #fff !important;
}

.hidden { display: none !important; }