/* ============================================================
   入口落地页 + 登录页 + 种植户端（移动优先）
   ============================================================ */

/* ---------- 入口落地页 ---------- */
@font-face {
  font-family: YunxiuBrush;
  src: url('../assets/fonts/yunxiu-brand.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.entry-page {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 56px 20px 40px;
  overflow: hidden;
  background:
    radial-gradient(1100px 480px at 80% -10%, rgba(127, 184, 161, .28), transparent 60%),
    radial-gradient(900px 420px at 12% 4%, rgba(201, 162, 39, .13), transparent 55%),
    linear-gradient(180deg, #F2ECDC 0%, #F5F0E4 46%, #E9E2CE 100%);
}
/* 飘叶粒子画布：入口页 / 登录页 / 注册页共用 */
.leaf-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.entry-brand { text-align: center; margin-bottom: 32px; position: relative; width: min(100%, 440px); }
.entry-mark { margin: 0 auto 8px; }
.brand-eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 13px;
  margin: 0 auto 7px;
  color: var(--clay); font-family: Georgia, serif;
  font-size: 10px; font-weight: 600; letter-spacing: .22em;
}
.brand-eyebrow::before, .brand-eyebrow::after {
  content: ''; width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(138,111,82,.55));
}
.brand-eyebrow::after { transform: rotate(180deg); }
.brand-wordmark {
  display: flex; align-items: center; justify-content: center; gap: .22em;
  font-family: YunxiuBrush, "KaiTi", "STKaiti", serif;
  font-weight: 400;
  color: var(--tea-dark);
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
}
.brand-wordmark span { letter-spacing: .08em; padding-left: .08em; white-space: nowrap; }
.brand-wordmark i {
  display: block; width: 5px; height: 5px; margin: 0 .06em;
  background: var(--gold-deep); border-radius: 1px; transform: rotate(45deg);
  box-shadow: 0 0 0 4px rgba(201,162,39,.08);
}
.entry-wordmark {
  font-size: clamp(36px, 8vw, 44px);
  line-height: 1.28;
}
.entry-title {
  margin-top: 12px;
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  letter-spacing: .14em; text-indent: .14em; text-wrap: balance;
}
.entry-sub { margin-top: 7px; color: var(--clay); font-size: 12px; }
.entry-cards {
  display: flex; flex-direction: column; gap: 14px;
  width: 100%; max-width: 420px;
  position: relative;
}
.entry-card {
  display: flex; align-items: center; gap: 16px;
  background: rgba(252, 249, 241, .88);
  border: 1px solid rgba(62, 122, 82, .16);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .entry-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: rgba(62, 122, 82, .32); }
}
.entry-card:active { transform: scale(.98); }
.entry-card-icon {
  width: 52px; height: 52px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--acc) 12%, transparent);
  color: var(--acc);
}
.entry-card-body h2 { font-size: 18px; color: var(--ink); }
.entry-card-body p { font-size: 13px; color: var(--clay); margin-top: 2px; }
.entry-arrow { color: var(--acc); font-size: 18px; flex-shrink: 0; }
.entry-demo { margin-top: 36px; text-align: center; font-size: 12px; color: var(--ink-soft); }
.site-foot { margin-top: 18px; padding-bottom: 28px; text-align: center; font-size: 12px; color: var(--ink-soft); }
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.entry-register { margin-top: 30px; text-align: center; font-size: 13.5px; }
.entry-register a { color: var(--tea-green); border-bottom: 1px dashed rgba(62, 122, 82, .45); padding-bottom: 1px; }

/* 入口页园区条：与登录页共用 .park-bar 样式，宽度对齐入口卡片 */
.entry-park-bar { max-width: 420px; margin: 26px 0 0; }


/* ---------- 登录页 ---------- */
.login-page {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 22px 40px;
  background:
    radial-gradient(900px 380px at 85% -6%, rgba(127, 184, 161, .3), transparent 58%),
    linear-gradient(180deg, #F2ECDC 0%, #F5F0E4 55%, #E9E2CE 100%);
}
/* 登录页沿用首页茶园背景：图片在最底层，暖色蒙版降低对比度，内容与飘叶保持清晰。 */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(245,240,228,.18), rgba(245,240,228,.78) 43%, rgba(245,240,228,.78) 57%, rgba(245,240,228,.18)),
    url('../assets/entry-tea-bg.png');
  background-size: cover;
  background-position: center;
  opacity: .48;
  mix-blend-mode: multiply;
}
.login-page > *:not(.leaf-canvas) { position: relative; z-index: 20; }
.login-page > .leaf-canvas { z-index: 10 !important; }
.login-brand { text-align: center; margin-bottom: 28px; position: relative; }
.login-mark { margin: 0 auto 6px; }
.login-wordmark {
  font-size: 32px;
  line-height: 1.3;
}
.login-title { margin-top: 8px; font-size: 17px; font-weight: 600; letter-spacing: .08em; }
.login-sub { color: var(--clay); font-size: 13px; margin-top: 6px; }
.login-form { width: 100%; max-width: 400px; padding: 26px 24px; }
.login-hint { text-align: center; color: var(--clay); font-size: 12px; margin-top: 14px; }
.login-back { margin-top: 22px; font-size: 13px; color: var(--clay); }

/* 登录 / 注册页顶部的「当前园区」条 */
.park-bar {
  width: 100%; max-width: 400px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; padding: 10px 16px;
  background: rgba(252, 249, 241, .82);
  border: 1px solid rgba(62, 122, 82, .18);
  border-radius: var(--r-md);
}
.park-bar-label { font-size: 12.5px; color: var(--clay); letter-spacing: .04em; flex-shrink: 0; }
.park-bar-pick {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
  font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
}
.park-bar-name {
  font-size: 13.5px; font-weight: 600; color: var(--tea-green);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.park-bar-switch {
  font-size: 11.5px; color: var(--ink-soft); flex-shrink: 0;
  border-bottom: 1px dashed rgba(90, 86, 77, .5); padding-bottom: 1px;
}
.park-bar-pick:active .park-bar-name { opacity: .7; }

/* 园区选择弹层 */
.sheet-note { font-size: 12.5px; margin: -8px 0 14px; }
.park-sheet-list { display: flex; flex-direction: column; gap: 8px; }
.park-sheet-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left; font: inherit;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(62, 122, 82, .18);
  border-radius: var(--r-md);
  padding: 12px 14px;
  cursor: pointer;
}
.park-sheet-dot {
  width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%;
  border: 1.5px solid rgba(62, 122, 82, .4);
}
.park-sheet-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.park-sheet-text strong { font-size: 14px; font-weight: 500; color: var(--ink); }
.park-sheet-text small { font-size: 11.5px; color: var(--ink-soft); }
.park-sheet-item.is-active {
  border-color: rgba(62, 122, 82, .5); background: rgba(62, 122, 82, .08);
}
.park-sheet-item.is-active .park-sheet-dot {
  background: var(--tea-green); border-color: var(--tea-green);
  box-shadow: 0 0 0 3px rgba(62, 122, 82, .15);
}
.park-sheet-item.is-active strong { color: var(--tea-green); }

/* ---------- 种植户外壳 ---------- */
.grower-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 22px 18px calc(84px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .grower-shell { padding-top: 34px; }
}
.grower-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.grower-hello { font-size: 24px; }
.grower-avatar {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--tea-green); color: #F7F2E7;
  font-family: var(--font-display); font-size: 19px;
  box-shadow: var(--sh-1);
}
.grower-avatar-lg { width: 64px; height: 64px; font-size: 26px; }

/* 统计卡 */
.grower-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.grower-stat {
  padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.grower-stat-num { font-size: 26px; font-weight: 700; color: var(--tea-deep); font-family: var(--font-display); }
.grower-stat-label { font-size: 12px; color: var(--clay); }

/* 主行动卡 */
.grower-cta {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--tea-green), var(--tea-deep));
  color: #F7F2E7;
  border-radius: var(--r-xl);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--sh-2);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .grower-cta:hover { transform: translateY(-2px); box-shadow: var(--sh-3); }
}
.grower-cta:active { transform: scale(.98); }
.grower-cta-icon {
  width: 54px; height: 54px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.grower-cta-text { flex: 1; display: flex; flex-direction: column; }
.grower-cta-text strong { font-size: 18px; font-family: var(--font-display); letter-spacing: .04em; }
.grower-cta-text small { font-size: 12px; opacity: .82; margin-top: 2px; }
.grower-cta-arrow { font-size: 20px; opacity: .8; }

/* 快捷徽章 */
.grower-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; }
.grower-quick-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--qc);
  font-size: 12px;
  box-shadow: var(--sh-1);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .grower-quick-chip:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
}
.grower-quick-chip:active { transform: scale(.95); }
.grower-quick-chip span { color: var(--ink-soft); }

/* 区块标题 */
.grower-sec-title { font-size: 17px; margin: 4px 0 12px; }

/* 最近记录 */
.grower-recent-list { display: flex; flex-direction: column; gap: 10px; }
.grower-recent-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px;
  box-shadow: var(--sh-1);
  transition: transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .grower-recent-item:hover { transform: translateY(-1px); }
}
.grower-recent-item img { border-radius: var(--r-md); outline: 1px solid rgba(0,0,0,.08); outline-offset: -1px; }
.grower-recent-note { font-size: 13px; color: var(--ink-soft); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 茶园天气条 */
.grower-weather { margin-top: 22px; }
.weather-region { font-size: 12px; font-weight: 400; color: var(--ink-soft); margin-left: 2px; }
.weather-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.weather-day {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px 6px;
  box-shadow: var(--sh-1);
}
.weather-label { font-size: 11.5px; color: var(--ink-soft); }
.weather-icon { font-size: 20px; line-height: 1.2; }
.weather-desc { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.weather-temp { font-size: 13px; font-weight: 600; }
.weather-precip { font-size: 11px; color: #4A90C2; }

/* AI 农事建议 */
.grower-advice { margin-top: 22px; }
.advice-list { display: flex; flex-direction: column; gap: 10px; }
.advice-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-left: 3px solid var(--moss);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  box-shadow: var(--sh-1);
}
.advice-card.advice-warn { border-left-color: #C08A2E; }
.advice-card.advice-tip { border-left-color: #4A90C2; }
.advice-icon { font-size: 19px; line-height: 1.35; }
.advice-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.advice-text p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }

/* 存储条 */
.grower-storage { margin-top: 22px; }

.grower-feedback { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:26px; padding:16px 18px; border:1px solid var(--line); border-radius:18px; background:var(--paper-bright); }
.grower-feedback-copy { min-width:0; }
.grower-feedback-copy strong { display:block; font-size:14px; }
.grower-feedback-copy p { margin:4px 0 0; color:var(--clay); font-size:12px; line-height:1.5; }
.feedback-sheet-head { display:flex; align-items:center; justify-content:space-between; }
.feedback-sheet-head h2 { margin:0; font-family:var(--font-display); }
.sheet-close { border:0; background:none; color:var(--clay); font-size:28px; line-height:1; cursor:pointer; }
.feedback-sheet-tip, .feedback-privacy { font-size:12px; line-height:1.5; }
.feedback-textarea { margin-top:12px; min-height:120px; }
.feedback-images { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.feedback-image { position:relative; display:block; width:64px; height:64px; }
.feedback-image img { width:100%; height:100%; object-fit:cover; border-radius:10px; }
.feedback-image button { position:absolute; top:-7px; right:-7px; width:20px; height:20px; border:0; border-radius:50%; background:var(--clay-red); color:#fff; cursor:pointer; }
.feedback-actions { display:flex; gap:10px; margin-top:16px; }
.feedback-actions .btn { flex:1; }
.storage-bar { height: 6px; border-radius: 3px; background: rgba(62, 122, 82, .1); overflow: hidden; }
.storage-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--moss), var(--tea-green)); transition: width var(--dur-slow) var(--ease-out); }

/* 底部 Tab */
.grower-tab {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 520px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(252, 249, 241, .94);
  border-top: 1px solid var(--line-soft);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}
.grower-tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--clay); font-size: 11px;
  padding: 4px 0;
  transition: color var(--dur-fast) var(--ease-out);
}
.grower-tab-item.active { color: var(--tea-green); }
.grower-tab-item.active span { font-weight: 700; }
.grower-tab-item:active { transform: scale(.95); }

/* 页面头 */
.grower-page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.grower-page-title { font-size: 20px; }

/* 上传页 */
.op-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.op-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 6px;
  background: var(--paper-bright);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--clay);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.op-card:active { transform: scale(.95); }
.op-card-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ops, rgba(138,111,82,.1));
  color: var(--op, var(--clay));
  transition: transform var(--dur-fast) var(--ease-out);
}
.op-card.selected {
  border-color: var(--op);
  background: color-mix(in srgb, var(--ops) 45%, var(--paper-bright));
}
.op-card.selected .op-card-icon { transform: translateY(-2px); }
.op-card-label { font-size: 13px; font-weight: 500; }

/* 多选操作类型时的字段分组：组间距 + 类型色小标题（--op/--ops 由内联样式给） */
.op-group + .op-group { margin-top: 24px; }
.op-group-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  font-size: 13px; font-weight: 600;
  color: var(--op, var(--clay));
}
.op-group-head::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--op, var(--clay));
}

.photo-area {
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: rgba(252, 249, 241, .6);
  padding: 24px 16px;
}
.photo-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.photo-empty-icon { color: var(--moss); opacity: .8; }
.photo-empty p { color: var(--clay); font-size: 13px; }
.photo-preview img { display: block; width: 100%; outline: 1px solid rgba(0,0,0,.08); outline-offset: -1px; animation: fadeUp var(--dur-med) var(--ease-out); }
.photo-canvas { position: relative; border-radius: var(--r-md); overflow: hidden; }

/* 本地检测框叠加层（模型缺失时整个 overlay 隐藏，不影响原照片展示） */
.photo-boxes { position: absolute; inset: 0; pointer-events: none; animation: fadeUp var(--dur-med) var(--ease-out); }
.det-box { position: absolute; border: 2px solid #E2543E; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }
.det-box.is-healthy { border-color: #2E9E5B; }
.det-tag { position: absolute; bottom: 100%; left: -2px; margin-bottom: 3px; background: #E2543E; color: #fff; font-style: normal; font-size: 10.5px; line-height: 1.7; padding: 0 6px; border-radius: 6px; white-space: nowrap; }
.det-box.is-healthy .det-tag { background: #2E9E5B; }
.det-box.is-flush .det-tag { bottom: auto; top: 0; margin-bottom: 0; }

/* 融合提示：本地检测模型与视觉大模型结论的对照 */
.diag-fuse { font-size: 12px; margin-top: 8px; padding: 6px 10px; border-radius: 8px; line-height: 1.5; }
.diag-fuse.is-ok { background: rgba(46,158,91,.12); color: #1F7A44; }
.diag-fuse.is-warn { background: rgba(226,84,62,.12); color: #B23A27; }
.upload-tip { text-align: center; color: var(--clay); font-size: 12px; margin-top: 12px; }

/* 撤回后重新编辑的提醒条（编辑记录页顶部） */
.resubmit-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: rgba(74, 144, 194, .10);
  border: 1px solid rgba(74, 144, 194, .28);
  border-radius: var(--r-md);
  color: #2F6A96;
  font-size: 12.5px;
  line-height: 1.6;
}

/* 记录页 */
.records-skeleton { margin-top: 8px; }
.rec-group { margin-bottom: 20px; }
.rec-date { font-size: 15px; color: var(--ink-soft); margin-bottom: 10px; font-family: var(--font-body); font-weight: 500; }
.rec-card { display: flex; gap: 12px; margin-bottom: 10px; padding: 14px; transition: opacity var(--dur-fast) var(--ease-out); }
.rec-withdrawn { opacity: .55; }
.rec-thumb {
  flex-shrink: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  outline: 1px solid rgba(0,0,0,.08); outline-offset: -1px;
  transition: transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .rec-thumb:hover { transform: scale(1.03); } }
.rec-thumb:active { transform: scale(.97); }
.rec-thumb-sm { border-radius: var(--r-sm); }
.rec-body { flex: 1; min-width: 0; }
.rec-note { font-size: 14px; margin: 6px 0 4px; }
.rec-withdraw-btn { color: var(--clay); }
.rec-reject-reason {
  margin-top: 8px; padding: 8px 12px;
  background: rgba(180, 85, 45, .07);
  border-radius: var(--r-sm);
  font-size: 12px; color: var(--clay-red);
}

/* 我的 */
.grower-me-head { display: flex; gap: 16px; align-items: center; margin-bottom: 4px; }

/* AI小茗（AI 助手） */
.ai-fill {
  padding: 14px 14px 16px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(201, 162, 39, .12), rgba(252, 249, 241, .92) 60%);
  border: 1px solid rgba(201, 162, 39, .38);
  border-radius: var(--r-lg);
}
.ai-fill-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ai-fill .textarea { margin-top: 10px; background: var(--paper-bright); }
.ai-guide { font-size: 12.5px; font-weight: 600; margin: 12px 0 0; color: var(--ink-soft); }
.ai-draft {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  animation: fadeUp var(--dur-med) var(--ease-out);
}
.ai-draft .f-chips { margin-top: 6px; }
.ai-filled { animation: aiFill 1.8s var(--ease-out); }
@keyframes aiFill {
  0% { background-color: rgba(201, 162, 39, .3); }
  100% { background-color: transparent; }
}
.ai-or { text-align: center; font-size: 11.5px; margin: 8px 0 0; }
.ai-diag-name { font-size: 14.5px; font-weight: 600; margin-top: 6px; }
.ai-diag-line { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; margin-top: 4px; }

/* 小茗形象：只做 AI 区域的视觉引导，不遮挡主要操作 */
.xiaoming-advice-head { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.xiaoming-ai-title { display:flex; align-items:center; gap:8px; }
.xiaoming-mini { width:52px; height:78px; object-fit:contain; object-position:bottom center; flex:0 0 auto; }
.xiaoming-caption { margin:3px 0 0; color:var(--clay); font-size:11.5px; }
.ai-fill .xiaoming-mini { width:40px; height:58px; }

/* 小茗轻微眨眼：闭眼帧只在停留时短暂显示，减少页面跳动 */
.xiaoming-avatar { position:relative; display:block; width:52px; height:78px; flex:0 0 auto; }
.xiaoming-avatar .xiaoming-mini { position:absolute; inset:0; width:100%; height:100%; }
.xiaoming-avatar .xiaoming-closed { opacity:0; animation:xiaomingBlink 5.6s ease-in-out infinite; }
@keyframes xiaomingBlink { 0%, 86%, 100% { opacity:0; } 88%, 91% { opacity:1; } 93% { opacity:0; } }
.ai-fill .xiaoming-avatar { width:40px; height:58px; }
@media (prefers-reduced-motion: reduce) { .xiaoming-avatar .xiaoming-closed { animation:none; } }

/* 标题信息左对齐，小茗固定在模块右侧，避免挤压标题 */
.xiaoming-advice-head { justify-content:space-between; }
.xiaoming-advice-head > div { order:1; }
.xiaoming-advice-head > .xiaoming-avatar { order:2; }
.ai-fill-head { align-items:center; }
.ai-fill-head > .text-muted { order:1; flex:1; }
.ai-fill-head > .xiaoming-ai-title { order:2; }

/* 入口首页茶园背景：左右叠加、中央留白，保证品牌与卡片清晰 */
.entry-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, rgba(245,240,228,.14), rgba(245,240,228,.72) 43%, rgba(245,240,228,.72) 57%, rgba(245,240,228,.14)), url('../assets/entry-tea-bg.png');
  background-size: cover;
  background-position: center;
  opacity: .52;
  mix-blend-mode: multiply;
}
.entry-page > * { position: relative; z-index: 1; }

/* 统一放大 AI 小茗，保持网页与小程序比例一致 */
.xiaoming-avatar { width:72px; height:108px; }
.ai-fill .xiaoming-avatar { width:64px; height:96px; }
.entry-page > .leaf-canvas { z-index:3; }
.entry-page > *:not(.leaf-canvas) { z-index:2; }

/* 网页上传页：小茗放在拍照/说话操作组右侧 */
.ai-fill { position:relative; }
.ai-action-mascot { position:absolute; top:112px; right:16px; width:72px; height:108px; z-index:3; }
.ai-action-mascot .xiaoming-mini { position:absolute; inset:0; width:100%; height:100%; }
.ai-action-mascot .xiaoming-closed { opacity:0; animation:xiaomingBlink 5.6s ease-in-out infinite; }
.ai-fill [data-action="ai-diagnose"], .ai-fill [data-action="ai-voice"], .ai-fill [data-action="ai-voice-file"] { width:calc(100% - 94px); margin-right:94px; }
.entry-page .leaf-canvas { z-index:10 !important; }
.entry-page > *:not(.leaf-canvas) { z-index:20; }

/* 最终层级修正：入口飘叶必须铺满整个视口，不能被 flex 计算成一条窄带 */
.entry-page .leaf-canvas { position:absolute !important; inset:0 !important; width:100% !important; height:100% !important; z-index:10 !important; }
.entry-page > *:not(.leaf-canvas) { position:relative; z-index:20; }

/* 上传页重新整理：标题在左，人物只服务于拍照/说话操作组 */
.ai-fill-head { display:flex; align-items:center; justify-content:flex-start; gap:12px; }
.ai-fill-head > .xiaoming-ai-title { order:1; flex:0 0 auto; }
.ai-fill-head > .text-muted { order:2; flex:1; text-align:right; }
.ai-action-mascot { top:116px; right:18px; width:86px; height:128px; }
.ai-fill [data-action="ai-diagnose"], .ai-fill [data-action="ai-voice"], .ai-fill [data-action="ai-voice-file"] { width:calc(100% - 112px); margin-right:112px; }

/* 小茗打招呼：一次性抬手挥两下、眨眼，然后停在原姿势 */
.xiaoming-avatar .xiaoming-wave, .ai-action-mascot .xiaoming-wave { opacity:0; animation:xiaomingWave 3.8s ease-in-out 1 both; }
.xiaoming-avatar .xiaoming-closed, .ai-action-mascot .xiaoming-closed { opacity:0; animation:xiaomingGreetingBlink 3.8s ease-in-out 1 both; }
@keyframes xiaomingWave {
  0%, 10% { opacity:0; transform:translateY(4px) rotate(0deg); }
  16%, 28% { opacity:1; transform:translateY(0) rotate(-2deg); }
  34%, 45% { opacity:1; transform:translateY(0) rotate(2deg); }
  52%, 100% { opacity:0; transform:translateY(0) rotate(0deg); }
}
@keyframes xiaomingGreetingBlink {
  0%, 57% { opacity:0; }
  60%, 63% { opacity:1; }
  66%, 100% { opacity:0; }
}

/* 动作帧切换时隐藏原帧，避免拿平板姿势与挥手姿势重叠 */
.xiaoming-avatar > .xiaoming-mini:first-child,
.ai-action-mascot > .xiaoming-mini:first-child { animation:xiaomingBaseSwap 3.8s ease-in-out 1 both; }
@keyframes xiaomingBaseSwap {
  0%, 10% { opacity:1; }
  16%, 50% { opacity:0; }
  56%, 58% { opacity:1; }
  60%, 66% { opacity:0; }
  70%, 100% { opacity:1; }
}

/* 首页小茗站在茶园留白处，独立于品牌与入口卡片。 */
.entry-page > .entry-mascot {
  position: absolute;
  top: 130px;
  left: max(22px, calc(50% - 280px));
  width: 132px;
  height: 198px;
  z-index: 21;
  pointer-events: none;
  transform: scaleX(-1);
  transform-origin: center;
}
.entry-mascot > .xiaoming-mini {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.entry-mascot > .xiaoming-mini:first-child {
  animation: xiaomingBaseSwap 3.8s ease-in-out 1 both;
}
.entry-mascot > .xiaoming-wave {
  opacity: 0;
  animation: xiaomingWave 3.8s ease-in-out 1 both;
}
.entry-mascot > .xiaoming-closed {
  opacity: 0;
  animation: xiaomingGreetingBlink 3.8s ease-in-out 1 both;
}
@media (max-width: 660px) {
  /* 背景：素材是「左右茶园、中央留白」构图，窄屏改用竖向渐变 + 定位到茶园侧 */
  .entry-page::before {
    background-image: linear-gradient(180deg, rgba(245,240,228,.28) 0%, rgba(245,240,228,.72) 52%, rgba(245,240,228,.92) 100%), url('../assets/entry-tea-bg.png');
    background-position: 20% center;
    opacity: .62;
    mix-blend-mode: normal;
  }
}
@media (prefers-reduced-motion: reduce) {
  .entry-mascot > .xiaoming-mini:first-child { animation: none; }
  .entry-mascot > .xiaoming-wave,
  .entry-mascot > .xiaoming-closed { animation: none; }
}

/* 首页右侧茗鉴：和小茗镜像相对，负责管理入口的迎宾提示 */
.entry-page > .entry-mascot-mingjian {
  left: auto;
  right: max(22px, calc(50% - 280px));
  transform: none;
}

/* 窄屏吉祥物：站到 logo 两侧的空档里（品牌文字居中，两侧各留 ~130px）。
   必须写在这里而不是上面的媒体查询里——两侧定位规则就在上方，
   同特异性下靠后的才生效。 */
@media (max-width: 660px) {
  .entry-page > .entry-mascot {
    top: 62px;
    left: 10px;
    width: 72px;
    height: 104px;
  }
  .entry-page > .entry-mascot-mingjian {
    left: auto;
    right: 10px;
  }
}

/* 登录页两侧 AI 形象：种植户与管理员登录共用同一套位置和动画 */
.login-page > .login-mascot-left,
.login-page > .login-mascot-right {
  position: absolute;
  top: 90px;
  width: 132px;
  height: 198px;
  z-index: 2;
  pointer-events: none;
  transform-origin: center;
}
.login-page > .login-mascot-left { left: max(22px, calc(50% - 220px)); transform: scaleX(-1); }
.login-page > .login-mascot-right { right: max(22px, calc(50% - 220px)); transform: none; }
.login-mascot-left > .login-mascot-frame,
.login-mascot-right > .login-mascot-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-mascot-left > .login-mascot-frame:first-child,
.login-mascot-right > .login-mascot-frame:first-child { animation: xiaomingBaseSwap 3.8s ease-in-out 1 both; }
.login-mascot-left > .login-mascot-wave,
.login-mascot-right > .login-mascot-wave { opacity: 0; animation: xiaomingWave 3.8s ease-in-out 1 both; }
.login-mascot-left > .login-mascot-closed,
.login-mascot-right > .login-mascot-closed { opacity: 0; animation: xiaomingGreetingBlink 3.8s ease-in-out 1 both; }

@media (max-width: 520px) {
  .login-page > .login-mascot-left,
  .login-page > .login-mascot-right {
    top: 80px;
    width: 78px;
    height: 118px;
  }
  .login-page > .login-mascot-left { left: 4px; }
  .login-page > .login-mascot-right { right: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-mascot-left > .login-mascot-frame:first-child,
  .login-mascot-left > .login-mascot-wave,
  .login-mascot-left > .login-mascot-closed,
  .login-mascot-right > .login-mascot-frame:first-child,
  .login-mascot-right > .login-mascot-wave,
  .login-mascot-right > .login-mascot-closed { animation: none; }
}



