/* 猫屿 UI polish — warm, content-first community design */
:root {
  --ink: #23362e;
  --muted: #65756d;
  --cream: #fbf7ef;
  --paper: #fffdf9;
  --orange: #f47a5b;
  --orange-deep: #d95d41;
  --green: #355f4f;
  --green-deep: #193d32;
  --line: #e6ddd0;
  --focus: #a6402e;
  --surface-soft: #f5efe5;
  --surface-tint: #fff7f1;
  --line-strong: #d8cdbf;
  --shadow-sm: 0 8px 24px rgba(41, 54, 47, .08);
  --shadow: 0 22px 60px rgba(41, 54, 47, .12);
  --shadow-hover: 0 20px 48px rgba(41, 54, 47, .16);
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 32px;
  --motion-fast: 160ms ease;
  --motion-standard: 240ms cubic-bezier(.2,.8,.2,1);
}

html, body { max-width: 100%; overflow-x: clip; }

html { scroll-padding-top: 20px; scrollbar-gutter: stable; }
body {
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 4%, rgba(244, 122, 91, .12), transparent 26rem),
    radial-gradient(circle at 8% 92%, rgba(53, 95, 79, .08), transparent 30rem),
    var(--cream);
  font-family: "Nunito Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main > section:focus { outline: 0; }
body.dialog-open { overflow: hidden !important; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--focus) !important;
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 999;
  transform: translateY(-160%);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.skip-link:focus { transform: translateY(0); }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.shell { max-width: 1240px; padding-inline: clamp(20px, 4vw, 56px); }
.section { padding-block: clamp(56px, 7vw, 92px); }
.soft { background: transparent; }
.sectionhead { margin-bottom: 34px; gap: 24px; }
.sectionhead h2 {
  color: var(--ink);
  font-family: ui-rounded, "Arial Rounded MT Bold", "PingFang SC", sans-serif;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -.045em;
}
.sectionhead h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 4px;
  margin-top: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), #f6b493);
}
.sectionhead p { max-width: 620px; font-size: 15px; }

.primary, .secondary, .navbtn, .filter, .forum-category, .forum-page-button, .video-comment-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.primary {
  background: var(--orange) !important;
  color: #1f2e28 !important;
  box-shadow: 0 10px 24px rgba(217, 93, 65, .24);
}
.primary:hover { transform: translateY(-2px); background: #ff896c !important; box-shadow: 0 14px 30px rgba(217, 93, 65, .30); }
.secondary { border-color: rgba(255,255,255,.50); color: var(--ink); background: rgba(255,255,255,.92); }
.secondary:hover { transform: translateY(-2px); border-color: var(--orange); }
#authButton.is-signed-in {
  border: 1px solid #e8b7a8 !important;
  color: #8c412f !important;
  background: #fff8f4 !important;
  box-shadow: 0 8px 22px rgba(112, 64, 47, .10) !important;
}
#authButton.is-signed-in:hover { background: #fff0e9 !important; box-shadow: 0 12px 28px rgba(112, 64, 47, .15) !important; }

/* Sidebar navigation */
#maoyuSidebar {
  background:
    radial-gradient(circle at 20% 4%, rgba(255,255,255,.09), transparent 13rem),
    var(--green-deep) !important;
  padding: 30px 20px 24px !important;
  border-right: 0 !important;
  box-shadow: 10px 0 42px rgba(20, 44, 36, .14) !important;
}
.side-brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 28px; }
.side-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #20372f;
  background: var(--orange);
  box-shadow: inset 0 -3px 0 rgba(89, 34, 24, .12), 0 10px 24px rgba(5, 20, 15, .22);
}
.side-brand-mark svg { width: 23px; height: 23px; }
.side-logo { margin: 0 !important; font-size: 23px !important; line-height: 1; }
.side-logo small { display: block; margin-top: 7px; color: #9eb5ab; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.side-menu { gap: 6px !important; }
.side-link {
  position: relative;
  min-height: 48px;
  padding: 12px 14px !important;
  border: 1px solid transparent !important;
  border-radius: 15px !important;
  color: #c7d6cf !important;
  font-family: inherit !important;
  font-size: 14px !important;
}
.side-link b { font: inherit; }
.side-link span { display: grid !important; place-items: center; width: 22px !important; color: #91aa9f; }
.side-link span svg { width: 19px; height: 19px; stroke-width: 1.9; }
.side-link:hover { background: rgba(255,255,255,.07) !important; border-color: rgba(255,255,255,.07) !important; color: #fff !important; transform: translateX(2px); }
.side-link.active {
  background: var(--orange) !important;
  color: #20372f !important;
  box-shadow: inset 0 -3px 0 rgba(89, 34, 24, .10), 0 12px 28px rgba(7, 23, 18, .24) !important;
}
.side-link.active span { color: #20372f; }
.side-publish {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 15px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: .2s ease;
}
.side-publish:hover { background: #fff; color: var(--green-deep); transform: translateY(-2px); }
.side-bottom { border-top-color: rgba(255,255,255,.12) !important; }
.side-note { color: #9eb5ab !important; }

/* Hero */
#home {
  height: 100dvh !important;
  min-height: 100dvh;
  background-position: 56% center !important;
}
#home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(15, 39, 31, .38) 0%, rgba(15, 39, 31, .08) 56%, transparent 78%), linear-gradient(0deg, rgba(12, 31, 25, .22), transparent 55%);
}
#home > div:first-child {
  top: clamp(28px, 6vh, 70px) !important;
  right: clamp(28px, 5vw, 72px) !important;
  bottom: auto !important;
  left: auto !important;
  width: min(390px, 42%) !important;
  padding: clamp(22px, 2.2vw, 28px);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 24px;
  background: rgba(20, 49, 40, .76);
  box-shadow: 0 28px 80px rgba(8, 27, 21, .34);
  backdrop-filter: blur(14px) saturate(120%);
  text-shadow: none !important;
}
#home > div:first-child p { color: #e7f0ec !important; text-shadow: none !important; max-width: 360px; font-size: 14px !important; line-height: 1.7 !important; }
#home > div:first-child .eyebrow { color: #ffc4ae !important; text-shadow: none !important; }
#home h1 { max-width: 360px; font-family: ui-rounded, "Arial Rounded MT Bold", "PingFang SC", sans-serif; font-size: clamp(34px, 3.7vw, 40px) !important; line-height: 1.05 !important; margin: 14px 0 12px !important; }
#home .actions { margin-top: 24px; }
#home .stats { padding-top: 22px; margin-top: 24px; border-top: 1px solid rgba(255,255,255,.18); }
#home .stat b { color: #fff; }
#home .stat span { color: #bed0c8; }

/* Content cards */
.breeds { gap: 22px; }
.nutrition-agegrid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.breed, .video, .post, .careitem, .agecard, .nutritioncard, .healthcard, .behaviorcard, .hygienecard {
  border: 1px solid rgba(224, 214, 201, .9) !important;
  background: var(--paper) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}
.post, .video, .careitem, .cat-profile-card {
  transition: transform var(--motion-standard), border-color var(--motion-fast), box-shadow var(--motion-standard);
}
.post:hover, .video:hover, .cat-profile-card:hover {
  transform: translateY(-3px);
  border-color: #efb9a8 !important;
  box-shadow: var(--shadow-hover) !important;
}
.breed { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.breed:hover { transform: translateY(-6px); border-color: #f3b6a6 !important; box-shadow: var(--shadow) !important; }
.breed img, .breed-visual { height: 210px !important; }
.tica-breed .breed-visual { height: auto !important; aspect-ratio: 3 / 2; background: #f4efe7; }
.tica-breed .breed-photo { width: 100%; height: 100% !important; object-fit: contain; object-position: center; }
.breedbody { padding: 20px !important; }
.tica-kicker { display: inline-block; margin-bottom: 9px; color: var(--orange-deep); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.breed-tools { width: min(540px, 100%); }
.breed-tools #breedSearch { width: 100%; min-height: 46px; padding: 11px 16px; border-radius: 999px; }
.breed-tools .filters { margin-top: 11px; }
.breed-result-count { margin: -8px 0 18px; color: var(--muted); font-size: 13px; font-weight: 700; }
.breed-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.breed-title-row h3 { margin-bottom: 3px; }
.breed-title-row small { color: var(--muted); font-size: 12px; }
.tica-chip { flex: none; background: #e9f3ef; color: #285b48; }
.breed-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0 14px; }
.breed-metrics > span { padding: 10px 11px; border-radius: 12px; background: #f7f2eb; }
.breed-metrics small { display: block; color: var(--muted); font-size: 10px; }
.breed-metrics b { display: block; margin-top: 2px; color: var(--ink); font-size: 13px; }
.tica-source { display: inline-flex; align-items: center; gap: 5px; min-height: 38px; margin-top: 13px; color: #326a55; font-size: 12px; font-weight: 800; }
.tica-source:hover { color: var(--orange-deep); }
.tica-breed .breed-visual { display: block; width: 100%; padding: 0; border: 0; color: inherit; cursor: pointer; touch-action: manipulation; transition: filter .2s ease, transform .2s ease; }
.tica-breed .breed-visual:hover { filter: brightness(.96); }
.tica-breed .breed-visual:active { filter: brightness(.91); }
.tica-breed .breed-visual:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.breed-detail-overlay { position: fixed; inset: 0; z-index: 130; display: none; place-items: center; padding: 24px; background: rgba(14, 35, 28, .76); backdrop-filter: blur(9px); }
.breed-detail-overlay.show { display: grid; }
.breed-detail-modal { position: relative; width: min(980px, 100%); max-height: calc(100svh - 48px); overflow: auto; padding: 30px; border: 1px solid rgba(255,255,255,.68); border-radius: 30px; background: var(--paper); box-shadow: 0 34px 110px rgba(7, 26, 20, .38); }
.breed-detail-close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f3ede5; color: var(--ink); font-size: 25px; cursor: pointer; }
.breed-detail-layout { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr); gap: 34px; align-items: start; }
.breed-detail-image-wrap { overflow: hidden; border-radius: 22px; background: #f4efe7; aspect-ratio: 3 / 2; }
.breed-detail-image-wrap img { display: block; width: 100%; height: 100%; object-fit: contain; }
.breed-detail-content { padding: 8px 42px 4px 0; }
.breed-detail-content h2 { margin: 2px 0 0; color: var(--ink); font-size: clamp(30px, 4vw, 46px); line-height: 1.12; }
.breed-detail-english { margin: 7px 0 22px; color: var(--muted); font-size: 16px; }
.breed-detail-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.breed-detail-metrics > div { padding: 13px 14px; border-radius: 14px; background: #f6f1ea; }
.breed-detail-metrics span { display: block; color: var(--muted); font-size: 10px; }
.breed-detail-metrics b { display: block; margin-top: 3px; color: var(--ink); font-size: 14px; }
.breed-official-profile { max-width: 850px; margin: 32px auto 0; padding-top: 30px; border-top: 1px solid var(--line); color: var(--ink); }
.breed-official-profile[hidden] { display: none; }
.breed-profile-head { margin-bottom: 22px; }
.breed-profile-source { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 999px; color: #9c4d35; background: #fff0e8; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.breed-profile-head h3 { margin: 12px 0 8px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.03em; }
.breed-profile-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.breed-profile-overview { padding: 22px 24px; border-left: 4px solid var(--orange); border-radius: 0 18px 18px 0; background: #fff8f3; }
.breed-profile-overview h4 { margin: 0 0 9px; color: var(--ink); font-size: 19px; }
.breed-profile-intro { margin: 0; color: #3e4c44; font-size: 15px; line-height: 1.9; }
.breed-profile-highlights { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px; padding: 0; list-style: none; }
.breed-profile-highlights li { padding: 8px 12px; border: 1px solid #d8e6dd; border-radius: 999px; color: #326a55; background: #f1f7f3; font-size: 12px; font-weight: 800; }
.breed-profile-sections { display: grid; gap: 16px; }
.breed-profile-sections section { padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 10px 28px rgba(57, 43, 31, .05); }
.breed-profile-sections h4 { margin: 0 0 9px; color: var(--ink); font-size: 19px; }
.breed-profile-sections p { margin: 0; color: #526159; font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
.breed h3, .post h3, .video h3, .careitem h4 { color: var(--ink); }
.breed p, .post p, .video p, .careitem p { line-height: 1.7; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f5eee5;
  color: #6d594b;
  font-size: 12px;
  font-weight: 750;
}
.filter, .forum-category { color: #53645c; border-color: var(--line); }
.filter:hover, .forum-category:hover { border-color: var(--orange); color: var(--orange-deep); }
.filter.active, .forum-category.active { background: var(--ink) !important; color: #fff !important; }
.caregrid, .community { gap: 26px; }
.caremain {
  min-height: 390px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #416d5b, #264b3d) !important;
  box-shadow: var(--shadow);
}
.caremain h2 { font-size: clamp(31px, 4vw, 48px); line-height: 1.15; }
.carelist { gap: 14px; }
.careitem { min-height: 86px; padding: 20px 22px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.careitem[role="button"] { cursor: pointer; }
.careitem[role="button"]:hover { transform: translateX(5px); border-color: #f0b8a9 !important; box-shadow: var(--shadow) !important; }
.care-topic-switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.care-weekly-label { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 850; letter-spacing: .04em; }
.care-history-trigger { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.42); border-radius: 999px; color: #fff; background: rgba(255,255,255,.10); cursor: pointer; font-weight: 800; touch-action: manipulation; transition: background-color .18s ease, border-color .18s ease; }
.care-history-trigger:hover, .care-history-trigger[aria-expanded="true"] { border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.20); }
.care-history-trigger:focus-visible, .care-history-close:focus-visible { outline: 3px solid rgba(255, 194, 166, .72); outline-offset: 3px; }
.care-history-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.care-history-overlay { position: fixed; inset: 0; z-index: 132; display: none; place-items: center; padding: 22px; background: rgba(14, 35, 28, .76); backdrop-filter: blur(9px); }
.care-history-overlay.show { display: grid; }
.care-history-modal { width: min(980px, 100%); max-height: calc(100svh - 44px); overflow: auto; padding: 30px; border: 1px solid rgba(255,255,255,.68); border-radius: 30px; background: var(--paper); box-shadow: 0 34px 110px rgba(7, 26, 20, .38); }
.care-history-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.care-history-modal-head h2 { margin: 4px 0 7px; color: var(--ink); font-size: clamp(28px, 4vw, 40px); letter-spacing: -.04em; }
.care-history-modal-head p { max-width: 560px; margin: 0; color: var(--muted); line-height: 1.7; }
.care-history-close { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #55625b; background: #f7f2eb; cursor: pointer; }
.care-history-close:hover { color: var(--orange); border-color: var(--orange); background: #fff7f2; }
.care-history-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.care-history-kicker { color: var(--orange-deep); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.care-history-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 18px; margin-bottom: 20px; }
.care-history-search label { grid-column: 1 / -1; color: var(--ink); font-size: 14px; font-weight: 850; }
.care-history-search-field { position: relative; min-width: 0; }
.care-history-search-field svg { position: absolute; left: 15px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: #68766e; stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.care-history-search-field input { width: 100%; min-height: 48px; padding: 11px 44px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; }
.care-history-search-field input:focus { outline: 0; }
.care-history-result-count { margin: 0 0 13px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.care-history-list { display: grid; border-block: 1px solid var(--line); }
.care-history-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 22px 4px; border-bottom: 1px solid var(--line); }
.care-history-item:last-child { border-bottom: 0; }
.care-history-item[hidden] { display: none; }
.care-history-meta { display: flex; align-items: center; gap: 11px; color: var(--orange-deep); font-size: 12px; font-weight: 800; }
.care-history-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fff0e8; }
.care-history-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.care-history-content h3 { margin: 0 0 7px; color: var(--ink); font-size: 20px; line-height: 1.4; }
.care-history-content > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.care-history-content ul { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 13px 0 0; padding: 0; color: #536159; font-size: 13px; line-height: 1.65; list-style: none; }
.care-history-content li { position: relative; padding-left: 13px; }
.care-history-content li::before { content: ''; position: absolute; left: 0; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.care-history-empty { padding: 52px 20px; text-align: center; color: var(--muted); }
.care-history-empty[hidden] { display: none; }
.care-history-empty svg { width: 36px; height: 36px; fill: none; stroke: #a69587; stroke-width: 1.6; stroke-linecap: round; }
.care-history-empty h3 { margin: 13px 0 6px; color: var(--ink); font-size: 18px; }
.care-history-empty p { margin: 0; font-size: 14px; }
.icon { background: #fff0e8; color: var(--orange-deep); }
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.post { padding: 24px; }
.posttop { padding-bottom: 12px; border-bottom: 1px solid #eee7dd; }
.side { border-radius: var(--radius-lg); padding: 30px; background: linear-gradient(145deg, #284d40, #17382e); box-shadow: var(--shadow); }
.side input { min-height: 46px; margin-top: 12px; }
#forum .community { display: block !important; }
#forum .forum-toolbar {
  padding: 16px;
  border: 1px solid rgba(224, 214, 201, .92);
  border-radius: 20px;
  background: rgba(255, 253, 249, .86);
  box-shadow: 0 12px 34px rgba(41, 54, 47, .07);
  backdrop-filter: blur(10px);
}
#forum .forum-tools {
  flex: 1 1 620px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 145px 230px;
  align-items: center;
  justify-content: stretch;
  min-width: 0;
}
#forum .forum-search {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-color: var(--line-strong) !important;
}
#forum .forum-page-info { width: 145px; min-width: 145px; }
#forum .forum-pagination { width: 230px; min-width: 230px; }
#forum .forum-page-button {
  flex: 0 0 auto;
  min-width: 72px;
  white-space: nowrap;
  word-break: keep-all;
}
#forum .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 18px; }
#forum .post { min-width: 0; height: 100%; display: flex; flex-direction: column; }
#forum .post .post-actions { margin-top: auto; }
#forum .post h3, #forum .post p { overflow-wrap: anywhere; }
#forum .posttop { align-items: center; gap: 10px; }
.post-author-line { display: inline-flex; min-width: 0; align-items: center; gap: 8px; font-weight: 800; }
.post-actions > .post-author-line { height: 44px; justify-content: center; overflow: hidden; }
.post-actions > .post-author-line .post-public-profile { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-time { margin-left: auto; white-space: nowrap; }
.post-follow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #b9d0c3;
  border-radius: 999px;
  background: #f3f8f5;
  color: #3d6b55;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.post-follow-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.post-follow-button:hover, .post-follow-button:focus-visible { color: var(--orange-deep); border-color: var(--orange); background: #fff7f2; }
.post-follow-button:focus-visible { outline: 3px solid rgba(244, 122, 91, .32); outline-offset: 2px; }
.post-follow-button.following { color: #2f6648; border-color: #a9ceb8; background: #e7f3eb; }
.post-follow-button[hidden] { display: none; }
.post-category-chip { border: 1px solid #eadfd2; background: var(--surface-soft) !important; }
.video { overflow: hidden; }
.video iframe { background: #17261f; }
.video-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(224, 214, 201, .92);
  border-radius: 20px;
  background: rgba(255, 253, 249, .86);
  box-shadow: 0 12px 34px rgba(41, 54, 47, .07);
}
.video-search-field {
  position: relative;
  width: min(480px, 100%);
  display: flex;
  align-items: center;
}
.video-search-field > svg {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #627068;
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.video-search-field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 72px 11px 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.video-search-clear {
  position: absolute;
  right: 5px;
  min-width: 58px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: #f2ede5;
  color: #59675f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}
.video-search-clear:hover { color: var(--orange-deep); background: #fff0e8; }
.video-search-clear:focus-visible { outline: 3px solid rgba(244, 122, 91, .32); outline-offset: 2px; }
.video-search-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.video-page-tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.video-pagination { display: flex; align-items: center; justify-content: center; gap: 7px; }
.video-page-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}
.video-page-button:hover:not(:disabled) { color: var(--orange-deep); border-color: #e7ae99; background: #fff7f2; }
.video-page-button:focus-visible { outline: 3px solid rgba(244, 122, 91, .32); outline-offset: 2px; }
.video-page-button:disabled { opacity: .45; cursor: not-allowed; }
.video-page-number { min-width: 76px; color: var(--muted); text-align: center; font-size: 12px; white-space: nowrap; }
.video-search-empty {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 44px 24px;
  border: 1px dashed #d8cec1;
  border-radius: 22px;
  background: rgba(255,255,255,.62);
  color: var(--muted);
  text-align: center;
}
.video-search-empty[hidden] { display: none; }
.video-search-empty b { display: block; margin-bottom: 7px; color: var(--ink); font-size: 17px; }
.video-search-empty span { display: block; line-height: 1.7; }

/* Equal-size community previews with progressive disclosure */
#forum .post.content-summary-card,
#videos .video.content-summary-card {
  height: 410px;
  min-height: 410px;
  max-height: 410px;
  cursor: pointer;
  touch-action: manipulation;
}
#forum .post.content-summary-card:focus-visible,
#videos .video.content-summary-card:focus-visible {
  outline: 3px solid rgba(244, 122, 91, .38);
  outline-offset: 4px;
}
#forum .post.content-summary-card {
  overflow: hidden;
}
#videos .video.content-summary-card {
  display: flex;
  flex-direction: column;
}
.content-summary-card > h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.content-summary-card > p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}
#forum .content-summary-card .post-image-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 82px));
  max-height: 82px;
  overflow: hidden;
}
#forum .content-summary-card .post-image-thumbnail {
  width: 82px;
  height: 82px;
}
#videos .content-summary-card > iframe,
#videos .content-summary-card > video {
  width: 100%;
  height: 170px;
  min-height: 170px;
  max-height: 170px;
  object-fit: cover;
  background: #17261f;
}
#videos .content-summary-card > h3 { flex: 0 0 auto; }
#videos .content-summary-card > p { flex: 0 0 auto; margin-bottom: 0; }
.content-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 148;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(23, 32, 27, .78);
  backdrop-filter: blur(9px);
}
.content-detail-overlay.show { display: grid; }
.content-detail-dialog {
  width: min(780px, 100%);
  max-height: calc(100dvh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  background: #fffdfb;
  box-shadow: 0 30px 90px rgba(31, 23, 22, .32);
}
.content-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #f0e3dc;
  background: linear-gradient(135deg, #fff4ee, #fffaf6);
}
.content-detail-kind {
  display: inline-block;
  color: #bd5663;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}
.content-detail-kind[hidden] { display: none; }
.content-detail-author { margin: 5px 0 0; color: #6e6864; line-height: 1.5; }
.content-detail-kind[hidden] + .content-detail-author { margin-top: 0; }
.content-detail-author strong { color: #684c55; font-size: 16px; font-weight: 900; }
.content-detail-author span { font-size: 12px; }
.content-detail-close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: 1px solid #ead4cc;
  border-radius: 50%;
  color: #80545d;
  background: #fff;
  cursor: pointer;
}
.content-detail-close svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.content-detail-close:hover { color: #b64e5e; border-color: #eca999; background: #ffede8; }
.content-detail-close:focus-visible { outline: 3px solid rgba(244, 122, 91, .36); outline-offset: 2px; }
.content-detail-scroll { overflow-y: auto; padding: 26px; overscroll-behavior: contain; }
.content-detail-scroll h2 { margin: 0; color: var(--ink); font-size: clamp(24px, 5vw, 34px); line-height: 1.3; overflow-wrap: anywhere; }
.content-detail-body { margin: 16px 0 0; color: #4f5d55; font-size: 16px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.content-detail-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.content-detail-media[hidden] { display: none; }
.content-detail-media img { width: 100%; max-height: 560px; object-fit: contain; border: 1px solid #eadfd8; border-radius: 18px; background: #f6f0eb; }
.content-detail-media img:only-child { grid-column: 1 / -1; }
.content-detail-media video,
.content-detail-media iframe { grid-column: 1 / -1; width: 100%; min-height: 360px; aspect-ratio: 16 / 9; border: 0; border-radius: 20px; background: #17261f; }
.content-detail-comments { margin-top: 30px; padding-top: 24px; border-top: 1px solid #efddd6; }
.content-detail-comments[hidden] { display: none; }
.content-detail-comments-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.content-detail-comments-head h3 { margin: 0; color: var(--ink); font-size: 21px; }
.content-detail-comments-head span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.content-detail-comment-list { display: grid; gap: 12px; margin-top: 16px; }
.content-detail-comment-item { padding: 15px 16px; border: 1px solid #eedad3; border-radius: 17px; background: #fffaf7; }
.content-detail-comment-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.content-detail-comment-meta b { min-width: 0; overflow: hidden; color: #5d4b51; text-overflow: ellipsis; white-space: nowrap; }
.content-detail-comment-meta time { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.content-detail-comment-item > p,
.content-detail-reply-item > p { margin: 8px 0 0; color: #4f5d55; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.content-detail-replies { display: grid; gap: 8px; margin: 12px 0 0 18px; padding-left: 12px; border-left: 2px solid #cfe5db; }
.content-detail-replies:empty { display: none; }
.content-detail-reply-item { padding: 11px 12px; border-radius: 13px; background: #f0f8f4; }
.content-detail-comment-empty { margin: 0; padding: 26px 18px; border: 1px dashed #e3d3cc; border-radius: 16px; color: var(--muted); text-align: center; background: #fffaf7; }

@media (max-width: 640px) {
  #forum .post.content-summary-card,
  #videos .video.content-summary-card {
    height: 410px;
    min-height: 410px;
    max-height: 410px;
  }
  #videos .content-summary-card > iframe,
  #videos .content-summary-card > video {
    height: 165px;
    min-height: 165px;
    max-height: 165px;
  }
  #videos .content-summary-card .video-community-meta { flex-wrap: nowrap; }
  #videos .content-summary-card .video-author-copy { min-width: 0; }
  #videos .content-summary-card .video-follow-button { width: auto; }
  #videos .content-summary-card > p { -webkit-line-clamp: 2; }
  #forum .content-summary-card .post-image-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: none; }
  #forum .content-summary-card .post-image-thumbnail { width: 100%; height: auto; aspect-ratio: 1; }
  .content-detail-overlay { padding: 10px; }
  .content-detail-dialog { max-height: calc(100dvh - 20px); border-radius: 22px; }
  .content-detail-head { padding: 14px 15px; }
  .content-detail-scroll { padding: 20px 16px 24px; }
  .content-detail-media { grid-template-columns: 1fr; }
  .content-detail-media img { grid-column: 1; }
  .content-detail-media video,
  .content-detail-media iframe { min-height: 210px; border-radius: 16px; }
  .content-detail-comments { margin-top: 24px; padding-top: 20px; }
  .content-detail-comment-item { padding: 14px; }
  .content-detail-replies { margin-left: 8px; }
}

/* Keeper personal profile */
.keeper-profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: start;
  gap: 14px;
  margin-top: 20px;
  padding: 17px 18px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 20px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}
.keeper-profile-copy { min-width: 0; }
.keeper-profile-copy > span { color: #ffe6da; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.keeper-profile-copy strong { display: block; margin-top: 5px; color: #fff; font-size: 18px; }
.keeper-profile-copy p { margin: 6px 0 0 !important; color: rgba(255,255,255,.88) !important; font-size: 13px; line-height: 1.6 !important; }
.keeper-profile-copy small { display: block; margin-top: 6px; color: rgba(255,255,255,.72); font-size: 11px; line-height: 1.55; }
.keeper-profile-edit {
  justify-self: start;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #315647;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}
.keeper-profile-edit:hover { background: #fff; color: var(--orange-deep); }
.keeper-profile-edit:focus-visible { outline: 3px solid rgba(255,255,255,.56); outline-offset: 3px; }
.keeper-profile-overlay { position: fixed; inset: 0; z-index: 155; display: none; place-items: center; padding: 18px; background: rgba(16,36,29,.76); backdrop-filter: blur(9px); }
.keeper-profile-overlay.show { display: grid; }
.keeper-profile-dialog { width: min(760px, 100%); max-height: calc(100dvh - 36px); overflow: auto; border: 1px solid rgba(255,255,255,.7); border-radius: 28px; background: #fff; box-shadow: 0 30px 100px rgba(10,31,24,.34); }
.keeper-profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 27px 28px 21px; border-bottom: 1px solid var(--line); }
.keeper-profile-head > div { min-width: 0; }
.keeper-profile-head span { color: var(--orange-deep); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.keeper-profile-head h2 { margin: 5px 0 6px; font-size: 25px; }
.keeper-profile-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.keeper-profile-close { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; border: 0; border-radius: 50%; background: #f4efe8; color: var(--ink); cursor: pointer; font-size: 22px; }
.keeper-profile-form { padding: 24px 28px 28px; }
.keeper-avatar-field { display: grid; grid-template-columns: minmax(0,1fr); min-width: 0; gap: 14px; margin-bottom: 16px; padding: 16px; border: 1px solid #eadbd4; border-radius: 18px; background: #fff9f6; }
.keeper-avatar-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.keeper-avatar-head strong, .keeper-avatar-head small { display: block; }
.keeper-avatar-head strong { color: #67434e; font-size: 14px; }
.keeper-avatar-head small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.keeper-avatar-head button { min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: #755649; background: #fff; cursor: pointer; font-weight: 800; white-space: nowrap; }
.keeper-avatar-editor { display: grid; grid-template-columns: 112px minmax(0,1fr); align-items: center; min-width: 0; gap: 16px; }
.keeper-avatar-preview, .keeper-profile-avatar-display { position: relative; display: grid; place-items: center; overflow: hidden; color: #67434e; background: linear-gradient(145deg,#ffe0d8,#ffc6b9); }
.keeper-avatar-preview { width: 112px; height: 112px; border: 2px solid #fff; border-radius: 34px 34px 34px 12px; box-shadow: 0 10px 24px rgba(103,67,78,.13); }
.keeper-avatar-preview img, .keeper-profile-avatar-display img { width: 100%; height: 100%; object-fit: cover; }
.keeper-avatar-preview svg, .keeper-profile-avatar-display svg { width: 42%; height: 42%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.keeper-avatar-upload { display: grid !important; min-width: 0; gap: 5px; min-height: 74px; align-content: center; padding: 13px 15px; border: 1px dashed #dfbdb3; border-radius: 15px; color: #67434e; background: #fff; cursor: pointer; font-size: 13px; font-weight: 800; }
.keeper-avatar-upload small { color: var(--muted); font-size: 11px; font-weight: 600; }
.keeper-avatar-upload input { width: 100%; max-width: 100%; min-width: 0; margin: 7px 0 0 !important; padding: 8px !important; background: #fff; }
.keeper-background-field { display: grid; grid-template-columns: minmax(0,1fr); min-width: 0; gap: 12px; margin-bottom: 20px; padding: 16px; border: 1px solid #dce8e0; border-radius: 18px; background: #f7faf8; }
.keeper-background-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.keeper-background-head strong, .keeper-background-head small { display: block; }
.keeper-background-head strong { color: #315647; font-size: 14px; }
.keeper-background-head small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.keeper-background-head button { min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #755649; font-weight: 800; cursor: pointer; white-space: nowrap; }
.keeper-background-preview { display: grid; place-items: center; min-height: 150px; aspect-ratio: 16 / 6; border: 1px dashed #b9cfc2; border-radius: 15px; background: linear-gradient(145deg,#416d5b,#264b3d); background-position: center; background-size: cover; color: rgba(255,255,255,.9); font-size: 12px; font-weight: 800; overflow: hidden; }
.keeper-background-preview span { padding: 7px 11px; border-radius: 999px; background: rgba(18,42,33,.64); backdrop-filter: blur(5px); }
.keeper-background-preview.has-image { border-style: solid; }
.keeper-background-upload { display: grid !important; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; color: #4a5a51; font-size: 13px; font-weight: 750; }
.keeper-background-upload input { width: 100%; min-width: 0; min-height: 44px; margin: 0 !important; padding: 8px !important; background: #fff; }
.keeper-avatar-field > *, .keeper-background-field > *, .keeper-background-head > *, .keeper-background-upload > * { min-width: 0; max-width: 100%; }
.keeper-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 16px; }
.keeper-profile-grid label, .keeper-phone-panel label { position: relative; display: block; color: #4a5a51; font-size: 13px; font-weight: 750; }
.keeper-profile-grid input, .keeper-profile-grid select, .keeper-profile-grid textarea, .keeper-phone-panel input { width: 100%; min-height: 46px; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; }
.keeper-profile-grid textarea { min-height: 102px; resize: vertical; }
.keeper-profile-wide { grid-column: 1 / -1; }
.keeper-profile-wide > small { position: absolute; right: 11px; bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 500; }
.keeper-current-value { float: right; color: var(--muted); font-size: 11px; font-weight: 500; }
.keeper-contact-block { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 16px 17px; border: 1px solid #dce8e0; border-radius: 16px; background: #f4f8f5; }
.keeper-contact-block span, .keeper-contact-block strong, .keeper-contact-block small { display: block; }
.keeper-contact-block span { color: var(--muted); font-size: 11px; font-weight: 800; }
.keeper-contact-block strong { margin-top: 3px; color: #315647; }
.keeper-contact-block small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.keeper-phone-toggle, .keeper-phone-save, .keeper-phone-code-row button { min-height: 44px; padding: 9px 14px; border-radius: 999px; cursor: pointer; font-weight: 800; }
.keeper-phone-toggle { border: 1px solid #b8d0c2; background: #fff; color: #315f4b; white-space: nowrap; }
.keeper-phone-panel { display: grid; gap: 12px; margin-top: 12px; padding: 17px; border: 1px solid #e5ddd2; border-radius: 16px; background: #fffaf5; }
.keeper-phone-panel[hidden] { display: none; }
.keeper-phone-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.keeper-phone-code-row button { border: 1px solid var(--orange); background: #fff3ed; color: var(--orange-deep); }
.keeper-phone-code-row button:disabled, .keeper-phone-save:disabled, .keeper-profile-submit:disabled { cursor: wait; opacity: .58; }
.keeper-phone-save { justify-self: end; border: 0; background: var(--green-deep); color: #fff; }
.keeper-profile-status { min-height: 18px; margin: 10px 0 0; font-size: 12px; line-height: 1.5; }
.keeper-profile-status.error { color: #a7473a; }
.keeper-profile-status.success { color: #347052; }
.keeper-profile-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.keeper-profile-actions button { min-height: 46px; }
.keeper-profile-close:focus-visible, .keeper-avatar-head button:focus-visible, .keeper-avatar-upload:focus-within, .keeper-background-head button:focus-visible, .keeper-phone-toggle:focus-visible, .keeper-phone-save:focus-visible, .keeper-phone-code-row button:focus-visible { outline: 3px solid rgba(244,122,91,.32); outline-offset: 2px; }

input, textarea, select {
  color: var(--ink);
  border-color: #d9d0c5 !important;
  background: #fff !important;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:hover, textarea:hover, select:hover { border-color: #baa99b !important; }
input:focus, textarea:focus, select:focus { border-color: var(--orange) !important; box-shadow: 0 0 0 4px rgba(244, 122, 91, .16) !important; }

/* Dialogs */
.modalwrap, .auth-overlay, .profile-overlay, .comment-overlay {
  padding: 20px !important;
  background: rgba(16, 36, 29, .72) !important;
  backdrop-filter: blur(8px);
}
.modal, .auth-card, .profile-modal, .comment-modal {
  border: 1px solid rgba(255,255,255,.70);
  border-radius: 28px !important;
  background: var(--paper) !important;
  box-shadow: 0 30px 100px rgba(10, 31, 24, .32) !important;
}
.modal { max-height: calc(100dvh - 40px); overflow-y: auto; padding: 30px; }
.modal h2 { margin: 0 0 18px; }
.modal textarea { min-height: 130px; }
.modalactions { margin-top: 20px; }
.post-image-field { display: grid; gap: 5px; margin-top: 14px; color: var(--ink); font-size: 13px; }
.post-image-field > span { color: var(--muted); font-size: 12px; font-weight: 400; }
.post-image-field input { min-height: 48px; margin-top: 4px; padding: 9px 11px; cursor: pointer; }
.post-image-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.post-image-preview:empty { display: none; }
.post-image-preview-item { position: relative; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 14px; background: #f5f0e8; }
.post-image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.post-image-preview-item button { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(38, 51, 45, .88); color: white; cursor: pointer; }
.post-image-preview-item button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.post-image-preview-item button:focus-visible { outline: 3px solid rgba(255, 128, 93, .42); outline-offset: 2px; }
.post-image-status { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.post-image-grid { display: flex; flex-wrap: wrap; gap: 9px; margin: 15px 0; }
.post-image-thumbnail { position: relative; display: block; width: 112px; height: 112px; min-width: 44px; min-height: 44px; overflow: hidden; padding: 0; border: 1px solid #ded7cc; border-radius: 14px; background: #f1ece4; cursor: zoom-in; transition: border-color .18s, box-shadow .18s; }
.post-image-thumbnail[hidden] { display: none; }
.post-image-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-image-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(31, 43, 37, .58); color: #fff; font-size: 20px; font-weight: 900; text-shadow: 0 1px 5px rgba(0,0,0,.28); pointer-events: none; }
.post-image-thumbnail:hover { border-color: var(--orange); box-shadow: 0 7px 20px rgba(79, 54, 42, .14); }
.post-image-thumbnail:focus-visible { outline: 3px solid rgba(244, 122, 91, .35); outline-offset: 2px; }
.post-image-viewer { position: fixed; inset: 0; z-index: 145; display: none; place-items: center; padding: 20px; background: rgba(10, 20, 16, .88); backdrop-filter: blur(9px); }
.post-image-viewer.show { display: grid; }
.post-image-viewer-dialog { width: min(1100px, 100%); max-height: calc(100dvh - 40px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 24px; background: #17231e; box-shadow: 0 30px 100px rgba(0,0,0,.5); }
.post-image-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; color: white; }
.post-image-viewer-head > div { min-width: 0; }
.post-image-viewer-head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-image-viewer-head span { display: block; margin-top: 3px; color: #b9c7c0; font-size: 12px; font-variant-numeric: tabular-nums; }
.post-image-viewer-close, .post-image-viewer-nav { display: grid; place-items: center; width: 48px; height: 48px; min-width: 48px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: rgba(255,255,255,.1); color: white; cursor: pointer; }
.post-image-viewer-close svg, .post-image-viewer-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.post-image-viewer-close:hover, .post-image-viewer-nav:hover { background: rgba(255,255,255,.2); }
.post-image-viewer-close:focus-visible, .post-image-viewer-nav:focus-visible { outline: 3px solid rgba(255, 153, 118, .72); outline-offset: 2px; }
.post-image-viewer-stage { min-height: 220px; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; place-items: center; gap: 12px; padding: 0 14px 22px; }
.post-image-viewer-stage > img { display: block; max-width: 100%; max-height: calc(100dvh - 145px); width: auto; height: auto; object-fit: contain; border-radius: 14px; }
.post-image-viewer-nav[hidden] { visibility: hidden; display: grid; }
.modalactions .primary:disabled { cursor: wait; opacity: .6; }

/* Community post actions and comments */
.post-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.post-action {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 7px;
  border: 0;
  border-radius: 12px;
  color: #536159;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  touch-action: manipulation;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.post-action svg, .post-comment-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.post-action strong { min-width: 1ch; font-size: 13px; font-variant-numeric: tabular-nums; }
.post-action:hover { color: var(--orange); border-color: var(--orange); background: #fff7f2; }
.post-action:active, .post-action.is-liked, .post-action.saved { color: #c84f49; background: #fff0ed; }
.post-like-action.is-liked svg, .post-favorite-action.saved svg { fill: currentColor; }
.post-action:disabled { cursor: wait; opacity: .68; }
.post-action:focus-visible, .post-comment-close:focus-visible { outline: 3px solid rgba(244, 122, 91, .32); outline-offset: 2px; }
.post-action-status {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 130;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  background: #203d33;
  box-shadow: 0 12px 35px rgba(20, 39, 31, .22);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.post-action-status.show { opacity: 1; transform: translate(-50%, 0); }

.post-comment-overlay {
  position: fixed;
  inset: 0;
  z-index: 112;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(16, 36, 29, .72);
  backdrop-filter: blur(8px);
}
.post-comment-overlay.show { display: grid; }
.post-comment-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 30px 100px rgba(10, 31, 24, .32);
}
.post-comment-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 26px 82px 18px 26px; }
.post-comment-head h2 { margin: 2px 0 5px; color: var(--ink); font-size: clamp(21px, 4vw, 28px); line-height: 1.3; }
.post-comment-kicker { margin: 0; color: var(--orange); font-size: 12px; font-weight: 850; letter-spacing: .12em; }
.post-comment-count { margin: 0; color: var(--muted); font-size: 13px; }
.post-comment-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #55625b;
  background: #fff;
  cursor: pointer;
}
.post-comment-close:hover { color: var(--orange); border-color: var(--orange); background: #fff7f2; }
.post-comment-list { min-height: 140px; display: grid; gap: 10px; overflow-y: auto; padding: 0 26px 20px; }
.post-comment-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fffdfa; }
.post-comment-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.post-comment-meta b { color: #496455; font-size: 13px; }
.post-comment-item p { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.post-comment-item-actions { display: flex; margin-top: 8px; }
.post-reply-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  color: #496455;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  touch-action: manipulation;
}
.post-reply-toggle:hover, .post-reply-toggle[aria-expanded="true"] { color: var(--orange); background: #fff2eb; }
.post-reply-toggle:focus-visible, .post-reply-cancel:focus-visible, .post-reply-submit:focus-visible { outline: 3px solid rgba(244, 122, 91, .32); outline-offset: 2px; }
.post-reply-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.post-reply-list { display: grid; gap: 8px; margin-left: 20px; }
.post-reply-list:empty { display: none; }
.post-reply-item { padding: 11px 13px; border-left: 3px solid #dbe9df; border-radius: 0 12px 12px 0; background: #f4f8f5; }
.post-reply-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.post-reply-meta b { color: #496455; font-size: 12px; }
.post-reply-item p { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.post-reply-form { display: grid; gap: 10px; margin: 10px 0 2px 20px; padding: 12px; border: 1px solid #e4ddd2; border-radius: 14px; background: #fffaf4; }
.post-reply-form[hidden] { display: none; }
.post-reply-form textarea { width: 100%; min-height: 78px; resize: vertical; padding: 10px 12px; border: 1px solid #d9d0c5; border-radius: 11px; color: var(--ink); background: #fff; font: inherit; font-size: 14px; line-height: 1.6; }
.post-reply-form textarea:focus { border-color: var(--orange); outline: 0; box-shadow: 0 0 0 4px rgba(244, 122, 91, .16); }
.post-reply-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.post-reply-cancel, .post-reply-submit { min-height: 44px; padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 800; }
.post-reply-cancel { border: 1px solid var(--line); color: #58665e; background: #fff; }
.post-reply-submit { border: 0; color: #fff; background: var(--orange-deep); }
.post-reply-submit:disabled { cursor: wait; opacity: .62; }
.post-comment-empty { min-height: 130px; display: grid; place-content: center; gap: 5px; text-align: center; color: var(--muted); }
.post-comment-empty b { color: var(--ink); }
.post-comment-auth-gate { margin: 0 26px 24px; padding: 20px; border: 1px solid #ead9cc; border-radius: 18px; background: #fff5ed; text-align: center; }
.post-comment-auth-gate[hidden], .post-comment-form[hidden] { display: none; }
.post-comment-auth-gate b { display: block; color: var(--ink); font-size: 16px; }
.post-comment-auth-gate p { margin: 7px auto 15px; max-width: 380px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.post-comment-auth-gate .primary { min-height: 44px; padding: 11px 20px; border: 0; }
.post-comment-form { padding: 18px 26px 24px; border-top: 1px solid var(--line); background: #fffaf4; }
.post-comment-form label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 800; }
.post-comment-form textarea { width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px; border: 1px solid #d9d0c5; border-radius: 14px; background: #fff; color: var(--ink); font: inherit; line-height: 1.6; }
.post-comment-form textarea:focus { border-color: var(--orange); outline: 0; box-shadow: 0 0 0 4px rgba(244, 122, 91, .16); }
.post-comment-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.post-comment-form-footer > span { color: var(--muted); font-size: 12px; }
.post-comment-form-footer .primary { min-height: 44px; padding: 11px 20px; border: 0; }
.post-comment-form-footer .primary:disabled { cursor: wait; opacity: .62; }

/* Nutrition buying guide */
.food-guide { padding: clamp(24px, 4vw, 42px) !important; }
.food-guide-header { max-width: 820px; margin-bottom: 26px; }
.food-guide-header > span { color: var(--orange-deep); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.food-guide-header h3 { margin: 8px 0 10px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.food-guide-header p { margin: 0; color: #5b675f; font-size: 15px; line-height: 1.8; }
.food-guide-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 30px; }
.food-guide-steps > div { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-content: start; padding: 18px; border: 1px solid #dce8e0; border-radius: 18px; background: #f4f8f5; }
.food-guide-steps b { grid-row: 1 / 3; color: #a9c3b5; font-size: 22px; line-height: 1; }
.food-guide-steps strong { color: #285542; font-size: 15px; }
.food-guide-steps span { color: #657269; font-size: 12px; line-height: 1.65; }
.food-guide-section { padding: 28px 0; border-top: 1px solid var(--line); }
.food-guide-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 17px; }
.food-guide-section-head > span { flex: none; padding: 5px 9px; border-radius: 999px; color: #9b4c34; background: #fff0e8; font-size: 11px; font-weight: 900; }
.food-guide-section h4 { margin: 0; color: var(--ink); font-size: clamp(19px, 2.4vw, 24px); letter-spacing: -.02em; }
.food-label-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 26px; margin: 0; padding: 0; list-style: none; }
.food-label-list li { position: relative; padding: 0 0 0 17px; color: #59665e; font-size: 14px; line-height: 1.75; }
.food-label-list li::before { content: ''; position: absolute; top: .72em; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.food-label-list b { color: #35443c; }
.food-guide-tip { display: flex; gap: 8px; margin-top: 18px; padding: 15px 17px; border-radius: 14px; color: #5d584d; background: #f8f4ed; font-size: 13px; line-height: 1.7; }
.food-guide-tip b { flex: none; color: #35443c; }
.food-nutrition-grid, .food-format-grid, .food-observe-grid { display: grid; gap: 12px; }
.food-nutrition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.food-nutrition-grid > div { padding: 18px; border-radius: 16px; background: #fff9f4; }
.food-nutrition-grid strong, .food-format-grid strong { color: #385c4c; font-size: 15px; }
.food-nutrition-grid p, .food-format-grid p { margin: 7px 0 0; color: #68736c; font-size: 13px; line-height: 1.75; }
.food-guide-note { margin: 15px 0 0; padding-left: 14px; border-left: 3px solid #9bb8a8; color: #5d6a62; font-size: 13px; line-height: 1.75; }
.food-format-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.food-format-grid > div { padding: 20px; border: 1px solid #e5ded4; border-radius: 18px; background: #fff; }
.food-format-grid small { display: block; margin-top: 12px; color: #9b5b45; font-size: 11px; font-weight: 800; line-height: 1.55; }
.food-observe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.food-observe-grid > div { display: grid; gap: 5px; padding: 16px; border-radius: 15px; background: #f6f8f5; }
.food-observe-grid b { color: #345846; font-size: 14px; }
.food-observe-grid span { color: #6a756e; font-size: 12px; line-height: 1.65; }
.food-transition { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.food-transition li { display: grid; gap: 5px; padding: 16px; border-radius: 14px; color: #fff; background: #315b49; }
.food-transition li:nth-child(2) { background: #416b57; }
.food-transition li:nth-child(3) { background: #527b66; }
.food-transition li:nth-child(4) { background: #638b75; }
.food-transition b { font-size: 13px; }
.food-transition span { color: #e7f0eb; font-size: 12px; line-height: 1.55; }

@media (max-width: 1100px) and (min-width: 901px) {
  :root { --side-width: 230px !important; }
  .breeds { grid-template-columns: repeat(3, 1fr); }
  #home > div:first-child { width: min(390px, 48%) !important; }
}

@media (max-width: 900px) {
  :root { --mobile-nav-height: calc(161px + env(safe-area-inset-top)); }
  body { padding-top: var(--mobile-nav-height) !important; padding-left: 0 !important; }
  main { min-height: calc(100dvh - var(--mobile-nav-height)) !important; }
  #maoyuSidebar {
    position: fixed !important;
    top: 0;
    bottom: auto !important;
    z-index: 50;
    width: 100% !important;
    height: auto !important;
    padding: calc(9px + env(safe-area-inset-top)) 12px 10px !important;
    box-shadow: 0 10px 35px rgba(19, 50, 40, .16) !important;
  }
  .side-brand { justify-content: center; margin: 0 4px 7px; }
  .side-brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .side-brand-mark svg { width: 19px; height: 19px; }
  .side-logo { font-size: 19px !important; }
  .side-logo small { display: none; }
  .side-menu {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  .side-link {
    min-width: 0;
    min-height: 48px;
    justify-content: center;
    gap: 5px;
    padding: 7px 4px !important;
    font-size: 0 !important;
    text-align: center;
  }
  .side-link::after { content: attr(data-mobile-label); font-size: 12px; font-weight: 800; }
  .side-link b { display: none; }
  .side-link span { display: grid !important; flex: 0 0 18px; width: 18px !important; }
  .side-link span svg { width: 17px; height: 17px; }
  .side-link:hover { transform: none; }
  .side-link:focus-visible { outline-color: #ffd2c2 !important; outline-offset: 1px; }
  .side-publish { display: none; }
  #home {
    height: calc(100dvh - var(--mobile-nav-height)) !important;
    min-height: calc(100dvh - var(--mobile-nav-height)) !important;
    background-position: calc(63% - 1cm) center !important;
  }
  #home::after { background: linear-gradient(0deg, rgba(12,31,25,.66), rgba(12,31,25,.02) 72%); }
  #home > div:first-child {
    top: 16px !important;
    right: 16px !important;
    bottom: auto !important;
    left: auto !important;
    width: min(340px, calc(100% - 32px)) !important;
    padding: 20px !important;
    border-radius: 22px;
  }
  #home > div:first-child h1 { font-size: clamp(32px, 10vw, 40px) !important; }
  #home > div:first-child p { font-size: 16px !important; line-height: 1.65 !important; }
  #home .stats { gap: 22px; }
  .section { padding-block: 44px; }
  .shell { padding-inline: 18px; }
  .sectionhead { margin-bottom: 24px; }
  .sectionhead h2 { font-size: clamp(30px, 8vw, 38px); }
  .breeds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #forum .posts { grid-template-columns: 1fr; }
  #forum .forum-toolbar { padding: 14px; }
  #forum .forum-tools { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  #forum .forum-search { width: 100% !important; }
  #forum .forum-page-info { grid-column: 1 / -1; grid-row: 2; width: auto; min-width: 0; }
  #forum .forum-pagination { grid-column: 2; grid-row: 1; width: auto; min-width: 0; }
  #user .caremain h2 { font-size: clamp(29px, 8vw, 38px); overflow-wrap: anywhere; }
  #user .caremain .chips { gap: 8px; }
  #user .caremain .chip { border-color: rgba(255,255,255,.24) !important; background: rgba(255,255,255,.92) !important; color: #315647 !important; }
  .breed-detail-layout { grid-template-columns: 1fr; gap: 22px; }
  .breed-detail-content { padding: 0; }
  .food-guide-steps, .food-observe-grid { grid-template-columns: 1fr 1fr; }
  .food-format-grid { grid-template-columns: 1fr; }
  .food-transition { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  :root { --mobile-nav-height: calc(64px + env(safe-area-inset-top)); }
  #maoyuSidebar { padding: calc(8px + env(safe-area-inset-top)) 10px 8px !important; }
  .side-brand { display: none; }
  .side-menu { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .side-link { min-height: 48px; padding-block: 6px !important; }
}

@media (max-width: 520px) {
  .post-image-thumbnail { width: 92px; height: 92px; }
  .post-image-viewer { padding: 10px; }
  .post-image-viewer-dialog { max-height: calc(100dvh - 20px); border-radius: 20px; }
  .post-image-viewer-head { padding: 10px 12px; }
  .post-image-viewer-stage { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; min-height: 180px; padding: 0 8px 14px; }
  .post-image-viewer-nav { width: 44px; height: 44px; min-width: 44px; }
  .post-image-viewer-stage > img { max-height: calc(100dvh - 112px); }
  .post-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .post-comment-overlay { align-items: end; padding: 10px; }
  .post-comment-dialog { max-height: calc(100dvh - 20px); border-radius: 24px; }
  .post-comment-head { padding: 20px 72px 15px 18px; }
  .post-comment-close { top: 13px; right: 13px; }
  .post-comment-list { padding: 0 18px 16px; }
  .post-comment-auth-gate { margin: 0 18px 18px; }
  .post-comment-form { padding: 16px 18px 18px; }
  .post-reply-list, .post-reply-form { margin-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .post-action, .post-image-thumbnail { transition: none; }
}

@media (max-width: 560px) {
  #home .actions { display: grid; grid-template-columns: 1fr 1fr; }
  #home .actions > * { padding-inline: 14px; }
  #home .stats { justify-content: space-between; gap: 12px; }
  #home .stat b { font-size: 21px; }
  .breeds, .videos, .agegrid, .nutrition-agegrid { grid-template-columns: 1fr !important; }
  .sectionhead { align-items: flex-start; }
  .filters, .forum-categories { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding: 3px 2px 8px; scrollbar-width: none; }
  .filter, .forum-category { white-space: nowrap; }
  .modal, .auth-card, .profile-modal, .comment-modal { padding: 24px !important; border-radius: 24px !important; }
  .breed-detail-overlay { padding: 12px; }
  .breed-detail-modal { max-height: calc(100svh - 24px); padding: 20px; border-radius: 24px; }
  .breed-detail-close { top: 10px; right: 10px; }
  .breed-detail-image-wrap { margin-top: 34px; }
  .breed-detail-metrics { grid-template-columns: 1fr; }
  .breed-official-profile { margin-top: 25px; padding-top: 24px; }
  .breed-profile-overview, .breed-profile-sections section { padding: 18px; }
  .breed-profile-intro, .breed-profile-sections p { font-size: 16px; line-height: 1.8; }
  .breed-profile-highlights { display: grid; }
  .care-history-overlay { align-items: end; padding: 12px; }
  .care-history-modal { max-height: calc(100dvh - 24px); padding: 20px; border-radius: 24px; }
  .care-history-modal-head { gap: 14px; }
  .care-history-search { grid-template-columns: 1fr; }
  .care-history-result-count { margin: 0; }
  .care-history-item { grid-template-columns: 1fr; gap: 13px; padding: 20px 2px; }
  .care-history-content ul { display: grid; gap: 7px; }
  .food-guide { padding: 22px 18px !important; }
  .food-guide-steps, .food-label-list, .food-nutrition-grid, .food-observe-grid, .food-transition { grid-template-columns: 1fr; }
  .food-guide-section-head, .food-guide-tip { align-items: flex-start; flex-direction: column; }
  #forum .forum-tools { grid-template-columns: 1fr; }
  #forum .forum-pagination { grid-column: 1; grid-row: 3; width: 100%; justify-content: space-between; }
  #forum .forum-page-info { grid-column: 1; grid-row: 2; }
  #forum .post { padding: 18px; }
  #forum .posttop { align-items: flex-start; flex-wrap: wrap; }
  .post-actions { flex-wrap: wrap; }
  .video-search-toolbar { align-items: stretch; flex-direction: column; padding: 12px; }
  .video-search-field { width: 100%; }
  .video-page-tools { align-items: stretch; flex-direction: column; gap: 8px; }
  .video-search-count { padding: 0 4px; }
  .video-pagination { justify-content: space-between; }
  .keeper-profile-card { grid-template-columns: 1fr; }
  .keeper-profile-edit { width: auto; justify-self: start; }
  .keeper-profile-overlay { align-items: end; padding: 10px; }
  .keeper-profile-dialog { max-height: calc(100dvh - 20px); border-radius: 24px; }
  .keeper-profile-head { padding: 22px 18px 17px; }
  .keeper-profile-form { padding: 20px 18px 22px; }
  .keeper-avatar-head { align-items: stretch; flex-direction: column; }
  .keeper-avatar-head button { width: 100%; }
  .keeper-avatar-editor { grid-template-columns: 88px minmax(0,1fr); gap: 12px; }
  .keeper-avatar-preview { width: 88px; height: 88px; border-radius: 27px 27px 27px 10px; }
  .keeper-background-head { align-items: stretch; flex-direction: column; }
  .keeper-background-head button { width: 100%; }
  .keeper-background-preview { min-height: 128px; aspect-ratio: 16 / 8; }
  .keeper-background-upload { grid-template-columns: 1fr; }
  .keeper-profile-grid { grid-template-columns: 1fr; }
  .keeper-profile-wide { grid-column: auto; }
  .keeper-contact-block { align-items: stretch; flex-direction: column; }
  .keeper-phone-toggle { width: 100%; }
  .keeper-phone-code-row { grid-template-columns: 1fr; }
  .keeper-phone-code-row button, .keeper-phone-save { width: 100%; }
  .keeper-profile-actions { display: grid; grid-template-columns: 1fr 1fr; }
  #user .sectionhead .primary { width: 100%; }
  #user .caremain { min-height: 0; padding: 28px 24px; }
}

@media (max-width: 420px) {
  .keeper-avatar-editor { grid-template-columns: 1fr; }
  .keeper-avatar-preview { justify-self: center; }
}

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

/* Cute theme layer — soft, playful and content-first */
html:root {
  --ink: #4b3940;
  --muted: #756269;
  --cream: #fff8f1;
  --paper: #fffefd;
  --orange: #ff917c;
  --orange-deep: #c95862;
  --green: #79b9a2;
  --green-deep: #503d49;
  --line: #efdcd5;
  --line-strong: #dfc6bf;
  --focus: #9c4054;
  --surface-soft: #fff1eb;
  --surface-tint: #fff8f4;
  --shadow-sm: 0 10px 28px rgba(108, 67, 78, .09);
  --shadow: 0 22px 56px rgba(108, 67, 78, .14);
  --shadow-hover: 0 20px 46px rgba(108, 67, 78, .18);
  --radius-sm: 16px;
  --radius: 26px;
  --radius-lg: 36px;
}

body {
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 12% 12%, rgba(255, 177, 165, .22) 0 7px, transparent 8px),
    radial-gradient(circle at 88% 20%, rgba(139, 205, 181, .18) 0 6px, transparent 7px),
    radial-gradient(circle at 82% 88%, rgba(194, 172, 230, .16) 0 8px, transparent 9px),
    linear-gradient(135deg, #fffaf4 0%, #fff6f0 48%, #fffaf6 100%);
  background-size: 170px 170px, 210px 210px, 250px 250px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 4% 72%, rgba(255, 145, 124, .12), transparent 24rem),
    radial-gradient(circle at 96% 8%, rgba(121, 185, 162, .13), transparent 27rem);
}

h1, h2, h3, h4, .side-logo, button {
  font-family: ui-rounded, "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", sans-serif;
}

#maoyuSidebar {
  background:
    radial-gradient(circle at 18% 6%, rgba(255, 255, 255, .13), transparent 11rem),
    radial-gradient(circle at 88% 82%, rgba(255, 177, 165, .14), transparent 14rem),
    linear-gradient(165deg, #594451 0%, #493944 56%, #3f353d 100%) !important;
  box-shadow: 12px 0 42px rgba(73, 52, 63, .18) !important;
}
.side-brand-mark {
  border-radius: 17px 17px 17px 7px;
  color: #563d45;
  background: linear-gradient(145deg, #ffb5a4, #ff8979);
  box-shadow: inset 0 -3px 0 rgba(123, 54, 65, .12), 0 12px 26px rgba(32, 19, 26, .24);
  transform: rotate(-3deg);
}
.side-logo i { color: #ffac9b !important; }
.side-logo small, .side-note { color: #d7c3cc !important; }
.side-link { color: #eadce2 !important; border-radius: 18px !important; }
.side-link span { color: #d3bdc7 !important; }
.side-link:hover { background: rgba(255,255,255,.09) !important; border-color: rgba(255,255,255,.10) !important; }
.side-link.active {
  color: #563d45 !important;
  background: linear-gradient(135deg, #ffb09e, #ff8b79) !important;
  box-shadow: inset 0 -3px 0 rgba(128, 53, 64, .12), 0 12px 28px rgba(37, 21, 30, .26) !important;
}
.side-link.active span { color: #563d45 !important; }
.side-publish {
  border-color: rgba(255, 215, 207, .42);
  border-radius: 18px;
  color: #fff8f5;
  background: rgba(255, 179, 164, .12);
}
.side-publish:hover { color: #563d45; background: #fff3ee; }

.sectionhead h2 { color: var(--ink); letter-spacing: -.035em; }
.sectionhead h2::after {
  width: 58px;
  height: 7px;
  border-radius: 999px 999px 999px 3px;
  background: linear-gradient(90deg, #ff8f7b 0 44%, #ffc067 44% 69%, #83c8ae 69%);
  box-shadow: 0 4px 12px rgba(201, 88, 98, .12);
}
.sectionhead p { color: var(--muted); }

.primary {
  border: 1px solid rgba(173, 72, 83, .12) !important;
  color: #4a3038 !important;
  background: linear-gradient(135deg, #ffad99, #ff8878) !important;
  box-shadow: 0 10px 24px rgba(201, 88, 98, .20);
}
.primary:hover {
  color: #402b32 !important;
  background: linear-gradient(135deg, #ffb9a7, #ff927f) !important;
  box-shadow: 0 15px 31px rgba(201, 88, 98, .26);
}
.secondary {
  border: 1px solid #eccfc6;
  color: #6d4650;
  background: rgba(255, 254, 252, .94);
  box-shadow: 0 7px 20px rgba(107, 69, 78, .07);
}
.secondary:hover { border-color: #ff9d8a; background: #fff8f4; }
.filter, .forum-category, .forum-page-button, .video-page-button {
  border-color: #ead2ca !important;
  color: #6b5259;
  background: #fffefd !important;
  box-shadow: 0 5px 14px rgba(108, 67, 78, .06);
}
.filter.active, .forum-category.active {
  border-color: #ff9a88 !important;
  color: #533940 !important;
  background: #ffe0d7 !important;
  box-shadow: inset 0 -2px 0 rgba(184, 79, 91, .10), 0 7px 16px rgba(184, 79, 91, .10);
}

#home::after {
  background:
    linear-gradient(90deg, rgba(75, 49, 59, .20), transparent 50%),
    linear-gradient(0deg, rgba(63, 45, 53, .16), transparent 48%);
}
#home > div:first-child {
  border: 2px solid rgba(255, 219, 209, .92);
  border-radius: 34px 34px 34px 12px;
  color: #4b3940;
  background: rgba(255, 252, 247, .91);
  box-shadow: 0 28px 76px rgba(76, 48, 60, .24), inset 0 1px 0 rgba(255,255,255,.92);
  backdrop-filter: blur(16px) saturate(115%);
}
#home > div:first-child::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 28px;
  width: 42px;
  height: 18px;
  border-radius: 50% 50% 35% 35%;
  background: #ffc0b1;
  box-shadow: 50px 2px 0 -3px #ffd16f, 94px -1px 0 -5px #8dceb6;
  transform: rotate(-4deg);
}
html body #home > div:first-child .eyebrow { color: #b34f5d !important; }
html body #home > div:first-child p { color: #665158 !important; }
#home h1 { color: #49353d; text-wrap: balance; }
#home .stats { border-top-color: rgba(188, 102, 111, .22); }
#home .stat b { color: #a84858; }
#home .stat span { color: #79636a; }

.breed, .video, .post, .careitem, .agecard, .nutritioncard, .healthcard, .behaviorcard, .hygienecard, .foodcard, .weightbox {
  border: 1px solid #efd9d2 !important;
  border-radius: var(--radius) !important;
  background: rgba(255, 254, 252, .96) !important;
  box-shadow: var(--shadow-sm) !important;
}
.breed, .video, .post { position: relative; }
.breed::before, .video::before, .post::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 4px;
  z-index: 2;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #ff9b89, #ffd071, #8bcbb4);
  opacity: .72;
}
.breed:nth-child(3n+2)::before, .post:nth-child(3n+2)::before { background: linear-gradient(90deg, #8bcbb4, #c6b1e7); }
.breed:nth-child(3n)::before, .post:nth-child(3n)::before { background: linear-gradient(90deg, #ffd071, #ff9b89); }
.breed:hover, .post:hover, .video:hover, .cat-profile-card:hover {
  border-color: #f4b9ad !important;
  box-shadow: var(--shadow-hover) !important;
}
.breed img, .breed-visual { border-radius: 24px 24px 9px 9px; }
.breedbody { background: linear-gradient(180deg, rgba(255,255,255,.2), #fffdfb); }
.chip, .post-category-chip, .tica-chip, .breed-profile-highlights li {
  border: 1px solid #efd6cd !important;
  border-radius: 999px !important;
  color: #76545c !important;
  background: #fff0ea !important;
}
.chip:nth-child(3n+2), .breed-profile-highlights li:nth-child(3n+2) { border-color: #cce6db !important; color: #426c5e !important; background: #edf8f3 !important; }
.chip:nth-child(3n), .breed-profile-highlights li:nth-child(3n) { border-color: #dfd5f0 !important; color: #66547e !important; background: #f5f0fb !important; }
.breed-metrics > span, .breed-detail-metrics > div { border: 1px solid #f0ded7; background: #fff7f2; }

#care .caremain {
  border: 1px solid rgba(255,255,255,.48);
  background: linear-gradient(145deg, #4f917a 0%, #417e6a 58%, #356b5a 100%) !important;
  box-shadow: 0 22px 52px rgba(72, 129, 109, .20);
}
#care .caremain::after {
  content: "";
  align-self: flex-end;
  width: 78px;
  height: 24px;
  margin-top: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.38) 0 5px, transparent 6px) 0 0 / 23px 23px;
  opacity: .7;
}
.careitem:nth-child(3n+1) .icon { color: #b9515f; background: #ffe5dd; }
.careitem:nth-child(3n+2) .icon { color: #3e7966; background: #e6f5ee; }
.careitem:nth-child(3n) .icon { color: #6e588c; background: #f1eafb; }
.careitem[role="button"]:hover { transform: translateX(4px) translateY(-1px); }

#forum .forum-toolbar, .video-search-toolbar {
  border: 1px solid #efd9d2;
  border-radius: 24px;
  background: rgba(255, 253, 250, .88);
  box-shadow: 0 10px 26px rgba(108, 67, 78, .07);
}
#forum .post { background: linear-gradient(165deg, #fffefd, #fffaf6) !important; }
.post-actions { border-top-color: #f2e3dd; }
.post-action {
  border: 1px solid transparent;
  border-radius: 14px;
  color: #735d64;
  background: #fffaf7;
}
.post-action:hover { border-color: #f0c9c0; color: #bd5663; background: #fff0eb; }
.post-action.is-liked, .post-action.saved { color: #b94e5d; background: #ffe7e4; }
.post-follow-button { border-color: #e5cec7; color: #75555e; background: #fff8f5; }
.post-follow-button.following { border-color: #bcdaca; color: #3f715f; background: #eaf7f1; }

.video { background: linear-gradient(180deg, #fffefd, #fff8f3) !important; }
.video-author-avatar { color: #805160; background: linear-gradient(145deg, #ffe2db, #ffd1c7); }
.video-action:hover, .video-action:focus-visible { color: #b95060; background: #fff0eb; }
.video-action.active, .video-action.saved { color: #b34c5c; background: #ffe5e2; }

#user .caremain {
  border: 1px solid rgba(255,255,255,.38);
  background: linear-gradient(145deg, #815f70 0%, #6b4f5e 58%, #59434f 100%) !important;
  box-shadow: 0 22px 54px rgba(93, 58, 74, .22);
}
.keeper-profile-card {
  position: relative;
  isolation: isolate;
  width: min(50%, 520px);
  gap: 16px;
  padding: 20px 22px 22px;
  overflow: hidden;
  border-color: rgba(255,255,255,.24);
  border-radius: 26px 26px 26px 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.20), rgba(255,255,255,.09));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 14px 34px rgba(55,32,43,.10);
  backdrop-filter: blur(14px);
  grid-template-columns: 64px minmax(0,1fr);
  align-items: center;
}
.keeper-profile-avatar-display { z-index: 1; width: 64px; height: 64px; border: 2px solid rgba(255,255,255,.32); border-radius: 21px 21px 21px 8px; box-shadow: 0 9px 20px rgba(52,31,40,.12); }
.keeper-profile-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -28px;
  z-index: -1;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(255,190,177,.10);
  pointer-events: none;
}
.keeper-profile-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
}
.keeper-profile-copy > span {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid rgba(255,225,218,.28);
  border-radius: 999px;
  background: rgba(255,238,233,.13);
}
.keeper-profile-copy strong {
  margin-top: 10px;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.keeper-profile-copy p {
  max-width: 680px;
  margin-top: 8px !important;
  font-size: 14px;
  line-height: 1.75 !important;
  overflow-wrap: anywhere;
}
.keeper-profile-copy small { overflow-wrap: anywhere; }
.keeper-profile-edit {
  position: relative;
  z-index: 1;
  padding-inline: 15px;
  border-color: rgba(255,255,255,.30);
  color: #67434e;
  background: #fff8f4;
  box-shadow: 0 7px 18px rgba(52,31,40,.10);
}
.keeper-profile-edit:hover { color: #ab4b5a; background: #fff; }

/* Public keeper profile */
.public-profile-trigger { font: inherit; }
.post-public-profile {
  min-height: 44px;
  margin: -10px 0;
  padding: 8px 4px;
  border: 0;
  border-radius: 10px;
  color: #684c55;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
}
.post-public-profile:hover { color: #b64e5e; background: #fff0eb; }
.video-public-profile {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  gap: 11px;
  padding: 3px;
  border: 0;
  border-radius: 16px;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.video-public-profile:hover { background: #fff0eb; }
.video-public-profile .video-author-copy b { font-size: 14px; }
.video-action { font-size: 12px !important; }
.video-action-count { font-size: 13px; }
.video-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.video-actions > .video-community-meta {
  min-width: 0;
  padding: 0;
}
.video-actions > .video-community-meta .video-author-avatar,
.video-actions > .video-community-meta .video-author-copy small { display: none; }
.video-actions > .video-community-meta .video-public-profile {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 4px 6px;
}
.video-actions > .video-community-meta .video-author-copy { flex: 0 1 auto; min-width: 0; }
.video-actions > .video-community-meta .video-author-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-actions > .video-follow-button { width: auto; min-width: 0; padding-inline: 7px; }
@media (max-width: 560px) {
  .video-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
  .video-actions > .video-community-meta { display: flex; }
  .video-actions > .video-follow-button { width: auto; }
}
.public-profile-trigger:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.public-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(66,46,56,.72);
  backdrop-filter: blur(10px) saturate(90%);
}
.public-profile-overlay.show { display: grid; }
.public-profile-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 30px;
  border: 2px solid rgba(255,223,215,.88);
  border-radius: 30px;
  background: #fffefd;
  box-shadow: 0 32px 96px rgba(80,52,64,.30);
}
.public-profile-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #efd3ca;
  border-radius: 50%;
  color: #7b5962;
  background: #fff5f1;
  cursor: pointer;
  font-size: 22px;
}
.public-profile-close:hover { color: #b94e5d; border-color: #f0a99b; background: #ffece7; }
.public-profile-close:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.public-profile-header { display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; gap: 18px; padding-right: 50px; }
.public-profile-avatar { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px 24px 24px 9px; color: #67434e; background: linear-gradient(145deg,#ffe0d8,#ffc6b9); font-size: 24px; font-weight: 900; }
.public-profile-avatar img, .video-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.public-profile-avatar.has-image, .video-author-avatar.has-image { background: #f5e4df; }
.public-profile-avatar svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.public-profile-header h2 { margin: 5px 0 6px; color: var(--ink); font-size: 26px; overflow-wrap: anywhere; }
.public-profile-header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.public-profile-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 24px 0 0; }
.public-profile-details > div { min-width: 0; padding: 14px 15px; border: 1px solid #eedad3; border-radius: 16px; background: #fff7f2; }
.public-profile-details dt { color: #9a737c; font-size: 11px; font-weight: 800; }
.public-profile-details dd { margin: 5px 0 0; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.55; overflow-wrap: anywhere; }
.public-profile-empty { margin: 18px 0 0; padding: 14px; border-radius: 14px; color: var(--muted); text-align: center; background: #fff6f1; }
@media (max-width: 560px) {
  .public-profile-dialog { padding: 24px 18px 20px; border-radius: 24px; }
  .public-profile-header { grid-template-columns: 62px minmax(0,1fr); gap: 13px; padding-right: 42px; }
  .public-profile-avatar { width: 62px; height: 62px; border-radius: 20px 20px 20px 8px; font-size: 20px; }
  .public-profile-header h2 { font-size: 22px; }
  .public-profile-details { grid-template-columns: 1fr; }
}

.modal, .auth-card, .profile-modal, .comment-modal, .post-comment-dialog, .keeper-profile-dialog, .breed-detail-modal, .care-history-modal {
  border: 2px solid rgba(255, 223, 215, .88) !important;
  border-radius: 30px !important;
  background: #fffefd !important;
  box-shadow: 0 32px 96px rgba(80, 52, 64, .30) !important;
}
.modalwrap, .auth-overlay, .profile-overlay, .comment-overlay, .post-comment-overlay, .keeper-profile-overlay, .breed-detail-overlay, .care-history-overlay {
  background: rgba(66, 46, 56, .70) !important;
  backdrop-filter: blur(10px) saturate(90%);
}
.post-comment-form, .keeper-avatar-field, .keeper-background-field, .keeper-contact-block, .profile-health { background: #fff6f1; }
.post-comment-item, .comment-item { border-color: #eedad3; background: #fffdfb; }
.post-reply-item, .video-reply { border-color: #cfe5db; background: #f0f8f4; }
.post-comment-close, .keeper-profile-close, .breed-detail-close, .care-history-close, .profile-close {
  border: 1px solid #efd3ca;
  color: #7b5962;
  background: #fff5f1;
  box-shadow: 0 7px 18px rgba(105, 65, 77, .10);
}
.post-comment-close:hover, .care-history-close:hover { color: #b94e5d; border-color: #f0a99b; background: #ffece7; }

input, textarea, select {
  border-color: #e6cec7 !important;
  border-radius: 14px !important;
  color: var(--ink);
  background: #fffefd !important;
}
input:hover, textarea:hover, select:hover { border-color: #dcaea4 !important; }
input:focus, textarea:focus, select:focus {
  border-color: #e77d7d !important;
  box-shadow: 0 0 0 4px rgba(231, 125, 125, .15) !important;
}

@media (max-width: 900px) {
  #maoyuSidebar {
    border-bottom: 1px solid rgba(255, 222, 215, .18) !important;
    background: linear-gradient(115deg, #56414e, #453842) !important;
    box-shadow: 0 10px 30px rgba(65, 45, 55, .17) !important;
  }
  .side-brand { margin-bottom: 10px; }
  .side-brand-mark { width: 38px; height: 38px; border-radius: 14px 14px 14px 6px; }
  .side-link { min-height: 44px; }
  #home > div:first-child { border-radius: 28px 28px 28px 10px; }
  .keeper-profile-card { width: 100%; }
}

@media (max-width: 560px) {
  .section { padding-block: 44px; }
  .sectionhead { margin-bottom: 24px; }
  .sectionhead h2 { font-size: clamp(28px, 9vw, 36px); }
  .breed, .video, .post, .careitem { border-radius: 22px !important; }
  #forum .forum-toolbar, .video-search-toolbar { border-radius: 20px; }
  #home > div:first-child { background: rgba(255, 252, 247, .92); }
  .modal, .auth-card, .profile-modal, .comment-modal, .post-comment-dialog, .keeper-profile-dialog { border-radius: 24px !important; }
}
