/* ------------------------------------------------------------
  Xiaohongshu-style Mobile UI (H5)
  - Accent: #FF991C
  - Background: white / light gray
  - Cards: rounded + subtle shadow
------------------------------------------------------------ */

:root {
  --accent: #ff991c;
  --accent-press: #f08700;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, 0.08);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --radius: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* 防止 Shoelace 组件未注册时把内容挤到主容器右侧 */
sl-dialog:not(:defined),
sl-alert:not(:defined) {
  display: none;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* Safe area padding on iOS */
body {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------------- Top Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  height: 52px;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}

.nav__title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.icon-btn--hidden {
  visibility: hidden;
  pointer-events: none;
}

.icon-btn:active {
  transform: scale(0.96);
  background: rgba(17, 24, 39, 0.05);
}

.icon-btn--light:active {
  background: rgba(255, 255, 255, 0.16);
}

.icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  color: currentColor;
  background: currentColor;
  -webkit-mask: var(--mask) center / contain no-repeat;
  mask: var(--mask) center / contain no-repeat;
}

/* Icon masks (inline SVG paths as data URIs) */
.icon[data-icon="back"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M15.5 5.5 9 12l6.5 6.5-1.4 1.4L6.2 12l7.9-7.9z'/%3E%3C/svg%3E");
}
.icon[data-icon="search"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10 18a8 8 0 1 1 5.3-14l.3.3A8 8 0 0 1 10 18m11 3-5.2-5.2a10 10 0 1 0-1.4 1.4L19.6 22z'/%3E%3C/svg%3E");
}
.icon[data-icon="home"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3 2.5 11.2l1.3 1.5L5 11.7V21h6v-6h2v6h6v-9.3l1.2 1 1.3-1.5z'/%3E%3C/svg%3E");
}
.icon[data-icon="msg"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m1 4v2h10V8zm0 4v2h8v-2z'/%3E%3C/svg%3E");
}
.icon[data-icon="me"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5m0 2c-5 0-9 2.2-9 5v2h18v-2c0-2.8-4-5-9-5'/%3E%3C/svg%3E");
}
.icon[data-icon="more"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 10a2 2 0 1 1-2 2 2 2 0 0 1 2-2m6 0a2 2 0 1 1-2 2 2 2 0 0 1 2-2m6 0a2 2 0 1 1-2 2 2 2 0 0 1 2-2'/%3E%3C/svg%3E");
}
.icon[data-icon="plus"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 5h2v14h-2zM5 11h14v2H5z'/%3E%3C/svg%3E");
}
.icon[data-icon="close"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 5.7 12 12l6.3 6.3-1.4 1.4L10.6 13.4 4.3 19.7 2.9 18.3 9.2 12 2.9 5.7 4.3 4.3l6.3 6.3 6.3-6.3z'/%3E%3C/svg%3E");
}

/* ---------------- Searchbar ---------------- */
.searchbar {
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
}

.searchbar__inner {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.searchbar__icon {
  color: var(--muted);
  background: var(--muted);
}

.searchbar__input {
  border: 0;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.searchbar__clear {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  transition: transform 120ms ease, background 120ms ease;
}

.searchbar__clear:active {
  transform: scale(0.98);
  background: rgba(255, 153, 28, 0.12);
}

/* ---------------- Page ---------------- */
.page {
  max-width: 460px;
  margin: 0 auto;
  padding: 12px 14px 92px;
}

/* ---------------- Banner ---------------- */
.banner {
  background: linear-gradient(
    135deg,
    rgba(255, 153, 28, 0.24),
    rgba(255, 255, 255, 0.9)
  );
  border: 1px solid rgba(255, 153, 28, 0.28);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 8px 0 12px;
}

.banner__media {
  width: 100%;
  aspect-ratio: 16 / 8;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.banner__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner__content {
  padding: 14px;
}

.banner__title {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.banner__desc {
  margin-top: 6px;
  color: #374151;
  font-size: 13px;
  line-height: 1.5;
}

.banner__actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.banner__actions .btn {
  flex: 1;
}

.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 10px;
}

.notice__title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 6px;
}

.notice__body {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}

.hero-cta {
  margin-bottom: 10px;
}

.hero-cta__btn {
  width: 100%;
  height: 44px;
  font-weight: 900;
}

.love-board {
  margin: 8px 0 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 153, 28, 0.25);
  background: linear-gradient(140deg, rgba(255, 153, 28, 0.14), rgba(255, 255, 255, 0.95));
  padding: 12px;
  box-shadow: var(--shadow);
}

.love-board__title {
  font-size: 12px;
  color: #6b7280;
}

.love-board__count {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 900;
  color: #9a4f00;
}

.love-board__quota {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.feed__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 12px;
}

.feed__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 153, 28, 0.12);
}

.feed__link {
  text-decoration: none;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  transition: transform 120ms ease;
}

.feed__link:active {
  transform: scale(0.98);
}

/* ---------------- Top5 ---------------- */
.top {
  margin: 12px 0;
}

.top__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.top__title {
  font-size: 15px;
  font-weight: 900;
}

.top__sub {
  font-size: 12px;
  color: var(--muted);
}

.top__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.topcard {
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease;
}

.topcard:active {
  transform: scale(0.99);
}

.topcard__img {
  aspect-ratio: 1 / 1;
  background: rgba(255, 153, 28, 0.12);
}

.topcard__img-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topcard__body {
  padding: 10px 10px 12px;
}

.topcard__title {
  font-weight: 900;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topcard__reason {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------- Cards ---------------- */
.feed__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.card--large {
  grid-column: 1 / -1;
}

.card--small .card__title {
  font-size: 14px;
}

.card--small .card__img-wrap {
  aspect-ratio: 1 / 1;
}

.card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, rgba(255, 153, 28, 0.25), rgba(255, 153, 28, 0.05));
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__body {
  padding: 12px 12px 10px;
}

.card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.card__title-btn {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.card__title-btn:active {
  opacity: 0.8;
}

.card__text {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: #374151;
}

.card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.feed-actions {
  padding: 0 12px 12px;
  display: flex;
  gap: 8px;
}

.feed-actions .btn {
  flex: 1;
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.action-btn:active {
  transform: scale(0.98);
  background: rgba(17, 24, 39, 0.03);
}

.action-btn--liked {
  color: var(--accent);
  border-color: rgba(255, 153, 28, 0.35);
  background: rgba(255, 153, 28, 0.08);
}

.action-btn__count {
  font-size: 12px;
  font-weight: 700;
  color: currentColor;
}

.action-icon {
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--mask) center / contain no-repeat;
  mask: var(--mask) center / contain no-repeat;
}

.action-icon[data-icon="like"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 21s-7-4.4-9.5-8.5C.5 9 2.2 6.5 5 6.1c1.7-.2 3.3.6 4.2 2C10.1 6.7 11.7 5.9 13.4 6.1 16.2 6.5 17.9 9 21.5 12.5 19 16.6 12 21 12 21z'/%3E%3C/svg%3E");
}
.action-icon[data-icon="comment"] {
  --mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
}

/* ---------------- Skeleton ---------------- */
.skeleton[hidden] {
  display: none;
}

.skeleton {
  display: grid;
  gap: 12px;
}

.sk-card {
  height: 260px;
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.6)
  );
  background-size: 300% 100%;
  animation: shimmer 1.2s infinite linear;
  border: 1px solid rgba(17, 24, 39, 0.06);
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ---------------- Empty state ---------------- */
.empty[hidden] {
  display: none;
}

.empty {
  margin-top: 14px;
  padding: 18px 14px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.empty__title {
  font-weight: 800;
}

.empty__desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------------- Error banner ---------------- */
.error[hidden] {
  display: none;
}

.error {
  margin: 10px 0 12px;
  padding: 14px 14px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid rgba(255, 153, 28, 0.35);
  box-shadow: var(--shadow);
}

.error__title {
  font-weight: 900;
  color: #9a4f00;
}

.error__desc {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

/* ---------------- Buttons ---------------- */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  border-color: rgba(255, 153, 28, 0.45);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.btn--primary:active {
  background: var(--accent-press);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.72);
}

.btn--sm {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
}

.pre {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fafafa;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 13px;
  color: #111827;
  min-height: 54px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 153, 28, 0.28);
  background: rgba(255, 153, 28, 0.08);
  color: #9a4f00;
  font-weight: 700;
}

/* ---------------- Tabbar ---------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: 72px;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}

.tabbar__item {
  height: 72px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 120ms ease;
  color: #111827;
}

.tabbar__item:active {
  transform: scale(0.98);
}

.tabbar__label {
  font-size: 11px;
  color: var(--muted);
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 0;
  background: var(--accent);
  margin: 0 auto;
  box-shadow: 0 10px 20px rgba(255, 153, 28, 0.28);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.fab:active {
  transform: scale(0.96);
  background: var(--accent-press);
}

.fab__icon {
  width: 24px;
  height: 24px;
  background: #fff;
}

/* ---------------- CTA (Publish + Submit) ---------------- */
.cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.cta__inner {
  max-width: 460px;
  margin: 0 auto;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cta__btn {
  height: 44px;
  font-size: 15px;
  font-weight: 900;
}

.feed-fx {
  position: fixed;
  z-index: 40;
  transform: translate(-50%, -20px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 153, 28, 0.95);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(255, 153, 28, 0.3);
}

.feed-fx--play {
  animation: feedFxPop 1.5s ease forwards;
}

@keyframes feedFxPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -24px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -52px) scale(1.04);
  }
}

.status {
  font-size: 13px;
  font-weight: 900;
  color: #9a4f00;
}

/* ===============================
   Home Refactor (Shoelace + Swiper)
================================== */
.home-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
  background: rgba(255, 252, 246, 0.92);
  border-bottom: 1px solid rgba(237, 189, 120, 0.24);
}

.home-header__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.home-header__title {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #171717;
}

.home-search {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 14px 12px;
}

.search-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  color: #171717;
  cursor: pointer;
}

.search-icon-btn svg {
  width: 20px;
  height: 20px;
}

/* 主舞台：宽屏/折叠屏时不要“死卡”在一条窄列里，同时让吸底 CTA 有边界感 */
#main-stage {
  min-height: 100vh;
}

.home-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 14px 110px;
}

@media (min-width: 820px) {
  body {
    background: radial-gradient(circle at 20% 10%, rgba(255, 153, 28, 0.10), transparent 40%),
      radial-gradient(circle at 80% 30%, rgba(230, 57, 70, 0.08), transparent 45%),
      var(--bg);
  }

  #main-stage {
    max-width: 820px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
  }

  .home-page {
    max-width: 820px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .home-header__inner,
  .home-search {
    max-width: 820px;
  }

  /* 宽屏内容区：热门推荐多列（移动端仍 2 列） */
  #notes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

.hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 360px;
  margin-bottom: 14px;
  box-shadow: 0 12px 28px rgba(193, 72, 19, 0.18);
  border: 1px solid rgba(240, 165, 82, 0.38);
}

/* 背景图层固定在 hero 内，避免跑到其他模块上方 */
.hero-swiper {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-swiper,
.hero-slide {
  width: 100%;
  min-height: 360px;
}

.hero-slide {
  background-size: cover;
  background-position: center;
}

.hero__content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 18px 16px 14px;
  /* 减轻蒙层压黑，让底图更通透 */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(31, 18, 5, 0.52));
  color: #fff;
}

.hero__kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  opacity: 0.92;
}

.hero__title {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.hero__desc {
  margin: 6px 0 0;
  line-height: 1.5;
  font-size: 14px;
}

.hero__actions {
  margin-top: 12px;
}

.hero__cta-group {
  margin-top: 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  gap: 16px;
}

#heroActionBtn,
#heroSubmitBtn {
  width: 40%;
  max-width: 168px;
}

/* CTA 按钮整体更“收” */
#heroActionBtn::part(base),
#heroSubmitBtn::part(base),
.home-footer sl-button::part(base) {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 14px;
}

#heroActionBtn,
#quickPostBtn,
#submitDoBtn,
#submitBtn {
  font-weight: 800;
}

#heroSubmitBtn,
#quickSubmitBtn,
#publishBtn {
  opacity: 0.94;
}

.hero__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.45;
}

.hero__decor {
  position: absolute;
  top: 10px;
  z-index: 3;
  width: 34px;
  color: rgba(255, 244, 226, 0.88);
}

.hero__decor--left {
  left: 10px;
}

.hero__decor--right {
  right: 10px;
}

.home-card {
  border-radius: 16px;
  border: 1px solid rgba(224, 183, 117, 0.28);
  background: #fff;
  box-shadow: 0 4px 16px rgba(180, 132, 54, 0.12);
  padding: 12px;
  margin-bottom: 10px;
}

.home-intro h2,
.recommend h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

/* 活动说明正文更紧凑一些 */
#activityIntro p,
#activityIntro li {
  font-size: 11.5px;
}

/* 第一行（“如何参加｜...”）稍微大一点，但仍尽量不换行 */
#activityIntro p:first-child {
  font-size: 12.5px;
  margin-bottom: 6px;
}

#activityIntro h2,
#activityIntro h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.quick-entry h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.quick-entry__actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.quick-entry .muted-tip {
  margin-top: 8px;
}

.home-intro p {
  margin: 0 0 8px;
  line-height: 1.65;
  color: #3f3f46;
}

/* 活动说明氛围纹理：淡淡红色撒金粉 */
#activityIntroCard {
  background:
    radial-gradient(circle at 18% 22%, rgba(230, 57, 70, 0.10) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 34%, rgba(255, 183, 3, 0.14) 0 2px, transparent 3px),
    radial-gradient(circle at 42% 78%, rgba(230, 57, 70, 0.08) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 86% 76%, rgba(255, 183, 3, 0.10) 0 1.5px, transparent 2.5px),
    linear-gradient(180deg, rgba(255, 246, 230, 0.75), rgba(255, 255, 255, 0.92));
}

#activityIntro ul {
  margin: 8px 0 0 18px;
  padding: 0;
}
#activityIntro li {
  margin: 0 0 6px;
  line-height: 1.6;
  color: #3f3f46;
}
#activityIntro a {
  color: #cd4f07;
  font-weight: 700;
  text-decoration: none;
}
#activityIntro a:active {
  opacity: 0.85;
}

.stats-card h3 {
  margin: 0 0 4px;
  color: #6b3b12;
  font-size: 14px;
}

.stats-main {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

.stats-main span {
  color: #cd4f07;
}

.stats-sub {
  margin: 5px 0;
  font-size: 15px;
}

.recommend__head {
  margin: 4px 0 10px;
}

.recommend-list {
  display: grid;
  gap: 12px;
}

.recommend-card {
  display: grid;
  grid-template-columns: 44% 56%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(228, 188, 124, 0.34);
  background: #fff;
  box-shadow: 0 4px 16px rgba(180, 132, 54, 0.11);
}

.recommend-card__left {
  min-height: 170px;
  background-size: cover;
  background-position: center;
}

.recommend-card__right {
  padding: 12px 12px 10px;
  display: grid;
  gap: 8px;
}

.recommend-card h3 {
  margin: 0;
  color: #121212;
  font-size: 16px;
  line-height: 1.35;
}

.recommend-reason {
  margin: 0;
  color: #44403c;
  font-size: 13px;
  line-height: 1.5;
}

.recommend-metrics {
  margin: 0;
  color: #78716c;
  font-size: 12px;
}

.recommend-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.load-sentinel {
  height: 1px;
}

.end-hint {
  margin-top: 12px;
  margin-bottom: 8px;
  padding: 14px;
  border: 1px dashed rgba(197, 103, 26, 0.45);
  border-radius: 14px;
  background: rgba(255, 246, 230, 0.75);
}

.end-hint p {
  margin: 0;
  color: #7c2d12;
  line-height: 1.6;
}

.hint-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  box-sizing: border-box;
  border-top: 1px solid rgba(201, 157, 93, 0.25);
  background: rgba(255, 252, 247, 0.96);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 10px;
}

.home-footer sl-button {
  width: min(260px, 46vw);
}

/* 宽屏/折叠屏：吸底 CTA 收到主舞台宽度内，形成“有边界”的浮层 */
@media (min-width: 820px) {
  .home-footer {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 820px;
    border-left: 1px solid rgba(201, 157, 93, 0.18);
    border-right: 1px solid rgba(201, 157, 93, 0.18);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    box-shadow: 0 -10px 26px rgba(180, 132, 54, 0.14);
  }
}

.dialog-stack {
  display: grid;
  gap: 12px;
}

.flow-steps {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #7c2d12;
  background: rgba(255, 246, 230, 0.8);
  border: 1px dashed rgba(197, 103, 26, 0.35);
  border-radius: 12px;
  padding: 8px 10px;
}

.dialog-label {
  margin: 0 0 6px;
  font-size: 13px;
  color: #57534e;
  font-weight: 700;
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.emotion-box {
  border: 1px dashed rgba(230, 158, 74, 0.7);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 248, 235, 0.74);
  margin-bottom: 8px;
}

.emotion-box p {
  margin: 0;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.5;
}

.emotion-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.draw-guides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.guide-item {
  border: 1px solid rgba(209, 165, 99, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
  padding: 10px;
  color: #7c3f0f;
}

.guide-item svg {
  width: 84px;
  height: 84px;
}

.guide-item p {
  margin: 2px 0 0;
  font-size: 12px;
}

.gen-result {
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(199, 159, 95, 0.36);
  background: #fffbf2;
  min-height: 76px;
  padding: 10px;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 13px;
}

.tag-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gen-tag {
  background: rgba(240, 130, 40, 0.13);
  border: 1px solid rgba(230, 133, 42, 0.36);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #9a4207;
}

.post-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.muted-tip {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

.dialog-label {
  letter-spacing: 0.2px;
}

.field-error {
  margin: -4px 0 0;
  font-size: 12px;
  color: #d92d20;
  line-height: 1.4;
}

#submitDoBtn[loading],
#generateBtn[loading] {
  opacity: 0.75;
}

.submit-actions {
  display: flex;
  justify-content: center;
}

.submit-success {
  border-top: 1px solid rgba(203, 163, 102, 0.3);
  padding-top: 10px;
}

.submit-success h4 {
  margin: 0 0 6px;
}

.submit-success p {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.5;
}

.mine-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.mine-item {
  border: 1px solid rgba(226, 193, 144, 0.45);
  border-radius: 10px;
  background: #fffefb;
  padding: 8px;
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.sl-toast-stack {
  z-index: 1200;
}

@media (max-width: 560px) {
  .home-header__title {
    font-size: 15px;
  }
  .hero,
  .hero-swiper,
  .hero-slide {
    min-height: 320px;
  }
  .recommend-card {
    grid-template-columns: 1fr;
  }
  .recommend-card__left {
    min-height: 200px;
  }
}

/* 超小屏才改为竖排按钮 */
@media (max-width: 420px) {
  .hero__cta-group {
    grid-auto-flow: row;
    grid-auto-columns: 1fr;
    gap: 10px;
  }
  #heroActionBtn,
  #heroSubmitBtn {
    width: 100%;
  }
  .home-footer {
    justify-content: stretch;
  }
  .home-footer sl-button {
    width: 100%;
  }
}

/* ===============================
   v1.2 Implementation Guide
================================== */
:root {
  --cny-red: #e63946;
  --cny-gold: #ffb703;
  --cny-bg: #fdf5e6;
  --radius-xl: 24px;
}

body {
  background-color: var(--cny-bg) !important;
  margin: 0;
  display: flex;
  justify-content: center;
}

#main-stage {
  width: 100%;
  /* 折叠屏/大屏手机更友好：默认不再死卡 450 */
  max-width: 520px;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
}

.home-header,
.home-footer {
  max-width: 520px;
}

.home-header__title {
  font-size: 16px;
  font-weight: 800;
}

.hero {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(230, 57, 70, 0.2);
  box-shadow: 0 8px 22px rgba(230, 57, 70, 0.14);
}

.hero-slide {
  min-height: 220px;
}

.hero__content {
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.hero__title,
.hero__desc {
  color: #fff;
}

.home-card,
.mascot-wrap sl-card::part(base),
.stats-grid sl-card::part(base) {
  border-radius: var(--radius-xl);
}

.mascot-wrap {
  margin-bottom: 12px;
}

#mascot-container {
  text-align: center;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 183, 3, 0.14), rgba(255, 255, 255, 0.95));
  padding: 12px;
}

#mascot-img {
  width: 120px;
  height: 96px;
  color: #5d2f08;
}

#mascot-img .horse {
  fill: rgba(255, 183, 3, 0.9);
}

#mascot-img .cat {
  fill: #fff;
  stroke: #5d2f08;
  stroke-width: 2.2;
}

#mascot-img .line {
  fill: none;
  stroke: #5d2f08;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#mascot-img .line-fill {
  fill: #5d2f08;
}

#mascot-text {
  margin: 8px 0 10px;
  color: #6b4b2a;
  font-size: 13px;
  font-weight: 700;
}

#mascot-img.is-idle {
  animation: mascotBreath 2.2s ease-in-out infinite;
}

#mascot-img.is-feeding {
  animation: mascotEat 0.35s ease-in-out infinite alternate;
}

#mascot-img.is-success {
  animation: mascotDone 0.45s ease-in-out 2;
}

@keyframes mascotBreath {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-1px) scale(1.02);
  }
}

@keyframes mascotEat {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(1.5px);
  }
}

@keyframes mascotDone {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.stats-grid sl-card::part(base) {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 183, 3, 0.35);
}

.stats-grid p {
  margin: 8px 0 0;
  color: #7c2d12;
  font-weight: 700;
}

#notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notes-section > h2 {
  margin: 0 0 8px;
}

.note-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid #f0e4cf;
  background: #fff;
  width: 100%;
  box-shadow: 0 4px 14px rgba(156, 108, 32, 0.12);
}

.note-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.note-card__link:active {
  opacity: 0.92;
}

.note-card__titlelink {
  text-decoration: none;
  color: inherit;
}

.note-card__titlelink:active {
  opacity: 0.85;
}

.note-card img {
  /* 小红书封面常见为竖图（示例实测 1080x1823 ≈ 3:5） */
  aspect-ratio: 3 / 5;
  object-fit: cover;
  width: 100%;
  display: block;
}

.note-card__body {
  padding: 10px;
}

.note-card__body h3 {
  margin: 0 0 4px;
  color: #101010;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card__body p {
  margin: 0 0 4px;
  font-size: 12px;
  color: #57534e;
  line-height: 1.45;
}

.note-card__body small {
  display: block;
  margin-bottom: 8px;
  color: #78716c;
}

.note-card__actions {
  display: flex;
  gap: 8px;
}

.note-card__actions sl-button {
  flex: 0 0 auto;
  width: 30%;
  min-width: 92px;
}

.mine-zero {
  border: 1px dashed rgba(230, 57, 70, 0.35);
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  color: #9a3412;
}

.mine-zero svg {
  width: 92px;
  height: 62px;
}

@media (max-width: 520px) {
  #main-stage {
    max-width: 100%;
    box-shadow: none;
  }
}

.mine {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.mine__item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  line-height: 1.5;
}

.mine__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mine__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 900;
}

/* ---------------- Modals / Sheets ---------------- */
.modal[hidden],
.sheet[hidden] {
  display: none;
}

.modal,
.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.modal__backdrop,
.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
}

.modal__panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 12px;
}

.modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
}

.modal__counter {
  font-size: 12px;
  opacity: 0.85;
}

.modal__stage {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.modal__img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.modal__hint {
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  padding-bottom: 8px;
}

.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.22);
  padding: 12px 14px 16px;
  max-height: min(86vh, 760px);
  overflow: auto;
}

.sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0 10px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.sheet__title {
  font-weight: 900;
  font-size: 15px;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 420px) {
  .form {
    grid-template-columns: 1fr;
  }
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  outline: none;
  font-size: 14px;
  background: #fff;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 153, 28, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 153, 28, 0.16);
}

.sheet__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.result__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activity.card {
  padding: 0;
}

.activity__head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.activity__title {
  font-weight: 950;
  font-size: 18px;
}

.activity__sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.activity__body {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #374151;
}

.activity__body p {
  margin: 0 0 10px;
}

.activity__cta {
  padding: 0 14px 14px;
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
