/* ==========================================================================
   宠膳 网页端 — 全局样式
   设计参考：TopiBowl.com（米色暖系极简）+ RawFedAndNerdy.com（工具布局）
   ========================================================================== */

/* --- CSS Variables (TopiBowl 色彩体系) --- */
:root {
  --bg-cream: #F8F4EE;
  --bg-warm: #EFE8DD;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;
  --text-primary: #2D2926;
  --text-secondary: #6B5D4F;
  --text-muted: #7A6E5E;
  --accent: #7E4523;          /* 暖橙主色（加深后通过 WCAG AA 对比度 5.99:1） */
  --accent-light: #E8B89A;
  --accent-lighter: #F5E1D3;
  --accent-dark: #5C2F18;     /* hover 加深版（保持视觉层级） */
  --border: #E5DCC9;
  --border-light: #F0E8D8;
  --shadow-soft: 0 2px 16px rgba(0,0,0,0.04);
  --shadow-medium: 0 6px 32px rgba(0,0,0,0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --nav-height: 68px;
  --max-width: 1600px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
               "Microsoft YaHei", sans-serif;
  background: var(--bg-cream);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, "Times New Roman", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); margin-bottom: 0.5em; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }

p { color: var(--text-secondary); margin-bottom: 1em; }

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-title h2 { margin-bottom: 0.3em; }
.section-title p { font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* --- Container --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: 50px; border: none;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: all 0.25s ease; white-space: nowrap;
  font-family: inherit; letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-medium); }
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-warm); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }

/* --- Card (TopiBowl 圆角卡片风格) --- */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); border: 1px solid var(--border-light);
  padding: 24px; transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover { box-shadow: var(--shadow-medium); }
.card-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--accent-lighter); margin-bottom: 16px; }
.card-icon svg { width: 24px; height: 24px; color: var(--accent); }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 0.92rem; line-height: 1.6; }

/* --- Navigation (对标 TopiBowl 极简导航) --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-height); background: rgba(248,244,238,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light); transition: background 0.3s;
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px; font-weight: 700;
  font-size: 1.2rem; color: var(--text-primary) !important;
}
.nav-logo svg { width: 32px; height: 32px; }
.nav-logo-img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-xs);
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: var(--accent-lighter); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; background: none; border: none; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: 0.3s; }

/* --- Hero Section (对标 TopiBowl 首屏) --- */
.hero {
  padding: calc(var(--nav-height) + 60px) 0 60px;
  min-height: 80vh; display: flex; align-items: center;
  background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-warm) 100%);
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  align-items: center;
}
.hero-text h1 { margin-bottom: 20px; }
.hero-text h1 span { color: var(--accent); }
.hero-sub { font-size: 1.1rem; line-height: 1.7; margin-bottom: 32px; max-width: 480px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
/* iOS APP mockup container */
.hero-visual { width: 100%; display: flex; flex-direction: column; align-items: center; min-height: 300px; }

/* ============== Showcase Carousel (Horizontal 滑动) ============== */
.showcase-wrapper {
  position: relative; width: 100%; max-width: 480px; margin: 0 auto;
}
.showcase-viewport {
  position: relative; z-index: 1; overflow: hidden;
  cursor: grab; user-select: none;
}
.showcase-viewport:active { cursor: grabbing; }
.showcase-track {
  display: flex; transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}
.showcase-track.sc-dragging { transition: none; }
.showcase-slide {
  min-width: 100%; display: flex; justify-content: center; align-items: center;
  box-sizing: border-box;
}
.sc-content {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 0; padding: 30px 20px; width: 100%;
}
.sc-title {
  font-family: Georgia, "Times New Roman", "PingFang SC", "Noto Serif SC", serif; font-size: 1.15rem; font-weight: 700;
  color: #3A322C; margin: 0 0 24px; line-height: 1.3;
}
.sc-phone-img {
  width: 280px; max-height: 540px; display: block; border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  object-fit: cover;
  aspect-ratio: 280 / 540;  /* 防止图片加载时 hero 区域发生 CLS 布局偏移 */
}

/* Arrows */
.showcase-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 5; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08); background: rgba(255,255,255,0.9);
  color: #8a7e6e; font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.showcase-arrow:hover { background: #fff; color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.showcase-arrow.left { left: 8px; }
.showcase-arrow.right { right: 8px; }
.showcase-arrow.sc-disabled { opacity: 0.25; cursor: default; pointer-events: none; }

/* Dots */
.sc-dots {
  display: flex; gap: 6px; justify-content: center; margin-top: 14px;
}
.sc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(0,0,0,0.15); cursor: pointer; transition: all 0.3s;
}
.sc-dot.active { background: var(--accent); width: 22px; border-radius: 4px; }

/* 移动端缩小 */
@media (max-width: 600px) {
  .sc-phone-img { width: 220px; max-height: 460px; object-fit: cover; }
  .showcase-arrow { width: 32px; height: 32px; font-size: 18px; }
}

/* --- Feature Grid (对标 TopiBowl 功能模块) --- */
.features { padding: 80px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.feature-card { padding: 32px; }
.feature-card .card-icon { width: 56px; height: 56px; border-radius: 14px; }
.feature-card .card-icon svg { width: 28px; height: 28px; }
.feature-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.feature-card p { font-size: 0.88rem; }

/* --- Pain Point Section (对标 TopiBowl "Why Choose Us") --- */
.pain-points { padding: 80px 0; background: var(--bg-warm); }
.pain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.pain-item { display: flex; gap: 16px; margin-bottom: 24px; }
.pain-num { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-lighter); display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.pain-item h3 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.pain-item p { font-size: 0.88rem; }

/* --- Endorsement / AAFCO Section --- */
.endorsement { padding: 80px 0; background: var(--bg-white); }
.endorse-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.endorse-card {
  text-align: center; padding: 40px 24px;
  border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--bg-cream);
}
.endorse-icon { font-size: 2.5rem; margin-bottom: 16px; }
.endorse-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.endorse-card p { font-size: 0.88rem; }

/* --- Membership (三档订阅，对标 TopiBowl) --- */
.membership { padding: 80px 0; background: var(--bg-cream); }
.pricing-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 40px; }
.pricing-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border-light); padding: 36px 28px;
  text-align: center; position: relative; transition: 0.3s;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-medium); }
.pricing-card.popular {
  border-color: var(--accent); transform: scale(1.02);
}
.pricing-card.popular:hover { transform: scale(1.02) translateY(-4px); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 4px 20px;
  border-radius: 50px; font-size: 0.8rem; font-weight: 600;
}
.pricing-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.pricing-price { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); margin: 12px 0; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-desc { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 20px; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing-features li {
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem; display: flex; align-items: center; gap: 8px;
}
.pricing-features li::before { content: '✓'; color: var(--accent); font-weight: 700; }

/* --- Footer (ICP 备案脚注) --- */
.footer {
  background: var(--text-primary); color: rgba(255,255,255,0.7);
  padding: 40px 0 24px;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand h3 { color: #fff; font-size: 1.1rem; margin-bottom: 8px; }
.footer-brand p { font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.footer-col h4 { color: #fff; font-size: 0.9rem; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; margin-bottom: 12px; }
.footer-col a { display: block; color: rgba(255,255,255,0.5); font-size: 0.85rem; padding: 4px 0; }
.footer-col a:hover { color: var(--accent-light); }
/* ============== ICP 备案底部栏 (强制要求) ============== */
.footer-icp {
  padding-top: 20px; text-align: center; font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
}
.footer-icp a { color: rgba(255,255,255,0.65); text-decoration: underline; }
.footer-icp a:hover { color: var(--accent-light); }
.icp-sep { margin: 0 10px; opacity: 0.3; }

/* 公安备案：警徽图标 + 公网安备号（与左侧 ICP 视觉一致） */
.footer-icp .police-record {
  display: inline-flex; align-items: center; vertical-align: middle;
  color: rgba(255,255,255,0.65); text-decoration: underline;
  font-size: 0.82rem; line-height: 1;
}
.footer-icp .police-record:hover { color: var(--accent-light); }
.footer-icp .police-badge {
  width: 14px; height: 14px; margin-right: 4px;
  fill: currentColor; flex-shrink: 0;
}
@media (max-width: 600px) {
  .footer-icp .police-record { font-size: 0.82rem; }
  .footer-icp .police-badge { width: 12px; height: 12px; margin-right: 3px; }
}

/* --- Tool Page Specific --- */
.tool-page {
  min-height: 100vh;
  background: var(--bg-cream);
}
.tool-container { max-width: 1400px; margin: 0 auto; padding: 24px 24px 60px; }

.tool-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.tool-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Filter bar (search + species dropdown) */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
}
.filter-search {
  width: 160px; padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: 50px; font-size: 0.82rem; font-family: inherit;
  background: var(--bg-card); color: var(--text-primary);
  outline: none; transition: border-color 0.2s;
}
.filter-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,120,73,0.1);
}
.filter-search::placeholder { color: var(--text-muted); font-size: 0.8rem; }

.filter-select {
  padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: 50px; font-size: 0.82rem; font-family: inherit;
  background: var(--bg-card); color: var(--text-primary);
  outline: none; cursor: pointer; transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239C8E7E' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,120,73,0.1);
}

/* Pet section wrapper — 与 .tool-section 卡片样式一致 */
.pet-section {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 20px 24px;
  margin-bottom: 20px;
}

/* Pet card horizontal — 单卡片横版布局 */
.pet-slots {
  display: block;
}
.pet-slot {
  background: var(--bg-card); border: 2px solid var(--border-light);
  border-radius: var(--radius-md); padding: 18px 20px;
  cursor: pointer; transition: all 0.25s ease;
  text-align: left; position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 88px;
}
.pet-slot:hover { border-color: var(--accent-light); box-shadow: var(--shadow-soft); }
.pet-slot.active {
  border-color: var(--accent); background: linear-gradient(135deg, var(--accent-lighter) 0%, var(--bg-card) 100%);
  box-shadow: 0 6px 20px rgba(201,120,73,0.18);
}
.pet-slot .pet-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg-warm); display: flex; align-items: center;
  justify-content: center; font-weight: 700; color: var(--accent);
  font-size: 1.4rem; font-family: Georgia, "Times New Roman", "PingFang SC", "Noto Serif SC", serif;
  flex-shrink: 0;
}
.pet-slot .pet-photo {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; background: var(--bg-warm);
}
.pet-slot .pet-avatar-wrap {
  position: relative; cursor: pointer; flex-shrink: 0;
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
}
.pet-slot .pet-avatar-wrap:hover::after {
  content: '📷'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35); font-size: 1.2rem;
  border-radius: 50%;
}
.pet-slot.active .pet-avatar {
  background: var(--accent); color: #fff;
}
.pet-slot .pet-info { flex: 1; min-width: 0; }
.pet-slot .pet-name { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; display:flex; align-items:center; gap:6px; }
.pet-slot .pet-detail { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.pet-slot .pet-detail .tag-chip {
  display: inline-block; padding: 2px 8px; background: var(--bg-warm);
  border-radius: 10px; margin-right: 4px; font-size: 0.72rem;
  color: var(--text-secondary);
}
.pet-slot.pinned { border-color: var(--accent-light); }
.pet-slot.pinned::before {
  content: ''; position: absolute; top: 0; left: 16px; right: 16px;
  height: 3px; background: var(--accent); border-radius: 0 0 3px 3px;
}
.pet-slot .pet-action-hint {
  flex-shrink: 0;
  font-size: 0.78rem; color: var(--accent);
  padding: 6px 12px; border-radius: 16px;
  background: var(--accent-lighter);
}
.pet-delete-btn {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.08); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; line-height: 1; cursor: pointer;
  transition: 0.2s; opacity: 0; user-select: none;
}
.pet-slot:hover .pet-delete-btn { opacity: 1; }
.pet-delete-btn:hover { background: var(--warning-red); color: #fff; }
.pet-slot .pet-add-inline {
  margin-top: 12px; padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s;
  font-size: 0.9rem;
}
.pet-slot .pet-add-inline:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-lighter);
}
.pet-pin-badge {
  display: inline-block; font-size: 0.7rem; margin-left: 2px;
  vertical-align: middle;
}
.pet-add {
  border-style: dashed; display: flex; align-items: center;
  justify-content: center; gap: 6px; color: var(--text-muted);
  font-size: 0.9rem; min-height: 112px; border-color: var(--border);
  background: transparent;
}
.pet-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lighter); transform: none; }
.pet-add span { font-weight: 500; }

/* Pet rail — 顶部圆头像选择条（横向铺满；溢出时滚动） */
.pet-rail {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; padding: 4px 0 8px; margin-bottom: 16px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.pet-rail::-webkit-scrollbar { height: 4px; }
.pet-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.pet-rail-item {
  flex: 1 1 0; min-width: 64px; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  cursor: pointer; transition: all 0.2s;
  position: relative;
}
.pet-rail-item .pet-rail-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-warm); display: flex; align-items: center;
  justify-content: center; font-weight: 700; color: var(--accent);
  font-size: 1.1rem; font-family: Georgia, "Times New Roman", "PingFang SC", "Noto Serif SC", serif;
  border: 3px solid transparent;
  transition: all 0.2s;
}
.pet-rail-item:hover .pet-rail-circle { border-color: var(--accent-light); }
.pet-rail-item.active .pet-rail-circle {
  border-color: var(--accent);
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(201,120,73,0.25);
}
.pet-rail-item .pet-rail-label {
  font-size: 0.72rem; color: var(--text-secondary);
  max-width: 56px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: center;
  transition: color 0.2s;
}
.pet-rail-item.active .pet-rail-label { color: var(--accent); font-weight: 600; }
.pet-rail-item.pinned .pet-rail-circle::after {
  content: '📌'; position: absolute; top: -4px; right: -4px;
  font-size: 0.65rem; background: var(--bg-card);
  border-radius: 50%; padding: 1px; line-height: 1;
}
.pet-rail-item.add-rail {
  justify-content: center; padding-top: 6px;
}
.pet-rail-item.add-rail .pet-rail-circle {
  background: transparent; border: 2px dashed var(--border);
  color: var(--text-muted); font-size: 1.3rem;
}
.pet-rail-item.add-rail:hover .pet-rail-circle {
  border-color: var(--accent); color: var(--accent);
}

/* Overflow indicator (槽位溢出：… + 数量) */
.pet-rail-item.overflow-rail .pet-rail-circle.overflow-circle {
  background: var(--bg-warm);
  border: 2px dashed var(--accent);
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
}
.pet-rail-item.overflow-rail:hover .pet-rail-circle.overflow-circle {
  background: var(--accent-lighter);
}
.pet-rail-item.overflow-rail .pet-rail-label {
  color: var(--accent);
  font-weight: 600;
}

/* 溢出宠物列表弹窗 */
.overflow-pet-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.overflow-pet-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  transition: all 0.15s;
}
.overflow-pet-row:hover { background: var(--accent-lighter); border-color: var(--accent); }
.overflow-pet-row .overflow-pet-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: Georgia, "Times New Roman", "PingFang SC", "Noto Serif SC", serif; flex-shrink: 0;
}
.overflow-pet-row .overflow-pet-info { flex: 1; min-width: 0; }
.overflow-pet-row .overflow-pet-name { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); }
.overflow-pet-row .overflow-pet-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* Pet empty state */
.pet-empty-state {
  grid-column: 1 / -1; text-align: center; padding: 40px 24px;
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.pet-empty-icon { font-size: 2.4rem; margin-bottom: 12px; }
.pet-empty-state h3 { font-size: 1.05rem; margin-bottom: 6px; }
.pet-empty-state p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }

/* Load more button */
.pet-load-more {
  text-align: center; margin-top: 12px;
}
.btn-load-more {
  padding: 10px 36px; font-size: 0.88rem;
}

/* Plan overview */
.plan-overview { margin-bottom: 32px; }
.plan-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.metric-card {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; border: 1px solid var(--border-light);
}
.metric-value { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.metric-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Table styles */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
  background: var(--bg-card); border-radius: var(--radius-sm); overflow: hidden;
}
.data-table th {
  background: var(--bg-warm); padding: 12px 16px; text-align: left;
  font-weight: 600; font-size: 0.82rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-cream); }

/* Donut chart placeholder */
.chart-container {
  display: flex; align-items: center; gap: 32px;
  background: var(--bg-card); border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px; border: 1px solid var(--border-light);
}
.donut-chart {
  width: 180px; height: 180px; border-radius: 50%;
  background: conic-gradient(var(--accent) 0% 30%, var(--accent-light) 30% 55%, var(--border) 55% 70%, var(--accent-lighter) 70% 85%, var(--bg-warm) 85% 100%);
  flex-shrink: 0; position: relative;
}
.donut-chart-inner {
  position: absolute; inset: 30px; border-radius: 50%;
  background: var(--bg-card); display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.donut-chart-inner span:first-child { font-weight: 700; font-size: 0.9rem; }
.donut-chart-inner span:last-child { font-size: 0.75rem; color: var(--text-muted); }
.chart-legend { display: flex; flex-direction: column; gap: 8px; }
.chart-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.chart-legend-dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }

/* Section blocks */
.section-block { margin-bottom: 32px; }
.section-block h3 { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* Cooking guide */
.cooking-guide {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 24px; border: 1px solid var(--border-light);
}
.cooking-guide h4 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; margin-bottom: 12px; }
.cooking-guide ul { list-style: none; }
.cooking-guide ul li {
  padding: 8px 0; padding-left: 20px; position: relative;
  font-size: 0.9rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}
.cooking-guide ul li:last-child { border-bottom: none; }
.cooking-guide ul li::before { content: '•'; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }

/* Action buttons row */
.action-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Nutrient modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-content {
  background: var(--bg-card); border-radius: var(--radius);
  max-width: 800px; width: 100%; max-height: 80vh; overflow-y: auto;
  padding: 32px; position: relative; box-shadow: var(--shadow-medium);
}
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border-radius: 50%; border: none; background: var(--bg-warm);
  cursor: pointer; font-size: 1.1rem; display: flex; align-items: center;
  justify-content: center; color: var(--text-secondary);
  transition: 0.2s;
}
.modal-close:hover { background: var(--border); }

.nutrition-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 50px; font-size: 0.78rem; font-weight: 600; }
.nutrition-status.ok { background: #E8F5E9; color: #2E7D32; }
.nutrition-status.warn { background: #FFF3E0; color: #E65100; }
.nutrition-status.over { background: #FFEBEE; color: #C62828; }

/* Auth modal */
.auth-modal .modal-content { max-width: 420px; }
#emailPwdMode { display: flex; flex-direction: column; gap: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.form-input {
  padding: 12px 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius-xs); font-size: 0.95rem;
  font-family: inherit; background: var(--bg-card); transition: 0.2s;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lighter); }

/* 账号输入联想 */
.identifier-suggest-group { position: relative; z-index: 20; }
.identifier-suggest-group:focus-within { z-index: 60; }
.identifier-suggestions {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 3px; padding: 6px;
  margin: 0; background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 14px; box-shadow: 0 14px 32px rgba(58, 50, 44, 0.14);
  max-height: 300px; overflow-y: auto;
  overscroll-behavior: contain;
  animation: identifierSuggestIn 160ms ease-out;
}
.identifier-suggestions[hidden] { display: none; }
.identifier-suggestion {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px;
  padding: 7px 9px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text-primary); cursor: pointer; font: inherit; text-align: left;
  transition: background 160ms ease, transform 160ms ease;
}
.identifier-suggestion:hover,
.identifier-suggestion.is-active { background: var(--bg-warm); transform: translateX(2px); }
.identifier-suggestion:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg-warm);
}
.identifier-suggestion-mark {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 30px;
  width: 30px; height: 30px; border-radius: 9px; background: var(--bg-warm);
  color: var(--accent-dark); font-size: 0.72rem; font-weight: 700; letter-spacing: -0.02em;
  white-space: nowrap;
}
.identifier-suggestion-mark.is-phone { background: var(--accent-lighter); color: var(--accent-dark); }
.identifier-suggestion-value {
  min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis;
  font-size: 0.92rem; line-height: 1.3; letter-spacing: 0.01em;
}
.identifier-suggestion-meta { flex: 0 0 auto; color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; }
@keyframes identifierSuggestIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .identifier-suggestions, .identifier-suggestion { animation: none; transition: none; }
}
/* Auth tabs (手机/邮箱/扫码) */
.auth-tabs { display: flex; border-bottom: 1px solid var(--border-light); margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 10px 8px; border: none; background: none; cursor: pointer; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; transition: 0.2s; font-family: inherit; text-align: center; }
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.auth-tab-content { display: none; }
.auth-tab-content.active { display: block; }

.form-divider { text-align: center; color: var(--text-muted); font-size: 0.85rem; position: relative; }
.form-divider::before, .form-divider::after {
  content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border);
}
.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

/* Community preview */
.community-preview { padding: 80px 0; }

/* ============== 社会证明（首页） ============== */
.social-proof {
  padding: 64px 0 80px;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-card) 100%);
}
.trust-stats {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-soft);
}
.trust-stat { flex: 1; text-align: center; }
.trust-num {
  font-size: 2.4rem; font-weight: 800;
  font-family: Georgia, "Times New Roman", "PingFang SC", "Noto Serif SC", serif;
  color: var(--accent-dark);
  line-height: 1.1;
  margin-bottom: 6px;
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
}
.trust-stars { font-size: 0.95rem; color: #FFB300; letter-spacing: 1px; font-weight: 600; }
.trust-label {
  font-size: 0.85rem; color: var(--text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
.trust-divider {
  width: 1px; height: 48px;
  background: linear-gradient(180deg, transparent, var(--border-light), transparent);
  margin: 0 8px;
}

.trust-badges {
  text-align: center;
  margin-bottom: 64px;
}
.trust-badge-title {
  display: inline-block;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  padding: 6px 16px;
  background: var(--bg-cream);
  border-radius: 50px;
}
.trust-badges-row {
  display: flex; justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.trust-badge {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 20px;
  min-width: 200px;
  transition: all 0.2s;
}
.trust-badge:hover {
  transform: translateY(-2px);
  border-color: var(--accent-light);
  box-shadow: var(--shadow-soft);
}
.trust-badge-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.78rem;
  letter-spacing: -0.02em;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.trust-badge-name {
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.4;
}

.testimonials .section-title { margin-bottom: 32px; }
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  display: flex; flex-direction: column;
  transition: all 0.25s;
  position: relative;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-light);
}
.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 8px; right: 20px;
  font-size: 4rem;
  color: var(--accent-light);
  opacity: 0.4;
  font-family: Georgia, "Times New Roman", "PingFang SC", "Noto Serif SC", serif;
  line-height: 1;
}
.testimonial-stars {
  color: #FFB300;
  font-size: 1rem;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.testimonial-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
.testimonial-author {
  display: flex; align-items: center; gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.testimonial-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.95rem;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
.testimonial-name {
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
.testimonial-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 900px) {
  .trust-stats { flex-wrap: wrap; gap: 20px; padding: 24px 16px; }
  .trust-stat { flex: 1 1 40%; }
  .trust-divider { display: none; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .trust-badges-row { gap: 12px; }
  .trust-badge { min-width: 0; flex: 1 1 45%; padding: 12px 14px; }
}
@media (max-width: 600px) {
  .trust-num { font-size: 1.6rem; }
  .trust-stat { flex: 1 1 100%; }
  .testimonial-card { padding: 20px; }
}

/* ==== 以下原社区预览样式 ==== */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.post-card {
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border-light);
  transition: 0.25s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-medium); }
.post-thumb {
  height: 200px; background: var(--bg-warm);
  position: relative; overflow: hidden;
}
.post-thumb .post-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.post-card:hover .post-thumb .post-img { transform: scale(1.05); }
.post-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.post-badge {
  align-self: flex-start;
  background: rgba(255,255,255,0.95);
  color: var(--accent-dark);
  font-size: 0.72rem; font-weight: 600;
  padding: 4px 10px; border-radius: 50px;
  backdrop-filter: blur(4px);
}
.post-title-overlay {
  color: #fff; font-size: 0.92rem; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  align-self: flex-start;
}
.post-body { padding: 14px 16px 16px; }
.post-body h3 { font-size: 0.95rem; margin-bottom: 10px; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-muted);
}
.post-author { display: flex; align-items: center; gap: 6px; min-width: 0; }
.post-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.72rem; font-weight: 600;
  flex-shrink: 0;
}
.post-author-name {
  color: var(--text-secondary); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 90px;
}
.post-stats { display: flex; gap: 10px; flex-shrink: 0; }
.post-stats span { white-space: nowrap; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: #fff; padding: 12px 24px;
  border-radius: 50px; font-size: 0.88rem; z-index: 3000;
  opacity: 0; transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- File upload / image preview --- */
.file-upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 24px; text-align: center; cursor: pointer;
  transition: 0.25s; background: var(--bg-cream);
}
.file-upload-zone:hover { border-color: var(--accent); background: var(--accent-lighter); }
.file-upload-zone.has-file { border-style: solid; border-color: var(--accent); }
.file-upload-zone svg { width: 32px; height: 32px; color: var(--text-muted); margin-bottom: 8px; }
.file-upload-zone p { font-size: 0.85rem; margin: 0; }
.file-upload-zone input[type="file"] { display: none; }
.image-preview { max-width: 160px; max-height: 160px; border-radius: 8px; margin: 8px auto 0; object-fit: cover; display: block; }
.upload-progress { height: 4px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.upload-progress-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; width: 0; }
.avatar-upload { width: 72px; height: 72px; border-radius: 50%; border: 2px dashed var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.5rem; overflow: hidden; flex-shrink: 0; transition: 0.2s; position: relative; }
.avatar-upload:hover { border-color: var(--accent); color: var(--accent); }
.avatar-upload img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 500; text-align: center; line-height: 1.2; padding: 6px; pointer-events: none; }
.avatar-row { display: flex; align-items: center; gap: 16px; }

/* Page header (internal pages) */
.page-hero {
  padding: calc(var(--nav-height) + 40px) 0 40px;
  background: linear-gradient(180deg, var(--bg-cream), var(--bg-warm));
  text-align: center;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.page-hero p { max-width: 600px; margin: 12px auto 0; }

/* Science / Content */
.content-page { padding: 0 0 60px; }
.content-section { max-width: 800px; margin: 0 auto; padding: 0 20px 40px; }
.content-section h3 { font-size: 1.3rem; margin: 32px 0 12px; }
.content-section p { line-height: 1.8; }
.content-section ul, .content-section ol { padding-left: 24px; margin-bottom: 1em; }
.content-section li { margin-bottom: 8px; color: var(--text-secondary); line-height: 1.7; }

/* --- Login Required Banner --- */
.login-required {
  text-align: center; padding: 60px 20px;
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.login-required svg { width: 48px; height: 48px; color: var(--text-muted); margin-bottom: 16px; }
.login-required h3 { margin-bottom: 8px; }
.login-required p { max-width: 400px; margin: 0 auto 20px; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-visual { order: -1; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin-left: auto; margin-right: auto; }
  .pricing-card.popular { transform: none; }
  .pricing-card.popular:hover { transform: translateY(-4px); }
  .pain-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .plan-metrics { grid-template-columns: 1fr 1fr; }
  .post-grid { grid-template-columns: 1fr 1fr; }
  .endorse-grid { grid-template-columns: 1fr 1fr; }
  .chart-container { flex-direction: column; text-align: center; }
  .modal-content { margin: 16px; }
  /* Pet rail: scroll horizontally on tablet */
  .filter-search { flex: 1; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--bg-cream); padding: 16px; border-bottom: 1px solid var(--border); gap: 4px; }
  .feature-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .endorse-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
  .plan-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  /* Pet rail: scroll horizontally on mobile */
  .tool-controls { flex-direction: column; align-items: stretch; }
  .filter-search { flex: 1; }
  .action-row { flex-direction: column; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .sc-phone { width: 160px; }
  .sc-title { font-size: 1rem; }
  .sc-desc { font-size: 0.78rem; }
}

/* --- NProgress-like Loader --- */
.loader { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   第二阶段新增样式 — 2026-06
   环形图 SVG / 食谱卡片 / 食材表增强 / 营养校验 / 食谱库
   ========================================================================== */

/* --- SVG Donut Chart --- */
.donut-svg {
  width: 180px; height: 180px; flex-shrink: 0;
  transform: rotate(-90deg);
}
.donut-svg .bg-circle {
  fill: none; stroke: var(--border-light); stroke-width: 24;
}
.donut-svg .segment {
  fill: none; stroke-width: 24; stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}
.donut-center-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.donut-center-label .big { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.donut-center-label .small { font-size: 0.72rem; color: var(--text-muted); }

/* --- Recipe Library --- */
.recipe-library { margin-bottom: 32px; }
.recipe-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.recipe-card {
  background: var(--bg-card); border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); overflow: hidden;
  cursor: pointer; transition: 0.25s;
}
.recipe-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-medium); }
.recipe-card-image {
  height: 120px; background: linear-gradient(135deg, var(--accent-lighter), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.recipe-card-image .emoji { font-size: 2.4rem; }
.recipe-card-image .lock-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(45,41,38,0.6); color: #fff; width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; backdrop-filter: blur(4px);
}
.recipe-card-body { padding: 14px 16px; }
.recipe-card-body h4 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; font-size: 0.92rem; margin-bottom: 4px; }
.recipe-card-body .meta {
  font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 12px;
}
.recipe-card-body .meta span { display: flex; align-items: center; gap: 3px; }
.recipe-card .login-overlay {
  position: absolute; inset: 0; background: rgba(248,244,238,0.85);
  backdrop-filter: blur(4px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; opacity: 0;
  transition: opacity 0.3s;
}
.recipe-card:hover .login-overlay { opacity: 1; }
.recipe-card .login-overlay p { font-size: 0.82rem; margin-bottom: 8px; color: var(--text-primary); font-weight: 500; }

/* --- Ingredient Table Enhanced --- */
.ingredient-table-wrap {
  overflow-x: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.ingredient-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  background: var(--bg-card);
}
.ingredient-table th {
  background: var(--bg-warm); padding: 10px 14px; text-align: left;
  font-weight: 600; font-size: 0.8rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ingredient-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.ingredient-table tr:last-child td { border-bottom: none; }
.ingredient-table tr:hover td { background: var(--bg-cream); }
.ingredient-table .pct-bar {
  display: inline-block; height: 6px; border-radius: 3px;
  background: var(--accent); margin-right: 8px; vertical-align: middle;
  min-width: 4px;
}
.ingredient-table .badge {
  display: inline-block; padding: 2px 8px; border-radius: 50px;
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}
.badge-core { background: var(--accent-lighter); color: var(--accent-dark); }
.badge-meat { background: #FCE4D6; color: #A85F35; }
.badge-organ { background: #E8D5B7; color: #7D6B4A; }
.badge-veg { background: #D4E8D4; color: #3E6B3E; }

/* --- Supplement Table --- */
.supplement-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
.supplement-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: var(--bg-card); }
.supplement-table th { background: var(--bg-warm); padding: 10px 14px; text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap; }
.supplement-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.supplement-table tr:last-child td { border-bottom: none; }
.supplement-table tr:hover td { background: var(--bg-cream); }

/* --- Nutrition Validation Panel --- */
.nutri-check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-top: 12px;
}
.nutri-check-card {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 14px 16px; border: 1px solid var(--border-light);
  display: flex; flex-direction: column; gap: 4px;
}
.nutri-check-card .nutri-name { font-size: 0.82rem; font-weight: 600; }
.nutri-check-card .nutri-value { font-size: 1rem; font-weight: 700; }
.nutri-check-card .nutri-range { font-size: 0.7rem; color: var(--text-muted); }
.nutri-check-card.ok { border-left: 3px solid #4CAF50; }
.nutri-check-card.ok .nutri-value { color: #2E7D32; }
.nutri-check-card.warn { border-left: 3px solid #FF9800; }
.nutri-check-card.warn .nutri-value { color: #E65100; }
.nutri-check-card.over { border-left: 3px solid #f44336; }
.nutri-check-card.over .nutri-value { color: #C62828; }
.nutri-check-card .nutri-status-icon { font-size: 0.8rem; }

/* --- Progress Steps / Timeline --- */
.steps { display: flex; gap: 0; margin: 32px 0; counter-reset: step; }
.step-item { flex: 1; text-align: center; position: relative; padding: 0 12px; }
.step-item::before {
  content: ''; position: absolute; top: 20px; left: 50%; right: -50%;
  height: 2px; background: var(--border); z-index: 0;
}
.step-item:last-child::before { display: none; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-lighter); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; margin: 0 auto 12px;
  position: relative; z-index: 1;
}
.step-item.active .step-num { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(201,120,73,0.3); }
.step-item h3 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; font-size: 0.9rem; margin-bottom: 4px; }
.step-item p { font-size: 0.78rem; color: var(--text-muted); }

/* --- Animated Progress Bar --- */
.progress-animated {
  height: 6px; background: var(--border); border-radius: 3px;
  overflow: hidden; position: relative;
}
.progress-animated-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent-light), var(--accent));
  border-radius: 3px; transition: width 1s ease;
  position: relative; overflow: hidden;
}
.progress-animated-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: 48px 20px;
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-muted); margin-bottom: 12px; }
.empty-state h4 { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; font-size: 1rem; margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }

/* --- Tool Section Card --- */
.tool-section {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border-light); padding: 24px;
  margin-bottom: 20px;
}
.tool-section h3 {
  font-size: 1.05rem; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.tool-section h3 .section-icon { width: 24px; height: 24px; color: var(--accent); }

/* --- How It Works Section (Index page) --- */
.how-it-works { padding: 80px 0; background: var(--bg-white); }

/* --- Testimonial Quotes --- */
.testimonial { padding: 80px 0; background: var(--bg-warm); }
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 28px; border: 1px solid var(--border-light);
  text-align: center;
}
.testimonial-card .quote { font-size: 0.88rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 16px; font-style: italic; }
.testimonial-card .author { font-size: 0.82rem; font-weight: 600; }
.testimonial-card .role { font-size: 0.75rem; color: var(--text-muted); }

/* --- Collapsible Section --- */
.collapsible-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: 12px 0; user-select: none;
}
.collapsible-header:hover { color: var(--accent); }
.collapsible-body { overflow: hidden; max-height: 0; transition: max-height 0.4s ease; }
.collapsible-body.open { max-height: 2000px; }

/* --- Responsive Additions --- */
@media (max-width: 900px) {
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .steps { flex-direction: column; gap: 16px; }
  .step-item::before { display: none; }
  .step-item { display: flex; align-items: center; gap: 16px; text-align: left; }
  .step-num { margin: 0; flex-shrink: 0; }
  .nutri-check-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonial-grid { grid-template-columns: 1fr; }
}

/* ============================
   AI 智能问答页
   ============================ */

.qa-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 24px) 24px 60px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部物种切换 */
.qa-species-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 8px;
}
.qa-species-btn {
  padding: 10px 32px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qa-species-btn:hover { border-color: var(--accent); color: var(--accent); }
.qa-species-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(201,120,73,0.25);
}
.qa-species-btn .emoji { font-size: 1.2rem; }
.qa-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* 聊天主容器 */
.qa-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.qa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
  min-height: 300px;
}

/* 欢迎区域 */
.qa-welcome {
  text-align: center;
  padding: 40px 24px 20px;
}
.qa-welcome-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  transition: transform 0.28s ease, filter 0.28s ease;
}
.qa-welcome-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.qa-welcome-icon:hover {
  transform: translateY(-2px) scale(1.025);
  filter: saturate(1.06);
}
@media (prefers-reduced-motion: reduce) {
  .qa-welcome-icon { transition: none; }
}
.qa-welcome h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.qa-welcome p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}
.qa-welcome-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.qa-quick-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-warm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  transition: all 0.2s;
}
.qa-quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(201,120,73,0.06);
}

/* 消息气泡 */
.qa-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: fadeInUp 0.25s ease;
}
.qa-msg.qa-msg-user { flex-direction: row-reverse; }
.qa-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}
.qa-msg-avatar.user {
  background: var(--accent);
  color: #fff;
}
.qa-msg-avatar.ai {
  background: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.qa-msg-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.qa-msg-user .qa-msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.qa-msg-ai .qa-msg-bubble {
  background: var(--bg-warm);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

/* 场景标签 */
.qa-scene-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.qa-scene-urgent { background: #fef2f2; color: #dc2626; }
.qa-scene-health { background: #f0fdf4; color: #16a34a; }
.qa-scene-supplement { background: #fefce8; color: #ca8a04; }
.qa-scene-breed { background: #f0f9ff; color: #0284c7; }
.qa-scene-disease { background: #fdf4ff; color: #c026d3; }
.qa-scene-unknown { background: var(--bg-warm); color: var(--text-muted); }

/* 紧急度横幅 */
.qa-urgency {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qa-urgency-1 { background: #fefce8; color: #a16207; }
.qa-urgency-2 { background: #fff7ed; color: #c2410c; }
.qa-urgency-3 { background: #fef2f2; color: #dc2626; }

/* 追问提示 */
.qa-followup {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qa-followup-btn {
  padding: 6px 14px;
  border: 1px dashed var(--border);
  border-radius: 50px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: all 0.2s;
}
.qa-followup-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid;
}

/* 来源引用 */
.qa-source {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.qa-source-toggle {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}
.qa-source-toggle:hover { color: var(--accent); }
.qa-source-list {
  margin-top: 6px;
  display: none;
}
.qa-source-list.open { display: block; }
.qa-source-item {
  padding: 6px 10px;
  background: var(--bg-warm);
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.qa-source-item strong { color: var(--text-primary); font-weight: 600; }
.qa-source-item .quote {
  display: block;
  margin-top: 2px;
  padding-left: 8px;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
  font-style: italic;
}

/* 打字动画 */
.qa-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.qa-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s infinite;
}
.qa-typing span:nth-child(2) { animation-delay: 0.2s; }
.qa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 输入栏 */
.qa-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.qa-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.qa-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-warm);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.qa-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,120,73,0.1);
}
.qa-input::placeholder { color: var(--text-muted); }
.qa-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.qa-send-btn:hover { background: #b5673a; transform: scale(1.03); }
.qa-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.qa-send-btn svg { width: 18px; height: 18px; }

/* 限额提示 */
.qa-quota {
  text-align: center;
  padding: 6px 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-warm);
}
.qa-quota a { color: var(--accent); text-decoration: none; }

/* 空搜索提示 */
.qa-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* 模型标记 */
.qa-model-badge {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 模式标签（LLM/规则） */
.qa-mode-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  margin-left: 6px;
}
.qa-mode-llm { background: #ede9fe; color: #6d28d9; }
.qa-mode-rule { background: #dbeafe; color: #1d4ed8; }

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

@media (max-width: 600px) {
  .nutri-check-grid { grid-template-columns: 1fr; }
  .donut-svg { width: 140px; height: 140px; }
  .recipe-card-image { height: 100px; }
  .qa-page { padding: calc(var(--nav-height) + 12px) 12px 0; }
  .qa-messages { padding: 16px; min-height: 200px; }
  .qa-msg-bubble { max-width: 85%; font-size: 0.85rem; }
  .qa-welcome { padding: 24px 12px 12px; }
  .qa-species-btn { padding: 8px 20px; font-size: 0.85rem; }
}

/* ==========================================================================
   营养补剂完整库
   ========================================================================== */

.supplement-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.supplement-tab {
  padding: 6px 14px;
  font-size: 0.82rem;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.supplement-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.supplement-tab:hover:not(.active) {
  background: var(--accent-lighter);
  border-color: var(--accent-light);
}

.supplement-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.supplement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: all 0.15s;
}

.supplement-card:hover:not(.blocked) {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-soft);
}

.supplement-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.supplement-risk-badge {
  display: inline-block;
  font-size: 0.65rem;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.supplement-brands {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: auto;
}

.supplement-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 4px 0 2px;
}

.supplement-card-group {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.supplement-compensation {
  font-size: 0.68rem;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}

.supplement-block-reason {
  font-size: 0.68rem;
  color: #e74c3c;
  margin-top: 4px;
}

.supplement-caution-reason {
  font-size: 0.68rem;
  color: #9C27B0;
  margin-top: 4px;
}

.supplement-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
  animation: fadeInUp 0.2s ease;
}

.supplement-detail-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.supplement-detail-header h4 {
  margin: 6px 0 4px;
  font-size: 1rem;
}

.supplement-caution {
  background: #fce4ec;
  border-left: 3px solid #e91e63;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #c62828;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-bottom: 12px;
}

.supplement-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.supplement-detail-table th {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
}

.supplement-detail-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-light);
}

.supplement-compensation-box {
  background: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.supplement-compensation-box strong {
  color: var(--accent-dark);
}

.supplement-basis-details {
  background: var(--bg-warm);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  font-size: 0.78rem;
}

.supplement-basis-details h5 {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.basis-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
}

.basis-row:last-child {
  border-bottom: none;
}

.basis-key {
  font-weight: 600;
  color: var(--accent);
  min-width: 60px;
  flex-shrink: 0;
}

.basis-val {
  color: var(--text-secondary);
}

/* --- User Profile Dropdown --- */
.user-dropdown {
  position: relative; display: inline-block;
}
.user-dropdown-trigger {
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius-xs);
  transition: background 0.2s; user-select: none;
}
.user-dropdown-trigger:hover { background: var(--bg-warm); }
.user-dropdown-trigger .avatar-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; flex-shrink: 0;
}
.user-dropdown-trigger .avatar-img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.user-dropdown-trigger .caret {
  font-size: 0.65rem; color: var(--text-muted); transition: transform 0.2s;
}
.user-dropdown-menu {
  position: absolute; top: 100%; right: 0; z-index: 1100;
  min-width: 220px; background: var(--bg-card); border-radius: var(--radius-sm);
  border: 1px solid var(--border); box-shadow: var(--shadow-medium);
  display: none; overflow: hidden; margin-top: 4px;
}
.user-dropdown-menu.open { display: block; }
.user-dropdown-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 12px;
}
.user-dropdown-header .avatar-big {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; flex-shrink: 0;
}
.user-dropdown-header .avatar-img-big {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.user-dropdown-header .user-info { min-width: 0; }
.user-dropdown-header .user-info .nickname { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown-header .user-info .email { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 0.85rem; color: var(--text-secondary);
  cursor: pointer; transition: background 0.15s; border: none;
  background: none; width: 100%; text-align: left; font-family: inherit;
}
.user-dropdown-item:hover { background: var(--bg-cream); color: var(--accent); }
.user-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.user-dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }
.user-dropdown-pet-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  font-size: 0.8rem; color: var(--text-secondary); cursor: pointer;
  transition: background 0.15s;
}
.user-dropdown-pet-item:hover { background: var(--bg-cream); }
.user-dropdown-pet-item .pet-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-light); flex-shrink: 0;
}
.user-dropdown-empty { padding: 8px 16px; font-size: 0.78rem; color: var(--text-muted); }
.user-dropdown-overlay {
  position: fixed; inset: 0; z-index: 1099; display: none;
}

/* ==========================================================================
   Inline style refactoring utilities (2026-06)
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; gap: 14px; }
.flex-wrap-gap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.flex-gap-8 { display: flex; gap: 8px; }
.flex-ac { display: flex; align-items: center; gap: 8px; }
.inline-flex-c { display: inline-flex; align-items: center; gap: 8px; }
.w-full { width: 100%; }
.tc { text-align: center; }
.hidden { display: none; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-muted-sm { font-size: 0.82rem; color: var(--text-muted); }
.text-muted-md { font-size: 0.85rem; color: var(--text-muted); }
.text-muted-xs { font-size: 0.78rem; color: var(--text-muted); }
.text-accent-link { color: var(--accent); font-size: 13px; }
.loading-area { text-align: center; padding: 32px; color: var(--text-muted); }
.divider-line { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.tag-label { font-size: 0.82rem; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.modal-sm { max-width: 500px; }
.modal-lg { max-width: 560px; }
.modal-xl { max-width: 600px; }
.modal-xs { max-width: 380px; text-align: center; padding: 40px 32px; }
.modal-420 { max-width: 420px; }
/* Standard toggle button (AAFCO/NRC) */
.standard-btn {
  padding: 6px 18px; border: none; border-radius: 50px; font-size: 0.82rem;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: 0.25s;
  background: transparent; color: var(--text-secondary);
}
.standard-btn.active { background: var(--accent); color: #fff; }
.diet-toggle { background: var(--bg-card); }

/* --- Skip-to-content link (a11y) --- */
.skip-link {
  position: absolute; top: -100px; left: 0; z-index: 9999;
  background: var(--accent); color: #fff; padding: 8px 16px;
  font-size: 0.85rem; font-weight: 600; text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; outline: 2px solid var(--accent-dark); outline-offset: 2px; }

/* ==========================================================================
   宠圈社区（公开网页端）— 2026-07
   覆盖：信息流卡片、Tab 切换、状态区、详情 Modal、评论回复、9 图上传
   ========================================================================== */

/* 工具栏 + Tab */
.community-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.community-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg-card); border-radius: 50px;
  border: 1px solid var(--border-light);
}
.community-tab {
  padding: 8px 20px; border: none; background: transparent;
  border-radius: 50px; font-size: 0.88rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.community-tab:hover { color: var(--accent); }
.community-tab.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(126,69,35,0.18);
}

/* 卡片（信息流） */
.post-card { cursor: pointer; }
.post-card:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.post-card .post-img-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 3rem;
  background: var(--bg-warm); color: var(--text-muted);
}
.post-card .post-time { color: var(--text-muted); font-size: 0.74rem; }
.post-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.post-tag {
  display: inline-block; padding: 1px 8px; font-size: 0.7rem;
  background: var(--accent-lighter); color: var(--accent-dark);
  border-radius: 50px; font-weight: 500;
}
.post-actions {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.post-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; padding: 4px 6px; border-radius: 6px;
  font-size: 0.78rem; color: var(--text-muted); cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.post-action-btn:hover { color: var(--accent); background: var(--bg-warm); }
.post-action-btn svg { width: 16px; height: 16px; }
.post-action-btn.is-active { color: var(--accent); }

/* 状态区 */
.community-state {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 48px 20px;
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px dashed var(--border);
  text-align: center; color: var(--text-muted);
  margin-top: 8px;
}
.community-state:not([hidden]) {
  display: flex;
}
.community-state svg { width: 40px; height: 40px; color: var(--text-muted); }
.community-state-title {
  font-size: 1rem; font-weight: 600; color: var(--text-primary);
  margin: 0;
}
.community-state-text { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* 加载更多 */
.community-loadmore { text-align: center; margin-top: 20px; }
.community-loadmore .btn { min-width: 200px; }

/* ===== 详情 Modal ===== */
.note-detail-modal {
  max-width: 920px; padding: 0; overflow: hidden;
  background: var(--bg-card);
}
.note-detail-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; min-height: 240px; color: var(--text-muted); font-size: 0.9rem;
}
.note-detail-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; min-height: 70vh;
  max-height: 86vh;
}
.note-detail-media {
  background: #000; display: flex; align-items: center;
  justify-content: center; position: relative; overflow: hidden;
}
.note-detail-side {
  display: flex; flex-direction: column; min-width: 0;
  max-height: 86vh; overflow-y: auto;
}
.note-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.note-detail-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.note-detail-author .post-avatar {
  width: 36px; height: 36px; font-size: 0.85rem;
}
.note-detail-author-name { font-weight: 600; font-size: 0.9rem; }
.note-detail-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.note-report-link { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.note-report-link:hover { color: var(--warning-red, #d32f2f); }
.note-detail-body { padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.note-detail-title {
  font-size: 1.15rem; margin: 0 0 8px; font-weight: 700; line-height: 1.4;
}
.note-detail-content {
  font-size: 0.92rem; color: var(--text-primary);
  white-space: pre-wrap; word-break: break-word; margin: 0;
  line-height: 1.7;
}
.note-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.note-tag {
  display: inline-block; padding: 1px 8px; font-size: 0.7rem;
  background: var(--accent-lighter); color: var(--accent-dark);
  border-radius: 50px; font-weight: 500;
}
.note-detail-stats {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8rem; color: var(--text-muted);
}
.note-detail-stats > div {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; gap: 2px;
}
.note-detail-stats span { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.note-detail-stats label { font-size: 0.7rem; }
.note-detail-actions {
  display: flex; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--border-light);
}
.note-detail-action {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 12px; background: var(--bg-cream);
  border: 1px solid var(--border-light); border-radius: 10px;
  font-size: 0.85rem; color: var(--text-secondary);
  cursor: pointer; font-family: inherit; transition: 0.15s;
}
.note-detail-action:hover { color: var(--accent); border-color: var(--accent-light); }
.note-detail-action svg { width: 18px; height: 18px; }
.note-detail-action.is-active {
  color: var(--accent); background: var(--accent-lighter);
  border-color: var(--accent);
}

.note-detail-comments {
  flex: 1; padding: 12px 20px 16px;
}
.note-detail-comments-title {
  font-size: 0.95rem; margin: 0 0 10px; display: flex; gap: 4px;
}
.note-detail-comments-title span { color: var(--text-muted); font-weight: 400; }

/* 评论 */
.comment-item {
  display: flex; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 28px; height: 28px; font-size: 0.7rem; flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
  display: flex; align-items: center; gap: 6px; font-size: 0.75rem;
  color: var(--text-muted); flex-wrap: wrap;
}
.comment-name { color: var(--text-primary); font-weight: 600; }
.comment-reply-to { color: var(--text-muted); }
.comment-reply-to strong { color: var(--accent); font-weight: 500; }
.comment-time { margin-left: auto; }
.comment-content {
  font-size: 0.88rem; color: var(--text-primary);
  margin: 4px 0 2px; line-height: 1.55; word-break: break-word;
}
.comment-actions { font-size: 0.75rem; }
.comment-action-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px 0; font-family: inherit;
  font-size: 0.75rem;
}
.comment-action-btn:hover { color: var(--accent); }
.comment-replies {
  margin-top: 8px; padding-left: 12px;
  border-left: 2px solid var(--border-light);
}
.comment-replies .comment-item { padding: 6px 0; }

/* 评论输入 */
.note-comment-form {
  border-top: 1px solid var(--border-light);
  padding: 12px 20px; background: var(--bg-card); position: sticky;
  bottom: 0;
}
.note-comment-reply {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; margin-bottom: 6px;
  background: var(--accent-lighter); border-radius: 8px;
  font-size: 0.78rem; color: var(--accent-dark);
}
.note-comment-reply strong { font-weight: 600; }
.note-comment-reply-cancel {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--accent-dark); font-size: 0.75rem; font-family: inherit;
}
.note-comment-input-row { display: flex; gap: 8px; align-items: flex-end; }
.note-comment-input {
  flex: 1; resize: none; min-height: 40px; max-height: 100px;
  padding: 8px 10px; border: 1px solid var(--border-light);
  border-radius: 10px; background: var(--bg-cream);
  font-family: inherit; font-size: 0.88rem; color: var(--text-primary);
  outline: none; transition: border-color 0.2s;
}
.note-comment-input:focus { border-color: var(--accent); background: #fff; }
.note-comment-counter {
  text-align: right; font-size: 0.72rem; color: var(--text-muted);
  margin-top: 4px;
}

/* 图片轮播 */
.note-carousel {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.note-carousel-track {
  display: flex; width: 100%; height: 100%;
  transition: transform 0.35s ease;
}
.note-carousel-slide {
  flex: 0 0 100%; display: flex; align-items: center;
  justify-content: center; min-width: 100%; height: 100%;
  background: #000;
}
.note-carousel-slide img {
  max-width: 100%; max-height: 100%; width: auto;
  height: auto; object-fit: contain;
}
.note-carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; border: none;
  font-size: 24px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.note-carousel-arrow:hover { background: rgba(0,0,0,0.8); }
.note-carousel-arrow.left { left: 10px; }
.note-carousel-arrow.right { right: 10px; }
.note-carousel-dots {
  position: absolute; bottom: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px;
}
.note-carousel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.5); cursor: pointer;
  transition: all 0.2s;
}
.note-carousel-dot.active { background: #fff; width: 18px; border-radius: 3px; }
.note-carousel-counter {
  position: absolute; top: 10px; right: 12px;
  background: rgba(0,0,0,0.5); color: #fff;
  padding: 2px 10px; border-radius: 50px; font-size: 0.72rem;
}

/* ===== 发布弹窗 ===== */
.modal-content.modal-lg { max-width: 560px; }
.publish-thumbs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 10px;
}
.publish-thumb {
  position: relative; aspect-ratio: 1 / 1; border-radius: 8px;
  overflow: hidden; background: var(--bg-warm);
  border: 1px solid var(--border-light);
}
.publish-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.publish-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: var(--text-muted);
  font-size: 0.82rem;
}
.publish-thumb-progress {
  position: absolute; inset: auto 0 0 0; height: 28px;
  background: linear-gradient(0deg, rgba(0,0,0,0.55), transparent);
  color: #fff; font-size: 0.72rem;
  display: flex; align-items: center; justify-content: center;
}
.publish-thumb-progress-bar {
  position: absolute; left: 0; top: 0; height: 3px;
  background: var(--accent); transition: width 0.2s;
}
.publish-thumb-error {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
}
.publish-thumb-remove {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.55);
  color: #fff; cursor: pointer; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: 0.15s;
}
.publish-thumb-remove:hover { background: rgba(0,0,0,0.85); }
.publish-thumb.is-error { border-color: #f44336; }
.file-upload-zone.is-drag { border-color: var(--accent); background: var(--accent-lighter); }
.file-upload-zone input[type="file"] { display: none; }
.form-counter { float: right; font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
.form-hint-inline { color: var(--text-muted); font-weight: 400; font-size: 0.78rem; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .note-detail-modal { max-width: 100%; width: 100%; }
  .note-detail-grid {
    grid-template-columns: 1fr; grid-template-rows: minmax(220px, 50vh) 1fr;
    min-height: 0; max-height: 100vh;
  }
  .note-detail-side { max-height: none; }
  .note-detail-comments { padding-bottom: 80px; }
  .note-comment-form { position: sticky; bottom: 0; }
  .community-toolbar { gap: 8px; }
  .community-tab { padding: 6px 14px; font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .note-carousel-track { transition: none; }
  .post-card { transition: none; }
}
