/* ===== 植愈所 · 公共样式体系 ===== */

:root {
  /* 色彩系统 */
  --deep-green: #1a4d2e;
  --forest: #2d5a3d;
  --sage: #4a7c5e;
  --moss: #84a98c;
  --cream: #f5f0e8;
  --warm-white: #faf7f2;
  --deep-brown: #1a1208;
  --muted: #3a3530;
  --light-border: #e8e2d6;
  --error: #c0504d;

  /* 排版 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", Georgia, serif;

  /* 间距 */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* 圆角 */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;

  /* 过渡 */
  --transition: all 0.3s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--deep-brown);
  background: var(--warm-white);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 300; line-height: 1.3; color: var(--deep-green); }

/* ===== 布局容器 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: var(--transition);
  background: transparent;
}
.navbar.scrolled {
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--light-border);
  box-shadow: 0 2px 20px rgba(26, 77, 46, 0.05);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.navbar-logo {
  width: 36px;
  height: 36px;
  color: var(--deep-green);
}
.navbar-title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--deep-green);
  letter-spacing: 0.08em;
}
.navbar-subtitle {
  font-size: 0.65rem;
  color: var(--sage);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.navbar-nav a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: var(--transition);
  position: relative;
}
.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--deep-green);
}
.navbar-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--deep-green);
  border-radius: 2px;
}
.navbar-cta {
  padding: 0.6rem 1.5rem;
  background: var(--deep-green);
  color: #fff !important;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  transition: var(--transition);
}
.navbar-cta:hover {
  background: var(--forest);
  box-shadow: 0 4px 16px rgba(26, 77, 46, 0.2);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}
.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: var(--deep-green);
  transition: var(--transition);
}

/* 移动端菜单 */
.mobile-menu {
  display: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  background: rgba(250, 247, 242, 0.98);
  backdrop-filter: blur(12px);
}
.mobile-menu.open { max-height: 600px; }
.mobile-menu a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--muted);
  border-bottom: 1px solid var(--light-border);
}
.mobile-menu a:hover { color: var(--deep-green); background: var(--cream); }

/* ===== 页脚 ===== */
.footer {
  background: var(--deep-green);
  color: var(--cream);
  padding: var(--space-xl) 0 var(--space-md);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.footer-brand h3 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.footer-brand p {
  font-size: 0.85rem;
  color: rgba(245, 240, 232, 0.6);
  line-height: 1.8;
  margin-bottom: 1rem;
  max-width: 280px;
}
.footer-wechat {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: rgba(245, 240, 232, 0.6);
  padding: 0.35rem 0;
  transition: var(--transition);
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(245, 240, 232, 0.4);
}

/* ===== 通用组件 ===== */

/* 分区标题 */
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--deep-green);
  margin-bottom: 1rem;
}
.section-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 500px;
  line-height: 1.8;
}
.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.section-header .section-desc {
  margin: 0 auto;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  transition: var(--transition);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--deep-green);
  color: #fff;
}
.btn-primary:hover {
  background: var(--forest);
  box-shadow: 0 8px 24px rgba(26, 77, 46, 0.2);
  transform: translateY(-1px);
}
.btn-outline {
  border-color: rgba(26, 77, 46, 0.2);
  color: var(--deep-green);
}
.btn-outline:hover {
  border-color: var(--deep-green);
  background: rgba(26, 77, 46, 0.05);
}
.btn-ghost {
  color: var(--deep-green);
}
.btn-ghost:hover { background: var(--cream); }
.btn-ghost-light {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: var(--deep-green);
}
.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(26, 77, 46, 0.1);
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--cream);
  color: var(--sage);
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--light-border);
  transition: var(--transition);
}
.card:hover {
  border-color: rgba(26, 77, 46, 0.2);
  box-shadow: 0 12px 40px rgba(26, 77, 46, 0.08);
  transform: translateY(-2px);
}

/* 分割线 */
.divider {
  height: 1px;
  background: var(--light-border);
  margin: var(--space-md) 0;
}

/* ===== 动画 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .section-title { font-size: 2rem; }
}

@media (max-width: 640px) {
  .navbar-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-menu { display: block; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  .section-title { font-size: 1.75rem; }
  .container { padding: 0 1rem; }
}

/* ===== 打印样式 ===== */
@media print {
  .navbar, .footer, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}


/* ===== 风格搭配章节 ===== */
.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.style-item {
  padding: 1.25rem;
  background: var(--warm-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--light-border);
}
.style-item h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--deep-green);
}
.style-item p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.3rem;
}
.style-tips {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(107, 144, 128, 0.08), rgba(26, 77, 46, 0.04));
  border-radius: var(--radius-md);
  border-left: 3px solid var(--sage);
}
.style-tips h4 {
  color: var(--forest);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
.style-tips ul {
  margin: 0;
  padding-left: 1.25rem;
}
.style-tips li {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 2;
}
@media (max-width: 768px) {
  .style-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 植物卡片图片（全局） ===== */
.plant-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.plant-card-img-error {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--sage);
  font-weight: 300;
}

/* ===== AI养护助手 · 新增样式 ===== */

/* 顶部用户信息栏 */
.ai-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--light-border);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.ai-top-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ai-top-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--deep-green);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.ai-top-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ai-top-title-wrap h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--deep-green);
  margin-bottom: 2px;
}
.ai-top-title-wrap p {
  font-size: 0.75rem;
  color: var(--sage);
}
.ai-top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}
.free-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.35rem 0.75rem;
  background: var(--cream);
  color: var(--forest);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 400;
}
.free-count-badge strong {
  font-weight: 600;
  color: var(--deep-green);
}
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  border-radius: var(--radius-full);
  background: var(--cream);
  cursor: pointer;
  transition: var(--transition);
}
.user-menu-trigger:hover {
  background: #ece6da;
}
.user-menu-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
}
.user-menu-name {
  font-size: 0.8rem;
  color: var(--deep-green);
  font-weight: 400;
}
.login-btn-sm {
  padding: 0.45rem 1rem;
  background: var(--deep-green);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  transition: var(--transition);
}
.login-btn-sm:hover {
  background: var(--forest);
}

/* 用户下拉菜单 */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(26,77,46,0.12);
  border: 1px solid var(--light-border);
  min-width: 160px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: var(--transition);
  z-index: 50;
}
.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--deep-brown);
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--cream);
  color: var(--deep-green);
}
.user-dropdown .divider-line {
  height: 1px;
  background: var(--light-border);
  margin: 2px 0;
}

/* Tabs 切换 */
.ai-tabs {
  display: flex;
  gap: 0;
  background: var(--cream);
  padding: 4px;
  border-radius: var(--radius-md);
  margin: 0 1.25rem 0.75rem;
  position: relative;
}
.ai-tab {
  flex: 1;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--sage);
  background: none;
  border: none;
  border-radius: calc(var(--radius-md) - 4px);
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  transition: var(--transition);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.ai-tab.active {
  color: var(--deep-green);
  background: #fff;
  box-shadow: 0 2px 8px rgba(26,77,46,0.08);
  font-weight: 500;
}
.ai-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ai-tab .coming-soon-tag {
  font-size: 0.65rem;
  padding: 1px 6px;
  background: var(--moss);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 400;
}

/* 消息气泡增强 */
.msg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0.25rem;
}
.msg-row.bot-row { align-self: flex-start; align-items: flex-start; }
.msg-row.user-row { align-self: flex-end; align-items: flex-end; }
.msg-time {
  font-size: 0.7rem;
  color: var(--moss);
  padding: 0 0.5rem;
}
.msg-img {
  max-width: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.5rem;
  border: 2px solid rgba(255,255,255,0.3);
}
.msg-img img {
  width: 100%;
  display: block;
}
.msg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.fav-btn {
  font-size: 1rem;
  color: var(--moss);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 4px;
  transition: var(--transition);
  line-height: 1;
}
.fav-btn:hover { color: var(--deep-green); transform: scale(1.1); }
.fav-btn.favorited { color: #d4a017; }

/* 打字机光标 */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  margin-left: 2px;
  animation: cursor-blink 1s infinite;
  vertical-align: text-bottom;
}
@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 三点 loading */
.msg-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.85rem 1.1rem;
  background: var(--cream);
  border-radius: var(--radius-md);
  border-bottom-left-radius: 4px;
}
.msg-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  animation: dot-bounce 1.4s infinite ease-in-out;
}
.msg-typing span:nth-child(1) { animation-delay: 0s; }
.msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.msg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* 消息淡入上浮 */
.msg-fade-in {
  animation: msgFadeIn 0.35s ease-out;
}
@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 快捷问题按钮 */
.quick-q-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--light-border);
  background: #fff;
}
.quick-q-btn {
  padding: 0.4rem 0.85rem;
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--forest);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}
.quick-q-btn:hover {
  background: #fff;
  border-color: var(--sage);
  color: var(--deep-green);
}

/* 输入区 - 文字模式 */
.input-area {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--light-border);
  background: #fff;
}
.input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}
.input-row textarea {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--light-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.5;
}
.input-row textarea:focus { border-color: var(--deep-green); }
.send-btn {
  padding: 0 1.25rem;
  height: 44px;
  background: var(--deep-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.send-btn:hover { background: var(--forest); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 输入区 - 图片模式 */
.image-input-area {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--light-border);
  background: #fff;
}
.image-upload-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.upload-box {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--light-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--warm-white);
  color: var(--sage);
  font-size: 0.7rem;
  flex-shrink: 0;
}
.upload-box:hover {
  border-color: var(--sage);
  background: var(--cream);
  color: var(--deep-green);
}
.upload-box svg { width: 24px; height: 24px; }
.image-preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--light-border);
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-remove-btn:hover { background: rgba(0,0,0,0.8); }
.img-question-input {
  flex: 1;
  min-width: 150px;
  display: flex;
  gap: 0.5rem;
}
.img-question-input input {
  flex: 1;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--light-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  height: 44px;
}
.img-question-input input:focus { border-color: var(--deep-green); }

/* 语音模式占位 */
.voice-placeholder {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--moss);
}
.voice-placeholder-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage);
  opacity: 0.6;
}
.voice-placeholder h4 {
  font-size: 1rem;
  color: var(--moss);
  margin-bottom: 0.5rem;
  font-weight: 400;
}
.voice-placeholder p {
  font-size: 0.85rem;
  line-height: 1.7;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 30, 28, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 2rem;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s;
}
.modal-overlay.show .modal-card {
  transform: translateY(0);
}
.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--deep-green);
}
.modal-card h3 {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--deep-green);
  margin-bottom: 0.75rem;
}
.modal-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warm-white);
  padding: 2rem 1rem;
}
.login-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 900px;
  width: 100%;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(26,77,46,0.1);
  min-height: 560px;
}
.login-brand {
  background: linear-gradient(135deg, var(--deep-green) 0%, var(--forest) 50%, var(--sage) 100%);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-brand::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.login-brand::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 250px;
  height: 250px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}
.brand-logo-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.brand-logo-text h1 {
  font-size: 1.4rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.1em;
}
.brand-logo-text p {
  font-size: 0.7rem;
  opacity: 0.7;
  letter-spacing: 0.2em;
}
.brand-slogan {
  position: relative;
  z-index: 1;
}
.brand-slogan h2 {
  font-size: 1.75rem;
  color: #fff;
  font-weight: 300;
  line-height: 1.4;
  margin-bottom: 1rem;
}
.brand-slogan p {
  font-size: 0.9rem;
  opacity: 0.75;
  line-height: 1.8;
}
.brand-footer {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  opacity: 0.5;
}

.login-form-area {
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
}
.login-header {
  margin-bottom: 2rem;
}
.login-header h3 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--deep-green);
  margin-bottom: 0.5rem;
}
.login-header p {
  font-size: 0.85rem;
  color: var(--muted);
}
.login-tabs {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--light-border);
  position: relative;
}
.login-tab {
  padding: 0.75rem 0;
  font-size: 0.95rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  transition: var(--transition);
  position: relative;
}
.login-tab.active {
  color: var(--deep-green);
  font-weight: 500;
}
.login-tab-indicator {
  position: absolute;
  bottom: -2px;
  height: 2px;
  background: var(--deep-green);
  transition: left 0.3s ease, width 0.3s ease;
  border-radius: 2px;
}

.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 400;
}
.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--light-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  background: var(--warm-white);
}
.form-input:focus {
  border-color: var(--deep-green);
  background: #fff;
}
.input-with-btn {
  display: flex;
  gap: 0.5rem;
}
.input-with-btn .form-input { flex: 1; }
.code-btn {
  padding: 0 1.25rem;
  background: var(--cream);
  color: var(--deep-green);
  border: 1px solid var(--light-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.code-btn:hover:not(:disabled) {
  background: var(--deep-green);
  color: #fff;
  border-color: var(--deep-green);
}
.code-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-submit-btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--deep-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  margin-top: 0.5rem;
}
.login-submit-btn:hover { background: var(--forest); }
.login-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-agreement {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--moss);
}
.login-agreement a {
  color: var(--sage);
}

.wechat-login-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0;
}
.wechat-btn-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #07c160;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  opacity: 0.5;
  transition: var(--transition);
}
.wechat-btn-large svg { width: 40px; height: 40px; }
.wechat-login-text {
  font-size: 1rem;
  color: var(--deep-green);
  font-weight: 500;
}
.wechat-login-tip {
  font-size: 0.8rem;
  color: var(--moss);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--sage);
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}
.back-link:hover { color: var(--deep-green); }

/* ===== 收藏页 ===== */
.favorites-page {
  padding: 100px 0 var(--space-xl);
  background: var(--warm-white);
  min-height: 100vh;
}
.favorites-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.favorites-header h1 {
  font-size: 2rem;
  font-weight: 300;
  color: var(--deep-green);
  margin-bottom: 0.75rem;
}
.favorites-header p {
  color: var(--muted);
  font-size: 0.95rem;
}
.favorites-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.fav-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--light-border);
  overflow: hidden;
  transition: var(--transition);
}
.fav-card:hover {
  box-shadow: 0 8px 32px rgba(26,77,46,0.08);
  border-color: rgba(26,77,46,0.15);
}
.fav-card-header {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  cursor: pointer;
}
.fav-card-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--cream);
}
.fav-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fav-card-thumb .text-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage);
  font-size: 1.4rem;
}
.fav-card-content {
  flex: 1;
  min-width: 0;
}
.fav-card-q {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--deep-green);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}
.fav-card-a {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fav-card-a.expanded {
  -webkit-line-clamp: unset;
  display: block;
}
.fav-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem 1rem;
  border-top: 1px solid var(--light-border);
  background: var(--warm-white);
}
.fav-card-time {
  font-size: 0.75rem;
  color: var(--moss);
}
.fav-card-actions {
  display: flex;
  gap: 0.75rem;
}
.fav-card-action-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  border: 1px solid transparent;
  background: none;
}
.btn-view-detail {
  color: var(--deep-green);
  background: var(--cream);
}
.btn-view-detail:hover {
  background: var(--deep-green);
  color: #fff;
}
.btn-unfav {
  color: var(--error);
  border-color: rgba(192,80,77,0.2);
}
.btn-unfav:hover {
  background: rgba(192,80,77,0.08);
  border-color: var(--error);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 400px;
  margin: 0 auto;
}
.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage);
}
.empty-state h3 {
  font-size: 1.2rem;
  color: var(--deep-green);
  margin-bottom: 0.75rem;
  font-weight: 400;
}
.empty-state p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(26, 30, 28, 0.9);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  max-width: 80%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ===== 响应式补充 ===== */
@media (max-width: 640px) {
  .ai-top-bar {
    padding: 0.6rem 1rem;
  }
  .ai-top-title-wrap h2 { font-size: 0.95rem; }
  .ai-top-title-wrap p { display: none; }
  .free-count-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }
  .user-menu-name { display: none; }
  .ai-tabs {
    margin: 0 1rem 0.5rem;
  }
  .ai-tab {
    font-size: 0.8rem;
    padding: 0.5rem 0.4rem;
  }
  .input-area, .image-input-area {
    padding: 0.6rem 1rem;
  }
  .quick-q-row {
    padding: 0.4rem 1rem 0.6rem;
  }
  .quick-q-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }
  .msg-img { max-width: 160px; }

  /* 登录页 */
  .login-container {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .login-brand {
    padding: 2rem 1.5rem;
    min-height: 180px;
  }
  .login-form-area {
    padding: 2rem 1.5rem;
  }
  .brand-slogan h2 { font-size: 1.3rem; }

  /* 收藏页 */
  .favorites-page { padding: 80px 0 var(--space-lg); }
  .favorites-header h1 { font-size: 1.5rem; }
  .fav-card-header { padding: 1rem; }
  .fav-card-meta { padding: 0.6rem 1rem 0.75rem; }
}

@media (max-width: 480px) {
  .ai-tabs { gap: 0; }
  .upload-box, .image-preview {
    width: 64px;
    height: 64px;
  }
  .img-question-input { min-width: 100%; flex-basis: 100%; order: 2; }
  .image-upload-row { align-items: flex-start; }
}
