body.home-page {
  padding: 0;
  overflow-x: hidden;
  background: var(--shell-bg, var(--bg));
}

/* 动效加载前：隐藏主内容，避免刷新/登录后排版闪动 */
@media (prefers-reduced-motion: no-preference) {
  html.home-motion-pending body.home-page .home-sidebar,
  html.home-motion-pending body.home-page .home-main {
    opacity: 0;
    visibility: hidden;
  }

  html.home-motion-pending body.home-page .home-ref-level,
  html.home-motion-pending body.home-page .journey-item,
  html.home-motion-pending body.home-page .journey-ring-item,
  html.home-motion-pending body.home-page .home-ref-stats article {
    opacity: 0;
  }
}

html.home-motion-ready body.home-page .home-sidebar,
html.home-motion-ready body.home-page .home-main {
  visibility: visible;
}

html.home-motion-fallback body.home-page .home-sidebar,
html.home-motion-fallback body.home-page .home-main {
  opacity: 1;
  visibility: visible;
}

body.home-page .page {
  max-width: none;
  margin: 0;
}

.home-shell {
  position: relative;
  min-height: 100vh;
  background: var(--shell-bg, var(--bg));
}

:root {
  --home-sidebar-width: 243px;
  --home-sidebar-inset-left: 18px;
  --home-main-offset: 285px;
}

.home-sidebar {
  position: fixed;
  inset: 21px auto 21px var(--home-sidebar-inset-left);
  width: var(--home-sidebar-width);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--sidebar-bg);
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 5px 5px 14px rgba(28, 42, 58, 0.14);
  transition: transform 0.26s ease, opacity 0.2s ease, visibility 0.26s;
}

html.is-sidebar-collapsed body.home-page .home-sidebar {
  transform: translateX(calc(-100% - 36px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.home-sidebar::before {
  content: "";
  position: absolute;
  inset: 56px 0 0;
  border-radius: 24px;
  background: #fff;
  z-index: 1;
}

.sidebar-topbar {
  position: relative;
  height: 78px;
  flex: 0 0 78px;
  background: var(--sidebar-bg);
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  z-index: 0;
}

.sidebar-title-tab {
  position: absolute;
  left: 21px;
  top: 22px;
  width: auto;
  height: 30px;
  display: flex;
  align-items: center;
  padding-left: 0;
  background: transparent;
  color: #fff;
  clip-path: none;
  filter: none;
  z-index: 2;
}

.sidebar-title-tab h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: var(--fs-card-title);
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-top-actions {
  position: absolute;
  right: 15px;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  z-index: 3;
}

.sidebar-notice-dot {
  display: none;
  position: absolute;
  right: 1px;
  top: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px var(--panel, #fff);
  pointer-events: none;
  z-index: 2;
}

.sidebar-icon-btn {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transform: perspective(1px) translateZ(0);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.sidebar-icon-btn img,
.sidebar-icon-btn .sidebar-theme-icon {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.sidebar-top-actions .sidebar-icon-btn:hover,
.sidebar-top-actions .sidebar-icon-btn:focus-visible {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 7px 8px rgba(var(--primary-shadow-rgb), 0.22));
  outline: none;
}

.sidebar-top-actions .sidebar-icon-btn:hover img,
.sidebar-top-actions .sidebar-icon-btn:focus-visible img,
.sidebar-top-actions .sidebar-icon-btn:hover .sidebar-theme-icon,
.sidebar-top-actions .sidebar-icon-btn:focus-visible .sidebar-theme-icon {
  transform: scale(1.03);
  filter: drop-shadow(0 2px 3px rgba(var(--primary-shadow-rgb), 0.16));
}

.sidebar-profile-stack {
  position: relative;
  z-index: 2;
  margin: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-ear-switch {
  display: grid;
  gap: 6px;
}

.sidebar-ear-label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  color: #6b6b65;
}

.sidebar-ear-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  isolation: isolate;
}

.sidebar-ear-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(33.333% - 2px);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(0);
  transition: transform 0.46s cubic-bezier(0.34, 1.28, 0.64, 1);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.sidebar-ear-toggle[data-ear="right"] .sidebar-ear-thumb {
  transform: translateX(calc(100% + 2px));
}

.sidebar-ear-toggle[data-ear="both"] .sidebar-ear-thumb {
  transform: translateX(calc(200% + 4px));
}

.sidebar-ear-toggle--dual .sidebar-ear-thumb {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: auto;
  height: auto;
  min-height: 34px;
  margin: 0;
  grid-row: 1;
  grid-column: 1;
  align-self: stretch;
  transform: none !important;
  transition: grid-column 0.46s cubic-bezier(0.34, 1.28, 0.64, 1);
}

.sidebar-ear-toggle--dual[data-ear="right"] .sidebar-ear-thumb {
  grid-column: 2;
}

.sidebar-ear-toggle--dual[data-ear="left"] .sidebar-ear-thumb {
  grid-column: 1;
}

.sidebar-ear-toggle--dual .sidebar-ear-option {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  padding: 0;
}

.sidebar-ear-toggle--dual .sidebar-ear-option[data-ear="left"] {
  grid-column: 1;
}

.sidebar-ear-toggle--dual .sidebar-ear-option[data-ear="right"] {
  grid-column: 2;
}

.sidebar-ear-option {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 5px 0;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--sub-text);
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.32s ease, transform 0.18s ease;
}

.sidebar-ear-option.is-active {
  color: #fff;
}

.sidebar-ear-option:not(.is-active):hover {
  color: var(--primary);
}

.sidebar-ear-option:active {
  transform: scale(0.97);
}

.sidebar-user-row {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
}

.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 8px 36px 8px 10px;
  border: 1px solid var(--user-link-border);
  border-radius: 10px;
  background: var(--user-link-bg);
  color: inherit;
  text-decoration: none;
  transform: perspective(1px) translateZ(0);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  position: relative;
  box-sizing: border-box;
}

.sidebar-user-link:hover,
.sidebar-user-link[aria-current="page"],
.sidebar-user-link:focus-visible {
  border-color: var(--primary);
  background: var(--primary-surface);
  box-shadow: 0 8px 14px rgba(var(--primary-shadow-rgb), 0.16);
  transform: translateY(-2px) scale(1.01);
  outline: none;
}

.sidebar-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  display: block;
  background: var(--primary-surface);
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  z-index: 2;
  isolation: isolate;
}

.sidebar-user-avatar:hover,
.sidebar-user-avatar:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(var(--primary-rgb), 0.35);
  outline: none;
}

.sidebar-user-avatar-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(31, 45, 61, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  box-shadow: 0 6px 16px rgba(31, 45, 61, 0.18);
  z-index: 6;
}

.sidebar-user-avatar-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(31, 45, 61, 0.92);
}

.sidebar-user-avatar:hover .sidebar-user-avatar-tip,
.sidebar-user-avatar:focus-visible .sidebar-user-avatar-tip {
  opacity: 1;
  visibility: visible;
}

.sidebar-user-avatar img,
.sidebar-user-avatar .sidebar-default-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: block;
  border-radius: inherit;
}

.sidebar-user-avatar img {
  object-fit: cover;
}

.sidebar-user-avatar img[hidden],
.sidebar-user-avatar .sidebar-default-avatar[hidden] {
  display: none !important;
}

.sidebar-user-avatar img.is-custom-avatar {
  object-fit: cover;
  z-index: 1;
}

.sidebar-user-avatar .sidebar-default-avatar {
  z-index: 0;
}

.sidebar-avatar-menu {
  position: fixed;
  z-index: 1200;
  min-width: 112px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  box-shadow: 0 10px 24px rgba(31, 45, 61, 0.16);
}

.sidebar-avatar-menu-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1f2d3d;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.sidebar-avatar-menu-item:hover,
.sidebar-avatar-menu-item:focus-visible {
  background: var(--primary-surface);
  outline: none;
}

.sidebar-avatar-menu-item[data-action="reset"] {
  color: var(--primary-strong);
}

.sidebar-user-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #1f2d3d;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-hint {
  font-size: 11px;
  color: var(--primary-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-achievement-link {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  transform: translateY(-50%);
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.sidebar-achievement-link img,
.sidebar-achievement-link .sidebar-theme-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.sidebar-achievement-link:hover,
.sidebar-achievement-link[aria-current="page"],
.sidebar-achievement-link:focus-visible {
  background: var(--primary-surface);
  transform: translateY(calc(-50% - 2px)) scale(1.05);
  filter: drop-shadow(0 4px 6px rgba(var(--primary-shadow-rgb), 0.18));
  outline: none;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 0 20px 0 21px;
  position: relative;
  z-index: 1;
}

.sidebar-nav-item[hidden],
.bottom-nav-item[hidden] {
  display: none !important;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: calc(100% + 16px);
  height: 42px;
  margin: 0 -8px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #303030;
  text-decoration: none;
  font: inherit;
  font-size: var(--fs-body);
  line-height: 42px;
  cursor: pointer;
  transition: color 0.24s cubic-bezier(0.2, 0, 0.2, 1),
    transform 0.24s cubic-bezier(0.2, 0, 0.2, 1),
    background 0.24s cubic-bezier(0.2, 0, 0.2, 1),
    box-shadow 0.24s cubic-bezier(0.2, 0, 0.2, 1);
}

.sidebar-nav-item::after {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid #7a7a7a;
  border-right: 2px solid #7a7a7a;
  transform: rotate(45deg);
  margin-right: 3px;
}

.sidebar-nav-item:hover,
.sidebar-nav-item[aria-current="page"] {
  background: var(--nav-hover-bg);
  border-color: transparent;
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 6px rgba(var(--primary-rgb), 0.16);
}

.sidebar-nav-item:hover::after,
.sidebar-nav-item[aria-current="page"]::after {
  border-color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
  padding: 0 0 0 0;
}

.sidebar-exit-btn {
  width: 52px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0 8px 0 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transform: perspective(1px) translateZ(0);
  transition: background 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

.sidebar-exit-btn img,
.sidebar-exit-btn .sidebar-theme-icon {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.sidebar-exit-btn:hover,
.sidebar-exit-btn:focus-visible {
  background: var(--primary-soft);
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 7px 8px rgba(var(--primary-shadow-rgb), 0.22));
  outline: none;
}

.sidebar-exit-btn:hover img,
.sidebar-exit-btn:focus-visible img,
.sidebar-exit-btn:hover .sidebar-theme-icon,
.sidebar-exit-btn:focus-visible .sidebar-theme-icon {
  transform: scale(1.03);
  filter: drop-shadow(0 2px 3px rgba(var(--primary-shadow-rgb), 0.16));
}

.home-main {
  margin-left: var(--home-main-offset);
  padding: 20px;
  min-width: 0;
  transition: margin-left 0.26s ease;
}

html.is-sidebar-collapsed body.home-page .home-main {
  margin-left: 20px;
}

.sidebar-collapse-toggle {
  position: fixed;
  z-index: 30;
  top: 50%;
  left: calc(var(--home-sidebar-inset-left) + var(--home-sidebar-width) + 8px);
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 30px;
  min-height: 72px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: 0 14px 14px 0;
  background: var(--panel);
  color: var(--sub-text);
  box-shadow: 2px 0 10px rgba(28, 42, 58, 0.08);
  cursor: pointer;
  transition: left 0.26s ease, border-radius 0.2s ease, background 0.18s ease, color 0.18s ease;
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus-visible {
  background: var(--primary-soft);
  color: var(--primary);
  outline: none;
}

.sidebar-collapse-toggle-icon {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-135deg);
  transition: transform 0.2s ease;
}

html.is-sidebar-collapsed .sidebar-collapse-toggle {
  left: 10px;
  border-radius: 14px;
}

html.is-sidebar-collapsed .sidebar-collapse-toggle-icon {
  transform: rotate(45deg);
}

.sidebar-collapse-toggle-text {
  font-size: 0.68rem;
  line-height: 1.2;
  writing-mode: vertical-rl;
  letter-spacing: 0.08em;
}

.home-main:has(.home-ref-grid) {
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Two-column flex layout: columns stretch to equal height */
.home-ref-grid {
  position: relative;
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex: 1;
  min-height: calc(100vh - 40px);
}

.home-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.home-col-left  { flex: 1.4; }
.home-col-right { flex: 1; }

.home-ref-progress,
.home-ref-journey,
.home-ref-heatmap,
.home-ref-growth {
  position: relative;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(var(--primary-shadow-rgb), 0.12), 0 2px 6px rgba(var(--primary-shadow-rgb), 0.08);
}

.home-ref-progress {
  margin-top: 40px; /* 「我的康复进度」垂直位置：增大=下移，减小/0=上移 */
  height: 192px;
  min-height: 192px;
  background: var(--progress-card-bg);
  overflow: hidden;
  transition: background 0.45s ease;
}

.home-ref-progress[data-progress-skin="sky"] {
  background: linear-gradient(145deg, #eef6fc 0%, #d4e8f7 42%, #b8d4ef 100%);
}

.home-ref-progress[data-progress-skin="meadow"] {
  background: linear-gradient(145deg, #edf7f0 0%, #cfe8d6 45%, #a8d4b8 100%);
}

.home-ref-progress[data-progress-skin="lavender"] {
  background: linear-gradient(145deg, #f3effa 0%, #ddd0f0 45%, #c4b0e4 100%);
}

.home-ref-progress[data-progress-skin="amber"] {
  background: linear-gradient(145deg, #fff8ec 0%, #fde8c4 45%, #f5d49a 100%);
}

.home-ref-progress[data-progress-skin="rose"] {
  background: linear-gradient(145deg, #fff0f2 0%, #f8d0d8 45%, #e8a8b8 100%);
}

.home-ref-progress[data-progress-skin="ocean"] {
  background: linear-gradient(145deg, #e8f4fa 0%, #a8cce8 48%, #6a9ec8 100%);
}

.home-ref-progress[data-progress-skin="dawn"] {
  background: linear-gradient(145deg, #fff5ee 0%, #ffd4b8 45%, #ffc8a0 100%);
}

.home-ref-progress[data-progress-skin="forest"] {
  background: linear-gradient(145deg, #eef5ee 0%, #b8d4b0 45%, #88b080 100%);
}

.home-ref-progress[data-progress-skin="dusk"] {
  background: linear-gradient(145deg, #f3eef8 0%, #c9b0e0 45%, #a888c8 100%);
}

.home-ref-progress[data-progress-skin="aurora"] {
  background: linear-gradient(145deg, #e8faf5 0%, #88d4c8 48%, #68b0c0 100%);
}

.home-ref-progress[data-progress-skin="starlight"] {
  background: linear-gradient(145deg, #1a2840 0%, #2d4a70 48%, #5080b0 100%);
  color: #e8f0fa;
}

.home-ref-progress[data-progress-skin="zenith"] {
  background: linear-gradient(145deg, #fff8e8 0%, #e8c878 42%, #d0a848 100%);
}

.home-ref-tab,
.home-ref-section-tab {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 148px;
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-radius: 7px 0 7px 0;
  background: #fff;
  color: var(--primary-muted);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.home-ref-tab h2,
.home-ref-section-tab h2 {
  margin: 0;
  font-size: var(--fs-card-title);
  line-height: 1;
}

.home-ref-progress-main {
  position: absolute;
  left: 26px;
  right: 230px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-ref-level {
  align-self: flex-start;
  min-width: 76px;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary-strong);
  color: #fff;
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.28);
}

.home-ref-level strong {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}

.home-ref-progress-line {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(var(--primary-shadow-rgb), 0.08);
}

.home-ref-progress-line span {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--progress-bar-start), var(--progress-bar-end));
  border-radius: inherit;
  will-change: width;
}

.home-ref-progress-shimmer {
  position: absolute;
  inset: 0 auto 0 -45%;
  width: 45%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.65) 50%,
    transparent 100%
  );
  pointer-events: none;
  opacity: 0;
}

.home-ref-progress-line span.is-animating .home-ref-progress-shimmer {
  animation: home-progress-shimmer 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.home-ref-progress-line span.is-filled {
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.35);
}

@keyframes home-progress-shimmer {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: translateX(calc(100vw * 0.28));
    opacity: 0;
  }
}

.home-ref-exp {
  margin: 0;
  color: var(--primary-muted);
  font-size: var(--fs-body);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.home-ref-stats {
  position: absolute;
  right: 28px;
  top: 16px;
  display: flex;
  gap: 12px;
}

.home-ref-stats article {
  width: 92px;
  height: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  box-sizing: border-box;
  border-radius: 16px;
  background: #fff;
  color: var(--primary-muted);
  box-shadow: 4px 8px 18px rgba(var(--primary-shadow-rgb), 0.2);
  overflow: hidden;
}

.home-ref-stats article:first-child {
  background: var(--primary-strong);
  color: #fff;
}

.home-ref-stats span {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: calc(var(--fs-caption) * 0.92);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  text-align: center;
  word-break: keep-all;
  overflow: hidden;
  color: var(--primary-muted);
}

.home-ref-stats article:first-child span {
  color: rgba(255, 255, 255, 0.86);
}

.home-ref-stats strong {
  display: block;
  width: 100%;
  min-height: 1em;
  min-width: 2ch;
  font-size: clamp(1.75rem, 4.2vw, 2.25rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  flex-shrink: 0;
}

.home-ref-stat-duration {
  position: relative;
}

.home-ref-stat-duration .home-ref-stat-unit {
  position: absolute;
  right: 8px;
  bottom: 7px;
  font-size: calc(var(--fs-caption) * 0.68);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.home-ref-hidden-value {
  display: none;
}

.home-progress-action-btn {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
  transform: perspective(1px) translateZ(0);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.home-progress-action-icon {
  width: 36px;
  height: 36px;
  display: block;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.home-progress-action-btn:hover,
.home-progress-action-btn:focus-visible {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 7px 8px rgba(var(--primary-shadow-rgb), 0.22));
  outline: none;
}

.home-progress-action-btn:hover .home-progress-action-icon,
.home-progress-action-btn:focus-visible .home-progress-action-icon {
  transform: scale(1.03);
  filter: drop-shadow(0 2px 3px rgba(var(--primary-shadow-rgb), 0.16));
}

.home-progress-skin-overlay .home-progress-skin-dialog {
  width: min(520px, 100%);
}

.home-progress-skin-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-progress-skin-lead {
  margin: 0;
  font-size: var(--fs-body-sm);
  color: var(--sub-text);
  line-height: 1.55;
}

.home-progress-skin-level-hint {
  margin: 0;
  font-size: var(--fs-body-sm);
  font-weight: 700;
  color: var(--primary-muted);
}

.home-progress-skin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-progress-skin-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-light);
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.home-progress-skin-option:hover:not(:disabled) {
  border-color: var(--primary-soft);
  transform: translateY(-1px);
}

.home-progress-skin-option.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.2);
}

.home-progress-skin-option.is-locked {
  opacity: 0.62;
  cursor: not-allowed;
}

.home-progress-skin-preview {
  flex-shrink: 0;
  width: 52px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(var(--primary-shadow-rgb), 0.12);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45);
}

.home-progress-skin-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-progress-skin-name {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  color: var(--text);
}

.home-progress-skin-tag {
  font-size: calc(var(--fs-caption) * 0.95);
  color: var(--sub-text);
}

.home-progress-skin-option.is-active .home-progress-skin-name {
  color: var(--primary);
}

.home-progress-skin-lock {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.85;
}

.home-progress-skin-footer {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

@media (max-width: 480px) {
  .home-progress-skin-grid {
    grid-template-columns: 1fr;
  }
}

.home-ref-journey {
  margin-top: auto;
  margin-bottom: 16px; /* 与「听力成长曲线」同步上移：增大=更往上，0=贴底 */
  padding: 58px 28px 26px;
}

.home-ref-journey .home-ref-section-tab {
  min-width: 152px;
  height: 46px;
  background: var(--primary-strong);
  color: #fff;
}

.journey-section-head {
  height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.journey-pretest-entry {
  position: absolute;
  left: 168px;
  right: 148px;
  top: 0;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 3;
}

.journey-pretest-btn {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--heatmap-btn-bg, #eef3f8);
  color: var(--primary-muted);
  font-size: calc(var(--fs-card-title) * 1.14);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.journey-pretest-btn:hover {
  background: var(--heatmap-btn-bg-hover, #e4ecf4);
}

.journey-pretest-btn[data-snoozed] {
  background: var(--primary-soft);
  color: var(--primary);
}

.journey-pretest-btn.is-snooze-due {
  animation: journey-pretest-pulse 0.8s ease 3;
}

@keyframes journey-pretest-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
}

.journey-pretest-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  min-width: 220px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 28px rgba(28, 42, 58, 0.16);
  border: 1px solid var(--border);
}

.journey-pretest-menu-primary {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--primary-strong);
  color: #fff;
  font-size: var(--fs-caption-md);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.journey-pretest-menu-primary:hover {
  filter: brightness(1.05);
}

.journey-pretest-snooze {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.journey-pretest-snooze label {
  font-size: var(--fs-caption);
  color: var(--sub-text);
  white-space: nowrap;
}

.journey-pretest-snooze select {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: var(--fs-caption);
  background: #fff;
}

.journey-pretest-later-btn {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-caption);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.journey-overview {
  position: absolute;
  top: 0;
  right: 28px;
  height: 46px;
  max-width: min(220px, 42%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  z-index: 4;
}

.journey-overview span {
  color: var(--primary-strong);
  font-size: var(--fs-caption-md);
  font-weight: 600;
  text-align: right;
  line-height: 1.4;
}

.journey-debug-toggle {
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--sub-text);
  font-size: calc(var(--fs-caption) * 0.92);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.journey-debug-toggle:hover,
.journey-debug-toggle.is-open {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.journey-debug-panel {
  position: absolute;
  top: 48px;
  right: 20px;
  z-index: 5;
  width: min(280px, calc(100% - 40px));
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 28px rgba(28, 42, 58, 0.14);
}

.journey-debug-title {
  margin: 0 0 10px;
  font-size: calc(var(--fs-caption) * 0.95);
  font-weight: 700;
  color: var(--primary-muted);
}

.journey-debug-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: var(--fs-caption);
  color: var(--sub-text);
}

.journey-debug-field select,
.journey-debug-field input[type="range"] {
  width: 100%;
  font: inherit;
}

.journey-debug-field select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.journey-debug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.journey-debug-btn {
  flex: 1 1 calc(50% - 6px);
  min-width: 108px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: calc(var(--fs-caption) * 0.95);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.journey-debug-btn:hover {
  border-color: var(--primary-soft);
  background: var(--primary-soft);
}

.journey-debug-btn-primary {
  border-color: var(--primary);
  background: var(--primary-strong);
  color: #fff;
}

.journey-debug-btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.journey-rings {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding-top: 8px;
}

.journey-ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.journey-ring {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.journey-ring-svg {
  width: 52px;
  height: 52px;
  display: block;
  overflow: visible;
}

.journey-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  pointer-events: none;
}

.journey-ring-label {
  color: var(--primary-strong);
  font-size: var(--fs-caption);
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.journey-ring-item.is-done .journey-ring-value {
  color: var(--primary-strong);
  font-size: 0.82rem;
}

.journey-ring-segment {
  transition: stroke 0.45s ease;
}

.journey-ring.is-complete-ring .journey-ring-value {
  color: var(--primary-strong);
  font-weight: 800;
}

.journey-ring-celebrate-stroke {
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.45));
}

.journey-ring-celebrate-stroke.is-swept {
  animation: journey-ring-rainbow-glow 3.2s ease-in-out infinite;
}

@keyframes journey-ring-rainbow-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 3px rgba(255, 120, 140, 0.45)) hue-rotate(0deg);
  }
  50% {
    filter: drop-shadow(0 0 5px rgba(91, 156, 245, 0.55)) hue-rotate(18deg);
  }
}

.journey-ring-item.is-done .journey-ring {
  filter: drop-shadow(0 2px 6px rgba(var(--primary-shadow-rgb), 0.18));
}

/* —— 全屏圆环合上庆祝 —— */
body.journey-celebrate-open {
  overflow: hidden;
}

.journey-celebrate-overlay {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.journey-celebrate-overlay.is-active {
  display: flex;
  pointer-events: auto;
}

.journey-celebrate-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(18, 28, 44, 0.42) 0%,
    rgba(10, 16, 28, 0.72) 100%
  );
  backdrop-filter: blur(4px);
  animation: journey-celebrate-backdrop-in 0.35s ease forwards;
}

@keyframes journey-celebrate-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.journey-celebrate-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.journey-celebrate-confetti-piece {
  position: absolute;
  top: -12px;
  left: var(--x, 50%);
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0;
  transform: translateX(0) rotate(var(--rot, 0deg));
  animation: journey-celebrate-confetti-fall var(--dur, 2.4s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes journey-celebrate-confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(var(--rot, 0deg)) scale(0.5);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 0px), 110vh, 0) rotate(calc(var(--rot, 0deg) + 540deg)) scale(1);
  }
}

.journey-celebrate-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.journey-celebrate-firework-burst {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 40%);
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    hsla(var(--hue, 0), 90%, 68%, 0.95) 0%,
    hsla(var(--hue, 0), 85%, 58%, 0.45) 35%,
    transparent 68%
  );
  opacity: 0;
  transform: scale(0.2);
  animation: journey-celebrate-firework-pop 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

.journey-celebrate-firework-burst::before,
.journey-celebrate-firework-burst::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 2px solid hsla(var(--hue, 0), 88%, 62%, 0.55);
  opacity: 0;
  animation: journey-celebrate-firework-ring 1.1s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.journey-celebrate-firework-burst::after {
  inset: -32px;
  animation-delay: calc(var(--delay, 0s) + 0.08s);
}

@keyframes journey-celebrate-firework-pop {
  0% {
    opacity: 0;
    transform: scale(0.15);
  }
  25% {
    opacity: 1;
    transform: scale(2.6);
  }
  100% {
    opacity: 0;
    transform: scale(4.5);
  }
}

@keyframes journey-celebrate-firework-ring {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  30% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

.journey-celebrate-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 28px 18px;
  text-align: center;
  animation: journey-celebrate-stage-in 0.55s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
}

@keyframes journey-celebrate-stage-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.journey-celebrate-ring-wrap {
  position: relative;
  width: min(220px, 52vw);
  height: min(220px, 52vw);
}

.journey-celebrate-ring-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.22));
}

.journey-celebrate-ring-track {
  stroke: rgba(255, 255, 255, 0.22);
}

.journey-celebrate-ring-progress {
  filter: drop-shadow(0 0 12px rgba(255, 200, 120, 0.45));
}

.journey-celebrate-ring-progress.is-sweeping {
  animation: journey-celebrate-ring-sweep 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes journey-celebrate-ring-sweep {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.journey-celebrate-ring-progress.is-sweeping.is-swept,
.journey-celebrate-ring-progress.is-swept {
  stroke-dashoffset: 0;
  animation: journey-celebrate-ring-glow 2.4s ease-in-out infinite;
}

@keyframes journey-celebrate-ring-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(255, 140, 160, 0.5)) hue-rotate(0deg);
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(91, 156, 245, 0.65)) hue-rotate(20deg);
  }
}

.journey-celebrate-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: scale(0.5);
  animation: journey-celebrate-check-pop 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) 0.72s forwards;
}

@keyframes journey-celebrate-check-pop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.journey-celebrate-title {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.journey-celebrate-sub {
  margin: 0;
  max-width: min(420px, 88vw);
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.journey-celebrate-dismiss {
  margin-top: 8px;
  min-width: 140px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b8a, #ffb347 45%, #5fd38d 80%, #5b9cf5);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.journey-celebrate-dismiss:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.06);
}

.journey-list {
  display: grid;
  gap: 0;
}

.journey-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(52px, max-content) 1fr;
  align-items: center;
  min-height: 52px;
  column-gap: 10px;
}

.journey-node {
  display: none;
}

.journey-name {
  font-size: var(--fs-card-title);
  font-weight: 500;
  color: #1e2d3d;
  justify-self: start;
  text-align: left;
}

.journey-count {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: 4px;
  font-weight: 700;
  font-size: var(--fs-caption-md);
  color: var(--primary-muted);
  white-space: nowrap;
  text-align: left;
}

.journey-count img,
.journey-count svg {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.8;
  flex-shrink: 0;
}

.journey-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  padding: 0 16px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--primary-strong);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--fs-caption-md);
  white-space: nowrap;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.14s ease;
}

.journey-action:hover:not(:disabled) {
  background: var(--primary-muted);
  transform: translateY(-1px);
}

/* "复习" status uses a softer teal */
.journey-item.is-done .journey-action {
  background: #e8f4f0;
  color: #3a8c6e;
  font-weight: 600;
}

.journey-item.is-done .journey-action:hover {
  background: #d4ede7;
  transform: translateY(-1px);
}

.journey-note {
  display: none;
}

.home-ref-heatmap {
  padding: 56px 0 20px;
}

/* Flex-center the calendar block for equal left/right margins */
.home-ref-heatmap .calendar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

.heatmap-head {
  position: absolute;
  inset: 0 0 auto 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.heatmap-head h2 {
  height: 46px;
  margin: 0;
  padding: 0 22px;
  display: flex;
  align-items: center;
  border-radius: 7px 0 7px 0;
  background: var(--primary-strong);
  color: #fff;
  font-size: var(--fs-card-title);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.heatmap-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 14px;
}

.heatmap-today-btn {
  height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--heatmap-btn-bg);
  color: var(--primary-muted);
  font-weight: 700;
  font-size: var(--fs-caption-md);
  cursor: pointer;
  transition: background 0.16s ease;
}

.heatmap-today-btn:hover {
  background: var(--heatmap-btn-bg-hover);
}

.month-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  padding: 0;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary-muted);
  font-size: var(--fs-card-title);
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease;
}

.month-btn:hover {
  background: rgba(var(--primary-rgb), 0.26);
}

.home-ref-calendar-toolbar,
.home-ref-filter,
.home-unstable-summary,
.home-ref-legend {
  display: none;
}

/* Fixed 34 px cells; calendar block is flex-centered in the card */
.home-ref-week-header {
  display: grid;
  grid-template-columns: repeat(7, 34px);
  gap: 7px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.home-ref-week-header span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--primary-strong);
  font-size: var(--fs-caption-md);
  font-weight: 700;
}

.home-ref-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 34px);
  grid-auto-rows: 34px;
  gap: 7px;
}

.day-cell.clickable {
  border-radius: 5px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.day-cell.clickable:hover {
  transform: scale(1.16);
  box-shadow: 0 5px 10px rgba(var(--primary-shadow-rgb), 0.22);
  z-index: 2;
}

.heatmap-month-jump {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 12px 0 0;
  padding: 0 24px;
  box-sizing: border-box;
}

.heatmap-month-jump-label {
  color: var(--primary-muted);
  font-size: var(--fs-caption-md);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.heatmap-month-input {
  width: auto;
  min-width: 148px;
  height: 32px;
  border: 1px solid rgba(var(--primary-rgb), 0.28);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--user-link-bg);
  color: var(--primary-muted);
  font-size: var(--fs-caption-md);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.heatmap-month-input:hover {
  background: var(--nav-hover-bg);
}

.heatmap-month-input:focus {
  border-color: var(--primary-strong);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}

.heatmap-month-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.72;
}

.home-ref-daily-detail {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 64px;
  z-index: 8;
  display: none;
  max-height: 330px;
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 28px rgba(var(--primary-shadow-rgb), 0.2);
}

.home-ref-daily-detail.is-open {
  display: block;
}

.home-detail-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--sidebar-bg);
  color: #fff;
  font-size: var(--fs-card-title);
  cursor: pointer;
}

.home-ref-growth {
  margin-top: auto;
  margin-bottom: 16px; /* 与「今日康复旅程」同步上移：增大=更往上，0=贴底 */
  min-height: 300px;
  padding: 54px 16px 16px;
  background: var(--growth-wrap-bg);
}

.home-ref-growth .home-ref-section-tab {
  left: 0;
  min-width: 148px;
  background: #fff;
  color: var(--primary-muted);
}

.home-ref-chart-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* 覆盖 main.css .chart-box 的 height: clamp(...) */
  height: auto !important;
  min-height: 272px;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
  padding: 34px 8px 8px;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.1);
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.home-growth-toolbar {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  min-width: 0;
  pointer-events: none;
}

.home-growth-module-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  pointer-events: auto;
  padding: 1px 0;
}

.home-growth-module-bar::-webkit-scrollbar {
  display: none;
}

.home-growth-module-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  height: 26px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 999px;
  padding: 0 10px 0 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-muted);
  font-size: var(--fs-caption);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-growth-module-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip-color, var(--primary-strong));
  opacity: 0.35;
  transition: opacity 0.16s ease;
}

.home-growth-module-chip:hover {
  background: var(--user-link-bg);
  color: var(--primary-muted);
}

.home-growth-module-chip.is-active {
  background: var(--nav-hover-bg);
  border-color: rgba(var(--primary-rgb), 0.34);
  color: var(--primary-muted);
  box-shadow: 0 1px 4px rgba(var(--primary-rgb), 0.12);
}

.home-growth-module-chip.is-active::before {
  opacity: 1;
}

.home-growth-module-chip[data-module="total"] { --chip-color: #34495e; }
.home-growth-module-chip[data-module="train_module_a"] { --chip-color: #3563d9; }
.home-growth-module-chip[data-module="train_module_b"] { --chip-color: #1e9b5c; }
.home-growth-module-chip[data-module="train_module_c"] { --chip-color: #e67e22; }
.home-growth-module-chip[data-module="train_module_d"] { --chip-color: #8e44ad; }

.home-growth-range-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 0;
  padding: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.home-growth-range-bar::-webkit-scrollbar {
  display: none;
}

.home-growth-range {
  flex: 0 0 auto;
  height: 28px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 12px;
  background: transparent;
  color: var(--primary-muted);
  font-size: var(--fs-caption-md);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.home-growth-range:hover {
  background: var(--nav-hover-bg);
  color: var(--primary-muted);
}

.home-growth-range.is-active {
  background: var(--heatmap-btn-bg);
  border-color: rgba(var(--primary-rgb), 0.22);
  color: var(--primary-muted);
}

.home-growth-avg-note {
  margin: 0;
  padding: 0 8px;
  color: var(--primary-muted);
  font-size: var(--fs-caption);
  line-height: 1.4;
  text-align: center;
}

.home-growth-period-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0;
  z-index: 4;
  pointer-events: none;
  flex: 0 1 auto;
  min-width: 0;
}

.home-growth-period-nav > * {
  pointer-events: auto;
}

.home-growth-period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-muted);
  font-size: 16px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 1px 3px rgba(var(--primary-rgb), 0.1);
  padding: 0;
}

.home-growth-period-btn:hover:not(:disabled) {
  background: var(--user-link-bg);
  border-color: rgba(var(--primary-rgb), 0.34);
}

.home-growth-period-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.home-growth-period-label {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 12em;
  text-align: center;
  color: var(--primary-muted);
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-growth-chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding: 6px 2px 0;
  flex-shrink: 0;
  box-sizing: border-box;
}

.home-growth-chart-footer .home-growth-period-nav {
  flex: 0 1 auto;
  justify-content: flex-start;
  min-width: 0;
  max-width: 48%;
}

.home-growth-chart-footer .home-growth-range-bar {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

@media (max-width: 380px) {
  .home-growth-chart-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .home-growth-chart-footer .home-growth-period-nav,
  .home-growth-chart-footer .home-growth-range-bar {
    justify-content: center;
  }
}

.home-echarts-trend.home-growth-chart-swipeable {
  touch-action: pan-y;
  cursor: grab;
}

.home-echarts-trend.home-growth-chart-swipeable:active {
  cursor: grabbing;
}

.heatmap-detail-open .home-ref-growth .home-ref-chart-box {
  filter: blur(2px);
  opacity: 0.78;
}

.home-echarts-trend {
  width: 100%;
  height: 196px;
  min-height: 196px;
  flex: 0 0 196px;
  margin-top: 0;
  min-width: 0;
}

.home-ref-svg-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 250px;
  opacity: 0;
  pointer-events: none;
}

.no-echarts .home-ref-svg-fallback {
  opacity: 1;
}

.no-echarts .home-echarts-trend {
  display: none;
}

.home-ref-trend-tools,
.home-ref-chart-box .trend-legend,
.home-ref-chart-box .trend-chart-hint,
.home-ref-chart-box .trend-avg-note {
  display: none;
}

.home-ear-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.achievement-card {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-tint-bg);
  border: 1px solid var(--panel-tint-border);
  color: var(--sub-text);
}

.achievement-card img,
.achievement-card .sidebar-theme-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: grayscale(0.8);
  opacity: 0.58;
}

.achievement-card strong {
  color: var(--text);
  font-size: 1rem;
}

.achievement-card.is-earned {
  background: #fff;
  color: var(--text);
  box-shadow: 8px 0 16px rgba(37, 61, 84, 0.07);
}

.achievement-card.is-earned img,
.achievement-card.is-earned .sidebar-theme-icon {
  filter: none;
  opacity: 1;
}

.home-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(28, 42, 58, 0.05);
}

.home-hero-copy {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--primary);
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, var(--fs-page-home));
  line-height: 1.2;
}

.hero-subtitle {
  margin-top: 8px;
  max-width: 58ch;
  color: var(--sub-text);
  font-size: var(--fs-body);
  line-height: 1.65;
}

.home-hero-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.home-icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
}

.home-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--sub-text);
  text-decoration: none;
  font-size: 0.82rem;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.home-link-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.progress-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--border-light);
  box-shadow: 0 6px 20px rgba(28, 42, 58, 0.05);
}

.progress-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-panel-title {
  margin: 0;
  font-size: var(--fs-card-title);
}

.progress-panel-meta {
  color: var(--sub-text);
  font-size: 0.82rem;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.progress-stat {
  display: grid;
  gap: 7px;
  padding: 14px;
  border-radius: 18px;
  background: var(--bg);
  border: 1px solid var(--border-light);
}

.progress-stat-label {
  font-size: 0.76rem;
  color: var(--sub-text);
  letter-spacing: 0.06em;
}

.progress-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.progress-stat-note {
  color: var(--sub-text);
  font-size: 0.8rem;
  line-height: 1.45;
}

.progress-bar-wrap {
  display: grid;
  gap: 8px;
}

.progress-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--sub-text);
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary);
}

.progress-summary {
  margin: 0;
  color: var(--sub-text);
  font-size: 0.84rem;
  line-height: 1.55;
}

.home-tip {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: #f7faff;
  color: var(--sub-text);
  font-size: 0.85rem;
  line-height: 1.55;
}

.home-tip strong {
  color: var(--text);
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.analytics-grid .card {
  min-width: 0;
}

.analytics-grid .card-head {
  flex-wrap: wrap;
}

.module-section,
.community-section {
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.section-kicker {
  margin-bottom: 5px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--primary);
  text-transform: uppercase;
}

.section-head h2 {
  margin: 0;
  font-size: 1.08rem;
}

.section-meta {
  margin: 0;
  color: var(--sub-text);
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 42ch;
}

.module-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.module-rail::-webkit-scrollbar,
.sidebar-module-list::-webkit-scrollbar,
.community-feed::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.module-rail::-webkit-scrollbar-thumb,
.sidebar-module-list::-webkit-scrollbar-thumb,
.community-feed::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.24);
  border-radius: 999px;
}

.module-rail::-webkit-scrollbar-track,
.sidebar-module-list::-webkit-scrollbar-track,
.community-feed::-webkit-scrollbar-track {
  background: transparent;
}

.rail-module-link {
  scroll-snap-align: start;
}

.module-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.module-card {
  position: relative;
  min-height: 192px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #7f9dbd;
  color: #fff;
  overflow: hidden;
  display: grid;
  gap: 12px;
  box-shadow: 0 12px 24px rgba(83, 113, 146, 0.16);
}

.module-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.module-card--compact {
  min-height: 0;
  padding: 12px;
  gap: 10px;
  border-radius: 16px;
}

.module-card--compact::after {
  width: 68px;
  height: 68px;
  right: -12px;
  top: -12px;
}

.module-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.98rem;
  font-weight: 700;
}

.module-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.module-status--locked {
  background: rgba(255, 255, 255, 0.12);
}

.module-card h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.02rem;
}

.module-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86rem;
  line-height: 1.55;
}

.module-card-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.9);
}

.module-card-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-card-arrow {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.module-link:hover .module-card {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(83, 113, 146, 0.22);
}

.module-link.profile-locked {
  pointer-events: none;
  opacity: 1;
  cursor: not-allowed;
}

.module-link.profile-locked .module-card {
  opacity: 0.55;
  filter: saturate(0.7);
}

.module-link.coming-soon .module-card {
  pointer-events: none;
  opacity: 0.72;
  background: #8f9baa;
}

.community-section {
  display: grid;
  gap: 14px;
}

.community-upload {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--user-link-bg);
  border: 1px solid var(--border-light);
}

.community-upload h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.community-upload p {
  margin: 0;
  color: var(--sub-text);
  font-size: 0.84rem;
  line-height: 1.5;
}

.community-upload-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.community-upload-btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--sub-text);
  padding: 10px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.community-upload-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.community-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.community-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  box-shadow: 0 6px 18px rgba(28, 42, 58, 0.04);
}

.community-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.community-card-head {
  flex: 1;
  min-width: 0;
}

.community-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.community-meta {
  margin: 4px 0 0;
  color: var(--sub-text);
  font-size: 0.78rem;
  line-height: 1.45;
}

.community-accent {
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf4fb;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.community-summary {
  margin: 0;
  color: #36475a;
  font-size: 0.86rem;
  line-height: 1.6;
}

.community-wave {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 44px;
  padding: 8px 2px 0;
}

.community-wave span {
  flex: 1;
  min-width: 6px;
  border-radius: 999px;
  background: var(--primary);
  opacity: 0.78;
}

.community-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.community-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
}

.community-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.community-action {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--sub-text);
  padding: 7px 11px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.community-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.messages-page-card {
  display: grid;
  gap: 12px;
}

.messages-page-state {
  font-size: 0.78rem;
  color: var(--sub-text);
  font-weight: 500;
}

.messages-page-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.messages-page-item {
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--bg);
  cursor: default;
}

.messages-page-item.is-unread {
  border-color: #8bb9ff;
  background: #eef5ff;
  cursor: pointer;
}

.messages-page-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.messages-page-item-title {
  color: var(--text);
  font-size: 0.94rem;
}

.messages-page-item-status {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px 9px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.76rem;
}

.messages-page-item.is-unread .messages-page-item-status {
  background: #ffedd5;
  color: #c2410c;
}

.messages-page-item-body {
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.6;
}

.messages-page-item-time {
  margin-top: 8px;
  color: #8a94a6;
  font-size: 0.76rem;
}

.messages-page-empty {
  margin: 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--bg);
  color: var(--sub-text);
  font-size: 0.88rem;
}

.bottom-nav {
  display: none;
}

.module-link.profile-locked.coming-soon .module-card {
  opacity: 0.68;
}

@media (max-width: 1240px) {
  .progress-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .community-feed {
    grid-template-columns: 1fr;
  }

  /* Equal columns on mid-size screens */
  .home-col-left,
  .home-col-right { flex: 1; }
}

@media (max-width: 960px) {
  .home-sidebar {
    display: none;
  }

  .sidebar-collapse-toggle {
    display: none !important;
  }

  html.is-sidebar-collapsed body.home-page .home-main {
    margin-left: 0;
  }

  .home-main {
    margin-left: 0;
    padding: 16px 16px 102px;
  }

  /* Stack columns vertically on mobile */
  .home-ref-grid {
    flex-direction: column;
    min-height: 0;
  }

  .home-col-left,
  .home-col-right { flex: none; width: 100%; }

  .home-ref-journey,
  .home-ref-growth {
    margin-top: 0;
  }

  .home-ref-progress {
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .home-hero {
    padding: 18px 18px 20px;
    flex-direction: column;
  }

  .home-hero-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .progress-grid {
    grid-template-columns: 1fr;
  }

  .module-rail {
    grid-auto-columns: minmax(78vw, 1fr);
  }

  .bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--border);
    z-index: 30;
    box-shadow: 0 -6px 24px rgba(28, 42, 58, 0.08);
    }

  .bottom-nav-item {
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--sub-text);
    text-decoration: none;
    font-size: 0.72rem;
    line-height: 1.2;
    cursor: pointer;
  }

  .bottom-nav-item::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.16);
  }

  .bottom-nav-item:hover,
  .bottom-nav-item:focus-visible {
    color: var(--primary);
    background: var(--primary-soft);
  }
}

@media (max-width: 640px) {
  .home-main {
    padding: 12px 12px 96px;
  }

  .home-hero,
  .progress-panel,
  .module-section,
  .community-section {
    border-radius: 18px;
  }

  .progress-panel {
    padding: 14px;
  }

  .community-upload {
    flex-direction: column;
    align-items: flex-start;
  }

  .community-upload-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .community-feed {
    gap: 12px;
  }

  .community-card {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-ear-thumb {
    transition: none;
  }

  html.home-motion-pending body.home-page .home-sidebar,
  html.home-motion-pending body.home-page .home-main,
  html.home-motion-pending body.home-page .home-ref-level,
  html.home-motion-pending body.home-page .journey-item,
  html.home-motion-pending body.home-page .journey-ring-item,
  html.home-motion-pending body.home-page .home-ref-stats article {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .home-ref-progress-shimmer,
  .home-ref-progress-line span.is-animating .home-ref-progress-shimmer {
    animation: none !important;
    opacity: 0 !important;
  }

  .journey-ring-celebrate-stroke.is-swept,
  .journey-celebrate-ring-progress.is-sweeping,
  .journey-celebrate-ring-progress.is-swept,
  .journey-celebrate-confetti-piece,
  .journey-celebrate-firework-burst,
  .journey-celebrate-check,
  .journey-celebrate-stage {
    animation: none !important;
  }

  .journey-celebrate-ring-progress {
    stroke-dashoffset: 0 !important;
  }

  .journey-celebrate-check {
    opacity: 1 !important;
    transform: none !important;
  }
}
