/* ==========================================================================
   校园猫咪管理系统 - 前台样式（PC + H5 响应式）
   ========================================================================== */

:root {
  --primary: #f97316;
  --primary-dark: #ea6a0b;
  --primary-soft: #fff4ec;
  --primary-line: #ffd9bd;
  --text: #2f2a26;
  --text-2: #6b6158;
  --muted: #9a8f86;
  --bg: #fbf8f5;
  --card: #ffffff;
  --border: #ece5de;
  --border-2: #f4efea;
  --green: #16a34a;
  --green-soft: #eafaf0;
  --blue: #2563eb;
  --blue-soft: #eef4ff;
  --amber: #d97706;
  --amber-soft: #fff7e6;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-soft: #f5f0ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 22px rgba(90, 66, 44, .07);
  --shadow-lg: 0 14px 40px rgba(90, 66, 44, .12);
  --header-h: 66px;
  --tabbar-h: 60px;
}

* { box-sizing: border-box; }

/* ---------------------------------------------------------------
 | 可点击元素的焦点框
 | 鼠标 / 触摸点击时不显示浏览器默认的方形框，键盘 Tab 操作时保留
 * --------------------------------------------------------------- */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
  outline: none;
}
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 触摸设备上给一点按下反馈，替代被去掉的高亮块 */
@media (hover: none) {
  .btn:active,
  .mobile-tabbar a:active,
  .nav-link:active,
  .user-trigger:active,
  .cat-card:active,
  .record-item:active {
    opacity: .72;
  }
}

/* hidden 属性必须真正隐藏元素（否则会被 .xxx{display:flex} 之类的规则覆盖） */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  /* 去掉移动端点击链接 / 按钮时浏览器画出的蓝色（或灰色）高亮方块 */
  -webkit-tap-highlight-color: transparent;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0; padding: 0; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; display: block; margin-top: 5px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; font-family: inherit; line-height: 1.4;
  cursor: pointer; text-decoration: none; transition: .18s ease; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--primary-dark); border-color: var(--primary-line); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-ghost { background: #fff; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: #faf7f4; color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-text { background: transparent; color: var(--muted); }
.btn-text:hover { color: var(--primary); }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-mini { padding: 5px 10px; font-size: 12px; border-radius: 8px; font-weight: 500; }
.btn-block { width: 100%; margin-bottom: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.inline-form { display: inline; }
.link-danger { background: none; border: 0; color: var(--red); font-size: 12.5px; cursor: pointer; padding: 0 4px; font-family: inherit; }
.link-danger:hover { text-decoration: underline; }
.link-more { font-size: 13.5px; font-weight: 600; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-logo { font-size: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 11.5px; color: var(--muted); }
.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-link { padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14.5px; }
.nav-link:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }
.mobile-nav { display: none; }

.user-menu { position: relative; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--border);
  border-radius: 30px; padding: 5px 11px; cursor: pointer; font-family: inherit; font-size: 14px;
  color: var(--text); line-height: 1.4; transition: .15s;
}
.user-trigger.has-avatar { padding-left: 4px; }
.user-caret { font-size: 10px; color: var(--muted); line-height: 1; margin-left: -1px; }
.user-trigger:hover { border-color: var(--primary-line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.avatar-text { display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.user-name { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px; background: #fff;
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 8px; display: none; z-index: 70;
}
.user-dropdown.open { display: block; }
/* JS 未生效时的兜底：悬停或聚焦也能展开账号菜单 */
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown { display: block; }
.user-dropdown a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-size: 14px; }
.user-dropdown a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.dropdown-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border-2); margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dropdown-admin { color: var(--primary-dark) !important; font-weight: 600; }
.dropdown-danger { color: var(--red) !important; }

.role-tag { font-size: 11.5px; background: var(--primary-soft); color: var(--primary-dark); padding: 2px 8px; border-radius: 20px; font-weight: 600; }

/* ---------------- 提示条 ---------------- */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 1180px; margin: 14px auto 0;
  padding: 13px 15px; border-radius: 12px; font-size: 14px; line-height: 1.6;
  border: 1px solid; box-shadow: 0 4px 16px rgba(90, 66, 44, .07);
}
.flash-icon { flex-shrink: 0; line-height: 1.5; font-size: 15px; }
.flash-text { flex: 1; min-width: 0; word-break: break-word; }
.flash-close {
  flex-shrink: 0; width: 24px; height: 24px; margin: -2px -4px 0 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 7px; font-size: 18px; line-height: 1;
  cursor: pointer; color: inherit; opacity: .45; transition: .15s; font-family: inherit;
}
.flash-close:hover { opacity: 1; background: rgba(0, 0, 0, .07); }
.flash-success { background: var(--green-soft); border-color: #bbf7d0; color: #15803d; }
.flash-error { background: var(--red-soft); border-color: #fecaca; color: #b91c1c; }
.flash-warning { background: var(--amber-soft); border-color: #fde68a; color: #b45309; }
.flash-info { background: var(--blue-soft); border-color: #bfdbfe; color: #1d4ed8; }

/* ---------------- 首页 Hero ---------------- */
.hero {
  background: linear-gradient(150deg, #fff7f0 0%, #fdf1e6 45%, #f7f3ff 100%);
  border-bottom: 1px solid var(--border-2);
  padding: 54px 0 46px;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero-tag { display: inline-block; background: #fff; border: 1px solid var(--primary-line); color: var(--primary-dark); padding: 5px 14px; border-radius: 30px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.hero-text h1 { font-size: 40px; letter-spacing: -.5px; margin-bottom: 14px; }
.hero-text p { font-size: 15.5px; color: var(--text-2); max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-card strong { display: block; font-size: 30px; color: var(--primary-dark); line-height: 1.2; }
.stat-card span { font-size: 13px; color: var(--muted); }

.notice-bar {
  margin-top: 18px; background: #fff; border: 1px dashed var(--primary-line); border-radius: 12px;
  padding: 12px 18px; font-size: 14px; color: var(--text-2); display: flex; gap: 8px;
}

/* ---------------- 通用区块 ---------------- */
.section { padding: 42px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { margin: 0 0 4px; font-size: 22px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.section-head.center { justify-content: center; text-align: center; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; position: relative; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  background: var(--primary); color: #fff; border-radius: 50%; font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; font-size: 13.5px; color: var(--text-2); }

/* ---------------- 猫咪卡片 ---------------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-grid-sm { grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; color: inherit;
  transition: .2s ease; box-shadow: 0 2px 10px rgba(90, 66, 44, .04);
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-line); color: inherit; }
.cat-card-photo { position: relative; aspect-ratio: 4 / 3; background: #f3efec; overflow: hidden; }
.cat-card-photo img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.cat-card:hover .cat-card-photo img { transform: scale(1.05); }
.cat-badge {
  position: absolute; left: 10px; top: 10px; font-size: 12px; padding: 3px 10px; border-radius: 20px;
  background: rgba(255, 255, 255, .94); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.cat-badge + .cat-badge { top: 40px; }
.species-tag {
  position: absolute; right: 10px; top: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}
.cat-card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.cat-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cat-card-title .gender-badge { width: 22px; height: 22px; font-size: 13px; flex-shrink: 0; }
.cat-card-title h3 { margin: 0; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gender { font-size: 15px; font-weight: 700; }
.gender.male { color: #2563eb; }
.gender.female { color: #db2777; }
.gender.unknown { color: var(--muted); }
.cat-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; background: #f7f4f1; color: var(--text-2); padding: 2px 9px; border-radius: 20px; }
.cat-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.health-tag { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.views { font-size: 12px; color: var(--muted); }

/* 状态 / 健康 / 审核 配色 */
.status-on, .health-ok { background: var(--green-soft); color: #15803d; }
.status-adopted { background: var(--blue-soft); color: #1d4ed8; }
.status-fostered { background: var(--purple-soft); color: #6d28d9; }
.status-missing { background: var(--amber-soft); color: #b45309; }
.status-deceased { background: #f2f0ee; color: #7a7269; }
.health-watch { background: var(--amber-soft); color: #b45309; }
.health-treat, .health-critical { background: var(--red-soft); color: #b91c1c; }
.health-disabled { background: var(--purple-soft); color: #6d28d9; }
.audit-pending { background: var(--amber-soft); color: #b45309; }
.audit-approved { background: var(--green-soft); color: #15803d; }
.audit-rejected { background: var(--red-soft); color: #b91c1c; }

/* ---------------- 动态记录列表 ---------------- */
.record-list { display: flex; flex-direction: column; gap: 10px; }
.record-item {
  display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 18px; color: inherit; transition: .18s;
}
.record-item:hover { border-color: var(--primary-line); transform: translateX(3px); color: inherit; }
.record-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.record-icon.sm { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }
.rec-feed { background: #fff4ec; }
.rec-water { background: var(--blue-soft); }
.rec-health { background: var(--green-soft); }
.rec-tnr { background: var(--purple-soft); }
.rec-medical { background: var(--red-soft); }
.rec-rescue { background: var(--amber-soft); }
.rec-adopt { background: #eefbf6; }
.rec-new { background: #f5f3ff; }
.rec-other { background: #f4f2f0; }
.record-main { flex: 1; min-width: 0; }
.record-title { display: flex; align-items: center; gap: 8px; }
.record-type { font-size: 12px; color: var(--muted); }
.record-main p { margin: 2px 0 0; font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-side { text-align: right; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.record-side time { display: block; }
.record-user { display: block; color: var(--text-2); }

/* ---------------- 页面头 ---------------- */
.page-head { padding: 30px 0 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 27px; }
.page-head p { margin: 0; color: var(--muted); }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb span { margin: 0 6px; }
.breadcrumb em { font-style: normal; color: var(--text-2); }

/* ---------------- 筛选栏 ---------------- */
.filter-bar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 18px; margin-bottom: 20px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row + .filter-row { margin-top: 10px; }
.filter-search { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.filter-search input {
  flex: 1; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit;
}
.filter-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar select, .admin-filter select, .admin-filter input, .inline-search input {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px;
  font-family: inherit; background: #fff; color: var(--text);
}
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, .1); }
.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 28px 0 10px; flex-wrap: wrap; }
.page-link {
  min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 11px; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px;
}
.page-link:hover { border-color: var(--primary); color: var(--primary-dark); }
.page-link.current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.page-link.disabled { opacity: .45; }
.page-gap { color: var(--muted); padding: 0 2px; }

/* ---------------- 空状态 / CTA ---------------- */
.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-icon { font-size: 44px; margin-bottom: 10px; }
.empty-text { font-size: 15px; margin: 0; color: var(--text-2); }
.empty-hint { font-size: 13px; margin: 4px 0 0; }
.cta-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, #fff4ec, #f8f3ff); border: 1px solid var(--primary-line);
  border-radius: var(--radius); padding: 18px 22px; margin: 26px 0;
}
.cta-bar strong { display: block; }
.cta-bar span { font-size: 13.5px; color: var(--text-2); }

/* ---------------- 通用面板 / 列表 / 时间线 ---------------- */
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel.soft { background: #fffdfa; border-color: var(--primary-line); }
.panel h2, .panel h3 { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head small { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 6px; }

.timeline { list-style: none; position: relative; padding-left: 0; }
.timeline-item { position: relative; padding: 0 0 22px 34px; border-left: 2px solid var(--border-2); }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-icon {
  position: absolute; left: -19px; top: 0; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border);
  box-sizing: border-box;
}
.timeline-content { background: #fdfcfa; border: 1px solid var(--border-2); border-radius: 12px; padding: 13px 16px; }
.timeline-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.timeline-content p { margin: 0 0 6px; font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.timeline-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 8px 0; }
.timeline-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; cursor: zoom-in; }
.timeline-foot { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.rec-tag { font-size: 11.5px; padding: 1px 9px; border-radius: 20px; background: #f4f2f0; color: var(--text-2); font-weight: 600; }
.side-list { list-style: none; }
.side-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border-2); font-size: 14px; }
.side-list li:last-child { border-bottom: 0; }
.side-list span { color: var(--muted); }

/* ---------------- 猫咪详情 ---------------- */
.cat-detail { padding-bottom: 46px; }

/* 顶部主卡：照片 + 档案 */
.cat-hero {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 26px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 12px rgba(90, 66, 44, .04);
}

.cat-hero-media { min-width: 0; }
.cat-photo-main {
  margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3;
  background: #f3efec; cursor: zoom-in;
}
.cat-photo-link { display: block; width: 100%; height: 100%; }
.cat-photo-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-photo-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.gallery-thumb {
  display: block; padding: 0; border: 2px solid transparent; border-radius: 10px;
  overflow: hidden; cursor: pointer; background: #f3efec; aspect-ratio: 1;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb:hover { border-color: var(--primary-line); }
.gallery-thumb.active { border-color: var(--primary); }

.cat-hero-info { display: flex; flex-direction: column; min-width: 0; }
.cat-hero-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cat-hero-head h1 { margin: 0; font-size: 30px; letter-spacing: -.5px; }
.gender-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 15px; font-weight: 700; line-height: 1;
  background: #f4f2f0; color: var(--muted); vertical-align: middle;
}
.gender-badge.male { background: var(--blue-soft); color: #1d4ed8; }
.gender-badge.female { background: #fdf2f8; color: #db2777; }
.gender-badge.lg { width: 32px; height: 32px; font-size: 18px; }

.gender-pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; background: #f7f4f1; color: var(--text-2);
}
.gender-pill.male { background: var(--blue-soft); color: #1d4ed8; }
.gender-pill.unknown { background: #f4f2f0; color: var(--muted); }
.gender-pill.female { background: #fdf2f8; color: #db2777; }
.cat-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
/* 状态徽章：带底色的小圆角标签 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; line-height: 1.5;
  padding: 4px 13px; border-radius: 20px; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .65; }
.cat-quote {
  margin: 0 0 16px; padding: 11px 15px; font-size: 14.5px; color: var(--text-2);
  background: var(--primary-soft); border-left: 3px solid var(--primary-line); border-radius: 8px;
}

/* 档案网格 */
.cat-facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--border-2); border: 1px solid var(--border-2); border-radius: 12px;
  overflow: hidden; margin: 0 0 18px;
}
.cat-facts > div { background: #fff; padding: 11px 14px; min-width: 0; }
.cat-facts dt { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.cat-facts dd { margin: 0; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-facts .gender-badge { width: 24px; height: 24px; font-size: 14px; }
.fact-flag { font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 20px; background: #f4f2f0; color: var(--text-2); }
.fact-flag.ok { background: var(--green-soft); color: #15803d; }
.fact-flag.no { background: var(--red-soft); color: #b91c1c; }
.fact-date { font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* 操作区 */
.cat-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.cat-actions .btn { height: 42px; }
.cat-actions .follow-form { display: inline-flex; margin: 0; }

/* 关注按钮 */
.btn-follow { background: #fff; border: 1px solid var(--primary-line); color: var(--primary-dark); }
.btn-follow:hover { background: var(--primary-soft); }
.btn-follow.active { background: var(--primary-soft); border-color: var(--primary); }
.follow-icon { font-size: 15px; line-height: 1; }
.follow-count { background: rgba(0, 0, 0, .06); border-radius: 20px; padding: 1px 8px; font-size: 12px; line-height: 1.6; }

/* 底部登记信息 */
.cat-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px;
  padding-top: 14px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted);
}
.cat-foot strong { color: var(--text-2); font-weight: 600; }
.cat-foot .dot { opacity: .5; }

/* 下方两栏：两列等高，底边与右侧卡片对齐；空白由卡片底部的收尾区填充 */
.cat-detail-body {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 20px; margin-top: 20px; align-items: stretch;
}
.cat-detail-main { display: flex; min-width: 0; }
.cat-detail-main .panel { margin-bottom: 0; width: 100%; display: flex; flex-direction: column; }
.panel-head-actions { display: flex; align-items: center; gap: 12px; }

/* 折叠按钮：只在手机端显示，PC 端不需要 */
@media (min-width: 769px) {
  .collapse-btn { display: none !important; }
}

.collapse-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 4px 9px; border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--muted); cursor: pointer; transition: .15s;
}
.collapse-btn:hover { background: #f7f4f1; color: var(--primary-dark); }
.record-panel.is-collapsed .collapse-btn { color: var(--primary-dark); }
.collapse-icon { display: inline-block; font-size: 11px; transition: transform .2s; }
.record-panel.is-collapsed .collapse-icon { transform: rotate(180deg); }

/* 记录列表：超出高度时内部滚动，避免把左侧卡片撑得过高 */
.timeline-wrap {
  /* 撑满整个卡片，让记录铺满照护记录区域 */
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  max-height: clamp(360px, 68vh, 900px);
  /* 左侧留白：圆形图标是绝对定位在 -19px 处，不留空间会被滚动容器裁掉 */
  padding-left: 26px;
  padding-right: 6px; margin-right: -6px;
}
.timeline-wrap::-webkit-scrollbar { width: 6px; }
.timeline-wrap::-webkit-scrollbar-thumb { background: #e3dcd5; border-radius: 6px; }
.timeline-wrap::-webkit-scrollbar-track { background: transparent; }
.record-panel.is-collapsed .timeline-wrap { display: none; }
.record-panel.is-collapsed .timeline { padding-bottom: 0; }

/* 折叠后的提示文案 */
.record-collapsed-hint { display: none; }
.record-panel.is-collapsed .record-collapsed-hint {
  display: flex; flex: 1 1 auto; align-items: center; justify-content: center;
  margin: 0; padding: 20px; text-align: center;
  font-size: 13.5px; color: var(--muted);
}
.cat-detail-side { display: flex; flex-direction: column; gap: 16px; }
.cat-detail-side .panel { margin-bottom: 0; }
/* 右侧最后一张卡片自动补足高度，保证两列底边齐平 */
.cat-detail-side > .panel:last-child { flex: 1 1 auto; }
.side-title { margin: 0 0 12px; font-size: 15px; }
.side-block + .side-block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-2); }
.side-block h4 { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.side-block p { margin: 0; font-size: 14px; color: var(--text-2); }
.side-note { font-size: 13px; color: var(--text-2); }

/* 详情页响应式 */
@media (max-width: 1100px) {
  .cat-hero { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; }
  .cat-hero-head h1 { font-size: 26px; }
}

@media (max-width: 900px) {
  .cat-hero { grid-template-columns: 1fr; }
  .cat-detail-body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cat-hero { padding: 14px; gap: 16px; border-radius: 14px; }
  .cat-hero-head { margin-bottom: 8px; }
  .cat-hero-head h1 { font-size: 23px; }
  .cat-photo-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cat-quote { font-size: 14px; margin-bottom: 14px; }
  .cat-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
  .cat-facts > div { padding: 10px 12px; }
  .cat-facts dd { font-size: 14px; }
  /* 单数个格子时，最后一个占满整行，避免留半格 */
  .cat-facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .cat-actions { gap: 8px; }
  .cat-actions > .btn,
  .cat-actions > .follow-form { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .cat-actions .btn { height: 44px; }
  .cat-actions .follow-form .btn { width: 100%; }
  .cat-foot { font-size: 12.5px; gap: 6px; margin-top: 12px; padding-top: 12px; }
  .cat-detail-body { gap: 14px; margin-top: 14px; }
  .cat-detail-side { gap: 14px; }
}

/* ---------------- 关于页 ---------------- */
.about-wrap { padding-bottom: 50px; }
.about-wrap h2 { font-size: 19px; margin-top: 26px; }
.about-wrap h2:first-child { margin-top: 0; }
.about-list { list-style: none; padding-left: 0; }
.about-list li { padding: 8px 0 8px 22px; position: relative; color: var(--text-2); }
.about-list li::before { content: "🐾"; position: absolute; left: 0; }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.about-stats > div { background: var(--primary-soft); border-radius: 12px; padding: 16px; text-align: center; }
.about-stats strong { display: block; font-size: 24px; color: var(--primary-dark); }
.about-stats span { font-size: 12.5px; color: var(--text-2); }

/* ---------------- 表单 ---------------- */
.form-wrap { padding-bottom: 50px; max-width: 900px; }
.form .field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field label em { color: var(--red); font-style: normal; }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=search],
.field input[type=date], .field input[type=datetime-local], .field input[type=file], .field select, .field textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
}
.field textarea { resize: vertical; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .field { margin-bottom: 0; }
.field-full { grid-column: 1 / -1; }
.form-section { border-top: 1px solid var(--border-2); padding-top: 18px; margin-top: 18px; }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section-title { font-size: 15px; color: var(--primary-dark); margin-bottom: 12px; font-weight: 700; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.panel-form { max-width: 780px; }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row-wide .radio-chip { flex: 0 0 auto; }
/* 候选标签：手机端点选（datalist 在手机上不可用） */
.chip-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.chip-btn {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px;
  background: #fff; color: var(--text-2); font-size: 13px; font-family: inherit;
  line-height: 1.4; cursor: pointer; transition: .15s; white-space: nowrap;
}
.chip-btn:hover { border-color: var(--primary-line); color: var(--primary-dark); }
.chip-btn.active {
  background: var(--primary-soft); border-color: var(--primary);
  color: var(--primary-dark); font-weight: 600;
}

.radio-chip { position: relative; cursor: pointer; }
.radio-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-chip span {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13.5px; color: var(--text-2); background: #fff; transition: .15s;
}
.radio-chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }

/* 性别选项：只显示符号 */
.gender-radios { gap: 10px; }
.gender-radios .radio-chip span {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; line-height: 1;
}
.gender-radios .radio-chip span.male { color: #1d4ed8; }
.gender-radios .radio-chip span.female { color: #db2777; }
.gender-radios .radio-chip span.unknown { color: var(--muted); }
.gender-radios .radio-chip input:checked + span {
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .16);
}
.radio-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(249, 115, 22, .18); }

.check-agree { align-items: flex-start; font-size: 13px; line-height: 1.6; }
.check-agree input { margin-top: 3px; flex-shrink: 0; }

.image-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.image-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

.existing-photos { margin-top: 14px; }
.photo-manage { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.photo-manage-item { position: relative; border: 2px solid var(--border); border-radius: 12px; overflow: hidden; }
.photo-manage-item.is-cover { border-color: var(--primary); }
.photo-manage-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.cover-tag { position: absolute; left: 6px; top: 6px; background: var(--primary); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 20px; }
.photo-manage-actions { display: flex; gap: 4px; padding: 6px; justify-content: center; background: #fff; }

.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid #fecaca; background: #fffbfb; border-radius: var(--radius); padding: 18px; margin-top: 8px;
}
.danger-zone strong { color: var(--red); }
.danger-zone p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-error { background: var(--red-soft); border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: var(--amber-soft); border-color: #fde68a; color: #b45309; }
.alert-success { background: var(--green-soft); border-color: #bbf7d0; color: #15803d; }

/* ---------------- 登录 / 注册 ---------------- */
.page-blank { background: #fbf8f5; }
.blank-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.blank-side {
  background: linear-gradient(150deg, #f97316 0%, #fb923c 55%, #f59e0b 100%);
  color: #fff; padding: 54px 48px; display: flex; flex-direction: column; justify-content: center;
}
.blank-brand { color: #fff; font-size: 19px; font-weight: 700; margin-bottom: 26px; display: block; }
.blank-side h2 { font-size: 30px; color: #fff; margin-bottom: 24px; }
.blank-points { list-style: none; }
.blank-points li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; font-size: 14.5px; opacity: .96; }
.blank-points span { font-size: 17px; }
.blank-back { color: rgba(255, 255, 255, .85); margin-top: 30px; font-size: 14px; }
.blank-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
/* 登录页的提示框：不要变成和表单并排的弹性子项 */
.blank-main .flash { width: 100%; max-width: 430px; margin: 0 0 16px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 22px; }
.auth-foot { text-align: center; font-size: 13.5px; margin-top: 16px; color: var(--text-2); }

/* ---------------- 个人中心 ---------------- */
.me-wrap { padding: 26px 0 50px; }
.me-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.me-hero-user { display: flex; align-items: center; gap: 16px; }
.avatar-lg { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; font-size: 24px; }
.avatar-xl { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; font-size: 30px; }
.me-hero-user h1 { margin: 0; font-size: 22px; }
.me-hero-user p { margin: 4px 0 0; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.me-hero-actions { display: flex; gap: 10px; }
.me-tabs { display: flex; gap: 6px; margin: 18px 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 6px; overflow-x: auto; }
.me-tabs a { padding: 8px 16px; border-radius: 10px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.me-tabs a:hover { background: #faf7f4; }
.me-tabs a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; color: inherit; }
.stat-box:hover { border-color: var(--primary-line); color: inherit; }
.stat-box strong { display: block; font-size: 26px; color: var(--primary-dark); }
.stat-box span { font-size: 13px; color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-list { list-style: none; }
.mini-list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border-2); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list strong { display: block; font-size: 14px; font-weight: 600; }
.mini-list small { font-size: 12.5px; color: var(--muted); }
.mini-icon { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.mini-cat img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }

.inline-search { display: flex; gap: 8px; margin-bottom: 16px; }
.inline-search input { flex: 1; }
.filter-lite { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-lite a { font-size: 12.5px; padding: 4px 11px; border-radius: 20px; background: #f7f4f1; color: var(--text-2); }
.filter-lite a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

.record-cards { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.record-card { display: flex; gap: 14px; border: 1px solid var(--border); border-radius: 14px; padding: 15px; }
.record-card-icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.record-card-main { flex: 1; min-width: 0; }
.record-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.record-card-main p { font-size: 13.5px; color: var(--text-2); margin: 0 0 8px; }
.record-card-foot { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

.profile-avatar { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }

/* ---------------- 错误页 ---------------- */
.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-size: 68px; font-weight: 800; color: var(--primary-line); line-height: 1; }
.error-page h1 { font-size: 20px; margin: 14px 0 22px; color: var(--text-2); }
.error-actions { display: flex; gap: 12px; justify-content: center; }

/* ---------------- 图片灯箱 ---------------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(28, 22, 18, .88); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 12px; }

/* ---------------- 页脚 ---------------- */
.site-footer { background: #fff; border-top: 1px solid var(--border); padding: 30px 0 20px; margin-top: 30px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-brand strong { font-size: 15px; }
.footer-brand p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 18px; font-size: 13.5px; }
.footer-bottom { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-2); }

.mobile-tabbar { display: none; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1100px) {
  .cat-grid, .cat-grid-sm { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-text h1 { font-size: 34px; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle {
    display: block; margin-left: auto; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; width: 40px; height: 40px; font-size: 17px; cursor: pointer;
  }
  .header-inner .header-actions { margin-left: 10px; }
  .user-name { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .detail-wrap, .detail-body, .two-col, .admin-grid-2 { grid-template-columns: 1fr; }
  .blank-wrap { grid-template-columns: 1fr; }
  .blank-side { display: none; }
  .mobile-nav {
    display: none; flex-direction: column; background: #fff; border-bottom: 1px solid var(--border); padding: 10px 18px 16px;
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a { padding: 11px 6px; border-bottom: 1px solid var(--border-2); font-size: 15px; color: var(--text-2); }
  .mobile-nav a:last-child { border-bottom: 0; }
  .mobile-nav a.active { color: var(--primary-dark); font-weight: 600; }
  .stat-grid, .about-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
  .hide-sm { display: none !important; }
  .brand-text small { display: none; }
  .header-inner { gap: 10px; }
  .header-actions { gap: 6px; }

  /* H5：不要页尾 */
  .site-footer { display: none; }

  /* H5：不要左上角汉堡按钮（导航交给底部标签栏） */
  .nav-toggle { display: none !important; }
  .mobile-nav { display: none !important; }

  /* H5：突出显示用户名 */
  .brand { min-width: 0; flex: 0 1 auto; }
  .brand-text { min-width: 0; }
  .brand-text strong {
    font-size: 14px; max-width: 148px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .header-inner .header-actions { margin-left: auto; min-width: 0; }
  .user-trigger {
    padding: 6px 12px; gap: 6px; max-width: 100%;
    border: 1px solid var(--primary-line); background: var(--primary-soft);
    border-radius: 30px;
  }
  .user-trigger.has-avatar { padding-left: 4px; }
  .avatar { width: 28px; height: 28px; }
  .user-name {
    display: inline; font-size: 15px; font-weight: 700; color: var(--primary-dark);
    max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .user-caret { color: var(--primary-dark); opacity: .7; }
  .container { padding: 0 14px; }
  h1 { font-size: 22px; }
  .hero { padding: 32px 0 30px; }
  .hero-text h1 { font-size: 26px; }
  .hero-text p { font-size: 14.5px; }
  .hero-actions .btn { flex: 1; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 10px; border-radius: 13px; }
  .stat-card strong { font-size: 23px; }
  .section { padding: 28px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cat-grid, .cat-grid-sm { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cat-card-body { padding: 10px 11px 12px; }
  .cat-card-title h3 { font-size: 15px; }
  .chip { font-size: 11px; padding: 1px 7px; }
  .steps { grid-template-columns: 1fr; }
  .record-item { padding: 12px 14px; gap: 11px; }
  .record-side { display: none; }
  .filter-bar { padding: 13px; }
  .filter-search { min-width: 100%; }
  .detail-meta { grid-template-columns: 1fr; }
  .detail-title h1 { font-size: 24px; }
  .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
  .timeline-photos { grid-template-columns: repeat(3, 1fr); }
  .form-grid, .field-row { grid-template-columns: 1fr; }
  .photo-manage, .image-preview { grid-template-columns: repeat(3, 1fr); }
  .panel { padding: 16px; border-radius: 14px; }
  .stat-grid, .about-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-box { padding: 14px 10px; }
  .stat-box strong { font-size: 22px; }
  .cta-bar { flex-direction: column; align-items: flex-start; }
  .cta-bar .btn { width: 100%; }
  .flash { margin: 10px 14px 0; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .me-hero { flex-direction: column; align-items: flex-start; }
  .me-hero-actions { width: 100%; }
  .me-hero-actions .btn { flex: 1; }
  .profile-avatar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer { padding-bottom: 20px; }
  .footer-inner { flex-direction: column; gap: 12px; }

  /* H5 底部导航 */
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    height: var(--tabbar-h); font-size: 11px; color: var(--muted);
  }
  .mobile-tabbar a span { font-size: 19px; line-height: 1; }
  .mobile-tabbar a.active { color: var(--primary-dark); font-weight: 600; }
  .mobile-tabbar .tab-primary { color: var(--primary-dark); }
  .mobile-tabbar .tab-primary span {
    background: var(--primary); color: #fff; width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 20px; margin-top: -14px;
    box-shadow: 0 6px 16px rgba(249, 115, 22, .4);
  }
}

@media print {
  .site-header, .site-footer, .mobile-tabbar, .detail-actions { display: none; }
}

/* ==========================================================
   个人中心：H5 排版优化（放在文件末尾，确保覆盖基础样式）
   ========================================================== */
@media (max-width: 640px) {
  .me-wrap { padding: 16px 0 30px; }

  /* 顶部信息卡 */
  .me-wrap .me-hero { padding: 16px; gap: 14px; border-radius: 14px; }
  .me-wrap .me-hero-user { gap: 12px; align-items: center; }
  .me-wrap .avatar-lg { width: 54px; height: 54px; font-size: 21px; }
  .me-wrap .me-hero-user h1 { font-size: 20px; }
  .me-wrap .me-hero-user p { font-size: 12.5px; gap: 8px; margin-top: 3px; }
  .me-wrap .me-hero-actions { width: 100%; gap: 8px; margin-top: 2px; }
  .me-wrap .me-hero-actions .btn { flex: 1; height: 42px; }

  /* 页签：3 列 2 行，全部可见，不再横向滚动 */
  .me-wrap .me-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 5px; padding: 6px; margin: 14px 0; overflow: visible;
  }
  .me-wrap .me-tabs a {
    padding: 10px 4px; text-align: center; font-size: 13.5px; border-radius: 10px;
  }

  /* 统计卡：更紧凑 */
  .me-wrap .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .me-wrap .stat-box { padding: 13px 10px; border-radius: 13px; }
  .me-wrap .stat-box strong { font-size: 22px; line-height: 1.25; }
  .me-wrap .stat-box span { font-size: 12px; }

  /* 面板与区块间距 */
  .me-wrap .panel { padding: 16px; border-radius: 14px; margin-bottom: 14px; }
  .me-wrap .panel-head { margin-bottom: 12px; }
  .me-wrap .panel-head h2 { font-size: 16.5px; }
  .me-wrap .two-col { gap: 14px; }
  .me-wrap .cat-grid-sm { gap: 12px; }
}
