/* ============================================
   TNR 流浪动物管理系统 - 水墨丹青设计系统
   中国传统配色 · PC/移动端自适应
   ============================================ */

/* === 1. 中国传统色彩设计令牌 === */
:root {
  /* 主色调 - 朱砂红系 */
  --cinnabar: #C3272B;           /* 朱砂 */
  --cinnabar-deep: #9D2933;      /* 胭脂 */
  --cinnabar-light: #FBE8E8;     /* 朱砂浅 */
  --cinnabar-dark: #A02222;      /* 深朱砂 */

  /* 墨色系 - 侧边栏/文字 */
  --ink: #1C1C1C;                /* 墨色 */
  --ink-deep: #141414;           /* 玄色 */
  --ink-blue: #1A1A2E;           /* 墨青 */
  --ink-soft: #2B2B2B;           /* 柔墨 */
  --ink-text: #2B2B2B;           /* 正文墨色 */
  --ink-muted: #6B5D54;          /* 赭灰文字 */
  --ink-light: #9C8B7E;          /* 浅灰褐 */

  /* 背景色 - 宣纸系 */
  --rice-paper: #F5F0E8;         /* 宣纸白 */
  --rice-light: #FAF6F0;         /* 素宣 */
  --rice-warm: #F0EAE0;          /* 暖宣 */
  --white: #FFFFFF;              /* 纯白卡片 */

  /* 辅助色 - 传统五色 */
  --bamboo-green: #5B7A4F;       /* 竹青 - 成功 */
  --bamboo-light: #E8F0E4;       /* 竹青浅 */
  --autumn-gold: #C89B3C;        /* 秋香 - 警告 */
  --autumn-light: #FBF3E0;       /* 秋香浅 */
  --azurite: #2B6CB0;            /* 石青 - 信息 */
  --azurite-light: #E0EEF7;     /* 石青浅 */
  --rouge: #9D2933;              /* 胭脂 - 危险 */
  --rouge-light: #FBE8E8;        /* 胭脂浅 */
  --ochre: #864E36;              /* 赭石 */
  --ochre-light: #F0E0D4;        /* 赭石浅 */

  /* 边框/分隔 */
  --border-ink: #D4C5B9;         /* 檀色边框 */
  --border-light: #E8DFD4;      /* 浅檀 */
  --border-faint: #F0EAE0;      /* 极浅 */

  /* 渐变 */
  --grad-sidebar: linear-gradient(180deg, #1A1A2E 0%, #16213E 50%, #1C1C1C 100%);
  --grad-cinnabar: linear-gradient(135deg, #C3272B 0%, #9D2933 100%);
  --grad-bamboo: linear-gradient(135deg, #5B7A4F 0%, #426666 100%);
  --grad-gold: linear-gradient(135deg, #C89B3C 0%, #B8860B 100%);
  --grad-header: linear-gradient(90deg, rgba(195,39,43,0.03) 0%, rgba(245,240,232,0) 100%);

  /* 排版 */
  --font-display: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Consolas', monospace;

  /* 字号 */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 20px;
  --fs-3xl: 24px;
  --fs-4xl: 28px;
  --fs-5xl: 34px;

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* 圆角 */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-full: 9999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(28,28,28,0.04);
  --shadow-sm: 0 2px 8px rgba(28,28,28,0.06);
  --shadow-md: 0 4px 16px rgba(28,28,28,0.08);
  --shadow-lg: 0 8px 32px rgba(28,28,28,0.12);
  --shadow-cinnabar: 0 4px 12px rgba(195,39,43,0.25);

  /* 过渡 */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* 布局尺寸 */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
  --header-h: 56px;
}

/* === 2. 基础重置 === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--ink-text);
  background: var(--rice-paper);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-ink); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-light); }

/* === 3. 布局系统 === */

/* 管理端布局 */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  background: var(--grad-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--t-slow);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-cinnabar);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.sidebar-brand-sub {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}

/* 导航 */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-3) var(--sp-2);
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.nav-group-title {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.35);
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r-md);
  margin-bottom: 2px;
  cursor: pointer;
  transition: all var(--t-fast);
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.95);
}

.nav-item.active {
  background: var(--grad-cinnabar);
  color: #fff;
  box-shadow: var(--shadow-cinnabar);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #fff;
  border-radius: 0 2px 2px 0;
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-item-label {
  font-size: var(--fs-md);
  font-weight: 500;
}

.nav-item-badge {
  margin-left: auto;
  background: var(--cinnabar);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  font-weight: 600;
}

/* 侧边栏底部用户 */
.sidebar-footer {
  padding: var(--sp-3);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
}

.sidebar-user:hover { background: rgba(255,255,255,0.06); }

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--grad-cinnabar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: var(--fs-sm); color: #fff; font-weight: 500; }
.sidebar-user-role { font-size: var(--fs-xs); color: rgba(255,255,255,0.5); }

/* 主内容区 */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* 顶部栏 */
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.topbar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--rice-paper);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 18px;
  color: var(--ink-text);
  align-items: center;
  justify-content: center;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--ink);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.topbar-district {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--rice-paper);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}

.topbar-district-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--bamboo-green);
}

.topbar-time {
  font-size: var(--fs-sm);
  color: var(--ink-light);
  font-variant-numeric: tabular-nums;
}

/* 内容容器 */
.admin-content {
  flex: 1;
  padding: var(--sp-6);
  overflow-y: auto;
}

.page-view { display: none; animation: fadeInUp 0.3s ease; }
.page-view.active { display: block; }

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

/* === 4. 卡片 === */
.card {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-faint);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.card-title-bar {
  width: 3px;
  height: 18px;
  background: var(--grad-cinnabar);
  border-radius: 2px;
}

.card-body { padding: var(--sp-5); }
.card-body-flush { padding: 0; }

/* === 5. 统计卡片 === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.stat-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--cinnabar);
}

.stat-card.green::before { background: var(--bamboo-green); }
.stat-card.gold::before { background: var(--autumn-gold); }
.stat-card.blue::before { background: var(--azurite); }
.stat-card.rouge::before { background: var(--rouge); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--cinnabar-light);
}

.stat-card.green .stat-card-icon { background: var(--bamboo-light); }
.stat-card.gold .stat-card-icon { background: var(--autumn-light); }
.stat-card.blue .stat-card-icon { background: var(--azurite-light); }
.stat-card.rouge .stat-card-icon { background: var(--rouge-light); }

.stat-card-value {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.stat-card-label {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-top: 2px;
}

/* === 6. 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 8px 16px;
  border: none;
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  font-family: var(--font-body);
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--grad-cinnabar);
  color: #fff;
  box-shadow: var(--shadow-cinnabar);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(195,39,43,0.35); transform: translateY(-1px); }

.btn-success { background: var(--grad-bamboo); color: #fff; }
.btn-success:hover { opacity: 0.9; }

.btn-gold { background: var(--grad-gold); color: #fff; }
.btn-gold:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--white);
  color: var(--ink-text);
  border: 1px solid var(--border-ink);
}
.btn-secondary:hover { background: var(--rice-paper); border-color: var(--ink-light); }

.btn-outline {
  background: transparent;
  color: var(--cinnabar);
  border: 1px solid var(--cinnabar);
}
.btn-outline:hover { background: var(--cinnabar-light); }

.btn-danger { background: var(--rouge); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-ghost { background: transparent; color: var(--ink-muted); }
.btn-ghost:hover { background: var(--rice-paper); color: var(--ink-text); }

.btn-sm { padding: 5px 10px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { padding: 12px 24px; font-size: var(--fs-lg); }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--r-md); }

.btn-link {
  background: none;
  border: none;
  color: var(--cinnabar);
  cursor: pointer;
  font-size: var(--fs-sm);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.btn-link:hover { background: var(--cinnabar-light); }
.btn-link.danger { color: var(--rouge); }
.btn-link.danger:hover { background: var(--rouge-light); }
.btn-link.success { color: var(--bamboo-green); }
.btn-link.success:hover { background: var(--bamboo-light); }

/* === 7. 表格 === */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  background: var(--rice-warm);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border-ink);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table thead th:first-child { border-top-left-radius: var(--r-lg); }
.data-table thead th:last-child { border-top-right-radius: var(--r-lg); }

.data-table tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-faint);
  font-size: var(--fs-md);
  color: var(--ink-text);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--t-fast);
}

.data-table tbody tr:hover { background: var(--rice-light); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* 表格容器 */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
}

.table-wrapper .data-table thead th:first-child { border-top-left-radius: 0; }
.table-wrapper .data-table thead th:last-child { border-top-right-radius: 0; }

/* 空状态 */
.table-empty {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  color: var(--ink-light);
}

.table-empty-icon { font-size: 48px; margin-bottom: var(--sp-3); opacity: 0.4; }
.table-empty-text { font-size: var(--fs-md); }

/* === 8. 表单 === */
.form-group { margin-bottom: var(--sp-4); }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
}

.form-label .req { color: var(--cinnabar); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-ink);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  color: var(--ink-text);
  background: var(--white);
  transition: all var(--t-fast);
  font-family: var(--font-body);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 3px rgba(195,39,43,0.1);
}

.form-input::placeholder { color: var(--ink-light); }

.form-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B5D54' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.form-hint {
  font-size: var(--fs-xs);
  color: var(--ink-light);
  margin-top: var(--sp-1);
}

.form-section {
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-5);
}

.form-section-header {
  background: var(--rice-warm);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--border-light);
}

.form-section-header-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--cinnabar-light);
  color: var(--cinnabar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.form-section-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
}

.form-section-body { padding: var(--sp-5); }

/* 复选框 */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-ink);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  background: var(--white);
}

.form-check:hover { border-color: var(--cinnabar); }
.form-check.checked { border-color: var(--cinnabar); background: var(--cinnabar-light); }

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cinnabar);
  cursor: pointer;
}

.form-check-label { font-size: var(--fs-md); color: var(--ink-text); }

/* === 9. 搜索筛选栏 === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.filter-item-label {
  font-size: var(--fs-xs);
  color: var(--ink-light);
  font-weight: 500;
}

.filter-item .form-input,
.filter-item .form-select {
  min-width: 140px;
  padding: 6px 10px;
  font-size: var(--fs-sm);
}

.filter-actions {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}

/* 搜索框 */
.search-input {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-icon {
  position: absolute;
  left: 10px;
  color: var(--ink-light);
  font-size: 14px;
  pointer-events: none;
}

.search-input .form-input {
  padding-left: 32px;
  min-width: 200px;
}

/* === 10. 徽章/标签 === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.6;
}

.badge-cinnabar { background: var(--cinnabar-light); color: var(--cinnabar); }
.badge-success { background: var(--bamboo-light); color: var(--bamboo-green); }
.badge-warning { background: var(--autumn-light); color: var(--autumn-gold); }
.badge-danger { background: var(--rouge-light); color: var(--rouge); }
.badge-info { background: var(--azurite-light); color: var(--azurite); }
.badge-default { background: var(--rice-warm); color: var(--ink-muted); }
.badge-ink { background: var(--ink-soft); color: #fff; }

/* 状态点 */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

.status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: currentColor;
}

/* === 11. 模态框/弹窗 === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28,28,28,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-faint);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--rice-paper);
  border-radius: var(--r-md);
  font-size: 18px;
  cursor: pointer;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.modal-close:hover { background: var(--rouge-light); color: var(--rouge); }

.modal-body {
  padding: var(--sp-5);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-faint);
  flex-shrink: 0;
}

/* === 12. 抽屉 === */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28,28,28,0.4);
  backdrop-filter: blur(2px);
  z-index: 1000;
}

.drawer-overlay.show { display: block; animation: fadeIn 0.2s ease; }

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 480px;
  max-width: 90vw;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--t-slow);
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

.drawer.show { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-faint);
  flex-shrink: 0;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
}

.drawer-body {
  padding: var(--sp-5);
  overflow-y: auto;
  flex: 1;
}

/* === 13. 标签页 === */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--sp-5);
}

.tab-item {
  padding: var(--sp-3) var(--sp-5);
  cursor: pointer;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.tab-item:hover { color: var(--ink-text); }

.tab-item.active {
  color: var(--cinnabar);
  border-bottom-color: var(--cinnabar);
  font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* === 14. Toast 通知 === */
.toast-container {
  position: fixed;
  top: var(--sp-6);
  right: var(--sp-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.toast {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 280px;
  max-width: 400px;
  animation: slideInRight 0.3s ease;
  border-left: 3px solid var(--cinnabar);
}

.toast.success { border-left-color: var(--bamboo-green); }
.toast.warning { border-left-color: var(--autumn-gold); }
.toast.danger { border-left-color: var(--rouge); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-text { font-size: var(--fs-sm); color: var(--ink-text); flex: 1; }

/* === 15. 分页 === */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  justify-content: flex-end;
  padding: var(--sp-4) 0;
}

.pagination-info {
  font-size: var(--fs-sm);
  color: var(--ink-light);
  margin-right: auto;
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--border-ink);
  background: var(--white);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--ink-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sp-2);
  transition: all var(--t-fast);
}

.pagination-btn:hover:not(:disabled) { border-color: var(--cinnabar); color: var(--cinnabar); }
.pagination-btn.active { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === 16. 详情描述列表 === */
.desc-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.desc-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.desc-label {
  font-size: var(--fs-xs);
  color: var(--ink-light);
  font-weight: 500;
}

.desc-value {
  font-size: var(--fs-md);
  color: var(--ink-text);
  font-weight: 500;
}

.desc-full { grid-column: 1 / -1; }

/* === 17. 步骤条 === */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--sp-5);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--rice-warm);
  color: var(--ink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.step.active .step-num { background: var(--cinnabar); color: #fff; }
.step.done .step-num { background: var(--bamboo-green); color: #fff; }

.step-label {
  font-size: var(--fs-sm);
  color: var(--ink-light);
  white-space: nowrap;
}

.step.active .step-label { color: var(--cinnabar); font-weight: 600; }
.step.done .step-label { color: var(--bamboo-green); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-light);
  margin: 0 var(--sp-2);
}

.step.done + .step-line { background: var(--bamboo-green); }

/* === 18. 上传区域 === */
.upload-area {
  border: 2px dashed var(--border-ink);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  background: var(--rice-light);
}

.upload-area:hover {
  border-color: var(--cinnabar);
  background: var(--cinnabar-light);
}

.upload-icon { font-size: 36px; margin-bottom: var(--sp-2); }
.upload-text { font-size: var(--fs-md); color: var(--ink-muted); margin-bottom: var(--sp-1); }
.upload-hint { font-size: var(--fs-xs); color: var(--ink-light); }

/* 照片网格 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--rice-warm);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(28,28,28,0.7);
  color: #fff;
  font-size: var(--fs-xs);
  padding: 2px 6px;
  text-align: center;
}

.photo-item-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  background: rgba(157,41,51,0.9);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === 19. 签名板 === */
.signature-pad {
  border: 2px solid var(--border-ink);
  border-radius: var(--r-lg);
  background: var(--white);
  cursor: crosshair;
  touch-action: none;
  width: 100%;
  display: block;
}

/* === 20. 时间线 === */
.timeline {
  position: relative;
  padding-left: var(--sp-6);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--sp-5);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  background: var(--cinnabar);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--cinnabar-light);
}

.timeline-item.done::before { background: var(--bamboo-green); box-shadow: 0 0 0 2px var(--bamboo-light); }

.timeline-time { font-size: var(--fs-xs); color: var(--ink-light); margin-bottom: 2px; }
.timeline-title { font-size: var(--fs-md); font-weight: 500; color: var(--ink-text); }
.timeline-desc { font-size: var(--fs-sm); color: var(--ink-muted); margin-top: 2px; }

/* === 21. 移动端布局（领养人小程序） === */
.mobile-frame {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--rice-paper);
  position: relative;
  padding-bottom: 60px;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--grad-sidebar);
  color: #fff;
  padding: var(--sp-4) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-header-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: var(--sp-2) 0;
  z-index: 100;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
  color: var(--ink-light);
  transition: color var(--t-fast);
}

.mobile-nav-item.active { color: var(--cinnabar); }
.mobile-nav-icon { font-size: 22px; }
.mobile-nav-label { font-size: var(--fs-xs); }

.mobile-content { padding: var(--sp-4); }

/* === 22. 响应式 === */
@media (max-width: 1024px) {
  .desc-list { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28,28,28,0.4);
    z-index: 199;
  }

  .sidebar-overlay.show { display: block; }

  .admin-main {
    margin-left: 0;
  }

  .topbar-toggle { display: flex; }

  .admin-content {
    padding: var(--sp-3);
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions {
    margin-left: 0;
    justify-content: flex-end;
  }

  .filter-item .form-input,
  .filter-item .form-select {
    min-width: 0;
    width: 100%;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }

  .modal {
    max-width: 100%;
    max-height: 95vh;
  }

  .drawer {
    width: 100%;
  }

  .topbar-district,
  .topbar-time {
    display: none;
  }
}

/* === 23. 工具类 === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--ink-muted); }
.text-light { color: var(--ink-light); }
.text-cinnabar { color: var(--cinnabar); }
.text-success { color: var(--bamboo-green); }
.text-warning { color: var(--autumn-gold); }
.text-danger { color: var(--rouge); }

.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.fs-sm { font-size: var(--fs-sm); }
.fs-md { font-size: var(--fs-md); }
.fs-lg { font-size: var(--fs-lg); }
.fs-xl { font-size: var(--fs-xl); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }

.w-full { width: 100%; }
.text-nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }

/* === 24. 装饰元素 === */
.seal-decoration {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--cinnabar);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  border-radius: var(--r-md);
  letter-spacing: -1px;
  box-shadow: var(--shadow-cinnabar);
}

.chinese-pattern-bg {
  background-image:
    radial-gradient(circle at 20% 50%, rgba(195,39,43,0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(200,155,60,0.02) 0%, transparent 50%);
}

/* 空行间距 */
.spacer { height: var(--sp-5); }

/* 隐藏 */
.hidden { display: none !important; }
