:root {
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --accent: #f59e0b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.hidden { display: none !important; }

button {
  cursor: pointer;
  border: none;
  font-size: 14px;
  border-radius: 10px;
  transition: all 0.15s ease;
}

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 6px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 11px 18px;
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f8fafc; color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* 登录 */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 55%, #5eead4 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  text-align: center;
}
.login-logo { font-size: 52px; }
.login-card h1 { font-size: 22px; margin: 10px 0 6px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
#login-form { text-align: left; }
/* 密码框和登录按钮之间留出呼吸空间，避免贴在一起 */
#login-form .btn-primary { margin-top: 18px; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }
.login-tip { color: var(--muted); font-size: 13px; margin-top: 14px; }
.login-tip a { color: var(--primary-dark); text-decoration: none; font-weight: 600; }
.login-tip a:hover { text-decoration: underline; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 6px; line-height: 1.5; }
.hint::before { content: "💡"; margin-right: 4px; }

/* 列表的日期 / 关键字过滤条 */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.filter-bar input { flex: 1 1 180px; min-width: 120px; }
.filter-bar input[type="date"] { flex: 0 0 150px; }
.filter-sep { color: var(--muted); font-size: 13px; }
.more-bar { margin-top: 10px; text-align: center; }

/* 布局 */
.app-view { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 20px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  padding: 6px 10px 22px;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar h2 { font-size: 19px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-info { color: var(--muted); font-size: 13px; }
.store-switch { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; }

.content { padding: 28px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.toolbar h3 { font-size: 16px; }
.toolbar button { white-space: nowrap; }

/* 卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.pet-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pet-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1); }
.pet-card .avatar { font-size: 40px; }
.pet-card h4 { font-size: 17px; margin: 8px 0 2px; }
.pet-card .species { color: var(--muted); font-size: 13px; }
.pet-card .meta { margin-top: 12px; font-size: 13px; color: var(--muted); }
.pet-card .meta div { margin: 3px 0; }
.pet-card .actions { margin-top: 14px; display: flex; gap: 8px; }

/* 按主人分组的宠物列表 */
.owner-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 20px;
  margin-bottom: 18px;
}
.owner-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.owner-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f0fdfa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.owner-head h4 { font-size: 16px; }
.owner-phone { color: var(--muted); font-size: 12px; }
/* 组内的宠物卡片弱化阴影，形成层次 */
.owner-group .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.owner-group .pet-card { box-shadow: none; }
.owner-group .pet-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); }

.tag {
  display: inline-block;
  background: #f0fdfa;
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-right: 4px;
}

/* 物种多选：选中的物种显示成一个个可删的小标签，比手输 "dog,cat" 友好得多 */
.chip-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fcfefe;
}
.chip {
  display: inline-flex;
  align-items: center;
  background: #f0fdfa;
  color: var(--primary-dark);
  border: 1px solid #cdf3ee;
  border-radius: 999px;
  padding: 2px 4px 2px 10px;
  font-size: 13px;
}
.chip-x {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 999px;
}
.chip-x:hover { background: #cdf3ee; }
.chip-empty { color: var(--muted); font-size: 13px; }
.chip-add { display: flex; gap: 8px; margin-top: 8px; }
.chip-add select { flex: 1; }

/* 表格 */
.table-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 50px 20px;
  font-size: 14px;
}
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-box {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h3 { font-size: 17px; margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.req { color: #dc2626; font-weight: 600; margin-left: 2px; }

.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: min(560px, 90vw);
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
  z-index: 200;
  animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.toast.ok { border-left: 4px solid #10b981; }
.toast.bad { border-left: 4px solid #ef4444; }
.toast-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #047857;
  font-size: 15px;
  font-weight: 700;
}
.toast.bad .toast-icon { background: #fef2f2; color: #b91c1c; }
.toast-text { font-size: 14px; line-height: 1.5; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 自定义确认框：居中 + 大图标（替代浏览器原生 confirm，原生框位置在顶部、很不显眼） */
.confirm-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 150;
}
.confirm-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 28px 26px 22px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.35);
  text-align: center;
  animation: pop-in 0.18s ease-out;
}
.confirm-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fffbeb;
  font-size: 30px;
  line-height: 1;
}
.confirm-icon.type-danger { background: #fef2f2; }
.confirm-icon.type-info { background: #eff6ff; }
.confirm-icon.type-question { background: #ecfeff; }
.confirm-title { font-size: 19px; font-weight: 700; margin: 0 0 8px; }
.confirm-msg { color: var(--muted); font-size: 14px; line-height: 1.7; }
.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}
.confirm-actions .btn-primary,
.confirm-actions .btn-ghost { min-width: 96px; }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* 长耗时操作的等待遮罩：盖住全屏 + 转圈 + 已等待秒数，处理完才消失 */
.busy {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 300; /* 比弹窗(100)和 toast(200)都高，保证盖得住 */
}
.busy-box {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 30px 28px 24px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.35);
}
.busy-orbit {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}
.spinner {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  margin: 0;
  border: 5px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.busy-emoji {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.busy-msg { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.7; }
.busy-bar {
  width: 100%;
  height: 5px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}
.busy-bar i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #14b8a6, #5eead4);
  animation: busy-slide 1.3s ease-in-out infinite;
}
@keyframes busy-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}
.busy-tip { color: var(--muted); font-size: 12px; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.5s; }
  .busy-bar i { animation: none; width: 100%; }
}

/* 宠物详情 */
.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head h3 { font-size: 18px; white-space: nowrap; }
.detail-head button { white-space: nowrap; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head h4 { font-size: 15px; }
.panel-actions { display: flex; align-items: center; gap: 10px; }
.count {
  color: var(--muted);
  font-size: 12px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 2px 10px;
}
.count.bad { color: #dc2626; background: #fef2f2; }
.text-bad { color: #dc2626; }
.panel .empty { padding: 24px 10px; }
.plain-list {
  margin: 0 0 10px;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.9;
}
.plain-list li { margin: 2px 0; }

.row { border-top: 1px solid var(--border); padding: 12px 0; }
.row:first-of-type { border-top: none; }
.row-main { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.row-time { color: var(--muted); font-size: 12px; }
.row-sub { color: var(--muted); font-size: 12px; }
.row-text { margin-top: 6px; font-size: 14px; line-height: 1.6; }
.row-ai { margin-top: 6px; font-size: 13px; color: var(--primary-dark); }

/* 跨面板互相引用的编号（服务 #id / 方案 #id / 使用 #id / 反馈 #id） */
.id-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
}
.id-link { cursor: pointer; transition: background .15s, color .15s; }
.id-link:hover { background: #ccfbf1; color: var(--primary-dark); }
.flash-highlight {
  position: relative;
  border-radius: 10px;
  animation: flash-highlight 3s ease;
}
@keyframes flash-highlight {
  0% {
    background: #fef3c7;
    box-shadow: 0 0 0 3px #f59e0b, 0 0 26px rgba(245, 158, 11, 0.35);
  }
  65% {
    background: #fffbeb;
    box-shadow: 0 0 0 3px #fbbf24, 0 0 18px rgba(251, 191, 36, 0.22);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}
.jump-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  animation: pop-in 0.18s ease-out;
}

/* 采购需求：按状态分组的卡片，比一行塞满小标签清爽 */
.proc-panel { padding-bottom: 16px; }
.proc-panel .panel-head h4 { display: flex; align-items: center; gap: 8px; }
.proc-list { display: flex; flex-direction: column; gap: 10px; }
.proc-card {
  position: relative;
  padding: 14px 16px 14px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.proc-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05); }
/* 左侧色条表示状态：黄=待采购、蓝=已下单、绿=已到货、灰=已取消 */
.proc-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #cbd5e1;
}
.proc-pending::before { background: #f59e0b; }
.proc-ordered::before { background: #3b82f6; }
.proc-received::before { background: #10b981; }
.proc-cancelled { opacity: 0.65; }
.proc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.proc-card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.proc-name { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.5; }
.proc-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
.proc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.proc-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}
.proc-reason {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
}
.proc-reason-label { flex-shrink: 0; padding-top: 1px; color: #94a3b8; font-size: 12px; }

/* 订阅管理：状态卡 + 套餐卡片 + 时长快捷选择 */
.sub-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 24px 20px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 10px 26px rgba(13, 148, 136, 0.18);
}
.sub-hero::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.sub-hero.sub-trial {
  background: linear-gradient(135deg, #1d4ed8, #38bdf8);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.18);
}
.sub-hero.sub-expired {
  background: linear-gradient(135deg, #b91c1c, #f97316);
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.18);
}
.sub-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.sub-hero-left { display: flex; align-items: flex-start; gap: 14px; }
.sub-hero-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 26px;
}
.sub-hero-kicker { font-size: 12px; opacity: 0.82; }
.sub-hero-title { margin-top: 2px; font-size: 28px; font-weight: 700; line-height: 1.25; }
.sub-hero-desc { margin-top: 4px; font-size: 13px; opacity: 0.88; }
.sub-hero-note { margin-top: 2px; font-size: 12px; opacity: 0.72; }
.sub-hero-right { display: flex; gap: 30px; flex-wrap: wrap; }
.sub-stat { display: flex; flex-direction: column; gap: 4px; }
.sub-stat span { font-size: 12px; opacity: 0.75; }
.sub-stat b { font-size: 16px; font-weight: 600; }
.sub-progress {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}
.sub-progress-fill { height: 100%; border-radius: 999px; background: #fff; }
.sub-progress-caption {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.8;
}
.sub-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 10px;
}
.sub-section-head h3 { font-size: 16px; }
.sub-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.sub-plan {
  position: relative;
  padding: 18px 18px 16px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sub-plan:hover { border-color: #99f6e4; transform: translateY(-1px); }
.sub-plan.selected {
  border-color: var(--primary);
  background: #fbfffe;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.sub-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sub-plan-name { color: var(--text); font-size: 15px; font-weight: 600; }
.sub-plan-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 11px;
  white-space: nowrap;
}
.sub-plan-price { display: flex; align-items: baseline; gap: 4px; margin-top: 10px; color: var(--text); }
.sub-plan-price b { font-size: 30px; font-weight: 700; line-height: 1; }
.sub-plan-price span { color: var(--muted); font-size: 12px; }
.sub-plan-desc {
  margin-top: 8px;
  padding-right: 26px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.sub-plan-check {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: transparent;
  font-size: 13px;
}
.sub-plan.selected .sub-plan-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.sub-renew {
  margin-top: 16px;
  padding: 18px 20px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.sub-renew-title { color: #475569; font-size: 13px; font-weight: 600; }
.sub-months { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sub-month {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.sub-month:hover { border-color: #99f6e4; color: var(--primary-dark); }
.sub-month.active {
  border-color: var(--primary);
  background: #f0fdfa;
  color: var(--primary-dark);
  font-weight: 600;
}
.sub-checkout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.sub-total-wrap { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sub-total-label { color: var(--muted); font-size: 13px; }
.sub-total { color: #0f766e; font-size: 26px; font-weight: 700; line-height: 1; }
.sub-total-note { color: var(--muted); font-size: 12px; }
.sub-pay-btn { min-width: 140px; padding: 11px 22px; }

/* 设置页：让偏好设置看起来像一张张可操作的卡片，而不是两个下拉框 */
.settings-card {
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.settings-card-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.settings-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f0fdfa;
  font-size: 20px;
}
.settings-icon.is-blue { background: #eff6ff; }
.settings-text { flex: 1; min-width: 200px; }
.settings-text h4 { color: var(--text); font-size: 15px; }
.settings-text p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.settings-current {
  padding: 3px 10px;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 12px;
  white-space: nowrap;
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5f9;
}
.seg-btn {
  padding: 7px 16px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg-btn:hover { color: var(--primary-dark); }
.seg-btn.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.settings-coming {
  padding: 16px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}
.settings-coming-head { color: #475569; font-size: 13px; font-weight: 600; }
.settings-coming-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.settings-coming-tags span {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

/* 主人管理：微信绑定状态（不把 openid 原文露给店员） */
.bind-badge {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  white-space: nowrap;
}
.bind-badge.off { background: #f1f5f9; color: var(--muted); }
.wx-bind-box {
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.wx-bind-state { color: var(--text); font-size: 13px; font-weight: 600; }
.wx-bind-state.is-on { color: #047857; }
.wx-bind-tip { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* 服务记录：卡片式条目 */
.event-item {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  transition: background .15s;
}
.event-item:first-of-type { border-top: none; }
.event-item:hover { background: #fafcff; }
.event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.event-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.event-type { font-weight: 600; }
.event-time, .event-employee { color: var(--muted); font-size: 12px; }
.event-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.event-raw {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: #0f172a;
}
.event-ai {
  margin-top: 8px;
  padding: 9px 12px;
  background: #f0fdfa;
  border-left: 3px solid #14b8a6;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #0f766e;
}
.event-review {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding: 9px 12px;
  background: #fffbeb;
  border-left: 3px solid #fbbf24;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #92400e;
}
.event-review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.event-review-label {
  font-size: 12px;
  color: #92400e;
  background: #fef3c7;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
}
.event-review-stars { color: #f59e0b; font-size: 15px; letter-spacing: 2px; line-height: 1; }
.event-review-dim { color: #fde68a; }
.event-review-score { color: #b45309; font-size: 12px; }
.event-review-text { margin-top: 4px; font-size: 13px; line-height: 1.6; color: #78350f; }
.event-review-time { margin-top: 2px; font-size: 11px; color: #b45309; opacity: .8; }
.event-void { margin-top: 8px; color: #b91c1c; font-size: 12px; }

/* 顾客评价：单独一块，避免藏在服务记录的小灰字里看不到 */
.review-row {
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.review-row:last-child { margin-bottom: 0; }
.review-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.review-stars { color: #f59e0b; font-size: 17px; letter-spacing: 1px; }
.review-content { margin-top: 6px; font-size: 14px; line-height: 1.6; color: #334155; }

/* 已作废的记录：整体灰掉，一眼能看出"这条不生效了，但数据还在" */
.row-void { opacity: 0.62; }
.void-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.void-toggle input { width: 14px; height: 14px; margin: 0; cursor: pointer; }

.feedbacks { margin-top: 8px; padding-left: 12px; border-left: 3px solid #f0fdfa; }
.feedback-item { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; }
.fb-src {
  background: #f1f5f9;
  color: var(--muted);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 12px;
  flex-shrink: 0;
}
.fb-star { color: var(--accent); letter-spacing: 1px; }
.usage-item { border-top: 1px solid var(--border); padding: 14px 0; }
.usage-item:first-of-type { border-top: none; }
.usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.usage-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usage-meta { color: #64748b; font-size: 12px; }
.usage-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.usage-feedbacks { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.feedback-item {
  display: block;
  margin: 0;
  padding: 8px 12px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px;
}
.feedback-item.fb-owner { background: #fffbeb; border-left-color: #fbbf24; }
.feedback-item.fb-staff { background: #f0fdfa; border-left-color: #14b8a6; }
.feedback-item.fb-owner .fb-src { background: #fef3c7; color: #92400e; }
.feedback-item.fb-staff .fb-src { background: #ccfbf1; color: #0f766e; }
.feedback-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-score { color: #475569; font-size: 12px; }
.fb-time { color: #94a3b8; font-size: 11px; }
.fb-actions { display: flex; gap: 6px; }
.feedback-text { margin-top: 6px; font-size: 13px; line-height: 1.6; color: #0f172a; }

/* 记录服务：保存后自动整理的勾选项 */
.auto-ai-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid #ccfbf1;
  border-radius: 10px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}
.auto-ai-line input {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}

/* 长期记忆：有未确认项时的提示条 */
.memory-pending-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
}

.memory-item { border-top: 1px solid var(--border); padding: 14px 0; }
.memory-item:first-of-type { border-top: none; }
.memory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.memory-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.memory-key { color: #64748b; font-size: 12px; }
.memory-actions { display: flex; gap: 6px; }
.memory-value {
  margin-top: 10px;
  padding: 9px 12px;
  background: #f8fafc;
  border-left: 3px solid #14b8a6;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: #0f172a;
}
.memory-time {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.st-badge {
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 10px;
  background: #f1f5f9;
  color: var(--muted);
}
.st-active { background: #dcfce7; color: #15803d; }
.st-pending { background: #fef3c7; color: #b45309; }
.st-ordered { background: #dbeafe; color: #1d4ed8; }
.st-rejected { background: #fee2e2; color: #b91c1c; }
.st-historical, .st-expired { background: #e2e8f0; color: #475569; }

/* AI 护理方案 */
.spacer { flex: 1; }

/* 二维码 */
.retrieval-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.retrieval-bar input { flex: 1; }

.qr-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.qr-box:first-of-type { border-top: none; }
.qr-img {
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
}
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.mini-code-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.mini-code-img {
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
}
.mini-code-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.mini-code-actions { display: flex; gap: 10px; }
.qr-url {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 10px;
}

/* 搜索框 */
.search-box { position: relative; display: flex; align-items: center; }
.search-box .search-icon {
  position: absolute;
  left: 11px;
  font-size: 13px;
  opacity: 0.55;
  pointer-events: none;
}
.search-box input { width: 260px; padding-left: 32px; }
.plan {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.plan:first-of-type { border-top: none; }
.plan-table-wrap {
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}
.plan-table-wrap.plan-confirmed { border-top: 3px solid #10b981; }
.plan-table-wrap.plan-completed { border-top: 3px solid #3b82f6; }
.plan-table-wrap.plan-recommended,
.plan-table-wrap.plan-draft { border-top: 3px solid #f59e0b; }
.plan-table-wrap.plan-rejected { border-top: 3px solid #ef4444; }
#plans-list { padding-bottom: 20px; }
.plan-divider {
  height: 0;
  border-top: 2px solid #cbd5e1;
  margin: 20px 0;
}
.plan-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.plan-table > thead > tr > th {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.plan-table-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-no {
  font-weight: 600;
  color: var(--text);
  background: #eef2f7;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}
.plan-table > tbody > tr > th,
.plan-table > tbody > tr > td {
  border-top: 1px solid #eef2f7;
  padding: 14px 16px;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.7;
}
.plan-table > tbody > tr > th {
  width: auto;
  background: #fafbfc;
  color: #64748b;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.plan-advice-cell {
  background: linear-gradient(90deg, #f0fdfa, #f7fffd);
  color: #0f766e;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
}
.plan-points-cell { color: #334155; line-height: 1.8; }
.plan-warn-cell {
  background: #fffdf5;
  color: #92400e;
  line-height: 1.8;
  border-left: 3px solid #fbbf24;
}
.plan-points-cell .plan-points,
.plan-warn-cell .plan-points { margin: 0 0 0 18px; }
.plan-items-table {
  width: 100%;
  min-width: 860px; /* 窄屏不硬挤列，交给 .plan-items-scroll 横向滚动 */
  border-collapse: collapse;
  border: none;
  border-radius: 0;
  table-layout: fixed;
}
/* 用品表单独占满一行：外面留一个滚动容器，窄屏时横向滚动而不是把列挤变形 */
.plan-items-scroll { width: 100%; overflow-x: auto; }
.plan-items-title {
  padding: 10px 16px;
  background: #fafbfc;
  border-bottom: 1px solid #eef2f7;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.plan-items-empty { padding: 14px 16px; }
.plan-items-table th,
.plan-items-table td {
  border-bottom: 1px solid #eef2f7;
  border-right: 1px solid #f1f5f9;
  padding: 10px 12px;
  font-size: 12px;
  vertical-align: top;
}
.plan-items-table thead th {
  background: #f1f5f9;
  color: #475569;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.plan-items-table tbody tr:nth-child(even) { background: #fbfdff; }
.plan-items-table tbody tr:hover { background: #f8fafc; }
/* 最后一行贴着卡片圆角，去掉横线，避免在圆角处露出半截边框 */
.plan-items-table tbody tr:last-child td { border-bottom: none; }
.plan-item-type { white-space: nowrap; }
.plan-item-reason { color: #64748b; line-height: 1.7; }
/* 「优先级」必须一行放得下，之前 80px 列宽减去左右 padding 后会折成两行 */
.plan-items-table th:nth-child(3),
.plan-items-table td.plan-item-priority { white-space: nowrap; }
/* 状态与操作改成竖向排列、统一右对齐：多行时右侧边缘仍然是一条直线 */
.plan-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.plan-item-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
.plan-item-status.is-ok { background: #ecfdf5; color: #047857; }
.plan-item-used {
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-items-table th:last-child,
.plan-items-table td:last-child {
  text-align: right;
  white-space: nowrap;
  border-right: none;
}
.plan-items-table th:first-child,
.plan-items-table td:first-child { padding-left: 16px; }
.plan-items-table td.plan-item-action-cell { padding-right: 16px; }
.plan-table > tbody > tr > td.plan-items-cell { padding: 0; }
.plan-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.plan-warn {
  margin-top: 6px;
  font-size: 13px;
  color: #b45309;
  background: #fffbeb;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-line;
}
.plan-points { margin: 6px 0 0 18px; padding: 0; }
.plan-points li { margin: 4px 0; line-height: 1.6; }
.plan-sub b, .plan-warn b { display: block; margin-bottom: 4px; }
.plan-advice { margin-top: 6px; font-size: 15px; font-weight: 600; line-height: 1.7; color: var(--text); }
.plan-advice b { color: var(--primary-dark); }
.plan-items b { font-size: 14px; }

/* 五角星评分（支持半颗：底灰星 + 上层金色星按百分比裁剪） */
.star-rating { display: flex; gap: 6px; font-size: 30px; line-height: 1; margin: 6px 0 4px; }
.star-unit { position: relative; width: 1em; height: 1em; }
.star-bg { position: absolute; inset: 0; color: #cbd5e1; }
.star-fill { position: absolute; inset: 0; color: #f59e0b; overflow: hidden; white-space: nowrap; }
.star-hit { position: absolute; top: 0; bottom: 0; width: 50%; cursor: pointer; z-index: 2; }
.star-hit.left { left: 0; }
.star-hit.right { right: 0; }
.rating-text { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.plan-items { list-style: none; margin: 8px 0 0; padding: 0; }
.plan-items li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-top: 1px dashed var(--border);
}
.plan-items li:first-child { border-top: none; }

@media (max-width: 720px) {
  .sidebar { width: 64px; }
  .sidebar-logo span, .nav-item { font-size: 0; }
  .nav-item::before { font-size: 20px; }
  .content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  /* 宠物详情：窄屏下标题、按钮、信息条都改成竖排，避免被挤成一条竖线 */
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar > div { flex-wrap: wrap; }
  .detail-head { flex-wrap: wrap; }
  .detail-meta { flex-direction: column; gap: 6px; }
  .panel-head { flex-wrap: wrap; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .sub-hero { padding: 18px; }
  .sub-hero-title { font-size: 23px; }
  .sub-hero-right { gap: 20px; }
  .sub-checkout { align-items: stretch; }
  .sub-pay-btn { width: 100%; }
}
