/* 乡赛汇平台 UI v2 — 产品级布局（浅米底、白卡片、双栏、智助手） */

:root {
  --xsh-red: #9f0f1b;
  --xsh-red-light: #c21f32;
  --xsh-page-bg: #f7f3ee;
  --xsh-card-bg: #ffffff;
  --xsh-border: rgba(159, 15, 27, 0.1);
  --xsh-shadow: 0 4px 20px rgba(30, 20, 20, 0.06);
  --xsh-inner: min(1360px, calc(100vw - 64px));
}

body[data-page="events"],
body[data-page="homestays"],
body[data-page="routes"],
body[data-page="redspots"],
body[data-page="study"] {
  background: var(--xsh-page-bg);
  font-family: "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif;
}

/* 顶栏 v2 */
.topbar--v2 {
  min-height: 68px;
  padding: 0 clamp(16px, 3vw, 40px);
  background: linear-gradient(90deg, #9f0f1b 0%, #b81828 45%, #c21f32 100%);
  box-shadow: 0 2px 12px rgba(80, 10, 20, 0.25);
  gap: 1rem;
}
.topbar--v2 .topbar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
}
.topbar--v2 .logo {
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
}
.topbar--v2 .topbar-sub {
  font-size: 0.68rem;
  opacity: 0.88;
  font-family: system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.topbar--v2 #main-nav {
  flex: 1;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.topbar--v2 #main-nav a {
  padding: 0.45rem 0.85rem;
  font-size: 0.92rem;
  border-radius: 8px;
  white-space: nowrap;
}
.topbar--v2 #main-nav a.active {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 -2px 0 #fff;
}
.topbar--v2 .topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.topbar--v2 .topbar-username {
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}
.topbar-logout {
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  white-space: nowrap;
  transition: background 0.15s;
}
.topbar-logout:hover {
  background: rgba(255, 255, 255, 0.28);
}
.topbar--v2 .topbar-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  font-family: system-ui, sans-serif;
}
.topbar--v2 .topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--xsh-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.topbar--v2 .role-tag { display: none; }
body.role-personal #main-nav a[href="./study.html"] { display: none !important; }

/* 顶栏升级前避免旧布局闪一下 */
body:not([data-page="landing"]):not([data-page="gov"]) .topbar:not(.topbar--v2) {
  min-height: 68px;
  background: linear-gradient(90deg, #9f0f1b 0%, #c21f32 100%);
}
body:not([data-page="landing"]):not([data-page="gov"]) .topbar:not(.topbar--v2) .logo,
body:not([data-page="landing"]):not([data-page="gov"]) .topbar:not(.topbar--v2) #main-nav,
body:not([data-page="landing"]):not([data-page="gov"]) .topbar:not(.topbar--v2) .role-tag {
  visibility: hidden;
}

/* 全站用户通知条（顶栏下方，各页面统一） */
.platform-notice-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
  background: #fff7e6;
  border-bottom: 1px solid #ffe7ba;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #874d00;
  flex-shrink: 0;
}
.platform-notice-bar__icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}
.platform-notice-bar__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.platform-notice-bar__close {
  flex: 0 0 auto;
  margin-left: 0.35rem;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #b0883d;
  padding: 0 0.2rem;
}
.platform-notice-bar__close:hover {
  color: #874d00;
}
body.has-notice-bar main.page-shell .page-inner {
  padding-top: 0.75rem;
}
body.has-notice-bar main.study-program-main .study-program-intro {
  padding-top: 0.35rem;
}

.route-map-host {
  width: 100%;
  margin-bottom: 1.25rem;
}
.route-map-host .route-map-panel--hero + .route-map-panel--hero {
  margin-top: 1.25rem;
}
.route-timeline-panel {
  min-height: auto;
}
body[data-page="routes"] .route-line-intro {
  margin-bottom: 1rem;
}
body[data-page="routes"] #route-content > h3 {
  margin-top: 1.5rem;
}

.xsh-ai-fab--v2 {
  width: 60px;
  height: 60px;
  animation: none;
  box-shadow: 0 6px 22px rgba(159, 15, 27, 0.38);
}
.xsh-ai-fab--v2 .xsh-ai-fab-svg {
  color: #fff;
  display: block;
}
#xsh-ai-root {
  right: 20px;
  bottom: 20px;
  left: auto !important;
  top: auto !important;
}

/* 页面壳 */
.page-shell {
  position: relative;
  padding-bottom: 2.5rem;
}
.page-scenery {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 200px;
  background:
    linear-gradient(180deg, rgba(247, 243, 238, 0) 0%, var(--xsh-page-bg) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath fill='%23e8ddd0' fill-opacity='0.45' d='M0 80 L200 60 L400 90 L600 50 L800 75 L1000 55 L1200 85 L1200 120 L0 120Z'/%3E%3Cpath fill='%23d4c4b0' fill-opacity='0.3' d='M0 95 L300 70 L600 100 L900 65 L1200 90 L1200 120 L0 120Z'/%3E%3C/svg%3E")
      center bottom / 100% 100% no-repeat;
  opacity: 0.9;
  z-index: 0;
}
.page-inner {
  position: relative;
  z-index: 1;
  width: var(--xsh-inner);
  margin: 0 auto;
  padding: 1.25rem 0 0;
}
.page-header {
  margin-bottom: 1.25rem;
}
.page-header h1 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  color: #1a1a1a;
  font-weight: 700;
}
.page-header-accent {
  width: 5px;
  height: 1.15em;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--xsh-red), var(--xsh-red-light));
  flex-shrink: 0;
}
.page-header-sub {
  margin: 0 0 0 1.1rem;
  font-size: 0.95rem;
  color: #666;
  font-family: system-ui, sans-serif;
}

/* 数据区：无大粉盒 */
.platform-dashboard {
  margin-bottom: 1.25rem;
}
.platform-section,
.platform-dashboard.platform-section {
  width: 100%;
  max-width: none;
  margin: 0 0 1.25rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.platform-stats--v2 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.platform-stat-card--v2 {
  background: var(--xsh-card-bg);
  border-radius: 16px;
  border: 1px solid var(--xsh-border);
  box-shadow: var(--xsh-shadow);
  padding: 0;
  min-height: 118px;
}
.platform-stat-card--v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 20, 20, 0.08);
}
.platform-stat-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  height: 100%;
}
.platform-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon--red { background: #fde8ea; }
.stat-icon--orange { background: #fff3e6; }
.stat-icon--blue { background: #e8f4ff; }
.stat-icon--green { background: #e8f8ef; }
.platform-stat-card--v2 .platform-stat-label {
  margin: 0;
  font-size: 0.8rem;
  color: #888;
  font-family: system-ui, sans-serif;
}
.platform-stat-card--v2 .platform-stat-value {
  margin: 0.2rem 0 0;
  font-size: clamp(1.65rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--xsh-red);
  line-height: 1.1;
}
.platform-stat-unit {
  font-size: 0.95rem;
  font-weight: 600;
  margin-left: 0.15rem;
}
.platform-stat-card--v2 .platform-stat-sub {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #52c41a;
  font-family: system-ui, sans-serif;
}
.platform-stat-sub.is-muted { color: #aaa; }

/* 筛选条 */
.platform-filter-bar--v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.1rem;
  min-height: 68px;
  background: var(--xsh-card-bg);
  border-radius: 14px;
  border: 1px solid var(--xsh-border);
  box-shadow: var(--xsh-shadow);
  margin-bottom: 1.25rem;
}
.platform-filter-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex: 1;
  min-width: 0;
}
.platform-filter-bar--v2 label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: #555;
  font-family: system-ui, sans-serif;
  white-space: nowrap;
}
.platform-filter-bar--v2 select {
  height: 40px;
  min-width: 7.5rem;
  padding: 0 0.65rem;
  border-radius: 10px;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  font-size: 0.86rem;
  font-family: inherit;
  color: #333;
}
.platform-filter-reset {
  flex-shrink: 0;
  height: 40px;
  padding: 0 1rem;
  border-radius: 10px;
  border: 1px solid var(--xsh-border);
  background: #fff;
  color: var(--xsh-red);
  font-size: 0.86rem;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: background 0.15s, border-color 0.15s;
}
.platform-filter-reset:hover {
  background: #fff6f6;
  border-color: var(--xsh-red);
}

/* 双栏 */
.platform-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 24px;
  align-items: start;
}
.platform-main-col { min-width: 0; }
.platform-side-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 84px;
}

.section-block {
  background: var(--xsh-card-bg);
  border-radius: 18px;
  border: 1px solid var(--xsh-border);
  box-shadow: var(--xsh-shadow);
  padding: 1.25rem 1.35rem 1.35rem;
  margin-bottom: 1.25rem;
}
.section-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.section-block-head h2 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1a1a1a;
}
.section-block-head h2 .accent,
.section-block-head .page-header-accent {
  width: 4px;
  height: 1em;
  border-radius: 2px;
  background: var(--xsh-red);
}

.content-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.content-tabs button {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #e8e8e8;
  background: #fafafa;
  color: #666;
  font-size: 0.84rem;
  cursor: pointer;
  font-family: system-ui, sans-serif;
}
.content-tabs button.active {
  background: var(--xsh-red);
  border-color: var(--xsh-red);
  color: #fff;
}

/* 赛事网格 */
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.event-card--grid {
  min-width: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--xsh-border);
  box-shadow: var(--xsh-shadow);
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.event-card--grid:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(30, 20, 20, 0.1);
}
.event-card--grid img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  height: auto !important;
  max-height: none !important;
  border-radius: 0;
  background: #eee;
}
.event-card--grid .event-content {
  padding: 0.85rem 1rem 1rem;
}
.event-card--grid h3 {
  font-size: 1rem;
  margin: 0.35rem 0 0.4rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-card--grid .event-content > p:not(.event-enroll) {
  font-size: 0.82rem;
  color: #777;
  margin: 0.25rem 0;
}
.event-card--grid .btn-row {
  margin-top: 0.65rem;
  gap: 0.45rem;
}
.event-card--grid .btn-row .btn-primary,
.event-card--grid .btn-row .btn-light {
  flex: 1;
  font-size: 0.82rem;
  padding: 0.45rem 0.5rem;
}

/* 侧栏卡片 */
.sidebar-card {
  padding: 1.1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--xsh-border);
  box-shadow: var(--xsh-shadow);
  background: var(--xsh-card-bg);
}
.sidebar-card-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: var(--xsh-red);
}
.sidebar-card .platform-insight {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.sidebar-mini-event {
  display: flex;
  gap: 0.65rem;
  margin: 0.75rem 0;
  padding: 0.65rem;
  background: #faf8f6;
  border-radius: 12px;
  border: 1px solid #eee;
}
.sidebar-mini-event img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.sidebar-mini-event strong {
  font-size: 0.88rem;
  line-height: 1.35;
  display: block;
  margin-bottom: 0.25rem;
}
.sidebar-mini-event p {
  margin: 0;
  font-size: 0.78rem;
  color: #888;
}
.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-links li {
  border-bottom: 1px solid #f0f0f0;
}
.sidebar-links a,
.sidebar-links button.linkish {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0;
  color: #444;
  text-decoration: none;
  font-size: 0.88rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-links a:hover { color: var(--xsh-red); }

.mini-calendar {
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
}
.mini-calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}
.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.mini-calendar-grid span {
  padding: 0.35rem 0;
  border-radius: 6px;
  color: #666;
}
.mini-calendar-grid span.has-event {
  position: relative;
  font-weight: 600;
  color: var(--xsh-red);
}
.mini-calendar-grid span.has-event::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--xsh-red);
}
.mini-calendar-grid span.today {
  background: #fde9ea;
}

.past-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 1rem;
}
.past-stat-item {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: #faf8f6;
  border-radius: 12px;
  border: 1px solid #eee;
}
.past-stat-item strong {
  display: block;
  font-size: 1.15rem;
  color: var(--xsh-red);
}
.past-stat-item span {
  font-size: 0.75rem;
  color: #888;
  font-family: system-ui, sans-serif;
}

body[data-page="homestays"] .home-card img,
body[data-page="redspots"] .spot-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  height: auto !important;
}

.study-sidebar .study-toc a {
  display: block;
  padding: 0.4rem 0;
  color: #555;
  text-decoration: none;
  font-size: 0.86rem;
  border-bottom: 1px solid #f0f0f0;
}
.study-sidebar .study-toc a:hover { color: var(--xsh-red); }
.study-program-main .study-route-pane {
  width: 100%;
  margin: 0;
}
.study-two-col { margin-top: 0; }

.platform-insight--compact .platform-insight-head { margin-bottom: 0.35rem; }
.platform-insight--compact .platform-insight-badge { font-size: 0.68rem; }

/* 弱化旧版大粉盒 */
body[data-page] .platform-section:not(.platform-dashboard) {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
}
body[data-page="homestays"] .homestay-section > h2,
body[data-page="redspots"] .section > h2 {
  display: none;
}

.events-live-note {
  width: 100%;
  margin: 0 0 1rem;
  font-size: 0.82rem;
}

body[data-page="events"] .hero {
  min-height: 220px;
  max-height: 280px;
}

/* 智助手 v2 */
#xsh-ai-root {
  position: fixed;
  z-index: 600;
  right: 24px;
  bottom: 24px;
}
#xsh-ai-root.is-dragging { user-select: none; }
.xsh-ai-fab-wrap {
  position: relative;
}
.xsh-ai-bubble {
  position: absolute;
  right: calc(100% + 12px);
  bottom: 50%;
  transform: translateY(50%);
  white-space: nowrap;
  padding: 0.5rem 0.85rem;
  background: #fff;
  color: #333;
  font-size: 0.82rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--xsh-border);
  font-family: system-ui, sans-serif;
  animation: xsh-bubble-in 0.35s ease;
}
.xsh-ai-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #fff;
}
.xsh-ai-bubble.hidden { display: none; }
@keyframes xsh-bubble-in {
  from { opacity: 0; transform: translateY(50%) translateX(8px); }
  to { opacity: 1; transform: translateY(50%) translateX(0); }
}
.xsh-ai-fab--v2 {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #c21f32, #9f0f1b);
  color: #fff;
  box-shadow: 0 6px 22px rgba(159, 15, 27, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.xsh-ai-fab--v2 .xsh-ai-fab-svg {
  color: #fff;
  display: block;
}
.xsh-ai-panel--v2 {
  position: fixed;
  width: min(400px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--xsh-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 601;
}
.xsh-ai-panel--v2.hidden { display: none !important; }
.xsh-ai-panel-head--v2 {
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, #9f0f1b, #c21f32);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.xsh-ai-panel-head--v2 strong {
  display: block;
  font-size: 1rem;
}
.xsh-ai-panel-head--v2 small {
  display: block;
  font-size: 0.72rem;
  opacity: 0.9;
  margin-top: 0.15rem;
  font-weight: 400;
}
.xsh-ai-head-actions {
  display: flex;
  gap: 0.35rem;
}
.xsh-ai-head-actions button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.xsh-ai-messages--v2 {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-size: 0.88rem;
  background: #fafafa;
}
.xsh-ai-welcome {
  margin: 0;
  line-height: 1.6;
  color: #555;
}
.xsh-ai-quick--v2 {
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  border-top: 1px solid #eee;
  background: #fff;
}
.xsh-ai-qbtn {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(159, 15, 27, 0.2);
  background: #fff;
  color: var(--xsh-red);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: system-ui, sans-serif;
}
.xsh-ai-qbtn:hover { background: #fff6f6; }
.xsh-ai-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid #eee;
  background: #fff;
}
.xsh-ai-input-row input {
  flex: 1;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  padding: 0 1rem;
  font-size: 0.86rem;
  font-family: system-ui, sans-serif;
}
.xsh-ai-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #c21f32, #9f0f1b);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.xsh-ai-messages--v2 .xsh-ai-msg { margin-bottom: 0.65rem; padding: 0.6rem 0.75rem; border-radius: 12px; line-height: 1.5; }
.xsh-ai-messages--v2 .xsh-ai-msg--user { background: #fde9ea; color: #333; margin-left: 1.5rem; }
.xsh-ai-messages--v2 .xsh-ai-msg--bot { background: #fff; border: 1px solid #eee; margin-right: 0.5rem; }
.xsh-ai-messages--v2 .xsh-ai-msg--bot p { margin: 0.35rem 0 0; }
.xsh-ai-messages--v2 .xsh-ai-msg--bot small { display: block; margin-top: 0.35rem; color: #999; font-size: 0.72rem; }

@media (max-width: 1100px) {
  .platform-two-col {
    grid-template-columns: 1fr;
  }
  .platform-side-col {
    position: static;
  }
  .events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  :root { --xsh-inner: calc(100vw - 32px); }
  .platform-stats--v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .events-grid,
  body[data-page="homestays"] .homestay-grid,
  body[data-page="redspots"] #red-spot-grid {
    grid-template-columns: 1fr;
  }
  .topbar--v2 #main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #9f0f1b;
    flex-direction: column;
    padding: 0.75rem;
  }
  .topbar--v2 #main-nav.show { display: flex; }
  .topbar--v2 .menu-toggle { display: block; }
  .past-stats-bar { grid-template-columns: repeat(2, 1fr); }
  #xsh-ai-root.is-mobile-fixed {
    right: 16px !important;
    bottom: 16px !important;
    left: auto !important;
    top: auto !important;
  }
}
@media (max-width: 480px) {
  .platform-stats--v2 { grid-template-columns: 1fr; }
}
