/* ==========================================================
   DD IN DA HOUSE — 设计系统(Design Tokens + Base + Components)
   ========================================================== */

/* Fluent Emoji 替换 */
img.fe {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.22em;
  user-select: none;
}
.btn img.fe { width: 1.15em; height: 1.15em; vertical-align: -0.18em; margin-right: 4px; }
.service-tile-icon img.fe,
.link-card-icon img.fe { width: 1em; height: 1em; vertical-align: middle; }
h1 img.fe, h2 img.fe { width: 0.95em; height: 0.95em; }
.day-meta img.fe,
.calendar-day img.fe { display: none; }
input.fe, .input img.fe, .textarea img.fe { display: none; }

:root {
  /* ===== 主色:招牌金黄系 ===== */
  --brand-yellow: #FFC83D;
  --brand-yellow-deep: #F6CE0D;
  --brand-yellow-light: #FFE9A8;
  --brand-yellow-pale: #FFF8E0;

  /* ===== 辅助色 ===== */
  --brand-purple: #C8A8E0;
  --brand-purple-light: #EBDFF5;
  --brand-teal: #81C1CF;
  --brand-teal-light: #D5EDF2;

  /* ===== 文字色 ===== */
  --text-primary: #4A3A10;
  --text-secondary: #8B6F1F;
  --text-muted: #B89A55;
  --text-on-brand: #4A3A10;
  --text-white: #FFFFFF;

  /* ===== 背景与中性色 ===== */
  --bg-base: #FFFAEF;
  --bg-card: #FFFFFF;
  --bg-section: #FFF8E0;
  --border: #F0E4C0;
  --border-strong: #E0D090;

  /* ===== 状态色 ===== */
  --status-success: #7DB87D;
  --status-success-bg: #E8F4E8;
  --status-warning: #FFB54C;
  --status-warning-bg: #FFF3E0;
  --status-danger: #E07B7B;
  --status-danger-bg: #FCEBEB;
  --status-info: #81C1CF;
  --status-info-bg: #E5F3F6;

  /* ===== 字体 ===== */
  --font-display: 'Comfortaa', 'Nunito', "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: 'Nunito', "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;

  /* ===== 圆角 ===== */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  /* ===== 间距 ===== */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* ===== 阴影 ===== */
  --shadow-sm: 0 2px 8px rgba(255, 200, 60, 0.10);
  --shadow-md: 0 4px 16px rgba(255, 200, 60, 0.12);
  --shadow-lg: 0 8px 32px rgba(255, 200, 60, 0.18);
  --shadow-btn: 0 4px 0 #E0A920;
  --shadow-btn-purple: 0 4px 0 #A88BC4;
  --shadow-btn-teal: 0 4px 0 #5FA3B2;
}

/* ========== Reset / Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255, 200, 60, 0.04) 0%, transparent 25%),
    radial-gradient(circle at 90% 70%, rgba(200, 168, 224, 0.04) 0%, transparent 25%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--text-secondary); text-decoration: none; }
a:hover { color: var(--brand-yellow-deep); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  line-height: 1.25;
}
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

p { margin: 0 0 var(--space-4); }

/* ========== Layout ========== */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-4);
}
.container-wide {
  max-width: 1080px;
}

.section {
  padding: var(--space-8) 0;
}
.section-tight {
  padding: var(--space-6) 0;
}

/* ========== Logo ========== */
.brand-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--brand-yellow-deep);
  text-shadow: 2px 2px 0 #B8941F;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* SVG paw 圆形 logo */
.paw-logo {
  display: inline-block;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.paw-logo-lg { width: 96px; height: 96px; }
.paw-logo-xl { width: 128px; height: 128px; }
.app-header .paw-logo { width: 32px; height: 32px; }
.hero .paw-logo { display: block; margin: 0 auto var(--space-3); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 700;
  font-size: 16px;
  min-height: 48px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
  white-space: nowrap;
  user-select: none;
}
.btn:active {
  transform: translateY(2px);
  box-shadow: none !important;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--brand-yellow);
  color: var(--text-primary);
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { background: #FFD45A; color: var(--text-primary); }

.btn-purple {
  background: var(--brand-purple);
  color: white;
  box-shadow: var(--shadow-btn-purple);
}
.btn-purple:hover { background: #D0B5E6; color: white; }

.btn-teal {
  background: var(--brand-teal);
  color: white;
  box-shadow: var(--shadow-btn-teal);
}
.btn-teal:hover { background: #92CFDD; color: white; }

.btn-outline {
  background: white;
  color: var(--text-secondary);
  border: 2px solid var(--brand-yellow);
}
.btn-outline:hover { background: var(--brand-yellow-pale); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-section); }

.btn-danger {
  background: var(--status-danger);
  color: white;
  box-shadow: 0 4px 0 #B85959;
}
.btn-danger:hover { background: #E89090; color: white; }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; min-height: 36px; font-size: 14px; }
.btn-lg { padding: 18px 32px; min-height: 56px; font-size: 18px; }

/* WhatsApp 按钮 — 绿色 */
.btn-whatsapp {
  background: #25D366;
  color: white;
  box-shadow: 0 4px 0 #1EA854;
}
.btn-whatsapp:hover { background: #34DD75; color: white; }

/* ========== Cards ========== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.card-flat {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.card-pop {
  background: var(--brand-yellow-light);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.card-purple { background: var(--brand-purple-light); }
.card-teal   { background: var(--brand-teal-light); }

/* ========== Form ========== */
.field {
  margin-bottom: var(--space-4);
}
.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: 14px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 14px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--text-primary);
  transition: border 0.15s, box-shadow 0.15s;
  min-height: 48px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px rgba(255, 200, 60, 0.2);
}
.textarea { min-height: 96px; resize: vertical; }

.input-error {
  border-color: var(--status-danger);
}

.field-help {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}
.field-error {
  font-size: 13px;
  color: var(--status-danger);
  margin-top: var(--space-1);
}

/* ========== Checkbox / Radio ========== */
.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: var(--space-2);
}
.check-row:hover {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow-pale);
}
.check-row input[type="checkbox"],
.check-row input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand-yellow-deep);
  flex-shrink: 0;
}
.check-row.checked {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow-pale);
}
.check-row-content {
  flex: 1;
}
.check-row-title {
  font-weight: 600;
  color: var(--text-primary);
}
.check-row-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== Pills / Badges ========== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--brand-yellow-light);
  color: var(--text-secondary);
}
.pill-purple { background: var(--brand-purple-light); color: #6E4F8C; }
.pill-teal   { background: var(--brand-teal-light); color: #467684; }
.pill-success{ background: var(--status-success-bg); color: #2D6B2D; }
.pill-warning{ background: var(--status-warning-bg); color: #8B5A00; }
.pill-danger { background: var(--status-danger-bg); color: #8B2D2D; }

/* ========== Header / Footer ========== */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.app-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.app-header .brand-logo { font-size: 22px; }

.app-footer {
  margin-top: var(--space-12);
  background: var(--bg-section);
  border-top: 1px solid var(--border);
  padding: var(--space-8) var(--space-4);
}
.app-footer-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.app-footer .footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 14px;
}
.app-footer .footer-row a { color: var(--text-secondary); }
.app-footer .footer-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-4);
}

/* ========== Hero (首页特用) ========== */
.hero {
  text-align: center;
  padding: var(--space-12) var(--space-4) var(--space-6);
}
.hero h1 {
  font-size: 36px;
  margin-bottom: var(--space-2);
}
.hero .brand-logo {
  font-size: 36px;
  display: block;
  margin-bottom: var(--space-2);
}
.hero p {
  color: var(--text-secondary);
  font-size: 18px;
}

/* ========== Link cards(首页底部连结卡) ========== */
.link-card {
  display: flex !important;
  align-items: center;
  gap: var(--space-4);
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s, box-shadow 0.15s;
}
.link-card:hover { transform: translateY(-2px); color: inherit; }
.link-card-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: var(--shadow-sm);
}
.link-card-arrow {
  font-size: 28px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 700;
}

/* ========== Service grid ========== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.service-tile {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-3);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.service-tile:hover {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow-pale);
  transform: translateY(-2px);
  color: var(--text-primary);
}
.service-tile-icon { font-size: 36px; line-height: 1; }
.service-tile-title { font-weight: 700; font-size: 16px; }

/* ========== Calendar ========== */
.calendar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.calendar-month-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.calendar-nav {
  background: var(--bg-section);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.calendar-nav:hover { background: var(--brand-yellow-light); }
.calendar-nav:disabled { opacity: 0.3; cursor: not-allowed; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.calendar-dow {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-2) 0;
  min-width: 0;
}
.calendar-day {
  aspect-ratio: 1;
  min-width: 0;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 2px;
  overflow: hidden;
}
.calendar-day .day-num {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  color: var(--text-primary);
}
.calendar-day .day-meta {
  font-size: 10px;
  line-height: 1.1;
  color: var(--status-success);
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— 日历 legend —— */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-4);
  font-size: 12px;
  color: var(--text-muted);
}
.calendar-legend .pill { font-size: 11px; padding: 2px 10px; }

/* ===== 手机版日历 ===== */
@media (max-width: 480px) {
  .calendar { padding: var(--space-3) 10px; }
  .calendar-grid { gap: 3px; }
  .calendar-dow { font-size: 11px; padding: 4px 0; }
  .calendar-day {
    min-height: 40px;
    border-radius: 10px;
    padding: 2px 0;
  }
  .calendar-day .day-num { font-size: 14px; }
  .calendar-day .day-meta { font-size: 9px; margin-top: 1px; }
  .calendar-month-label { font-size: 16px; }
  .calendar-nav { width: 32px; height: 32px; font-size: 16px; }
}
@media (max-width: 360px) {
  .calendar { padding: 10px 6px; }
  .calendar-grid { gap: 2px; }
  .calendar-day { min-height: 38px; padding: 1px 0; }
  .calendar-day .day-num { font-size: 13px; }
  .calendar-day .day-meta { font-size: 8.5px; }
}
.calendar-day.day-empty { background: transparent; border: none; cursor: default; }
.calendar-day.day-past   { background: var(--bg-section); color: var(--text-muted); cursor: not-allowed; }
.calendar-day.day-past .day-num { color: var(--text-muted); }
.calendar-day.day-closed { background: var(--bg-section); cursor: not-allowed; }
.calendar-day.day-closed .day-meta { color: var(--text-muted); }
.calendar-day.day-full   { background: var(--status-danger-bg); cursor: not-allowed; }
.calendar-day.day-full .day-meta { color: var(--status-danger); }
.calendar-day.day-selected {
  background: var(--brand-yellow);
  border-color: var(--brand-yellow-deep);
}
.calendar-day:not(.day-empty):not(.day-past):not(.day-closed):not(.day-full):hover {
  background: var(--brand-yellow-light);
  border-color: var(--brand-yellow);
}

/* ========== Toast ========== */
.toast-host {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 480px;
}
.toast {
  background: var(--bg-card);
  border-left: 4px solid var(--status-info);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
  font-size: 14px;
}
.toast-success { border-left-color: var(--status-success); }
.toast-warning { border-left-color: var(--status-warning); }
.toast-danger  { border-left-color: var(--status-danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== Modal ========== */
.modal-host {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(74, 58, 16, 0.5);
  backdrop-filter: blur(2px);
}
.modal-host.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin-bottom: var(--space-3); }
.modal-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-6);
}
.modal-actions .btn { flex: 1; }

/* ========== Loading / Spinner ========== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-yellow-deep);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

/* ========== Stack helpers ========== */
.stack > * + * { margin-top: var(--space-3); }
.stack-lg > * + * { margin-top: var(--space-6); }
.stack-sm > * + * { margin-top: var(--space-2); }
.row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}
.row-tight { gap: var(--space-2); }
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.grow { flex: 1; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.fw-700 { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.hidden { display: none !important; }

/* ========== Mobile tweaks ========== */
@media (max-width: 480px) {
  h1 { font-size: 28px; }
  .hero h1 { font-size: 30px; }
  .hero .brand-logo { font-size: 30px; }
  .container { padding: var(--space-3); }
  .card { padding: var(--space-4); }
  .service-grid { grid-template-columns: 1fr; }
  .btn { padding: 14px 20px; }
}

/* ========== Print(简单友好) ========== */
@media print {
  .app-header, .app-footer, .btn { display: none; }
  body { background: white; }
}
