
/* ==========================================================
   THEME · Sunny Paws / 暖爪日光
   ========================================================== */
:root {
  --brand: #C2451B;
  --brand-deep: #9A3412;
  --brand-soft: #FFE0CB;
  --brand-ink: #6B2A0F;
  --accent: #2E7D6B;
  --accent-deep: #1F5A4D;
  --accent-soft: #D5E8E1;
  --highlight: #F2B441;
  --highlight-soft: #FFF1DC;
  --risk: #B44E12;
  --risk-soft: #FBE7D6;
  --bg: #FFF8EE;
  --surface: #FFFFFF;
  --surface-sunk: #FBF0DE;
  --ink: #1F1A17;
  --ink-2: #4A3F36;
  --ink-3: #6F6259;
  --line: #EFE3D4;
  --line-strong: #DFCDB5;
  --shadow-sm: 0 1px 2px rgba(74,38,14,.06), 0 1px 1px rgba(74,38,14,.04);
  --shadow-md: 0 6px 18px -8px rgba(74,38,14,.18), 0 2px 6px rgba(74,38,14,.06);
  --shadow-lg: 0 24px 48px -20px rgba(74,38,14,.25), 0 8px 16px -8px rgba(74,38,14,.12);
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --font-display: "Fraunces", "Noto Serif SC", ui-serif, Georgia, serif;
  --font-body: "Manrope", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22,.61,.36,1);
}
html[data-theme="dark"] {
  --bg: #1A1410; --surface: #241C16; --surface-sunk: #1F1814;
  --ink: #F5ECE0; --ink-2: #D8CABA; --ink-3: #9F9080;
  --line: #3A2E25; --line-strong: #4B3B2E;
  --brand: #FF8E58; --brand-deep: #FF7A3C; --brand-soft: #3A2117; --brand-ink: #FFD0B5;
  --accent: #56B49F; --accent-deep: #2E7D6B; --accent-soft: #1E2F2A;
  --highlight: #FFC861; --highlight-soft: #2D2418;
  --risk: #E8804A; --risk-soft: #2E1F15;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 8px 22px -10px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.25);
  --shadow-lg: 0 24px 48px -20px rgba(0,0,0,.7);
}

/* ==========================================================
   RESET + BASE
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
img[data-protected="1"] {
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.protected-photo-frame { position: relative; overflow: hidden; }
.protected-photo-frame::after {
  content: "";
  display: none;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: var(--brand-deep); text-decoration: none; }
input, select { font: inherit; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================
   APP LAYOUT
   ========================================================== */
.app-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 24px;
  width: 100%; max-width: none; margin: 0;
  padding: 14px 28px;
  background: rgba(255,248,238,.86);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .app-nav { background: rgba(26,20,16,.88); }

.app-logo {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto; min-width: max-content;
  cursor: pointer; font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1; color: var(--ink);
  text-decoration: none;
}
.app-logo:hover { color: var(--ink); text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: block; object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.app-nav-links { display: flex; align-items: center; justify-content: center; gap: 26px; min-width: 0; flex: 1 1 auto; font-size: 14px; font-weight: 650; color: var(--ink-2); }
.app-nav-links a { display: inline-flex; align-items: center; min-height: 28px; color: var(--ink-2); padding: 4px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; line-height: 1.2; text-decoration: none; white-space: nowrap; transition:color 120ms var(--ease),background-color 120ms var(--ease),border-color 120ms var(--ease),box-shadow 120ms var(--ease),transform 120ms var(--ease),opacity 120ms var(--ease); }
.app-nav-links a:hover { background: transparent; color: var(--ink); text-decoration: none; }
.app-nav-links a.active { color: var(--brand-deep); border-bottom-color: var(--brand-deep); font-weight: 750; }

/* Tablet-portrait fallback (769-980px): gap-shrink + overflow scroll
   so the single-row nav doesn't get cropped. */
@media (min-width: 769px) and (max-width: 980px) {
  .app-nav { padding: 12px 20px; gap: 16px; }
  .app-nav-links { gap: 16px; font-size: 13px; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .app-nav-links::-webkit-scrollbar { display: none; }
}

.app-nav-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.lang-switch, .theme-switch {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 38px; padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 12px; font-weight: 750; line-height: 1; color: var(--ink-2); text-decoration: none;
  transition:color 120ms var(--ease),background-color 120ms var(--ease),border-color 120ms var(--ease),box-shadow 120ms var(--ease),transform 120ms var(--ease),opacity 120ms var(--ease);
}
.lang-switch:hover, .theme-switch:hover { color: var(--ink); border-color: var(--line-strong); text-decoration: none; }
.lang-switch .lang-active { background: var(--brand-soft); color: var(--brand-ink); padding: 2px 8px; border-radius: var(--r-pill); }
.theme-switch { width: 48px; padding-left: 0; padding-right: 0; }

@media (max-width: 768px) {
  /* Mobile / portrait: 2-row nav so links are always visible without
     competing with logo+lang+theme buttons. Row 1 = logo + lang/theme.
     Row 2 = full-width horizontally-scrollable strip of links. */
  .app-nav {
    flex-wrap: wrap;
    padding: 10px 14px 0;
    gap: 8px;
    row-gap: 0;
  }
  .app-logo { flex-shrink: 0; order: 1; }
  .app-logo span { display: none; }   /* hide brand text, keep logo mark */
  .app-nav-right { flex-shrink: 0; order: 2; gap: 6px; margin-left: auto; }
  .app-nav-links {
    order: 3;
    display: flex; justify-content: flex-start; gap: 18px; font-size: 13px;
    width: 100%;
    margin: 6px -14px 0;
    padding: 6px 14px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-top: 1px solid var(--line);
  }
  .app-nav-links::-webkit-scrollbar { display: none; }
  .app-nav-links a { padding: 4px 2px; flex: 0 0 auto; }
}
@media (max-width: 480px) {
  .app-nav-links { font-size: 12px; gap: 14px; }
  .lang-switch, .theme-switch { min-height: 34px; padding: 5px 10px; font-size: 11px; }
  .theme-switch { width: 42px; }
  .logo-mark { width: 30px; height: 30px; }
}

.app-main { min-height: calc(100vh - 70px); }

/* ==========================================================
   COMMON ELEMENTS
   ========================================================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 768px) { .container { padding: 0 18px; } }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: clamp(18px, 2vw, 22px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px;
  transition:color 120ms var(--ease),background-color 120ms var(--ease),border-color 120ms var(--ease),box-shadow 120ms var(--ease),transform 120ms var(--ease),opacity 120ms var(--ease);
  white-space: nowrap; user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-primary { background: #B23A0E; color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #9A3209; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-sunk); color: var(--ink); border-color: var(--line-strong); }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; font-size: 11px; font-weight: 600;
  border-radius: var(--r-pill);
  background: var(--surface-sunk); color: var(--ink-2);
  border: 1px solid var(--line);
  line-height: 1.6;
}
.chip-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.chip-accent { background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; }
.chip-risk { background: var(--risk-soft); color: var(--risk); border-color: transparent; }
.chip-highlight { background: var(--highlight-soft); color: #8C5D11; border-color: transparent; }
html[data-theme="dark"] .chip-highlight { color: var(--brand-deep); }

.callout {
  display: grid; grid-template-columns: 32px 1fr; gap: 12px;
  padding: 14px 18px; border-radius: var(--r-md);
  border-left: 3px solid;
  margin: 16px 0;
}
.callout-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: white; font-weight: 700; font-size: 14px; }
.callout-info { background: var(--accent-soft); border-color: var(--accent); }
.callout-info .callout-icon { background: var(--accent); }
.callout-warn { background: var(--risk-soft); border-color: var(--risk); }
.callout-warn .callout-icon { background: var(--risk); }
.callout-tip { background: var(--highlight-soft); border-color: var(--brand-deep); }
.callout-tip .callout-icon { background: var(--highlight); color: var(--ink); }
.callout-title { font-weight: 700; color: var(--ink); margin-bottom: 2px; font-size: 14px; }
.callout-body { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

/* ==========================================================
   HOME PAGE
   ========================================================== */
.home-hero {
  padding: 56px 0 32px;
  position: relative;
  overflow: hidden;
}
.home-hero-grid {
  display: grid; grid-template-columns: 1.25fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) { .home-hero-grid { grid-template-columns: 1fr; gap: 24px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 12px; font-weight: 600;
  margin-bottom: 14px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.home-title { font-size: clamp(36px, 5.5vw, 58px); line-height: 1.08; }
.home-title .brand { color: var(--brand-deep); }
.home-title .italic { font-style: italic; color: var(--accent); font-weight: 500; }

.home-tagline { font-size: 17px; color: var(--ink-2); margin: 16px 0 14px; max-width: 520px; line-height: 1.55; }

.home-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-3); margin-bottom: 28px; }
.home-meta span { display: inline-flex; align-items: center; gap: 4px; }

.home-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.social-proof { display: flex; align-items: center; gap: 12px; margin-top: 32px; font-size: 13px; color: var(--ink-3); }
.avatar-stack { display: flex; }
.avatar-stack > div { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg); }
.avatar-stack > div + div { margin-left: -10px; }

/* Inspiration wall */
.inspiration {
  background: linear-gradient(135deg, var(--highlight-soft) 0%, transparent 70%);
  padding: 20px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
}
.inspiration-title { font-size: 12px; color: var(--ink-3); font-weight: 700; letter-spacing: .04em; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.inspiration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Pet card */
.pet-card {
  background: var(--surface); border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.pet-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pet-card-img { aspect-ratio: 4/3; position: relative; overflow: hidden; }
.pet-card-img.square { aspect-ratio: 1/1; }
.pet-illus {
  width: 100%; height: 100%; display: grid; place-items: center; position: relative;
}
.pet-illus.bg-cream { background: linear-gradient(135deg, #FFE0CB, #FFF1DC); }
.pet-illus.bg-sage { background: linear-gradient(135deg, #D5E8E1, #EFE3D4); }
.pet-illus.bg-peach { background: linear-gradient(135deg, #FFD0B5, #FFE0CB); }
.pet-illus.bg-honey { background: linear-gradient(135deg, #FFF1DC, #F2D6A0); }
.pet-illus.bg-mint { background: linear-gradient(135deg, #E6F0EC, #D5E8E1); }
.pet-illus.bg-sand { background: linear-gradient(135deg, #FBF0DE, #EFE3D4); }
.pet-illus.bg-blue { background: linear-gradient(135deg, #D6E4EC, #E6EEF2); }
.pet-illus.bg-rose { background: linear-gradient(135deg, #F2D6CB, #FFE0CB); }
html[data-theme="dark"] .pet-illus { filter: brightness(.9) saturate(.9); }

.pet-card-body { padding: 12px 14px 14px; }
.pet-card-name { font-weight: 700; color: var(--ink); font-size: 15px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pet-card-name .heart { color: var(--risk); cursor: pointer; }
.pet-card-summary { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.pet-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.match-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); margin-top: 10px; }
.match-track { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.match-fill { height: 100%; border-radius: 999px; transition: width 600ms cubic-bezier(.2,.8,.2,1); background: linear-gradient(90deg, var(--accent), #56B49F); }
.match-fill.mid { background: linear-gradient(90deg, var(--highlight), #E8B575); }
.match-fill.low { background: linear-gradient(90deg, var(--risk), #E8804A); }
.match-num { font-weight: 700; font-family: var(--font-mono); font-size: 12px; color: var(--accent-deep); }
.match-num.mid { color: #8C5D11; }
.match-num.low { color: var(--risk); }

/* Decorative paw */
.deco-paw {
  position: absolute; right: -40px; top: 20%;
  width: 280px; height: 280px; pointer-events: none;
  opacity: .55;
  z-index: -1;
}

/* Sections beneath hero */
.section { padding: 32px 0; }
.section-title { font-size: 24px; font-family: var(--font-display); font-weight: 700; margin-bottom: 18px; }
.section-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 18px; }
/* Homepage modular cards */
.home-section { padding: 36px 0; }
.home-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:20px; }
.home-section-title-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.home-section-title { font-family:var(--font-display); font-size:clamp(28px,4vw,42px); font-weight:800; letter-spacing:-.035em; line-height:1.1; margin:0; color:var(--ink); }
.home-section-dot { width:16px; height:16px; border-radius:50%; background:var(--brand); box-shadow:0 0 0 6px color-mix(in srgb, var(--brand) 18%, transparent); flex:0 0 auto; }
.home-section-sub { margin:0; font-size:16px; font-weight:700; color:var(--ink-3); }
.home-section-more { color:var(--ink); font-weight:800; font-size:14px; white-space:nowrap; }
.home-tools-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.home-tool-card { min-height:142px; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:22px; padding:24px; border:1px solid var(--line); border-radius:var(--r-xl); background:var(--surface); box-shadow:var(--shadow-sm); cursor:pointer; transition:transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease); color:inherit; text-decoration:none; }
.home-tool-card:hover { transform:translateY(-3px); border-color:var(--line-strong); box-shadow:var(--shadow-md); text-decoration:none; }
.home-tool-icon { width:72px; height:72px; border-radius:22px; display:grid; place-items:center; font-size:32px; color:var(--brand-ink); box-shadow:0 18px 38px -24px var(--brand-deep); }
.home-tool-icon.age { background:var(--brand-soft); }
.home-tool-icon.weight { background:var(--accent-soft); color:var(--accent-deep); }
.home-tool-icon.cost { background:var(--surface-sunk); color:var(--brand-ink); }
.home-tool-copy { min-width:0; }
.home-tool-title { font-size:18px; font-weight:800; color:var(--ink); margin-bottom:6px; line-height:1.25; }
.home-tool-desc { font-size:14px; color:var(--ink-2); line-height:1.55; margin:0; }
.home-card-arrow { width:42px; height:42px; border-radius:999px; border:1px solid var(--line-strong); display:grid; place-items:center; font-size:24px; line-height:1; color:var(--ink); background:var(--surface); flex:0 0 auto; }
.home-guides-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.home-guide-card { display:grid; grid-template-columns:132px 1fr; gap:20px; min-height:174px; padding:20px; border:1px solid var(--line); border-radius:var(--r-xl); background:var(--surface); box-shadow:var(--shadow-sm); color:inherit; text-decoration:none; transition:transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease); }
.home-guide-card:hover { text-decoration:none; transform:translateY(-3px); border-color:var(--line-strong); box-shadow:var(--shadow-md); }
.home-guide-illus { width:132px; height:132px; border-radius:20px; display:grid; place-items:center; font-size:58px; overflow:hidden; }
.home-guide-kicker { color:var(--brand-deep); font-size:12px; font-weight:850; margin-bottom:8px; }
.home-guide-title { color:var(--ink); font-size:18px; line-height:1.35; font-weight:850; margin:0 0 8px; }
.home-guide-desc { color:var(--ink-2); font-size:14px; line-height:1.55; margin:0 0 10px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.home-guide-meta { color:var(--ink-3); font-size:12px; font-weight:650; }
.home-topic-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:12px; }
.home-topic-card { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:15px 16px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--surface); color:var(--ink); font-weight:750; box-shadow:var(--shadow-sm); text-decoration:none; transition:transform 160ms var(--ease), border-color 160ms var(--ease); }
.home-topic-card:hover { text-decoration:none; border-color:var(--line-strong); transform:translateY(-2px); }
.home-faq-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }
.home-faq-card { border:1px solid var(--line); border-radius:var(--r-xl); padding:20px; background:var(--surface); box-shadow:var(--shadow-sm); }
.home-faq-card h3 { font-family:var(--font-display); font-size:18px; line-height:1.35; margin:0 0 10px; color:var(--ink); }
.home-faq-card p { margin:0; color:var(--ink-2); font-size:14px; line-height:1.65; }
@media (max-width: 1024px) { .home-tools-grid,.home-guides-grid { grid-template-columns:1fr; } }
@media (max-width: 640px) {
  .home-section { padding:28px 0; }
  .home-section-head { align-items:flex-start; flex-direction:column; }
  .home-tool-card { grid-template-columns:auto 1fr; padding:20px; gap:16px; }
  .home-tool-card .home-card-arrow { grid-column:2; width:36px; height:36px; justify-self:start; }
  .home-tool-icon { width:62px; height:62px; border-radius:19px; }
  .home-guide-card { grid-template-columns:96px 1fr; padding:16px; gap:14px; }
  .home-guide-illus { width:96px; height:96px; font-size:44px; border-radius:18px; }
}
html[data-theme="dark"] .cc-top,html[data-theme="dark"] .pet-profile-page .cc-top{background:rgba(28,21,14,.9);border-bottom-color:var(--line)}
/* cp-aa-theme-fix */
html[data-theme="dark"] :where(.cp-btn-primary,.cp-cmp-btn.is-on,.cp-pcol-rank,.preview-rank.r1,.result-tier-rank.r1,.result-hero-summary-row .rank-pill.rank-1,.admin-sidebar a.active .badge,.quiz-progress .dot.done,.quiz-progress .dot.cur){color:#1A1410!important}
