/* ============================================
   智语助老 — 适老化样式
   字体大、对比度高、按钮大、无弹窗
   ============================================ */

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

html, body {
  height: 100%;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: #333;
  background: #f5f5f5;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── 标题 ─────────────────────────────────── */

.title {
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  color: #222;
  margin-bottom: 16px;
}

/* ── 主按钮 ───────────────────────────────── */

.btn-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.talk-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: #4CAF50;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  touch-action: none;
}

.talk-btn .btn-icon {
  font-size: 36px;
  line-height: 1;
}

.talk-btn .btn-label {
  font-size: 16px;
  font-weight: bold;
}

.talk-btn:active,
.talk-btn.recording {
  background: #E53935;
  box-shadow: 0 6px 20px rgba(229, 57, 53, 0.5);
  transform: scale(0.95);
}

.talk-btn.recording .btn-label {
  content: "正在听您说...";
}

.talk-btn:disabled {
  background: #999;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ── 状态提示 ─────────────────────────────── */

.status-text {
  text-align: center;
  font-size: 20px;
  color: #666;
  min-height: 36px;
  margin: 8px 0;
  transition: opacity 0.2s;
}

.status-text.active {
  color: #E53935;
  font-weight: bold;
}

/* ── 对话区 ───────────────────────────────── */

.chat-box {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0 12px;
  min-height: 180px;
  max-height: 50vh;
  border: 1px solid #ddd;
}

.chat-msg {
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

.chat-msg .label {
  font-size: 14px;
  color: #999;
  margin-bottom: 2px;
}

.chat-msg.user .label {
  color: #1976D2;
}

.chat-msg.ai .label {
  color: #4CAF50;
}

.chat-msg .text {
  font-size: 20px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 10px;
  word-break: break-all;
}

.chat-msg.user .text {
  background: #E3F2FD;
  color: #0D47A1;
}

.chat-msg.ai .text {
  background: #E8F5E9;
  color: #1B5E20;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 快捷按钮 ─────────────────────────────── */

.quick-btns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.quick-btn {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 14px 8px;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-btn:active {
  background: #f0f0f0;
  border-color: #999;
}

.quick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── 加载动画 ─────────────────────────────── */

.loading-dots::after {
  content: "";
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0%  { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* ── 滚动条（适老、醒目）───────────────────── */

.chat-box::-webkit-scrollbar {
  width: 6px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}