/* ==================================================================
   萌宠认领 · 公共样式表（style.css）
   ------------------------------------------------------------------
   主色   ：#FF9F43（暖橙）      辅助： #2ECC71（绿）
   页面底色：#F7F8FA             卡片： #FFFFFF 圆角 16px
   设计基准：375px（iPhone），内容最大宽度 480px，桌面浏览时居中
   ================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --primary:       #FF9F43;   /* 主色：暖橙 */
  --primary-deep:  #F78B2B;   /* 主色加深 */
  --primary-light: #FFF4E6;   /* 主色浅底 */
  --green:         #2ECC71;   /* 辅助绿：健康状态 */
  --green-light:   #E8F8EF;
  --red:           #FF4D4F;   /* 未读红点 */
  --blue:          #4A90E2;   /* 公 */
  --pink:          #FF6B9A;   /* 母 */
  --bg:            #F7F8FA;   /* 页面底色 */
  --card:          #FFFFFF;
  --text:          #333333;
  --text-2:        #666666;
  --text-3:        #999999;
  --line:          #F0F1F3;
  --radius-card:   16px;
  --radius-btn:    24px;
  --brandbar:      44px;      /* 顶部品牌栏高度 */
  --tabbar:        60px;      /* 底部 Tab 栏高度 */
  --shadow:        0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ---------- 2. 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: #ECEEF1;   /* 桌面浏览器观看时页面两侧的底色 */
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; width: 100%; border: 0; }
input, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
input, textarea { border: none; outline: none; background: none; }
button { border: none; background: none; cursor: pointer; }

/* ---------- 3. 页面容器 ---------- */
.page {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

/* 带底部 Tab 的页面：内容区给 Tab 栏留出空间 */
.page.has-tab {
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 24px);
}

/* ---------- 4. 通用卡片 / 标题 / 标签 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 16px 12px;
}

.section-title { font-size: 17px; font-weight: 700; }
.section-more  { font-size: 12px; color: var(--text-3); }

/* 小标签（可认领 / 健康状态等） */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
}
.tag-orange { background: var(--primary-light); color: var(--primary); }
.tag-green  { background: var(--green-light);  color: var(--green); }
.tag-gray   { background: #F1F2F4;             color: var(--text-2); }

/* 性别小图标 */
.pet-gender {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  color: #fff;
  font-style: normal;
}
.pet-gender.male   { background: var(--blue); }
.pet-gender.female { background: var(--pink); }

/* ---------- 5. 按钮 ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 600;
  background: #F1F2F4;
  color: var(--text);
}
.btn-primary {
  background: linear-gradient(135deg, #FFB25E, var(--primary));
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 159, 67, 0.35);
}
.btn-primary:active { opacity: 0.88; }

/* ---------- 6. 表单 ---------- */
.field-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: #F7F8FA;
  font-size: 14px;
}
.field-input::placeholder { color: #C0C4CC; }

/* ---------- 7. 页头（带标题的页面用） ---------- */
.page-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 16px;
}
.page-title h1 { font-size: 18px; font-weight: 700; }

.title-back {
  position: absolute;
  left: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 20px;
  line-height: 1;
}

/* ---------- 8. 底部 Tab 导航栏（公共组件，5 个页面复用） ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  width: 100%;
  max-width: 480px;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-3);
}
.tab-item .tab-icon { width: 23px; height: 23px; fill: currentColor; }
.tab-item.active { color: var(--primary); font-weight: 600; }

/* 中间凸起的「发布」大按钮 */
.tab-add .tab-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin-top: -28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFB25E, var(--primary));
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  box-shadow: 0 6px 16px rgba(255, 159, 67, 0.5);
}
.tab-add.active .tab-add-btn { box-shadow: 0 6px 18px rgba(255, 159, 67, 0.65); }

/* ---------- 9. 顶部品牌栏（5 个 Tab 页面共用） ---------- */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--brandbar);
  background: var(--card);
  border-bottom: 1px solid #F4F5F7;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
}
.brand-paw { font-size: 16px; }

/* ---------- 10. 升级版公共组件 ---------- */
/* 轻提示 toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 24px);
  transform: translateX(-50%) translateY(10px);
  z-index: 999;
  max-width: 72%;
  padding: 10px 18px;
  border-radius: 20px;
  background: rgba(40, 40, 40, 0.88);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* AI 助手头像（橙底爪印，消息页 / 聊天页共用） */
.avatar-ai {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFB25E, var(--primary));
  font-size: 24px;
}

/* 空状态 */
.empty-state {
  grid-column: 1 / -1;
  padding: 48px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.empty-state .empty-icon {
  display: block;
  font-size: 40px;
  margin-bottom: 8px;
}
