/* ============================================================
   喂猫去咯 · 自定义样式（配合 Tailwind CSS 使用）
   —— 组件部分使用原生 CSS，保证即使 CDN 未加载也不会散架
   ============================================================ */

:root {
  --cream: #fff9f5;
  --milk: #fffdfb;
  --peach: #ffe0ce;
  --blush: #ffb7c5;
  --rose: #ff7a9c;
  --rose-dark: #e85c80;
  --mint: #b7e4c7;
  --mint-dark: #52b788;
  --sky: #bfe3f5;
  --sky-dark: #4f9dc7;
  --lemon: #ffe9a8;
  --lilac: #d9ccff;
  --ink: #5b4a4a;
  --ink-2: #9a8888;
  --line: rgba(255, 183, 197, 0.45);
  --shadow-card: 0 10px 30px -18px rgba(91, 74, 74, 0.35);
  --shadow-soft: 0 16px 34px -18px rgba(255, 122, 156, 0.55);
}

* {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    ui-rounded, system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* 背景上的粉色柔光 + 猫爪氛围 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 420px at 8% -6%, rgba(255, 183, 197, 0.42), transparent 62%),
    radial-gradient(560px 420px at 102% 4%, rgba(191, 227, 245, 0.4), transparent 60%),
    radial-gradient(620px 480px at 50% 108%, rgba(183, 228, 199, 0.36), transparent 62%);
}

::selection {
  background: var(--blush);
  color: #fff;
}

/* ---------------- 滚动条 ---------------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 183, 197, 0.75);
  border-radius: 9999px;
  border: 2px solid var(--cream);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--rose);
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--milk);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-card);
}

.card-hover {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease,
    color 0.18s ease;
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px) scale(0.985);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #ff9db6, #ff7a9c);
  color: #fff;
  box-shadow: 0 14px 26px -14px rgba(255, 122, 156, 0.95);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -14px rgba(255, 122, 156, 1);
}

.btn-mint {
  background: linear-gradient(135deg, #a9e2c1, #6ec89a);
  color: #1f6b49;
  box-shadow: 0 14px 26px -16px rgba(82, 183, 136, 0.9);
}
.btn-mint:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  background: #fff;
  color: var(--rose-dark);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: #fff4f7;
  transform: translateY(-2px);
}

.btn-quiet {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-2);
  border-color: rgba(154, 136, 136, 0.22);
}
.btn-quiet:hover {
  background: #fff;
  color: var(--ink);
}

.btn-danger {
  background: #fff1f4;
  color: #d94f70;
  border-color: rgba(217, 79, 112, 0.35);
}
.btn-danger:hover {
  background: #ffe1e8;
}

.btn-xs {
  padding: 0.34rem 0.78rem;
  font-size: 0.78rem;
  border-radius: 9999px;
}

/* ---------------- 表单 ---------------- */
.label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #7d6a6a;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.66rem 0.95rem;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.94rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input::placeholder,
.textarea::placeholder {
  color: #c4b6b6;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(255, 183, 197, 0.28);
}
.textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.7;
}

.hint {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--ink-2);
}

.field-error {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #d94f70;
}

.input.is-error,
.select.is-error,
.textarea.is-error {
  border-color: rgba(217, 79, 112, 0.6);
  background: #fff8f9;
}

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem 0.66rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-pending {
  background: #fff6dd;
  color: #a9781a;
  border-color: rgba(169, 120, 26, 0.18);
}
.badge-ongoing {
  background: #e8f6ff;
  color: #2f7ea8;
  border-color: rgba(47, 126, 168, 0.18);
}
.badge-done {
  background: #e7f8ef;
  color: #237a54;
  border-color: rgba(35, 122, 84, 0.18);
}
.badge-cancelled {
  background: #f2eef7;
  color: #7b6a92;
  border-color: rgba(123, 106, 146, 0.18);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.7rem;
  border-radius: 9999px;
  background: #fff2f6;
  border: 1px solid var(--line);
  color: #b8506e;
  font-size: 0.78rem;
  font-weight: 600;
}

.chip-mint {
  background: #effaf4;
  border-color: rgba(82, 183, 136, 0.28);
  color: #2f7a5c;
}

.chip-sky {
  background: #eef8fe;
  border-color: rgba(79, 157, 199, 0.28);
  color: #2f7ea8;
}

/* ---------------- 导航 ---------------- */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.46rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #8a7777;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.nav-link:hover {
  background: #fff2f6;
  color: var(--rose-dark);
}
.nav-link.is-active {
  background: linear-gradient(135deg, #ff9db6, #ff7a9c);
  color: #fff;
  box-shadow: 0 12px 22px -14px rgba(255, 122, 156, 1);
}

/* ---------------- 日历 ---------------- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-head {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  padding-bottom: 0.4rem;
}

.cal-cell {
  position: relative;
  min-height: 104px;
  padding: 0.45rem 0.45rem 0.5rem;
  border-radius: 18px;
  border: 1.5px solid transparent;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 183, 197, 0.28);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cal-cell:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px -18px rgba(255, 122, 156, 0.9);
  border-color: var(--blush);
}
.cal-cell.is-other {
  background: rgba(255, 253, 251, 0.55);
  opacity: 0.6;
}
.cal-cell.is-today {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(255, 183, 197, 0.35);
}
.cal-cell.is-selected {
  border-color: var(--rose);
  background: #fff6f8;
}

.cal-daynum {
  font-size: 0.84rem;
  font-weight: 800;
  color: #7d6a6a;
}
.cal-cell.is-today .cal-daynum {
  color: var(--rose-dark);
}
.cal-cell.is-other .cal-daynum {
  color: #c4b6b6;
}

.cal-chip {
  display: block;
  width: 100%;
  padding: 0.16rem 0.42rem;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff0f4;
  color: #b8506e;
  border-left: 3px solid var(--rose);
}
.cal-chip.is-done {
  background: #eefaf3;
  color: #2f7a5c;
  border-left-color: var(--mint-dark);
}
.cal-chip.is-skipped {
  background: #f3f0f7;
  color: #7b6a92;
  border-left-color: #b3a3c9;
}
.cal-more {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-2);
  padding-left: 0.2rem;
}

/* ---------------- 时间线 ---------------- */
.timeline {
  position: relative;
  padding-left: 1.6rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: linear-gradient(180deg, #ffd3de, #cbe9dd);
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  padding-bottom: 0.95rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.19rem;
  top: 0.42rem;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: #fff;
  border: 2.5px solid var(--blush);
}
.timeline-item.is-done::before {
  border-color: var(--mint-dark);
  background: var(--mint-dark);
}
.timeline-item.is-skipped::before {
  border-color: #b3a3c9;
  background: #d7cbe6;
}

/* ---------------- 动态行 ---------------- */
.row-block {
  border: 1.5px dashed rgba(255, 183, 197, 0.75);
  border-radius: 20px;
  background: rgba(255, 249, 245, 0.75);
  padding: 0.85rem;
}

/* ---------------- 空状态 ---------------- */
.empty {
  text-align: center;
  padding: 2.6rem 1rem;
}
.empty-emoji {
  font-size: 3rem;
  display: inline-block;
  animation: floaty 3.2s ease-in-out infinite;
}

/* ---------------- 动画 ---------------- */
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(4deg);
  }
}
@keyframes popin {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toastin {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-floaty {
  animation: floaty 3.2s ease-in-out infinite;
}
.animate-wiggle {
  animation: wiggle 0.9s ease-in-out infinite;
  display: inline-block;
}
.animate-popin {
  animation: popin 0.34s ease-out both;
}

/* ---------------- Toast ---------------- */
.toast {
  animation: toastin 0.3s ease-out both;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.05rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 18px 34px -18px rgba(91, 74, 74, 0.55);
  border: 1.5px solid var(--line);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}
.toast-success {
  border-color: rgba(82, 183, 136, 0.5);
}
.toast-error {
  border-color: rgba(217, 79, 112, 0.5);
}
.toast-warn {
  border-color: rgba(200, 152, 40, 0.5);
}

/* 打印（把当天清单打出来带去上门） */
@media print {
  body::before,
  .no-print {
    display: none !important;
  }
  .card {
    box-shadow: none;
    border-color: #ddd;
  }
}

/* ---------------- 独立展示页（名片 / 订单分享） ---------------- */
.paw-float {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  opacity: 0.16;
  animation: floaty 5s ease-in-out infinite;
}
.paw-float:nth-child(2) {
  animation-duration: 6.5s;
  animation-delay: -1.5s;
}
.paw-float:nth-child(3) {
  animation-duration: 5.6s;
  animation-delay: -3s;
}
.paw-float:nth-child(4) {
  animation-duration: 7.2s;
  animation-delay: -2.2s;
}

@media print {
  .paw-float {
    display: none !important;
  }
  body {
    background: #fff !important;
  }
}
