/* ============================================
   增重笔记 · 全局样式（01-cream-journal 风格）
   暖米奶油日记本 · 宋体标题 · 虚线分割
   ============================================ */

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

html {
  /* 防止 iOS 输入框聚焦时页面被放大 */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Heiti SC", serif;
  background: #faf6ef;
  color: #4a3f2f;
  min-height: 100vh;
  padding: 24px 16px 100px;
  background-image:
    linear-gradient(rgba(180,160,120,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180,160,120,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  /* iOS 滚动优化 */
  -webkit-overflow-scrolling: touch;
  /* 防止横向溢出 */
  overflow-x: hidden;
}

/* —— 容器 —— */
.container { max-width: 720px; margin: 0 auto; }

/* —— 顶部栏 —— */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 4px; margin-bottom: 28px;
  gap: 12px;
}
.topbar-logo {
  font-family: "Songti SC", serif;
  font-size: 17px; color: #6a5a3a;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-logo::before {
  content: "·"; margin-right: 6px; color: #c8b888;
}
.topbar-date {
  font-size: 12px; color: #9a8a6a; letter-spacing: 0.5px;
  white-space: nowrap;
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-user {
  position: relative;
  font-size: 13px; color: #6a5a3a;
  cursor: pointer; padding: 6px 8px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
}
.topbar-user:hover { background: rgba(200,184,136,0.1); }
.topbar-user::after { content: "▾"; font-size: 10px; color: #a8956a; }
/* 默认隐藏用户名文字，窄屏只显示头像 */
.topbar-user .user-name { display: none; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #c8b888; color: #fffdf6;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}

/* —— 头像下拉菜单 —— */
.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fffdf6; border: 1px solid #ebe0c8;
  border-radius: 10px; min-width: 180px;
  padding: 8px 0; box-shadow: 0 4px 20px rgba(150,130,80,0.1);
  z-index: 100; display: none;
}
.dropdown.show { display: block; }
.dropdown-item {
  padding: 10px 16px; font-size: 13px;
  color: #6a5a3a; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.dropdown-item:hover { background: rgba(200,184,136,0.1); }
.dropdown-divider {
  height: 1px; background: #ebe0c8; margin: 6px 0;
}
.dropdown-item.danger { color: #a06a4a; }

/* —— 页面大标题 —— */
.page-title-block { margin-bottom: 24px; padding: 0 4px; }
.page-title {
  font-family: "Songti SC", serif;
  font-size: 28px; font-weight: 400; color: #4a3f2f;
  margin-bottom: 6px;
  line-height: 1.3;
}
.page-subtitle {
  font-size: 13px; color: #9a8a6a;
  font-style: italic; letter-spacing: 0.5px;
  line-height: 1.5;
}

/* —— 卡片 —— */
.card {
  background: #fffdf6;
  border: 1px solid #ebe0c8;
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(150,130,80,0.04);
  /* 防止内部内容溢出卡片 */
  min-width: 0;
}
.card-title {
  font-size: 11px; letter-spacing: 3px; color: #a8956a;
  text-transform: uppercase; margin-bottom: 18px;
  font-weight: 500;
}

/* —— 体重区 —— */
.weight-display {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 12px;
  flex-wrap: nowrap;
}
.weight-input {
  font-family: "Songti SC", serif;
  font-size: 36px; font-weight: 400;
  width: 100%; max-width: 200px;
  background: transparent; border: none;
  border-bottom: 1px solid #d4c8a8;
  color: #4a3f2f; padding: 4px 0; outline: none;
  min-width: 0; /* 关键：允许 flex item 收缩 */
}
.weight-unit { font-size: 16px; color: #9a8a6a; font-family: "Songti SC", serif; flex-shrink: 0; }
.weight-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #8a7a5a;
  flex-wrap: wrap;
}
.weight-compare {
  display: inline-block; padding: 2px 10px;
  border-radius: 12px; font-size: 12px;
}
.weight-compare.up { background: rgba(176,133,80,0.12); color: #b08550; }
.weight-compare.down { background: rgba(122,138,90,0.12); color: #7a8a5a; }
.weight-compare.flat { background: rgba(154,138,106,0.12); color: #9a8a6a; }
.weight-saved {
  font-size: 11px; color: #b8a888;
}

/* —— 三餐表格 —— */
.meal-table { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.meal-row {
  display: grid; grid-template-columns: 56px 1fr;
  gap: 12px; align-items: start;
}
.meal-label {
  font-size: 12px; color: #a8956a;
  padding-top: 14px; letter-spacing: 2px;
}
.meal-input {
  background: #fffdf6; border: 1px solid #ebe0c8;
  border-radius: 8px; padding: 12px 14px;
  font-size: 15px; color: #4a3f2f; resize: vertical;
  min-height: 44px; font-family: inherit; outline: none;
  transition: border-color 0.2s;
  width: 100%;
  /* 防止 iOS 自动放大 */
  font-size: max(15px, 1rem);
}
.meal-input:focus { border-color: #c8b888; }

/* —— 按钮 —— */
.btn-save {
  background: #c8b888; color: #fffdf6;
  border: none; padding: 10px 28px; border-radius: 8px;
  font-size: 13px; letter-spacing: 2px; cursor: pointer;
  transition: background 0.2s; font-family: inherit;
}
.btn-save:hover { background: #b8a878; }
.btn-save:disabled { background: #d4c8a8; cursor: wait; }
.btn-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.btn-saved-tip {
  font-size: 12px; color: #9a8a6a;
  display: flex; align-items: center; gap: 6px;
}
.btn-saved-tip::before {
  content: "✓"; color: #88a878; font-weight: 600;
}

/* —— 分析卡片 —— */
.analysis-card {
  background: linear-gradient(135deg, #fffdf6 0%, #f8f1de 100%);
  border: 1px solid #d4c8a8;
}
.analysis-tag {
  display: inline-block; background: #c8b888; color: #fffdf6;
  padding: 4px 12px; border-radius: 12px; font-size: 11px;
  letter-spacing: 1px; margin-bottom: 14px;
}
.analysis-tag.water { background: #88a8b8; }
.analysis-tag.normal { background: #88a878; }
.analysis-tag.attention { background: #b88a58; }
.analysis-text { font-size: 14px; line-height: 1.8; color: #5a4f3f; }
.analysis-text strong { color: #4a3f2f; font-weight: 600; }
.analysis-section { margin-bottom: 14px; }
.analysis-section-title {
  font-size: 11px; letter-spacing: 2px; color: #a8956a;
  margin-bottom: 6px; text-transform: uppercase;
}
.analysis-meal-list { list-style: none; padding: 0; }
.analysis-meal-list li {
  font-size: 13px; line-height: 1.7; color: #5a4f3f;
  padding-left: 14px; position: relative;
}
.analysis-meal-list li::before {
  content: "·"; position: absolute; left: 0; color: #c8b888;
}
.disclaimer {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px dotted #d4c8a8;
  font-size: 12px; color: #9a8a6a; line-height: 1.6;
}
.analysis-loading {
  text-align: center; padding: 20px;
  color: #9a8a6a; font-size: 13px;
}
.analysis-loading::after {
  content: "..."; animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0%, 20% { content: ""; }
  40% { content: "."; }
  60% { content: ".."; }
  80%, 100% { content: "..."; }
}

/* —— 底部 Tab 导航 —— */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fffdf6;
  border-top: 1px solid #ebe0c8;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  display: flex; justify-content: space-around;
  z-index: 50;
  /* 防止 iOS 工具栏覆盖 */
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.bottom-nav-item {
  flex: 1; text-align: center; padding: 6px 4px;
  text-decoration: none; color: #9a8a6a;
  font-size: 11px; letter-spacing: 2px;
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  transition: color 0.15s;
  min-width: 0;
}
.bottom-nav-item .icon { font-size: 20px; line-height: 1; }
.bottom-nav-item:hover { color: #6a5a3a; }
.bottom-nav-item.active { color: #6a5a3a; }
.bottom-nav-item.active .icon { color: #c8b888; }

/* —— 折线图占位 —— */
.chart-container {
  background: #fffdf6; border: 1px solid #ebe0c8;
  border-radius: 12px; padding: 20px;
  margin-bottom: 16px;
  min-width: 0;
}
.chart-toolbar { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.chart-tab {
  padding: 6px 14px; border-radius: 16px;
  border: 1px solid #ebe0c8; background: transparent;
  font-size: 12px; color: #9a8a6a; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
  white-space: nowrap;
}
.chart-tab:hover { border-color: #c8b888; color: #6a5a3a; }
.chart-tab.active {
  background: #c8b888; color: #fffdf6;
  border-color: #c8b888;
}
.chart-canvas {
  width: 100%; height: 240px;
  background: #fffdf6; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #b8a888; font-size: 13px;
  border: 1px dashed #ebe0c8;
  text-align: center;
  padding: 16px;
}
.chart-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-top: 16px;
  padding-top: 16px; border-top: 1px dashed #d4c8a8;
}
.chart-stat-item { text-align: center; min-width: 0; }
.chart-stat-label { font-size: 10px; color: #9a8a6a; letter-spacing: 1px; }
.chart-stat-value {
  font-family: "Songti SC", serif;
  font-size: 18px; color: #4a3f2f; margin-top: 4px;
}

/* —— 历史列表 —— */
.history-toolbar {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 12px;
  padding: 0 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.history-toolbar input[type="date"] {
  font-size: 12px;
}
.history-list {
  background: #fffdf6; border: 1px solid #ebe0c8;
  border-radius: 12px; overflow: hidden;
}
.history-item {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px dashed #ebe0c8;
  cursor: pointer; transition: background 0.15s;
  text-decoration: none; color: inherit;
  min-width: 0;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: rgba(200,184,136,0.05); }
.history-date {
  font-size: 13px; color: #4a3f2f;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.history-date .weekday {
  font-size: 11px; color: #9a8a6a;
  margin-left: 6px;
  display: inline-block;
}
.history-weight {
  font-family: "Songti SC", serif;
  font-size: 16px; color: #4a3f2f;
  white-space: nowrap;
}
.history-arrow { color: #c8b888; font-size: 14px; flex-shrink: 0; }

/* —— 单日详情 —— */
.detail-header {
  display: flex; justify-content: space-between;
  align-items: center; padding: 12px 0;
  border-bottom: 1px dashed #d4c8a8;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-date { font-family: "Songti SC", serif; font-size: 20px; color: #4a3f2f; }
.detail-weight-block { text-align: right; }
.detail-weight {
  font-family: "Songti SC", serif; font-size: 22px; color: #4a3f2f;
}
.detail-meal-block { margin-bottom: 16px; }
.detail-meal-row {
  padding: 10px 0; border-bottom: 1px dotted #ebe0c8;
}
.detail-meal-row:last-child { border-bottom: none; }
.detail-meal-label {
  font-size: 11px; color: #a8956a;
  letter-spacing: 2px; margin-bottom: 4px;
}
.detail-meal-text { font-size: 14px; color: #4a3f2f; line-height: 1.6; word-break: break-word; }

/* —— 表单 —— */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 11px; color: #a8956a;
  letter-spacing: 2px; margin-bottom: 6px;
  text-transform: uppercase;
}
.form-input {
  width: 100%; background: transparent;
  border: none; border-bottom: 1px solid #d4c8a8;
  padding: 8px 0; font-size: 16px;
  color: #4a3f2f; outline: none;
  font-family: inherit;
  /* 防止 iOS 自动放大 */
  -webkit-appearance: none;
  border-radius: 0;
}
.form-input:focus { border-bottom-color: #c8b888; }
.form-input::placeholder { color: #c8b888; }

/* —— 登录页 —— */
.login-container { max-width: 380px; margin: 60px auto 0; padding: 0 4px; }
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo-title {
  font-family: "Songti SC", serif;
  font-size: 28px; color: #4a3f2f;
}
.login-logo-sub {
  font-size: 12px; color: #9a8a6a;
  margin-top: 6px; letter-spacing: 2px;
}
.login-card { padding: 28px 24px; }
.login-toggle {
  text-align: center; margin-top: 16px;
  font-size: 13px; color: #9a8a6a;
}
.login-toggle a { color: #b08550; text-decoration: none; }
.login-toggle a:hover { text-decoration: underline; }

/* —— 设置项 —— */
.settings-section { padding: 16px 20px; }
.settings-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 12px 0;
  border-bottom: 1px dotted #ebe0c8;
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label {
  font-size: 14px; color: #4a3f2f;
  flex-shrink: 0;
}
.settings-row-value {
  font-size: 13px; color: #9a8a6a;
  text-align: right;
  word-break: break-word;
  min-width: 0;
}
.settings-btn {
  background: transparent; border: 1px solid #d4c8a8;
  padding: 6px 14px; border-radius: 6px;
  font-size: 12px; color: #6a5a3a;
  cursor: pointer; font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.settings-btn:hover { border-color: #c8b888; background: rgba(200,184,136,0.08); }
.settings-btn.danger { color: #a06a4a; border-color: #d4c8a8; }
.settings-btn.danger:hover { border-color: #a06a4a; background: rgba(160,106,74,0.08); }

/* —— 返回链接 —— */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: #9a8a6a;
  text-decoration: none; margin-bottom: 16px;
}
.back-link:hover { color: #6a5a3a; }
.back-link::before { content: "←"; }

/* —— 空状态 —— */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: #9a8a6a; font-size: 13px;
}

/* —— 工具提示 —— */
.tip {
  display: inline-block; font-size: 11px; color: #b8a888;
  padding: 4px 10px; border-radius: 12px;
  background: rgba(200,184,136,0.08);
  border: 1px dotted #d4c8a8;
}

/* ============================================
   响应式适配
   桌面：> 768px（默认值，已在上面定义）
   平板：481 - 768px
   手机大：376 - 480px
   手机小：≤ 375px（iPhone SE 等）
   ============================================ */

/* 平板及以下 */
@media (max-width: 768px) {
  body { padding: 20px 16px 96px; }
  .topbar { margin-bottom: 24px; }
}

/* 手机大屏 */
@media (max-width: 480px) {
  body {
    padding: 16px 12px 96px;
    /* 缩小背景纹理密度 */
    background-size: 24px 24px;
  }
  .topbar {
    gap: 8px;
    margin-bottom: 20px;
  }
  .topbar-logo {
    font-size: 16px;
  }
  .topbar-logo::before {
    margin-right: 4px;
  }
  .topbar-date {
    font-size: 11px;
  }
  .topbar-user {
    padding: 6px;
    gap: 4px;
  }
  .topbar-user::after { content: ""; } /* 隐藏下拉箭头，节省空间 */

  .page-title { font-size: 24px; }
  .page-subtitle { font-size: 12px; }

  .card {
    padding: 20px 16px;
    border-radius: 10px;
  }
  .card-title {
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: 14px;
  }

  /* 体重区 */
  .weight-display {
    gap: 6px;
  }
  .weight-input {
    font-size: 32px;
    width: 100%;
    max-width: 160px;
  }
  .weight-unit {
    font-size: 14px;
  }
  .weight-meta {
    font-size: 11px;
    gap: 6px;
  }

  /* 三餐表格 */
  .meal-row {
    grid-template-columns: 48px 1fr;
    gap: 8px;
  }
  .meal-label {
    font-size: 11px;
    letter-spacing: 1px;
    padding-top: 12px;
  }
  .meal-input {
    padding: 10px 12px;
    font-size: 14px;
  }
  .btn-save {
    padding: 10px 24px;
    font-size: 12px;
  }

  /* 图表 */
  .chart-container {
    padding: 16px 12px;
  }
  .chart-canvas {
    height: 200px;
    font-size: 12px;
  }
  .chart-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .chart-stat-value {
    font-size: 16px;
  }

  /* 历史列表 */
  .history-toolbar {
    flex-direction: row;
    gap: 8px;
  }
  .history-item {
    padding: 12px 14px;
    gap: 8px;
  }
  .history-date {
    font-size: 12px;
  }
  .history-date .weekday {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
  .history-weight {
    font-size: 14px;
  }

  /* 单日详情 */
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .detail-weight-block {
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .detail-date {
    font-size: 18px;
  }
  .detail-weight {
    font-size: 20px;
  }

  /* 登录页 */
  .login-container {
    margin-top: 40px;
    padding: 0 4px;
  }
  .login-logo-title {
    font-size: 26px;
  }
  .login-logo-sub {
    font-size: 11px;
  }
  .login-card {
    padding: 24px 20px;
  }

  /* 设置 */
  .settings-section {
    padding: 12px 16px;
  }
  .settings-row {
    padding: 10px 0;
    gap: 8px;
  }
  .settings-row-label {
    font-size: 13px;
  }
  .settings-row-value {
    font-size: 12px;
  }
  .settings-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* 头像下拉菜单 */
  .dropdown {
    right: -8px;
    min-width: 160px;
  }

  /* 底部导航 */
  .bottom-nav-item {
    font-size: 10px;
    letter-spacing: 1px;
  }
  .bottom-nav-item .icon {
    font-size: 18px;
  }
}

/* 手机小屏（iPhone SE 等 ≤ 375px） */
@media (max-width: 375px) {
  body {
    padding: 12px 10px 96px;
  }
  .topbar {
    gap: 6px;
  }
  .topbar-logo {
    font-size: 14px;
    letter-spacing: 0;
  }
  .topbar-logo::before {
    content: "";
    margin-right: 0;
  }
  .topbar-date {
    font-size: 10px;
  }
  .avatar {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .page-title {
    font-size: 22px;
  }

  .card {
    padding: 16px 14px;
  }

  .weight-input {
    font-size: 28px;
    max-width: 130px;
  }

  .meal-label {
    font-size: 10px;
  }

  .chart-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .chart-stat-label {
    font-size: 9px;
  }
  .chart-stat-value {
    font-size: 14px;
  }

  .login-logo-title {
    font-size: 22px;
  }
}

/* 极小屏（≤ 320px，老旧机型） */
@media (max-width: 320px) {
  body { padding: 10px 8px 96px; }
  .weight-input { font-size: 26px; }
  .page-title { font-size: 20px; }
}

/* ============================================
   AI 分析结果样式
   ============================================ */
.ai-result-card {
  background: linear-gradient(135deg, #fffdf6 0%, #faf6ef 100%);
  border: 1px solid #ebe0c8;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.ai-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.tag-water {
  background: rgba(100, 150, 200, 0.12);
  color: #4a6a8a;
  border: 1px solid rgba(100, 150, 200, 0.3);
}
.tag-normal {
  background: rgba(140, 180, 120, 0.12);
  color: #5a7a4a;
  border: 1px solid rgba(140, 180, 120, 0.3);
}
.tag-attention {
  background: rgba(200, 140, 80, 0.12);
  color: #8a5a2a;
  border: 1px solid rgba(200, 140, 80, 0.3);
}
.ai-section {
  margin-bottom: 14px;
}
.ai-section:last-of-type { margin-bottom: 0; }
.ai-section-title {
  font-size: 11px;
  color: #a8956a;
  letter-spacing: 2px;
  margin-bottom: 6px;
  font-weight: 500;
}
.ai-section-body {
  font-size: 14px;
  color: #4a3f2f;
  line-height: 1.7;
}
.ai-meal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.ai-meal-item {
  background: #fffdf6;
  border: 1px dotted #ebe0c8;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #4a3f2f;
  line-height: 1.5;
}
.ai-meal-label {
  display: block;
  font-size: 10px;
  color: #a8956a;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.ai-meta {
  font-size: 11px;
  color: #b8a888;
  margin-top: 12px;
  text-align: right;
  font-style: italic;
}
.ai-empty {
  text-align: center;
  padding: 32px 16px;
  color: #9a8a6a;
}
.ai-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.ai-empty-text {
  font-size: 13px;
  line-height: 1.6;
}
.trend-up { color: #5a7a4a !important; }
.trend-down { color: #8a5a2a !important; }

/* ============================================
   按钮组
   ============================================ */
.btn-row {
  display: flex; gap: 10px; align-items: center;
  margin-top: 8px; flex-wrap: wrap;
}
.btn-save {
  background: #c8b888; color: #fffdf6;
  border: none; padding: 10px 32px;
  border-radius: 8px; font-size: 13px;
  letter-spacing: 2px; cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-save:hover { background: #b8a878; }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ai {
  background: transparent;
  color: #6a5a3a;
  border: 1px solid #c8b888;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-ai:hover {
  background: rgba(200,184,136,0.1);
  border-color: #b8a878;
}
.btn-ai:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-saved-tip {
  font-size: 12px; color: #9a8a6a;
  font-style: italic;
}

/* ============================================
   下拉菜单
   ============================================ */
.dropdown {
  display: none;
  position: absolute;
  top: 100%; right: 0;
  background: #fffdf6;
  border: 1px solid #ebe0c8;
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(150,130,80,0.1);
  margin-top: 4px;
  z-index: 100;
  overflow: hidden;
}
.dropdown.show { display: block; }
.dropdown-item {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: #4a3f2f;
  text-decoration: none;
  transition: background 0.15s;
}
.dropdown-item:hover { background: rgba(200,184,136,0.1); }
.dropdown-item.danger { color: #a06a4a; }
.dropdown-divider {
  height: 1px;
  background: #ebe0c8;
  margin: 4px 0;
}

/* 旧 analysis-* 样式兼容（如果残留） */
.analysis-card { /* alias */ }
.analysis-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  background: rgba(140,180,120,0.12);
  color: #5a7a4a;
}
.analysis-section { margin-bottom: 14px; }
.analysis-section-title {
  font-size: 11px;
  color: #a8956a;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.analysis-text { font-size: 14px; color: #4a3f2f; line-height: 1.7; }
.analysis-meal-list {
  list-style: none;
  padding: 0;
}
.analysis-meal-list li {
  padding: 6px 0;
  border-bottom: 1px dotted #ebe0c8;
  font-size: 13px;
}
.analysis-meal-list li:last-child { border-bottom: none; }
.disclaimer {
  margin-top: 16px;
  padding: 10px;
  background: rgba(200,184,136,0.06);
  border-radius: 6px;
  font-size: 11px;
  color: #8a7a5a;
  line-height: 1.6;
}
.weight-compare {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}
.weight-compare.up { color: #5a7a4a; background: rgba(140,180,120,0.1); }
.weight-compare.down { color: #8a5a2a; background: rgba(200,140,80,0.1); }
.weight-compare.flat { color: #9a8a6a; background: rgba(150,140,100,0.1); }
.analysis-loading {
  text-align: center;
  padding: 40px 0;
  color: #a8956a;
  font-size: 13px;
  letter-spacing: 2px;
}
.analysis-loading::before {
  content: "🧠";
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
