/* ==========================================================================
   LeanLoop — 静态可交互原型
   设计方向：淡绿色 · 清新自然，AI 陪跑感，克制且有温度
   ========================================================================== */

/* ---------- base reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button svg { width: 16px; height: 16px; flex-shrink: 0; }
ul, ol { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
h1, h2, h3, h4 { line-height: 1.2; }

::selection { background: rgba(63, 143, 91, 0.22); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- design tokens ---------- */
:root {
  /* type scale (capped for web-app density) */
  --text-xs: clamp(0.72rem, 0.7rem + 0.1vw, 0.8rem);
  --text-sm: clamp(0.82rem, 0.8rem + 0.15vw, 0.9rem);
  --text-base: clamp(0.95rem, 0.92rem + 0.15vw, 1rem);
  --text-lg: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  --text-xl: clamp(1.35rem, 1.15rem + 0.8vw, 1.8rem);

  /* spacing (4px system) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* 微信绿灵感的清新浅绿色系，比上一版更浅、更透气 */
  --color-bg: #f4faf3;
  --color-surface: #ffffff;
  --color-surface-2: #f0f8ee;
  --color-surface-offset: #e6f4e3;
  --color-border: #e0eedb;
  --color-divider: #eaf5e6;

  --color-text: #26362a;
  --color-text-muted: #6d8069;
  --color-text-faint: #a6b8a1;
  --color-text-inverse: #ffffff;

  --color-primary: #29c76f;
  --color-primary-hover: #22b062;
  --color-primary-active: #1c9852;
  --color-primary-highlight: #d9f5e3;
  --color-primary-tint: #eafbf1;

  --color-success: #29c76f;
  --color-success-highlight: #d9f5e3;
  --color-warning: #b8873a;
  --color-warning-highlight: #f5ecd8;
  --color-error: #d1596a;
  --color-error-highlight: #fae3e6;
  --color-idle: #9bab96;
  --color-idle-highlight: #eef4ec;
  --color-pending: #4fa0c2;
  --color-pending-highlight: #dff1f6;

  --color-ai: #22a97a;
  --color-ai-highlight: #d3f3e6;
  --color-ai-tint: #eefbf5;

  --color-moss: #7fae4f;
  --color-moss-tint: #eef6e2;
  --color-sage: #4fae86;
  --color-sage-tint: #e4f7ee;

  --radius-sm: 0.4rem;
  --radius-md: 0.7rem;
  --radius-lg: 1.1rem;
  --radius-xl: 1.6rem;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(30, 46, 26, 0.06);
  --shadow-md: 0 6px 20px rgba(30, 46, 26, 0.08);
  --shadow-lg: 0 16px 40px rgba(30, 46, 26, 0.14);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- layout shell ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--color-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 540px) {
  #app { margin: var(--space-6) auto; min-height: calc(100dvh - var(--space-12)); border-radius: var(--radius-xl); overflow: hidden; }
}

.view {
  flex: 1;
  padding: var(--space-5) var(--space-4) var(--space-6);
  display: none;
  animation: fadeIn 220ms ease;
}
.view.active { display: block; }

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

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--color-bg);
}
.brand { display: flex; align-items: center; gap: var(--space-2); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--color-primary), #6fdb9b);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.01em; }
.top-date { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-1) calc(var(--space-2) + env(safe-area-inset-bottom, 0));
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--space-1) var(--space-1);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item.active { color: var(--color-primary); }
.nav-item:hover { color: var(--color-primary-hover); }

/* 中间逐动入口：AI记录，青叶形图标悬浮醒目 */
.nav-item--fab { color: var(--color-text-muted); margin-top: -22px; gap: 4px; }
.nav-item--fab span:last-child { margin-top: 2px; }
.nav-item--fab.active { color: var(--color-primary); }
.nav-fab {
  position: relative;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--color-primary), var(--color-sage));
  box-shadow: 0 8px 18px rgba(41, 199, 111, 0.38), 0 0 0 5px var(--color-bg);
  transition: transform var(--transition);
}
.nav-item--fab:hover .nav-fab { transform: translateY(-2px) scale(1.04); }
.nav-item--fab:active .nav-fab { transform: scale(0.96); }
.nav-fab svg { width: 24px; height: 24px; color: #fff; position: relative; z-index: 2; animation: fabBeat 2.6s ease-in-out infinite; }
.nav-fab__pulse {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px solid var(--color-primary);
  opacity: 0.55;
  animation: fabPulse 2.6s ease-out infinite;
}
@keyframes fabBeat { 0%, 100% { transform: scale(1); } 22% { transform: scale(1.14); } 40% { transform: scale(0.98); } }
@keyframes fabPulse { 0% { transform: scale(0.85); opacity: 0.6; } 70% { transform: scale(1.35); opacity: 0; } 100% { opacity: 0; } }

/* ---------- section heading ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-1);
}
.section-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-1); }
.section-title-row .section-title { margin-bottom: 0; }
.section-title-badge {
  width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffb648, #ff8a5c);
  color: #fff; box-shadow: 0 4px 10px rgba(255, 138, 92, 0.35);
}
.section-title-badge svg { width: 15px; height: 15px; }
.section-sub { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-5); }

/* ---------- card ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--space-4); }

/* ---------- status pills / dots ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 600;
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-full);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.status--idle { background: var(--color-idle-highlight); color: #5c554a; }
.status--idle .status-dot { background: var(--color-idle); }
.status--pending { background: var(--color-pending-highlight); color: #2c5776; }
.status--pending .status-dot { background: var(--color-pending); }
.status--done { background: var(--color-success-highlight); color: #33531f; }
.status--done .status-dot { background: var(--color-success); }
.status--error { background: var(--color-error-highlight); color: #7a2431; }
.status--error .status-dot { background: var(--color-error); }

/* ---------- today status card ---------- */
.today-card { position: relative; overflow: hidden; }
.today-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.today-card__greeting { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.today-card__weight { font-size: 2.1rem; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.today-card__weight small { font-size: 1rem; font-weight: 500; color: var(--color-text-muted); margin-left: 4px; }
.today-card__hint { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-2); }
.today-card__streak { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px dashed var(--color-divider); }
.streak-flame { font-size: 1.1rem; }
.streak-num { font-weight: 700; color: var(--color-primary); }

/* ---------- AI 快速录入卡（首页） ---------- */
.ai-quick-card {
  position: relative; overflow: hidden; margin-top: var(--space-4);
  background: linear-gradient(155deg, var(--color-ai-tint) 0%, var(--color-surface) 65%);
  border-color: var(--color-ai-highlight);
}
.ai-quick-card::before {
  content: '';
  position: absolute; top: -34px; right: -34px; width: 130px; height: 130px;
  background: radial-gradient(circle, var(--color-ai-highlight), transparent 70%);
  opacity: 0.85; pointer-events: none;
}
.ai-quick-card__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 700; color: var(--color-ai);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 4px; position: relative; z-index: 1;
}
.ai-quick-card__label svg { width: 14px; height: 14px; }
.ai-quick-card__sub { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-3); position: relative; z-index: 1; }
.ai-quick-card .chat-input-row { position: relative; z-index: 1; }
.ai-quick-card .quick-phrases { position: relative; z-index: 1; padding-bottom: 0; margin-top: var(--space-3); }
.home-ai-result { position: relative; z-index: 1; margin-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.home-ai-result .msg, .home-ai-result .draft-card { max-width: 100%; width: 100%; align-self: stretch; }
.home-ai-more {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: var(--text-xs); font-weight: 600; color: var(--color-ai);
  background: var(--color-ai-highlight); border-radius: var(--radius-full); padding: 6px 12px;
  transition: background var(--transition);
}
.home-ai-more:hover { background: var(--color-sage-tint); }
.home-ai-more svg { width: 13px; height: 13px; }

/* ---------- quick actions grid ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: var(--space-4); }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: var(--space-3) var(--space-1);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.quick-btn svg { width: 18px; height: 18px; }
.quick-btn:hover { transform: translateY(-2px); border-color: var(--color-primary); background: var(--color-primary-tint); }
.quick-btn:active { transform: translateY(0); }
.quick-btn__badge {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
}
.quick-btn__badge--record { background: var(--color-primary-highlight); color: var(--color-primary); }
.quick-btn__badge--trend { background: var(--color-ai-highlight); color: var(--color-sage); }
.quick-btn__badge--records { background: var(--color-moss-tint); color: var(--color-moss); }
.quick-btn__badge--summary { background: var(--color-pending-highlight); color: var(--color-pending); }

/* ---------- AI 一下卡内嵌入的洞察条 (合并自 AI洞察 + AI快速记录) ---------- */
.ai-insight-strip {
  position: relative; z-index: 1; overflow: hidden;
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-ai-highlight);
  display: flex; align-items: center; gap: var(--space-3);
}
.ai-insight-strip__info { flex: 1; min-width: 0; }
.ai-insight-strip__label { display: flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: 2px; }
.ai-insight-strip__label svg { width: 12px; height: 12px; flex-shrink: 0; }
.ai-insight-strip__delta { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.ai-insight-strip__delta.pos { color: var(--color-error); }
.ai-insight-strip__delta.neg { color: var(--color-success); }
.ai-insight-strip__sub { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 2px; }
.ai-insight-strip__chart { width: 96px; height: 44px; flex-shrink: 0; }
.ai-insight-strip__chart--svg {
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(79, 174, 134, 0.08), rgba(79, 174, 134, 0.02));
  padding: 4px;
}
.ai-insight-strip__chart--svg svg { width: 100%; height: 100%; overflow: visible; }
.ai-insight-strip__chart--svg polyline {
  fill: none;
  stroke: var(--color-sage);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- primary CTA ---------- */
.cta-primary {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition);
}
.cta-primary:hover { background: var(--color-primary-hover); }
.cta-primary:active { transform: scale(0.98); }
.cta-primary:disabled { background: var(--color-text-faint); cursor: not-allowed; transform: none; }
.cta-primary.loading { pointer-events: none; }

.cta-secondary {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-weight: 600; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  transition: background var(--transition), border-color var(--transition);
}
.cta-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }

.cta-ghost {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}
.cta-ghost:hover { color: var(--color-primary); background: var(--color-primary-tint); }

.cta-danger { color: var(--color-error); }
.cta-danger:hover { background: var(--color-error-highlight); }

/* ---------- AI insight card ---------- */
.ai-card {
  background: linear-gradient(150deg, var(--color-ai-tint), var(--color-surface));
  border: 1px solid var(--color-ai-highlight);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: '';
  position: absolute; top: -30px; right: -30px; width: 120px; height: 120px;
  background: radial-gradient(circle, var(--color-ai-highlight), transparent 70%);
  opacity: 0.7;
}
.ai-card__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 700; color: var(--color-ai);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}
.ai-card__label svg { width: 14px; height: 14px; }
.ai-card__text { font-size: var(--text-sm); line-height: 1.65; color: var(--color-text); position: relative; z-index: 1; }
.ai-card__actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }
.ai-chip {
  font-size: var(--text-xs); font-weight: 600; color: var(--color-ai);
  background: var(--color-ai-highlight); border-radius: var(--radius-full);
  padding: 6px 12px;
  transition: background var(--transition);
}
.ai-chip:hover { background: var(--color-ai-highlight); }

/* ---------- recent records list (home) ---------- */
.mini-list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.mini-record {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), transform var(--transition);
}
.mini-record:hover { border-color: var(--color-primary); transform: translateX(2px); }
.mini-record__left { display: flex; align-items: center; gap: var(--space-3); }
.mini-record__date { font-size: var(--text-xs); color: var(--color-text-muted); width: 44px; }
.mini-record__weight { font-weight: 700; font-family: var(--font-display); font-size: var(--text-base); }
.mini-record__tags { font-size: var(--text-xs); color: var(--color-text-faint); }

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-text-muted);
}
.empty-state svg { width: 44px; height: 44px; margin: 0 auto var(--space-3); color: var(--color-text-faint); }
.empty-state p { font-size: var(--text-sm); margin-bottom: var(--space-4); }

/* ---------- chat view ---------- */
#view-chat.view { padding-bottom: var(--space-3); }
.chat-shell { display: flex; flex-direction: column; height: 420px; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: var(--space-4); }
.msg { max-width: 84%; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); font-size: var(--text-sm); line-height: 1.55; }
.msg--user { align-self: flex-end; background: var(--color-primary); color: var(--color-text-inverse); border-bottom-right-radius: var(--radius-sm); }
.msg--ai { align-self: flex-start; background: var(--color-surface); border: 1px solid var(--color-border); border-bottom-left-radius: var(--radius-sm); }
.msg--ai.thinking { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
.msg-time { font-size: 10px; opacity: 0.65; margin-top: 4px; display: block; }

.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-faint); animation: blink 1.1s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* 草稿卡片：AI 解析文字后生成的可确认记录卡片 */
.draft-card {
  align-self: flex-start;
  flex-shrink: 0;
  width: 84%;
  max-width: 320px;
  background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-ai-tint) 100%);
  border: 1px solid var(--color-ai-highlight);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.draft-card::before {
  content: '';
  position: absolute; top: -24px; right: -24px; width: 90px; height: 90px;
  background: radial-gradient(circle, var(--color-ai-highlight), transparent 70%);
  opacity: 0.8;
}
.draft-card--saved { background: var(--color-primary-tint); border-color: var(--color-primary-highlight); }
.draft-card--invalid { border-color: var(--color-error-highlight); }
.draft-card--needs-weight { border-color: var(--color-warning-highlight); }
.draft-card__label {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 600; color: var(--color-ai);
  margin-bottom: var(--space-2);
}
.draft-card__label svg { width: 14px; height: 14px; }
.draft-card__weight {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700;
  color: var(--color-text); line-height: 1; margin-bottom: var(--space-1);
  position: relative; z-index: 1;
}
.draft-card__weight small { font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted); margin-left: 4px; }
.draft-card__meta { display: flex; gap: 6px; font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-2); }
.draft-card__meal { font-size: var(--text-xs); color: var(--color-text-muted); background: var(--color-surface-2); border-radius: var(--radius-sm); padding: 6px 8px; margin-bottom: var(--space-2); line-height: 1.45; }
.draft-card__warn { font-size: var(--text-xs); color: var(--color-error); background: var(--color-error-highlight); border-radius: var(--radius-sm); padding: 6px 8px; margin-bottom: var(--space-2); }
.draft-card__warn--info { color: var(--color-warning); background: var(--color-warning-highlight); }
.draft-card__actions { display: flex; gap: var(--space-2); position: relative; z-index: 1; }
.draft-card__btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); font-weight: 600; padding: 7px 12px; border-radius: var(--radius-md);
  transition: transform 0.15s ease, background 0.15s ease;
}
.draft-card__btn svg { width: 13px; height: 13px; }
.draft-card__btn--primary { background: var(--color-primary); color: var(--color-text-inverse); }
.draft-card__btn--primary:hover { background: var(--color-primary-hover); }
.draft-card__btn--ghost { background: var(--color-surface-2); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.draft-card__btn--ghost:hover { background: var(--color-surface-offset); }
.draft-card__btn:active { transform: scale(0.97); }
.draft-card__saved { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); font-weight: 600; color: var(--color-primary); }
.draft-card__saved svg { width: 13px; height: 13px; }

.quick-phrases { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-2) 0 var(--space-3); scrollbar-width: none; }
.quick-phrases::-webkit-scrollbar { display: none; }
.quick-phrase {
  flex-shrink: 0;
  font-size: var(--text-xs); font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-full);
  padding: 7px 13px;
  color: var(--color-text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.quick-phrase:hover { border-color: var(--color-primary); color: var(--color-primary); }

.chat-input-row { display: flex; gap: var(--space-2); align-items: flex-end; }
.chat-input {
  flex: 1;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  resize: none;
  max-height: 96px;
}
.chat-input:focus { border-color: var(--color-primary); }
.chat-send {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--color-primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.chat-send:hover { background: var(--color-primary-hover); }
.chat-send:disabled { background: var(--color-text-faint); }
.chat-send svg { width: 18px; height: 18px; }

/* ---------- records center ---------- */
.filter-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); flex-wrap: wrap; }
.filter-chip {
  font-size: var(--text-xs); font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  transition: all var(--transition);
}
.filter-chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.record-list { display: flex; flex-direction: column; gap: var(--space-3); }
.record-card {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color var(--transition), transform var(--transition);
}
.record-card:hover { border-color: var(--color-primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.record-card__date { display: flex; flex-direction: column; align-items: center; width: 46px; flex-shrink: 0; }
.record-card__date .dow { font-size: 10px; color: var(--color-text-faint); text-transform: uppercase; }
.record-card__date .dom { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.record-card__mid { flex: 1; min-width: 0; }
.record-card__weight { font-weight: 700; font-size: var(--text-base); font-family: var(--font-display); }
.record-card__meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tag-water { font-size: 10px; color: var(--color-sage); background: var(--color-sage-tint); border-radius: var(--radius-full); padding: 1px 7px; }
.tag-backfill { font-size: 10px; color: var(--color-pending); background: var(--color-pending-highlight); border-radius: var(--radius-full); padding: 1px 7px; }
.tag-edited { font-size: 10px; color: var(--color-warning); background: var(--color-warning-highlight); border-radius: var(--radius-full); padding: 1px 7px; }
.record-card__actions { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--color-surface-offset); color: var(--color-primary); }
.icon-btn.danger:hover { color: var(--color-error); background: var(--color-error-highlight); }

/* ---------- trends ---------- */
.range-toggle { display: inline-flex; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 3px; margin-bottom: var(--space-4); }
.range-toggle button { padding: 6px 16px; font-size: var(--text-xs); font-weight: 600; border-radius: var(--radius-full); color: var(--color-text-muted); transition: all var(--transition); }
.range-toggle button.active { background: var(--color-primary); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: var(--space-4); }
.stat-box { text-align: center; padding: var(--space-3) var(--space-2); background: var(--color-surface-2); border-radius: var(--radius-md); border: 1px solid var(--color-border); position: relative; overflow: hidden; }
.stat-box__icon {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
}
.stat-box__icon svg { width: 14px; height: 14px; }
.stat-box--delta .stat-box__icon { background: rgba(255, 122, 89, 0.16); color: #e05d3a; }
.stat-box--latest .stat-box__icon { background: rgba(58, 141, 214, 0.16); color: #2f7fc4; }
.stat-box--completion .stat-box__icon { background: rgba(214, 158, 26, 0.18); color: #b9800f; }
.stat-box__val { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.stat-box__val.pos { color: var(--color-success); }
.stat-box__val.neg { color: var(--color-error); }
.stat-box__label { font-size: 10px; color: var(--color-text-muted); margin-top: 2px; }

.chart-wrap { position: relative; height: 220px; margin-top: var(--space-2); }
.trend-fallback {
  margin-top: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-3);
}
.trend-fallback__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.trend-fallback__chart {
  position: relative;
  height: 168px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(to top, rgba(41, 199, 111, 0.06), rgba(41, 199, 111, 0.02)),
    repeating-linear-gradient(to top, transparent 0 31px, rgba(224, 238, 219, 0.9) 31px 32px);
  overflow: hidden;
}
.trend-fallback__chart svg {
  position: absolute;
  inset: 10px 10px 20px 10px;
  width: calc(100% - 20px);
  height: calc(100% - 30px);
  overflow: visible;
}
.trend-fallback__chart polyline {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trend-fallback__dot {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(41, 199, 111, 0.25);
}
.trend-fallback__dot span { display: none; }
.trend-fallback__labels {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: 10px;
  color: var(--color-text-faint);
}

/* ---------- report page decoration ---------- */
#reportContent { position: relative; overflow: hidden; }
#reportContent::before {
  content: '';
  position: absolute; top: -20px; right: -50px; width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255, 154, 66, 0.28), transparent 70%);
  pointer-events: none; z-index: 0;
}
#reportContent::after {
  content: '';
  position: absolute; top: 260px; left: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(58, 141, 214, 0.2), transparent 70%);
  pointer-events: none; z-index: 0;
}
#reportContent > * { position: relative; z-index: 1; }

/* ---------- summary ---------- */
.summary-hero {
  background: linear-gradient(155deg, var(--color-primary) 0%, var(--color-primary-active) 62%, #0f7a5c 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  position: relative;
  overflow: hidden;
}
.summary-hero::after {
  content: '';
  position: absolute; right: -40px; bottom: -40px; width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
}
.summary-hero::before {
  content: '';
  position: absolute; left: -30px; top: -40px; width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(255, 200, 87, 0.35), transparent 70%);
}
.summary-hero__stage { font-size: var(--text-xs); opacity: 0.85; text-transform: uppercase; letter-spacing: 0.05em; position: relative; z-index: 1; }
.summary-hero__head { display: flex; align-items: center; gap: 8px; margin: var(--space-1) 0 var(--space-3); position: relative; z-index: 1; }
.summary-hero__badge {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.22); color: #ffd873;
}
.summary-hero__badge svg { width: 16px; height: 16px; }
.summary-hero__title { font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; margin: 0; }
.summary-hero__metrics { display: flex; gap: var(--space-6); }
.summary-hero__metric-val { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.summary-hero__metric-label { font-size: 10px; opacity: 0.8; margin-top: 2px; }
.summary-quote { font-size: var(--text-sm); line-height: 1.7; margin-top: var(--space-4); opacity: 0.95; position: relative; z-index: 1; }

.summary-list { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.summary-row { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) 0; border-bottom: 1px dashed var(--color-divider); font-size: var(--text-sm); }
.summary-row:last-child { border-bottom: none; }
.summary-row__label { color: var(--color-text-muted); }
.summary-row__val { font-weight: 700; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 46, 26, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; animation: overlayIn 180ms ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  width: 100%; max-width: 480px;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-5) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom, 0));
  max-height: 88dvh;
  overflow-y: auto;
  animation: sheetIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 540px) {
  .modal-sheet { border-radius: var(--radius-xl); margin-bottom: var(--space-8); }
}
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }

.modal-handle { width: 36px; height: 4px; background: var(--color-border); border-radius: var(--radius-full); margin: 0 auto var(--space-4); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.modal-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); background: var(--color-surface-2); }
.modal-close:hover { color: var(--color-text); }
.modal-close svg { width: 14px; height: 14px; }

.modal-status-banner {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  display: flex; align-items: center; gap: 6px;
}

.field { margin-bottom: var(--space-4); }
.field label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); margin-bottom: 6px; }
.field input[type="text"], .field input[type="date"], .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
}
.field input:disabled, .field textarea:disabled, .field select:disabled { background: var(--color-surface-offset); color: var(--color-text-muted); }
.field textarea { resize: none; min-height: 64px; }
.field-error { color: var(--color-error); font-size: var(--text-xs); margin-top: 4px; display: none; }
.field-error.show { display: block; }
.field.has-error input, .field.has-error textarea { border-color: var(--color-error); }

.weight-input-row { display: flex; align-items: baseline; gap: var(--space-2); }
.weight-input-row input { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; text-align: left; padding: var(--space-2) var(--space-3); }
.weight-unit { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; }

.mood-grid { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.mood-opt {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  font-size: var(--text-sm);
}
.mood-opt.selected { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.modal-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.modal-actions-row { display: flex; gap: var(--space-2); }
.modal-actions-row .cta-secondary, .modal-actions-row .cta-primary { flex: 1; }

.source-note { font-size: var(--text-xs); color: var(--color-pending); background: var(--color-pending-highlight); padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: var(--space-4); }
.edited-note { font-size: var(--text-xs); color: var(--color-warning); background: var(--color-warning-highlight); padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: var(--space-4); }

.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- confirm dialog (secondary confirmation) ---------- */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30, 46, 26, 0.5);
  display: none; align-items: center; justify-content: center;
  padding: var(--space-4);
}
.confirm-overlay.open { display: flex; }
.confirm-box {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: sheetIn 200ms ease;
}
.confirm-box p { font-size: var(--text-sm); margin-bottom: var(--space-4); line-height: 1.6; }
.confirm-actions { display: flex; gap: var(--space-2); }
.confirm-actions button { flex: 1; }

/* ---------- toast ---------- */
.toast-stack {
  position: fixed; top: var(--space-4); left: 50%; transform: translateX(-50%);
  z-index: 300;
  display: flex; flex-direction: column; gap: var(--space-2);
  width: min(92%, 420px);
  pointer-events: none;
}
.toast {
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.error { background: var(--color-error); }
.toast.success { background: var(--color-primary); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.toast.leaving { animation: toastOut 200ms ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- misc ---------- */
.divider-label { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-faint); font-size: 10px; margin: var(--space-5) 0 var(--space-2); text-transform: uppercase; letter-spacing: 0.06em; }
.divider-label::after { content: ''; flex: 1; height: 1px; background: var(--color-divider); }

.hide { display: none !important; }

/* ---------- 报告页（趋势 + 总结 合并） ---------- */
.report-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.report-actions .cta-secondary, .report-actions .cta-primary { flex: 1; }
.summary-hero__foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-4); position: relative; z-index: 1; }
.summary-hero__regenerate {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: var(--text-xs); font-weight: 600; color: #fff;
  background: rgba(255,255,255,0.2); border-radius: var(--radius-full); padding: 7px 13px;
  transition: background var(--transition);
}
.summary-hero__regenerate:hover { background: rgba(255,255,255,0.32); }
.summary-hero__regenerate svg { width: 13px; height: 13px; }
.summary-hero__regenerate:disabled { opacity: 0.7; }

/* ---------- 分享页 ---------- */
.share-tabs { display: inline-flex; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 3px; margin-bottom: var(--space-4); width: 100%; }
.share-tabs button { flex: 1; padding: 8px 10px; font-size: var(--text-xs); font-weight: 600; border-radius: var(--radius-full); color: var(--color-text-muted); transition: all var(--transition); }
.share-tabs button.active { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }

.share-stage { display: flex; flex-direction: column; align-items: center; }
.share-card-wrap { width: 100%; display: flex; justify-content: center; margin-bottom: var(--space-4); }

.share-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-5);
}
.share-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,40,26,0.05) 0%, rgba(16,34,22,0.35) 55%, rgba(10,26,16,0.78) 100%);
}
.share-card__top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.share-card__brand { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); }
.share-card__brand-mark { width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,0.92); color: var(--color-primary-active); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; }
.share-card__stage-tag { font-size: 10px; background: rgba(255,255,255,0.22); padding: 3px 9px; border-radius: var(--radius-full); letter-spacing: 0.03em; }
.share-card__body { position: relative; z-index: 1; margin-top: auto; }
.share-card__delta { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; line-height: 1; text-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.share-card__delta small { font-size: var(--text-base); font-weight: 600; margin-left: 4px; opacity: 0.9; }
.share-card__delta-label { font-size: var(--text-xs); opacity: 0.85; margin-top: 2px; margin-bottom: var(--space-3); }
.share-card__caption { font-size: var(--text-base); font-weight: 600; line-height: 1.55; text-shadow: 0 1px 8px rgba(0,0,0,0.3); margin-bottom: var(--space-3); }
.share-card__spark { height: 40px; margin: var(--space-2) 0 var(--space-3); opacity: 0.9; }
.share-card__meta { display: flex; gap: var(--space-3); font-size: 10px; opacity: 0.85; }

.poster-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: linear-gradient(165deg, var(--color-surface) 0%, var(--color-ai-tint) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.poster-card::before {
  content: '';
  position: absolute; top: -50px; right: -50px; width: 180px; height: 180px;
  background: radial-gradient(circle, var(--color-primary-highlight), transparent 70%);
  opacity: 0.9;
}
.poster-card::after {
  content: '';
  position: absolute; bottom: -60px; left: -50px; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255, 183, 77, 0.28), transparent 70%);
}
.poster-card__brand { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; margin-bottom: var(--space-5); }
.poster-card__brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--color-primary), #6fdb9b); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; }
.poster-card__brand-name { font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); }
.poster-card__brand-tag {
  margin-left: auto; font-size: 10px; font-weight: 600; color: #b9800f;
  background: rgba(214, 158, 26, 0.16); border-radius: var(--radius-full); padding: 3px 10px;
}
.poster-card__stage { position: relative; z-index: 1; font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.poster-card__title { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; margin: var(--space-1) 0 var(--space-4); }
.poster-card__title svg { width: 16px; height: 16px; color: #e0a020; }
.poster-card__metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-bottom: var(--space-4); }
.poster-card__metric {
  text-align: center; padding: var(--space-3) var(--space-2); border-radius: var(--radius-md);
  background: var(--color-surface); border: 1px solid var(--color-border);
}
.poster-card__metric-icon {
  width: 24px; height: 24px; border-radius: 50%; margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center;
}
.poster-card__metric-icon svg { width: 13px; height: 13px; }
.poster-card__metric--delta .poster-card__metric-icon { background: rgba(255, 122, 89, 0.16); color: #e05d3a; }
.poster-card__metric--days .poster-card__metric-icon { background: rgba(58, 141, 214, 0.16); color: #2f7fc4; }
.poster-card__metric--streak .poster-card__metric-icon { background: rgba(214, 158, 26, 0.18); color: #b9800f; }
.poster-card__metric-val { font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; color: var(--color-primary-active); }
.poster-card__metric-val.neg { color: var(--color-error); }
.poster-card__metric-label { font-size: 10px; color: var(--color-text-muted); margin-top: 2px; }
.poster-card__chart-wrap {
  position: relative; z-index: 1; height: 130px; margin-bottom: var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2) var(--space-1);
}
.poster-card__chart-wrap .trend-fallback {
  margin-top: 0;
  height: 100%;
  padding: var(--space-2);
  border: none;
  background: transparent;
}
.poster-card__chart-wrap .trend-fallback__chart { height: calc(100% - 20px); }
.poster-card__highlight { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 8px; background: var(--color-ai-tint); border: 1px solid var(--color-ai-highlight); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.poster-card__highlight-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--color-ai); margin-top: 1px; }
.poster-card__highlight-icon svg { width: 16px; height: 16px; }
.poster-card__highlight-text { font-size: var(--text-xs); line-height: 1.5; color: var(--color-text); }
.poster-card__highlight-text b { font-family: var(--font-display); }
.poster-card__detail-list { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 7px; margin-bottom: var(--space-4); }
.poster-card__detail-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-xs); padding: 7px var(--space-3);
  background: var(--color-surface); border-radius: var(--radius-sm); border: 1px solid var(--color-border);
}
.poster-card__detail-row span:first-child { color: var(--color-text-muted); }
.poster-card__detail-row span:last-child { font-weight: 700; font-family: var(--font-display); }
.poster-card__quote { position: relative; z-index: 1; font-size: var(--text-sm); line-height: 1.7; color: var(--color-text); background: var(--color-surface); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); border: 1px dashed var(--color-border); }
.poster-card__footer { position: relative; z-index: 1; margin-top: var(--space-4); font-size: 10px; color: var(--color-text-faint); text-align: center; }

.share-actions { display: flex; gap: var(--space-2); width: 100%; max-width: 340px; flex-wrap: wrap; }
.share-actions button { flex: 1 1 48%; min-width: 0; white-space: nowrap; font-size: var(--text-sm); padding-left: var(--space-2); padding-right: var(--space-2); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.share-actions button.cta-primary { flex-basis: 100%; }
.share-actions button svg { width: 16px; height: 16px; flex: none; }
.share-bg-dots { display: flex; gap: 6px; margin-top: var(--space-3); }
.share-bg-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background-size: cover; background-position: center; cursor: pointer; transition: transform var(--transition), border-color var(--transition); }
.share-bg-dot.active { border-color: var(--color-primary); transform: scale(1.12); }

@media (max-width: 380px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .share-card, .poster-card { max-width: 100%; }
}
