/* ============================================================
   栖晤 Quidwel · 管理端样式（design tokens 转 CSS 变量）
   来源: 03-UIUX设计规范/design-tokens.json（ADR-004~008）
   移动端优先 → 管理端为桌面工作台，按 1280 基准 + 响应式收缩
   ============================================================ */
:root {
  /* brand.primary */
  --brand-900: #2E5C47;
  --brand-700: #3E7A5F;
  --brand-500: #4F9072;
  --brand-300: #7BA98C;
  --brand-50: #E3EFE7;
  /* brand.accent */
  --accent-700: #8F6733;
  --accent-500: #C08A4E;
  --accent-300: #D9B07A;
  --accent-50: #F6ECDD;
  /* neutral */
  --ink: #2A342E;
  --secondary: #68746C;
  --weak: #8A948D;
  --line: #DDE5DA;
  --background: #F4F7F2;
  --surface: #FFFFFF;
  /* semantic */
  --success: #3E7A5F;
  --warning: #C08A4E;
  --error: #C05F4E;
  --info: #4F86A8;
  /* category */
  --cat: #B06E5B; --cat-deep: #9C5A48;
  --dog: #B08A3E; --dog-deep: #9A7430;
  --bird: #4F86A8; --bird-deep: #3F7292;
  --reptile: #7A9B6D; --reptile-deep: #648257;
  --fish: #4E8A93; --fish-deep: #3E737B;
  --other: #8A7FA3; --other-deep: #73688C;
  /* typography (design tokens scale) */
  --font-ui: "HarmonyOS Sans SC", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --size-display: 28px;
  --size-page-title: 22px;
  --size-card-title: 17px;
  --size-body: 15px;
  --size-helper: 13px;
  --size-label: 11px;
  /* spacing / radius / shadow */
  --radius-image: 12px;
  --radius-card: 16px;
  --radius-card-large: 18px;
  --radius-sheet: 22px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 14px rgba(42,52,46,.05);
  --shadow-floating: 0 10px 24px rgba(62,122,95,.30);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--size-body);
  color: var(--ink);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--brand-50) 0%, var(--background) 55%, var(--accent-50) 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-card-large);
  box-shadow: var(--shadow-card);
  padding: 40px 36px 32px;
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand .logo-mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--size-page-title);
  font-weight: 700;
  color: var(--brand-700);
}
.login-brand .logo-mark .logo-dot {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.login-brand .logo-mark .logo-dot .paw { font-size: 17px; }
.login-brand .subtitle {
  margin-top: 8px;
  font-size: var(--size-helper);
  color: var(--secondary);
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--size-helper);
  color: var(--secondary);
}
.form-control {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-image);
  font-size: var(--size-body);
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(79,144,114,.15);
}
.form-control::placeholder { color: var(--weak); }
textarea.form-control { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2368746C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 20px;
  border: none; border-radius: var(--radius-pill);
  font-size: var(--size-body); font-family: var(--font-ui);
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-900); box-shadow: 0 4px 12px rgba(62,122,95,.28); }
.btn-primary:disabled { background: var(--brand-300); cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--brand-50); color: var(--brand-700); }
.btn-secondary:hover { background: var(--brand-300); color: #fff; }
.btn-ghost { background: transparent; color: var(--secondary); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand-500); color: var(--brand-700); background: var(--brand-50); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #A84F40; }
.btn-warning { background: var(--accent-500); color: #fff; }
.btn-warning:hover { background: var(--accent-700); }
.btn-sm { height: 32px; padding: 0 14px; font-size: var(--size-helper); border-radius: var(--radius-pill); }
.btn-block { width: 100%; height: 46px; }
.btn-link {
  background: none; border: none; color: var(--brand-700); cursor: pointer;
  font-size: var(--size-helper); font-family: var(--font-ui); padding: 0;
}
.btn-link:hover { color: var(--brand-900); text-decoration: underline; }
.hint-text { font-size: var(--size-helper); color: var(--weak); margin-top: 10px; text-align: center; }
.error-text { font-size: var(--size-helper); color: var(--error); margin-top: 8px; min-height: 18px; }
/* ---------- 主框架 ---------- */
.app-shell { display: none; height: 100vh; }
.app-shell.active { display: flex; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 12px;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  font-weight: 700; color: var(--brand-700); font-size: var(--size-card-title);
}
.sidebar .brand .logo-dot {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.sidebar .brand .logo-dot .paw { font-size: 14px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-image);
  color: var(--secondary);
  cursor: pointer;
  font-size: var(--size-body);
  margin-bottom: 4px;
  border: none; background: none; width: 100%; text-align: left; font-family: var(--font-ui);
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--brand-50); color: var(--brand-700); }
.nav-item.active { background: var(--brand-700); color: #fff; font-weight: 500; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 10px 12px; border-top: 1px solid var(--line); }
.sidebar-footer .admin-info { font-size: var(--size-helper); color: var(--secondary); margin-bottom: 10px; word-break: break-all; }
.main { flex: 1; overflow-y: auto; padding: 24px 28px 48px; min-width: 0; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 { font-size: var(--size-page-title); font-weight: 600; color: var(--ink); }
.page-header .desc { font-size: var(--size-helper); color: var(--secondary); margin-top: 4px; }
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 20px;
}
.card-title { font-size: var(--size-card-title); font-weight: 600; margin-bottom: 16px; color: var(--ink); }

/* 看板统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  border-top: 3px solid var(--brand-500);
}
.stat-card.accent { border-top-color: var(--accent-500); }
.stat-card.warn { border-top-color: var(--error); }
.stat-card.info { border-top-color: var(--info); }
.stat-card .stat-label { font-size: var(--size-helper); color: var(--secondary); }
.stat-card .stat-value { font-size: 30px; font-weight: 700; color: var(--ink); margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub { font-size: var(--size-label); color: var(--weak); margin-top: 6px; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 20px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bar-row .bar-label { width: 56px; font-size: var(--size-helper); color: var(--secondary); text-align: right; flex-shrink: 0; }
.bar-row .bar-track { flex: 1; height: 20px; background: var(--background); border-radius: 6px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 6px; transition: width .35s ease; min-width: 2px; }
.bar-row .bar-value { width: 44px; font-size: var(--size-helper); color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-pill { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--size-label); color: #fff; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
  text-align: left; font-size: var(--size-label);
  color: var(--secondary); font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--background);
}
.data-table td {
  padding: 12px;
  font-size: var(--size-body);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--brand-50); }
.data-table .row-title { font-weight: 500; color: var(--ink); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .row-sub { font-size: var(--size-label); color: var(--weak); margin-top: 3px; }
.empty-row td { text-align: center; color: var(--weak); padding: 40px 0; }

/* 状态标签 */
.status-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: var(--size-label); font-weight: 500;
  white-space: nowrap;
}
.status-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-pending { background: var(--accent-50); color: var(--accent-700); }
.tag-approved { background: var(--brand-50); color: var(--brand-700); }
.tag-rejected { background: #F7E3DF; color: var(--error); }
.tag-review { background: #E7EEF5; color: var(--info); }
.tag-muted { background: var(--background); color: var(--secondary); }
.tag-official { background: var(--brand-50); color: var(--brand-700); }
.tag-pinned { background: var(--accent-50); color: var(--accent-700); }
.tag-cat { background: #F4E3DE; color: var(--cat-deep); }
.tag-dog { background: #F4EAD8; color: var(--dog-deep); }
.tag-bird { background: #E4EEF4; color: var(--bird-deep); }
.tag-reptile { background: #E9F0E5; color: var(--reptile-deep); }
.tag-fish { background: #E4EEEF; color: var(--fish-deep); }
.tag-other { background: #EAE7F1; color: var(--other-deep); }

/* ---------- 分页 ---------- */
.pagination {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding-top: 16px;
  font-size: var(--size-helper); color: var(--secondary);
}
.pagination .page-btn {
  min-width: 32px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; cursor: pointer; font-family: var(--font-ui); color: var(--ink);
}
.pagination .page-btn:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-700); }
.pagination .page-btn:disabled { color: var(--weak); cursor: not-allowed; }
.pagination .page-info { margin: 0 6px; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 16px;
  background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
}
.filter-bar .filter-item { display: flex; align-items: center; gap: 8px; }
.filter-bar label { font-size: var(--size-helper); color: var(--secondary); white-space: nowrap; }
.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="datetime-local"] {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-ui); font-size: var(--size-helper); color: var(--ink); background: var(--surface); outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--brand-500); }
/* ---------- 弹窗 / 抽屉 ---------- */
.modal-mask {
  display: none;
  position: fixed; inset: 0; z-index: 100;
  background: rgba(42,52,46,.45);
  align-items: flex-start; justify-content: center;
  padding: 60px 16px 40px;
  overflow-y: auto;
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow-floating);
  padding: 24px;
}
.modal.wide { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h3 { font-size: var(--size-card-title); font-weight: 600; }
.modal-close {
  width: 30px; height: 30px; border: none; background: var(--background);
  border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--line); color: var(--ink); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row .full { grid-column: 1 / -1; }
.form-hint { font-size: var(--size-label); color: var(--weak); margin-top: 4px; }

/* 详情抽屉 */
.drawer-mask {
  display: none;
  position: fixed; inset: 0; z-index: 90;
  background: rgba(42,52,46,.35);
}
.drawer-mask.show { display: block; }
.drawer {
  position: fixed; top: 0; right: -520px; width: 100%; max-width: 520px;
  height: 100vh; z-index: 95;
  background: var(--surface);
  box-shadow: var(--shadow-floating);
  transition: right .24s ease-out;
  overflow-y: auto; padding: 24px;
}
.drawer.show { right: 0; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.drawer-header h3 { font-size: var(--size-card-title); font-weight: 600; }
.drawer-section { margin-bottom: 20px; }
.drawer-section .sec-label { font-size: var(--size-label); color: var(--weak); margin-bottom: 6px; letter-spacing: .02em; }
.drawer-section .sec-body { font-size: var(--size-body); line-height: 1.6; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.drawer-section .sec-body img { max-width: 100%; border-radius: var(--radius-image); margin-top: 6px; }
.drawer-section .sec-body .img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.drawer-section .sec-body .img-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-image); }

/* 详情信息行 */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.info-grid .info-item .k { font-size: var(--size-label); color: var(--weak); }
.info-grid .info-item .v { font-size: var(--size-body); color: var(--ink); margin-top: 2px; word-break: break-all; }

/* 活动表单网格 */
.activity-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* 图片缩略 */
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--background); }
.thumb-stack { display: flex; gap: 4px; }

/* Toast */
.toast-wrap { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 20px; border-radius: var(--radius-pill);
  font-size: var(--size-helper); color: #fff; background: var(--ink);
  box-shadow: var(--shadow-floating);
  animation: toast-in .2s ease-out;
  max-width: 80vw;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--accent-700); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 加载态 */
.loading { text-align: center; padding: 40px 0; color: var(--weak); font-size: var(--size-helper); }
.loading .spinner {
  width: 26px; height: 26px; margin: 0 auto 10px;
  border: 3px solid var(--brand-50); border-top-color: var(--brand-700);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   管理端 V1.1 补充样式（t_a5441403：用户管理/系统/敏感词/评论审核/看板增强）
   ============================================================ */

/* 看板增强：北极星卡 */
.north-star {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  color: #fff;
  border-radius: var(--radius-card-large);
  box-shadow: var(--shadow-floating);
  padding: 22px 26px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.north-star .ns-label {
  font-size: var(--size-body);
  color: rgba(255,255,255,.85);
  font-weight: 500;
}
.north-star .ns-value {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.north-star .ns-sub {
  font-size: var(--size-helper);
  color: rgba(255,255,255,.7);
}

/* 趋势占位 */
.trend-card { margin-bottom: 16px; }

/* 近 7 日趋势（t_a5441403 看板增强） */
.trend-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--size-helper);
  color: var(--secondary);
}
.trend-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.trend-placeholder {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-image);
  color: var(--weak);
  font-size: var(--size-helper);
  text-align: center;
  padding: 16px;
}

/* 系统设置 tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 6px;
  width: fit-content;
}
.tab-btn {
  padding: 8px 22px;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  font-size: var(--size-body);
  font-family: var(--font-ui);
  color: var(--secondary);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tab-btn:hover { color: var(--brand-700); }
.tab-btn.active { background: var(--brand-700); color: #fff; font-weight: 500; }
.tab-panel { display: block; }

/* 敏感词分类 tag-info 补充 */
.tag-info { background: #E7EEF5; color: var(--info); }

/* 响应式 */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  .sidebar .brand { justify-content: center; padding: 0 0 14px; }
  .sidebar .brand span.text { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item .nav-text { display: none; }
  .sidebar-footer .admin-info { display: none; }
  .main { padding: 16px 14px 40px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .activity-form-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .north-star { flex-direction: column; align-items: flex-start; gap: 8px; }
  .north-star .ns-value { font-size: 34px; }
  .tabs { width: 100%; }
  .tab-btn { flex: 1; }
}