/* 本文件负责“晴日记”网站的视觉系统、响应式布局与原创 ACG 漫画装饰。 */

/* 设计令牌：统一颜色、阴影、圆角与侧栏尺寸。 */
:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-soft: #fbfaff;
  --ink: #2d2b3d;
  --muted: #8b899c;
  --line: #eceaf3;
  --purple: #7c6cf2;
  --purple-dark: #6657df;
  --purple-soft: #eeebff;
  --coral: #ef7f8d;
  --coral-soft: #fff0f2;
  --mint: #53bfa7;
  --mint-soft: #e9f8f4;
  --blue: #68a7e8;
  --blue-soft: #eaf4ff;
  --yellow: #eead4b;
  --yellow-soft: #fff7e6;
  --shadow: 0 10px 32px rgba(61, 52, 112, 0.07);
  --shadow-hover: 0 16px 42px rgba(61, 52, 112, 0.12);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --sidebar-width: 238px;
  --acg-outline: #34264d;
  --acg-cyan: #44d8dc;
  --acg-pink: #ff6f9d;
  --acg-yellow: #ffd45c;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color-scheme: light;
}

/* 基础重置：消除默认盒模型差异并统一交互控件字体。 */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 1px 1px, rgba(89, 69, 148, 0.12) 1px, transparent 1.2px) 0 0 / 18px 18px,
    linear-gradient(135deg, rgba(68, 216, 220, 0.04), transparent 38%),
    var(--bg);
  color: var(--ink);
  transition: background 0.25s ease, color 0.25s ease;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 应用骨架：确保仪表盘至少占满一个视口高度。 */
.app-shell {
  min-height: 100vh;
}

.app-shell[hidden],
.auth-screen[hidden] {
  display: none;
}

/* 本地登录模块：在进入仪表盘前完成账户创建、密码校验和会话隔离。 */
.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 16%, rgba(124, 108, 242, 0.11) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 82%, rgba(239, 127, 141, 0.12) 0 3px, transparent 4px),
    linear-gradient(145deg, #f5f2ff, #fbf9ff 52%, #fff5f7);
}

.auth-card {
  display: grid;
  width: min(100%, 920px);
  min-height: 575px;
  grid-template-columns: 1.08fr 0.92fr;
  overflow: hidden;
  border: 1px solid rgba(124, 108, 242, 0.16);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(63, 51, 121, 0.16);
}

.auth-intro {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 39px 43px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.34) 0 2px, transparent 3px),
    linear-gradient(145deg, #eeeaff, #f6efff 55%, #ffeef2);
}

.auth-intro::before,
.auth-intro::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(124, 108, 242, 0.1);
  border-radius: 50%;
}

.auth-intro::before {
  top: -80px;
  right: -70px;
  width: 270px;
  height: 270px;
}

.auth-intro::after {
  bottom: -120px;
  left: -75px;
  width: 300px;
  height: 300px;
}

.auth-brand {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  padding: 0;
  margin-bottom: 56px;
}

.auth-copy {
  position: relative;
  z-index: 2;
}

.auth-kicker {
  color: var(--purple);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.auth-copy h1 {
  margin: 15px 0 13px;
  color: #353144;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: clamp(27px, 3vw, 37px);
  line-height: 1.42;
  letter-spacing: 0.03em;
}

.auth-copy h1 span {
  color: var(--purple-dark);
}

.auth-copy p {
  margin: 0;
  color: #7f798f;
  font-size: 11px;
  line-height: 1.7;
}

.auth-art {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 210px;
}

.auth-cat {
  position: absolute;
  right: 36px;
  bottom: -18px;
  width: 142px;
  height: 132px;
  border: 3px solid #655987;
  border-radius: 48% 48% 42% 42%;
  background: #fffaf8;
  box-shadow: 0 16px 25px rgba(77, 61, 122, 0.13);
}

.auth-cat::before {
  position: absolute;
  top: -3px;
  right: -3px;
  left: -3px;
  height: 57px;
  content: "";
  border-radius: 70px 70px 30% 30%;
  background: linear-gradient(145deg, #9582d2, #7764bd);
}

.auth-cat-ear {
  position: absolute;
  z-index: -1;
  top: -25px;
  width: 52px;
  height: 55px;
  border: 3px solid #655987;
  background: #fffaf8;
}

.auth-cat-ear.left {
  left: 8px;
  border-radius: 12px 80% 12px 80%;
  transform: rotate(25deg);
}

.auth-cat-ear.right {
  right: 8px;
  border-radius: 80% 12px 80% 12px;
  transform: rotate(65deg);
}

.auth-cat-eye {
  position: absolute;
  top: 76px;
  width: 8px;
  height: 11px;
  border-radius: 50%;
  background: #514768;
}

.auth-cat-eye.left { left: 43px; }
.auth-cat-eye.right { right: 43px; }

.auth-cat-mouth {
  position: absolute;
  top: 93px;
  left: 50%;
  width: 15px;
  height: 7px;
  border-bottom: 2px solid #655987;
  border-radius: 50%;
  transform: translateX(-50%);
}

.auth-plant {
  position: absolute;
  right: 179px;
  bottom: 0;
  display: grid;
  width: 53px;
  height: 53px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 26px;
  transform: rotate(-5deg);
}

.auth-star {
  position: absolute;
  color: #dc9b42;
}

.auth-star-one { right: 15px; bottom: 132px; font-size: 21px; }
.auth-star-two { right: 244px; bottom: 105px; color: var(--coral); font-size: 16px; }

.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 50px 48px;
  background: var(--surface);
}

.auth-form h2 {
  margin: 10px 0 7px;
  font-size: 23px;
}

.auth-form > div:first-child > p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.auth-form > label {
  color: #656174;
  font-size: 11px;
  font-weight: 750;
}

.auth-form input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  transition: 0.2s ease;
}

.auth-form input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 45px;
}

.password-field button {
  position: absolute;
  right: 7px;
  bottom: 6px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-field button:hover {
  background: var(--purple-soft);
  color: var(--purple);
}

.auth-error {
  padding: 9px 11px;
  margin: -7px 0 0;
  border-radius: 10px;
  background: var(--coral-soft);
  color: #c95d6c;
  font-size: 10px;
  line-height: 1.5;
}

.auth-error[hidden] {
  display: none;
}

.auth-submit {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  box-shadow: 0 9px 22px rgba(102, 87, 223, 0.25);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.auth-submit:hover:not(:disabled) {
  box-shadow: 0 12px 25px rgba(102, 87, 223, 0.32);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.auth-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.auth-note span {
  color: var(--mint);
  font-size: 13px;
}

.auth-note[hidden] {
  display: none;
}

.auth-note.legacy-note {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--yellow-soft);
  color: #9f762e;
}

.auth-note.legacy-note span {
  color: var(--yellow);
  font-weight: 900;
}

/* 桌面侧边栏模块：固定品牌、导航、语录和设置入口。 */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 30px 20px 22px;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  margin-bottom: 38px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--purple) 0%, #a897ff 100%);
  box-shadow: 0 8px 18px rgba(124, 108, 242, 0.26);
  color: #fff;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  width: 25px;
  height: 25px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  transform: rotate(30deg);
}

.brand-mark::after {
  width: 15px;
  height: 15px;
  transform: rotate(60deg);
}

.brand-spark {
  position: relative;
  z-index: 1;
  font-size: 19px;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: #aaa7b9;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.side-nav {
  display: grid;
  gap: 7px;
}

.nav-item,
.settings-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 49px;
  gap: 13px;
  padding: 0 15px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #777487;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-item:hover,
.settings-link:hover {
  color: var(--purple);
  background: var(--purple-soft);
}

.nav-item.active {
  color: var(--purple-dark);
  background: var(--purple-soft);
  box-shadow: inset 3px 0 0 var(--purple);
}

.nav-icon {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
}

.nav-icon svg,
.icon-button svg,
.chevron {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft);
}

.sidebar-spacer {
  flex: 1;
}

.quote-card {
  position: relative;
  padding: 18px 16px;
  margin: 20px 0 14px;
  overflow: hidden;
  border: 1px solid #eae5ff;
  border-radius: 16px;
  background: linear-gradient(145deg, #f8f5ff, #fffafa);
}

.quote-card::after {
  position: absolute;
  right: -14px;
  bottom: -18px;
  width: 60px;
  height: 60px;
  content: "";
  border-radius: 50%;
  background: rgba(124, 108, 242, 0.08);
}

.quote-star {
  color: var(--purple);
  font-size: 16px;
}

.quote-card p {
  margin: 8px 0 9px;
  color: #59556f;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 13px;
  line-height: 1.7;
}

.quote-card small {
  color: #aaa7b9;
  font-size: 10px;
}

.settings-link {
  width: 100%;
  text-align: left;
}

/* 主内容模块：为固定侧栏留出空间并限制超宽屏阅读宽度。 */
.main-content {
  max-width: 1480px;
  min-height: 100vh;
  padding: 28px 40px 34px;
  margin-left: var(--sidebar-width);
}

/* 顶部用户模块：承载动态日期、主题按钮和用户切换菜单。 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 750;
  letter-spacing: 0.02em;
}

.wave {
  display: inline-block;
  color: #efaf54;
  font-size: 19px;
  animation: twinkle 2.8s ease-in-out infinite;
}

/* 星光动画：为问候区域加入克制的二次元闪烁感。 */
@keyframes twinkle {
  0%, 100% { transform: scale(0.85) rotate(0); opacity: 0.7; }
  50% { transform: scale(1.15) rotate(20deg); opacity: 1; }
}

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

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: #706d81;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(61, 52, 112, 0.04);
  transition: 0.2s ease;
}

.icon-button:hover {
  border-color: #dcd7fb;
  color: var(--purple);
  transform: translateY(-1px);
}

.user-switcher {
  position: relative;
}

.user-button {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 11px;
  padding: 7px 10px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(61, 52, 112, 0.04);
}

.avatar {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--avatar-color, var(--purple)), color-mix(in srgb, var(--avatar-color, var(--purple)) 55%, white));
  box-shadow: 0 4px 10px color-mix(in srgb, var(--avatar-color, var(--purple)) 25%, transparent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.user-button-copy {
  display: grid;
  flex: 1;
  gap: 2px;
  text-align: left;
}

.user-button-copy strong {
  font-size: 13px;
}

.user-button-copy small {
  color: var(--muted);
  font-size: 10px;
}

.chevron {
  width: 17px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.user-button[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 9px);
  right: 0;
  width: 252px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 20px 55px rgba(50, 43, 90, 0.16);
}

.user-menu[hidden] {
  display: none;
}

.user-menu > p {
  margin: 2px 5px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

/* 账户菜单模块：只展示当前登录身份和退出入口，不允许绕过密码切换数据。 */
.account-menu-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px;
}

.account-menu-heading .avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.account-menu-heading > span:last-child {
  display: grid;
  flex: 1;
  gap: 3px;
}

.account-menu-heading strong {
  font-size: 12px;
}

.account-menu-heading small {
  color: var(--muted);
  font-size: 9px;
}

.user-menu .account-menu-tip {
  padding: 9px 5px 11px;
  margin: 7px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.logout-button {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 0;
  border-radius: 11px;
  background: var(--coral-soft);
  color: #cc6573;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.logout-button:hover {
  background: #ffe3e7;
}

.menu-user {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.menu-user:hover,
.menu-user.active {
  background: var(--purple-soft);
}

.menu-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.menu-user span:nth-child(2) {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
}

.menu-user .selected-mark {
  color: var(--purple);
}

.add-user-button {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border: 1px dashed #dcd7f6;
  border-radius: 11px;
  background: transparent;
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* 今日概览模块：用柔和渐变与原创 CSS 角色表达治愈氛围。 */
.hero-card {
  position: relative;
  display: flex;
  min-height: 270px;
  justify-content: space-between;
  padding: 38px 44px;
  overflow: hidden;
  border: 1px solid #e0dcff;
  border-radius: 27px;
  background:
    radial-gradient(circle at 62% 18%, rgba(255, 255, 255, 0.82) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 72%, rgba(255, 255, 255, 0.7) 0 3px, transparent 4px),
    linear-gradient(120deg, #f2efff 0%, #f8f6ff 55%, #fceef2 100%);
  box-shadow: var(--shadow);
}

.hero-card::before {
  position: absolute;
  top: -85px;
  right: 19%;
  width: 270px;
  height: 270px;
  content: "";
  border: 1px solid rgba(124, 108, 242, 0.09);
  border-radius: 50%;
}

.hero-card::after {
  position: absolute;
  right: -36px;
  bottom: -118px;
  width: 300px;
  height: 300px;
  content: "";
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.33);
}

.hero-copy {
  position: relative;
  z-index: 3;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero-kicker span {
  font-size: 15px;
}

.hero-copy h2 {
  margin: 14px 0 12px;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.hero-copy h2 span {
  position: relative;
  color: var(--purple-dark);
}

.hero-copy h2 span::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 6px;
  content: "";
  border-radius: 8px;
  background: rgba(239, 173, 84, 0.25);
}

.hero-copy > p {
  margin: 0;
  color: #6f6b7f;
  font-size: 13px;
}

.hero-copy > p strong {
  color: var(--coral);
}

.hero-tags {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.hero-tags span {
  padding: 7px 11px;
  border: 1px solid rgba(124, 108, 242, 0.12);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.68);
  color: #777286;
  font-size: 11px;
}

.hero-tags b {
  color: var(--purple-dark);
}

.hero-art {
  position: relative;
  z-index: 2;
  width: 410px;
  min-width: 360px;
}

/* CSS 吉祥物模块：通过纯样式绘制猫耳健康伙伴，避免图片依赖。 */
.mascot {
  position: absolute;
  right: 86px;
  bottom: -41px;
  width: 148px;
  height: 225px;
  filter: drop-shadow(0 14px 12px rgba(84, 67, 135, 0.14));
}

.mascot-head {
  position: absolute;
  z-index: 4;
  top: 30px;
  left: 17px;
  width: 114px;
  height: 105px;
  border: 3px solid #675b8e;
  border-radius: 48% 48% 46% 46%;
  background: #fffaf7;
}

.mascot-ear {
  position: absolute;
  z-index: 2;
  top: 18px;
  width: 45px;
  height: 52px;
  border: 3px solid #675b8e;
  background: #fffaf7;
  transform: rotate(36deg);
}

.mascot-ear::after {
  position: absolute;
  inset: 10px;
  content: "";
  background: #f6c5d0;
  opacity: 0.7;
}

.ear-left {
  left: 20px;
  border-radius: 10px 80% 12px 80%;
}

.ear-right {
  right: 20px;
  border-radius: 80% 10px 80% 12px;
  transform: rotate(54deg);
}

.mascot-hair {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 114px;
  height: 52px;
  overflow: hidden;
  border-radius: 50px 50px 22px 22px;
  background: #8c79c7;
}

.mascot-hair::after {
  position: absolute;
  right: 12px;
  bottom: -18px;
  width: 37px;
  height: 38px;
  content: "";
  border-radius: 50%;
  background: #fffaf7;
}

.mascot-eye {
  position: absolute;
  top: 61px;
  width: 7px;
  height: 10px;
  border-radius: 50%;
  background: #574c73;
}

.eye-left { left: 34px; }
.eye-right { right: 34px; }

.mascot-blush {
  position: absolute;
  top: 76px;
  width: 15px;
  height: 6px;
  border-radius: 50%;
  background: #f4b3bf;
  opacity: 0.72;
}

.blush-left { left: 18px; }
.blush-right { right: 18px; }

.mascot-mouth {
  position: absolute;
  top: 76px;
  left: 50%;
  width: 13px;
  height: 7px;
  border-bottom: 2px solid #675b8e;
  border-radius: 50%;
  transform: translateX(-50%);
}

.mascot-body {
  position: absolute;
  z-index: 3;
  top: 127px;
  left: 28px;
  display: grid;
  width: 93px;
  height: 107px;
  place-items: start center;
  padding-top: 33px;
  border: 3px solid #675b8e;
  border-radius: 42px 42px 18px 18px;
  background: linear-gradient(160deg, #9a86d5, #7764bd);
  color: rgba(255,255,255,.82);
  font-family: "KaiTi", serif;
  font-size: 22px;
}

.mascot-body::before {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 38px;
  height: 17px;
  content: "";
  border: 3px solid #675b8e;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: #fffaf7;
  transform: translateX(-50%);
}

.mascot-tail {
  position: absolute;
  right: 3px;
  bottom: 6px;
  width: 55px;
  height: 37px;
  border: 3px solid #675b8e;
  border-radius: 50%;
  background: #fffaf7;
  transform: rotate(-18deg);
}

.hero-bubble {
  position: absolute;
  top: 20px;
  right: 3px;
  padding: 12px 16px;
  border: 1px solid rgba(124, 108, 242, 0.15);
  border-radius: 18px 18px 18px 4px;
  background: rgba(255,255,255,.75);
  color: #8d879b;
  font-family: "KaiTi", serif;
  font-size: 12px;
  line-height: 1.4;
  transform: rotate(3deg);
}

.hero-bubble strong {
  color: var(--coral);
  font-size: 14px;
}

.floating-star {
  position: absolute;
  color: #e6a449;
}

.star-one { top: 28px; left: 58px; font-size: 18px; }
.star-two { right: 42px; bottom: 36px; font-size: 22px; }
.floating-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; }
.dot-one { top: 86px; left: 3px; background: var(--coral); }
.dot-two { right: 14px; bottom: 73px; background: var(--purple); }

/* 健康卡片网格：桌面双列展示睡眠与每日清单。 */
.dashboard-grid,
.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 20px;
  margin-top: 20px;
}

.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.card-heading.compact {
  align-items: center;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.label-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 13%, transparent);
}

.label-dot.purple { background: var(--purple); color: var(--purple); }
.label-dot.coral { background: var(--coral); color: var(--coral); }
.label-dot.mint { background: var(--mint); color: var(--mint); }
.label-dot.blue { background: var(--blue); color: var(--blue); }
.label-dot.yellow { background: var(--yellow); color: var(--yellow); }

.card h3,
.section-header h2 {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.3;
}

.status-chip,
.trend-average,
.calendar-month {
  padding: 7px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}

.status-chip.good {
  background: var(--mint-soft);
  color: #31987f;
}

.status-chip.warn {
  background: var(--yellow-soft);
  color: #bb7923;
}

/* 睡眠记录模块：组合月亮插画、时长滑杆和作息摘要。 */
.sleep-content {
  display: flex;
  align-items: center;
  gap: clamp(22px, 4vw, 50px);
  padding: 24px 5px 22px;
}

.sleep-orbit {
  position: relative;
  display: grid;
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px dashed #cbc4f3;
  border-radius: 50%;
  background: radial-gradient(circle, #f6f2ff 0 48%, transparent 49%);
}

.moon {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #8978d5, #6f5cbc);
  box-shadow: 0 10px 22px rgba(111, 92, 188, 0.24);
  color: #fff;
  font-family: serif;
  font-size: 44px;
  transform: rotate(-15deg);
}

.orbit-star {
  position: absolute;
  color: #b2a8df;
}

.orbit-a { top: 3px; right: 12px; }
.orbit-b { bottom: 8px; left: 3px; font-size: 25px; }
.orbit-c { right: -8px; bottom: 23px; }

.sleep-editor {
  flex: 1;
}

.sleep-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sleep-value strong {
  font-size: 39px;
  line-height: 1;
}

.sleep-value span {
  color: var(--muted);
  font-size: 12px;
}

.sleep-editor > p {
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 10px;
}

input[type="range"] {
  width: 100%;
  height: 5px;
  border-radius: 8px;
  outline: none;
  background: linear-gradient(to right, var(--purple) 0 var(--range-progress, 50%), #eae7f4 var(--range-progress, 50%) 100%);
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 2px 8px rgba(84, 70, 164, 0.35);
  cursor: pointer;
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 2px 8px rgba(84, 70, 164, 0.35);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: #aaa7b5;
  font-size: 9px;
}

.range-labels span:nth-child(2) {
  color: #8c80cf;
}

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

.sleep-meta {
  display: flex;
  gap: 18px;
  color: #777485;
  font-size: 10px;
}

.mini-icon {
  margin-right: 5px;
}

.moon-icon { color: var(--purple); }
.sun-icon { color: var(--yellow); }

.small-button,
.outline-button {
  border: 0;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.small-button {
  min-width: 92px;
  padding: 10px 14px;
}

.small-button.primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  box-shadow: 0 7px 16px rgba(102, 87, 223, 0.22);
  color: #fff;
}

.small-button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 19px rgba(102, 87, 223, 0.29);
}

.small-button.ghost {
  background: var(--surface-soft);
  color: var(--muted);
}

/* 每日清单模块：圆环反映进度，列表承担可点击打卡交互。 */
.progress-ring {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--coral) var(--progress, 0%), #f2edf0 0);
}

.progress-ring::before {
  grid-area: 1 / 1;
  width: 38px;
  height: 38px;
  content: "";
  border-radius: 50%;
  background: var(--surface);
}

.progress-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  color: var(--muted);
  font-size: 9px;
}

.progress-ring b {
  color: var(--coral);
  font-size: 13px;
}

.progress-ring small {
  font-size: 9px;
}

.checklist {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.check-item {
  display: flex;
  min-height: 49px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #faf9fc;
  cursor: pointer;
  transition: 0.2s ease;
}

.check-item:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.check-item.done {
  background: #fbfaff;
}

.check-item-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--item-soft);
  font-size: 17px;
}

.check-item-copy {
  display: grid;
  flex: 1;
  gap: 2px;
}

.check-item-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.check-item.done .check-item-copy strong {
  color: #aaa7b4;
  text-decoration: line-through;
}

.check-item-copy small {
  color: var(--muted);
  font-size: 9px;
}

.check-box {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1.5px solid #d8d4e4;
  border-radius: 7px;
  background: var(--surface);
  color: #fff;
  font-size: 12px;
  transition: 0.2s ease;
}

.check-item.done .check-box {
  border-color: var(--purple);
  background: var(--purple);
  transform: rotate(-4deg);
}

.text-button {
  width: 100%;
  padding: 12px 0 0;
  border: 0;
  background: transparent;
  color: var(--purple);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.text-button span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.text-button:hover span {
  transform: translateX(4px);
}

/* 计划模块：以彩色卡片展示目标、频率和近七天达成度。 */
.section-block {
  margin-top: 32px;
  scroll-margin-top: 24px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 0 3px;
}

.section-header h2 {
  font-size: 20px;
}

.outline-button {
  padding: 10px 14px;
  border: 1px solid #dcd8ed;
  background: var(--surface);
  color: var(--purple-dark);
  box-shadow: 0 5px 15px rgba(61, 52, 112, 0.04);
}

.outline-button:hover {
  border-color: var(--purple);
  transform: translateY(-1px);
}

.outline-button span {
  margin-right: 4px;
  font-size: 15px;
}

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

.plan-card {
  position: relative;
  min-height: 170px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--plan-line);
  border-radius: 20px;
  background: var(--plan-bg);
  transition: 0.25s ease;
}

.plan-card::after {
  position: absolute;
  right: -26px;
  bottom: -38px;
  width: 105px;
  height: 105px;
  content: "";
  border: 20px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.plan-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.plan-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.plan-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  box-shadow: 0 5px 12px rgba(61,52,112,.06);
  font-size: 23px;
}

.plan-menu {
  position: relative;
  z-index: 4;
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.plan-menu:hover {
  background: rgba(255,255,255,.7);
  color: var(--coral);
}

.plan-card h3 {
  position: relative;
  z-index: 2;
  margin: 15px 0 4px;
  font-size: 14px;
}

.plan-card p {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #827f8e;
  font-size: 10px;
}

.plan-progress {
  position: relative;
  z-index: 2;
  height: 5px;
  margin: 16px 0 8px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255,255,255,.82);
}

.plan-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--plan-accent);
}

.plan-stats {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  color: #7f7a8d;
  font-size: 9px;
}

.empty-plan {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 20px;
  border: 1px dashed #dcd7ed;
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.empty-plan button {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--purple);
  cursor: pointer;
}

/* 克制计划模块：用额度卡片表达本周使用量、剩余额度和超额状态。 */
.limit-section {
  padding: 25px 26px 27px;
  margin-top: 22px;
  border: 1px solid #f0e4e6;
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 16%, rgba(239, 127, 141, 0.09) 0 46px, transparent 47px),
    linear-gradient(145deg, #fffdfd, #fff9fa);
  box-shadow: 0 9px 28px rgba(115, 69, 78, 0.05);
}

.limit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.limit-header h3 {
  margin: 8px 0 5px;
  font-size: 17px;
}

.limit-header p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.limit-create-button {
  flex: 0 0 auto;
  border-color: #f0cdd2;
  color: #d66574;
}

.limit-create-button:hover {
  border-color: var(--coral);
}

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

.limit-card {
  position: relative;
  min-width: 0;
  padding: 17px;
  overflow: hidden;
  border: 1px solid #f0e4e6;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.limit-card::after {
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 86px;
  height: 86px;
  content: "";
  border: 16px solid rgba(239, 127, 141, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.limit-card:hover {
  border-color: #e9d4d8;
  box-shadow: 0 10px 25px rgba(91, 54, 63, 0.08);
  transform: translateY(-2px);
}

.limit-card.reached {
  border-color: #f0d5b6;
  background: rgba(255, 250, 241, 0.88);
}

.limit-card.exceeded {
  border-color: #efbdc4;
  background: rgba(255, 243, 245, 0.9);
}

.limit-card-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 11px;
}

.limit-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #f3dfe2;
  border-radius: 13px;
  background: var(--coral-soft);
  font-size: 21px;
}

.limit-title-copy {
  min-width: 0;
  flex: 1;
}

.limit-title-copy h4 {
  overflow: hidden;
  margin: 0 0 4px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-title-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.limit-status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 99px;
  background: var(--mint-soft);
  color: #389b84;
  font-size: 9px;
  font-weight: 800;
}

.limit-card.reached .limit-status {
  background: var(--yellow-soft);
  color: #b77a29;
}

.limit-card.exceeded .limit-status {
  background: var(--coral-soft);
  color: #d65f70;
}

.limit-meter {
  position: relative;
  z-index: 2;
  height: 7px;
  margin: 16px 0 8px;
  overflow: hidden;
  border-radius: 9px;
  background: #f2edf0;
}

.limit-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #75cbb7, var(--mint));
  transition: width 0.3s ease;
}

.limit-card.reached .limit-meter span {
  background: linear-gradient(90deg, #efc06b, var(--yellow));
}

.limit-card.exceeded .limit-meter span {
  background: linear-gradient(90deg, #f49baa, var(--coral));
}

.limit-summary {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.limit-summary strong {
  color: var(--ink);
  font-size: 11px;
}

.limit-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.limit-record-button,
.limit-undo-button {
  min-height: 35px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: 0.2s ease;
}

.limit-record-button {
  flex: 1;
  border: 0;
  background: linear-gradient(135deg, #f08d9a, #df6d7d);
  box-shadow: 0 6px 14px rgba(223, 109, 125, 0.18);
  color: #fff;
}

.limit-record-button:hover {
  box-shadow: 0 8px 18px rgba(223, 109, 125, 0.25);
  transform: translateY(-1px);
}

.limit-card.reached .limit-record-button,
.limit-card.exceeded .limit-record-button {
  background: var(--surface);
  border: 1px solid #efc7cd;
  box-shadow: none;
  color: #cf6272;
}

.limit-undo-button {
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.limit-undo-button:hover:not(:disabled) {
  border-color: #d3cedf;
  color: var(--ink);
}

.limit-undo-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.limit-delete-button {
  position: relative;
  z-index: 3;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.limit-delete-button:hover {
  background: var(--coral-soft);
  color: var(--coral);
}

.empty-limit {
  display: grid;
  min-height: 130px;
  grid-column: 1 / -1;
  place-items: center;
  padding: 20px;
  border: 1px dashed #ead8db;
  border-radius: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.empty-limit button {
  border: 0;
  background: transparent;
  color: var(--coral);
  font-weight: 700;
  cursor: pointer;
}

/* 趋势模块：组合近七日睡眠柱状图与当月打卡日历。 */
.insights-grid {
  margin-top: 20px;
}

/* 匿名对比模块：展示主动加入者的聚合健康指标和友好排名。 */
.comparison-card {
  position: relative;
  grid-column: 1 / -1;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 88% 12%, rgba(68, 216, 220, 0.14) 0 78px, transparent 79px),
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--purple-soft) 42%, var(--surface)));
}

.comparison-card::after {
  position: absolute;
  z-index: 0;
  right: -44px;
  bottom: -74px;
  width: 180px;
  height: 180px;
  content: "";
  border: 26px solid rgba(124, 108, 242, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.comparison-heading,
.comparison-layout {
  position: relative;
  z-index: 1;
}

.comparison-heading > div > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.comparison-status {
  padding: 7px 10px;
  border: 1px solid var(--acg-outline);
  border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(52, 38, 77, 0.12);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.comparison-status.joined {
  background: var(--mint-soft);
  color: #27836e;
}

.comparison-status.private {
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.comparison-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
  gap: 22px;
  margin-top: 22px;
}

.comparison-current,
.comparison-leaderboard {
  min-width: 0;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--acg-outline) 25%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.comparison-current-top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.comparison-score {
  position: relative;
  display: grid;
  width: 102px;
  height: 102px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--acg-outline);
  border-radius: 50%;
  background: conic-gradient(var(--acg-cyan) 0 var(--score), var(--purple-soft) var(--score) 100%);
  box-shadow: 4px 4px 0 rgba(52, 38, 77, 0.13);
}

.comparison-score::before {
  position: absolute;
  inset: 9px;
  content: "";
  border-radius: 50%;
  background: var(--surface);
}

.comparison-score strong,
.comparison-score small {
  position: relative;
  z-index: 1;
}

.comparison-score strong {
  align-self: end;
  font-size: 29px;
  line-height: 1;
}

.comparison-score small {
  align-self: start;
  color: var(--muted);
  font-size: 9px;
}

.comparison-rank-copy > span,
.leaderboard-heading span {
  color: var(--purple);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.comparison-rank-copy h4,
.leaderboard-heading h4 {
  margin: 7px 0 5px;
  font-size: 17px;
}

.comparison-rank-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.comparison-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 18px 0;
}

.comparison-metrics > span {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  text-align: center;
}

.comparison-metrics b {
  color: var(--purple-dark);
  font-size: 14px;
}

.comparison-metrics small {
  color: var(--muted);
  font-size: 9px;
}

.comparison-consent {
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.comparison-consent > label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.comparison-alias-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.comparison-alias-row input {
  min-width: 0;
  flex: 1;
  padding: 0 12px;
  border: 2px solid color-mix(in srgb, var(--acg-outline) 30%, var(--line));
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
}

.comparison-alias-row input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft);
}

.comparison-consent > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.comparison-consent > p span {
  margin-right: 4px;
  color: var(--mint);
}

.leaderboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.leaderboard-heading small {
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 9px;
  font-weight: 800;
}

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

.leaderboard-item {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.leaderboard-item.current {
  border: 2px solid var(--purple);
  background: var(--purple-soft);
}

.leaderboard-rank {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.leaderboard-user {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.leaderboard-user strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-user small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-item > b {
  color: var(--purple-dark);
  font-size: 16px;
}

.comparison-empty {
  display: grid;
  min-height: 128px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 18px;
  border: 1px dashed color-mix(in srgb, var(--purple) 35%, var(--line));
  border-radius: 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.comparison-empty > span {
  color: var(--purple);
  font-size: 20px;
}

.comparison-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.comparison-empty small {
  color: var(--muted);
  font-size: 9px;
}

.trend-average {
  background: var(--blue-soft);
  color: #5b8fc7;
}

.calendar-month {
  background: var(--yellow-soft);
  color: #b27825;
}

.sleep-chart {
  position: relative;
  display: grid;
  height: 170px;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  padding: 26px 4px 22px;
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
}

.sleep-chart::before {
  position: absolute;
  top: 41px;
  right: 0;
  left: 0;
  content: "";
  border-top: 1px dashed #c8c1e7;
}

.chart-column {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.chart-value {
  position: absolute;
  top: calc(100% - var(--bar-height) - 20px);
  color: var(--muted);
  font-size: 8px;
  opacity: 0;
  transition: opacity .2s ease;
}

.chart-column:hover .chart-value,
.chart-column.today .chart-value {
  opacity: 1;
}

.chart-bar {
  width: min(24px, 64%);
  height: var(--bar-height);
  min-height: 8px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(to top, #a89be9, #8171d2);
  opacity: 0.65;
  transition: 0.2s ease;
}

.chart-column:hover .chart-bar,
.chart-column.today .chart-bar {
  opacity: 1;
  box-shadow: 0 7px 13px rgba(108, 91, 196, 0.2);
}

.chart-column label {
  position: absolute;
  bottom: -17px;
  color: var(--muted);
  font-size: 9px;
}

.chart-column.today label {
  color: var(--purple);
  font-weight: 800;
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  color: var(--muted);
  font-size: 9px;
}

.chart-legend span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--purple);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-weekdays {
  margin: 20px 0 8px;
  color: #aaa7b4;
  font-size: 9px;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  aspect-ratio: 1.1;
  place-items: center;
  border-radius: 9px;
  color: #6e6a7c;
  font-size: 9px;
}

.calendar-day.blank {
  visibility: hidden;
}

.calendar-day.checked {
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-weight: 800;
}

.calendar-day.checked::after {
  position: absolute;
  right: 2px;
  bottom: 1px;
  content: "✓";
  color: var(--purple);
  font-size: 7px;
}

.calendar-day.today {
  background: var(--purple);
  box-shadow: 0 5px 12px rgba(124,108,242,.27);
  color: #fff;
  font-weight: 800;
}

.calendar-day.today::after {
  color: #fff;
}

.calendar-footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-top: 13px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.calendar-footer span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.today-mark,
.done-mark {
  display: grid;
  width: 11px;
  height: 11px;
  place-items: center;
  border-radius: 4px;
}

.today-mark { background: var(--purple); }
.done-mark { background: var(--purple-soft); color: var(--purple); font-size: 7px; }

/* 页脚模块：使用弱化文字结束仪表盘内容。 */
.page-footer {
  display: flex;
  justify-content: space-between;
  padding: 28px 4px 0;
  color: #aaa7b4;
  font-size: 10px;
}

.page-footer i {
  color: var(--coral);
}

/* 移动导航默认隐藏，只在窄屏断点启用。 */
.mobile-nav {
  display: none;
}

/* 表单弹窗模块：统一计划与用户创建流程的输入样式。 */
.app-dialog {
  width: min(92vw, 470px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(48, 39, 93, 0.24);
}

.app-dialog::backdrop {
  background: rgba(34, 29, 61, 0.34);
  backdrop-filter: blur(4px);
}

.app-dialog form {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.dialog-header h2 {
  margin: 7px 0 0;
  font-size: 21px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 21px;
  cursor: pointer;
}

.app-dialog label,
.app-dialog legend {
  color: #656174;
  font-size: 11px;
  font-weight: 700;
}

.app-dialog input[type="text"],
.app-dialog input[type="number"],
.app-dialog select {
  width: 100%;
  padding: 12px 13px;
  margin-top: 7px;
  border: 1px solid #e1ddea;
  border-radius: 11px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
}

.app-dialog input[type="text"]:focus,
.app-dialog input[type="number"]:focus,
.app-dialog select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft);
}

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

.icon-picker,
.color-picker {
  display: flex;
  gap: 9px;
  padding: 0;
  border: 0;
}

.icon-picker legend,
.color-picker legend {
  width: 100%;
  margin-bottom: 9px;
}

.icon-picker label,
.color-picker label {
  position: relative;
}

.icon-picker input,
.color-picker input {
  position: absolute;
  opacity: 0;
}

.icon-picker span {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 20px;
  cursor: pointer;
}

.icon-picker input:checked + span {
  border-color: var(--purple);
  background: var(--purple-soft);
  box-shadow: 0 0 0 3px rgba(124,108,242,.09);
}

.color-picker span {
  display: block;
  width: 35px;
  height: 35px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.color-picker input:checked + span {
  box-shadow: 0 0 0 2px var(--swatch);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 4px;
}

/* 限额表单补充样式：强调非评判式说明与克制计划的珊瑚主题。 */
.dialog-description {
  max-width: 330px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.dialog-tip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--coral-soft);
  color: #a96973;
  font-size: 10px;
  line-height: 1.5;
}

.dialog-tip span {
  color: var(--coral);
  font-size: 14px;
}

.small-button.coral-button {
  background: linear-gradient(135deg, #f08d9a, #df6d7d);
  box-shadow: 0 7px 16px rgba(223, 109, 125, 0.22);
}

/* 操作反馈模块：在页面右下角短暂显示保存或打卡结果。 */
.toast {
  position: fixed;
  z-index: 100;
  right: 28px;
  bottom: 28px;
  display: flex;
  min-width: 260px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(48,39,93,.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: .3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast > span {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  background: var(--mint-soft);
  color: var(--mint);
  font-weight: 800;
}

.toast p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.toast strong { font-size: 12px; }
.toast small { color: var(--muted); font-size: 10px; }

/* ACG 视觉皮肤：用角色插画、漫画网点、速度线和偏移描边统一页面语言。 */
.auth-screen {
  background:
    repeating-radial-gradient(circle at 12% 82%, rgba(52, 38, 77, 0.12) 0 1px, transparent 1.5px 7px),
    linear-gradient(120deg, transparent 0 67%, rgba(255, 111, 157, 0.13) 67% 76%, transparent 76%),
    linear-gradient(145deg, #e9e5ff, #f8f4ff 54%, #fff0f6);
}

.auth-card {
  border: 3px solid var(--acg-outline);
  border-radius: 26px;
  box-shadow: 12px 12px 0 rgba(52, 38, 77, 0.16), 0 32px 90px rgba(63, 51, 121, 0.2);
}

.auth-intro {
  isolation: isolate;
  border-right: 3px solid var(--acg-outline);
  background:
    linear-gradient(155deg, transparent 0 61%, rgba(68, 216, 220, 0.28) 61% 67%, transparent 67%),
    linear-gradient(145deg, #cfc5ff, #eee9ff 52%, #ffd7e6);
}

.auth-intro::before {
  z-index: -1;
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: repeating-conic-gradient(from 214deg at 82% 83%, rgba(52, 38, 77, 0.12) 0 1deg, transparent 1deg 8deg);
  opacity: 0.72;
}

.auth-intro::after {
  z-index: -1;
  right: -74px;
  bottom: -112px;
  left: auto;
  width: 300px;
  height: 300px;
  border: 44px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
}

.auth-kicker,
.hero-kicker {
  color: #553ab7;
  font-family: Consolas, "Microsoft YaHei UI", sans-serif;
  font-weight: 950;
}

.auth-copy h1,
.hero-copy h2 {
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-weight: 950;
  letter-spacing: -0.025em;
}

.auth-copy h1 span,
.hero-copy h2 span {
  color: #6646d7;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.9);
}

.auth-art {
  min-height: 236px;
}

/* 登录向导插画：把方形素材处理成略微倾斜的漫画分镜卡。 */
.auth-character-art {
  position: absolute;
  right: 4px;
  bottom: -28px;
  width: 286px;
  aspect-ratio: 1;
  max-width: none;
  border: 3px solid var(--acg-outline);
  border-radius: 52% 44% 18px 42%;
  background: #e5d4e6;
  box-shadow: 7px 9px 0 rgba(52, 38, 77, 0.2);
  object-fit: cover;
  object-position: center;
  animation: acg-float 4.5s ease-in-out infinite;
}

.auth-scene-tag,
.hero-panel-tag {
  position: absolute;
  z-index: 3;
  padding: 6px 10px;
  border: 2px solid var(--acg-outline);
  background: var(--acg-cyan);
  box-shadow: 3px 3px 0 var(--acg-outline);
  color: #20172f;
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
  transform: rotate(-2deg);
}

.auth-scene-tag {
  bottom: 14px;
  left: 2px;
}

.auth-sfx,
.hero-sfx {
  position: absolute;
  z-index: 4;
  color: var(--acg-pink);
  font-family: "Yu Gothic UI", "Microsoft YaHei UI", sans-serif;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: -0.12em;
  text-shadow: 2px 2px 0 #fff, 3px 3px 0 var(--acg-outline);
  transform: rotate(9deg);
}

.auth-sfx {
  top: 8px;
  right: 4px;
}

.auth-form input,
.app-dialog input[type="text"],
.app-dialog input[type="number"],
.app-dialog select {
  border: 2px solid color-mix(in srgb, var(--acg-outline) 35%, var(--line));
}

.auth-submit,
.small-button.primary,
.mobile-nav button {
  border: 2px solid var(--acg-outline);
  box-shadow: 4px 4px 0 var(--acg-outline);
}

.sidebar {
  border-right: 2px solid var(--acg-outline);
  background:
    radial-gradient(circle at 1px 1px, rgba(95, 73, 151, 0.1) 1px, transparent 1.2px) 0 0 / 15px 15px,
    rgba(255, 255, 255, 0.96);
}

.brand-mark {
  border: 2px solid var(--acg-outline);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--acg-outline);
  transform: rotate(-3deg);
}

.nav-item.active {
  border: 2px solid var(--acg-outline);
  border-radius: 8px;
  background: linear-gradient(105deg, var(--acg-yellow), #fff1a5);
  box-shadow: 4px 4px 0 var(--acg-outline);
  color: #302346;
  transform: rotate(-1deg);
}

.quote-card {
  border: 2px solid var(--acg-outline);
  border-radius: 8px 18px 8px 18px;
  box-shadow: 4px 4px 0 rgba(52, 38, 77, 0.14);
}

.hero-card {
  min-height: 306px;
  isolation: isolate;
  border: 3px solid var(--acg-outline);
  border-radius: 18px 34px 18px 34px;
  background:
    radial-gradient(circle at 74% 46%, rgba(52, 38, 77, 0.14) 0 1px, transparent 1.4px) 0 0 / 8px 8px,
    linear-gradient(116deg, #eeeaff 0 57%, #c9f8f8 57% 72%, #ffd9e6 72% 100%);
  box-shadow: 8px 8px 0 rgba(52, 38, 77, 0.14);
}

.hero-card::before {
  z-index: -1;
  top: -18%;
  right: 5%;
  width: 48%;
  height: 138%;
  border: 0;
  border-radius: 0;
  background: repeating-conic-gradient(from 190deg at 52% 51%, rgba(52, 38, 77, 0.13) 0 1deg, transparent 1deg 7deg);
}

.hero-card::after {
  z-index: -1;
  right: -54px;
  bottom: -146px;
  width: 330px;
  height: 330px;
  border: 42px solid rgba(255, 255, 255, 0.45);
  background: transparent;
}

.chapter-badge {
  padding: 5px 8px;
  border: 2px solid var(--acg-outline);
  background: var(--acg-outline);
  color: #fff;
  font-size: 9px !important;
  letter-spacing: 0.08em;
  transform: rotate(-2deg);
}

.hero-copy {
  max-width: 620px;
}

.hero-copy h2 {
  font-size: clamp(29px, 3.2vw, 43px);
  line-height: 1.26;
}

.hero-tags span {
  border: 2px solid var(--acg-outline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 3px 3px 0 rgba(52, 38, 77, 0.14);
  color: #514763;
  font-weight: 750;
}

.hero-art {
  width: 420px;
  min-width: 390px;
}

/* 首页向导插画：完整保留素材构图，并用不规则圆角融入漫画卡片。 */
.hero-character-art {
  position: absolute;
  right: 48px;
  bottom: -26px;
  width: 316px;
  aspect-ratio: 1;
  max-width: none;
  border: 3px solid var(--acg-outline);
  border-radius: 46% 52% 22px 43%;
  background: #e5d4e6;
  box-shadow: 7px 8px 0 rgba(52, 38, 77, 0.2);
  object-fit: cover;
  object-position: center;
  animation: acg-float 4.5s ease-in-out infinite;
}

.hero-panel-tag {
  right: 0;
  bottom: 21px;
  background: var(--acg-yellow);
  transform: rotate(2deg);
}

.hero-sfx {
  top: 38px;
  left: 4px;
  font-size: 23px;
}

.hero-bubble {
  top: 22px;
  right: 1px;
  border: 2px solid var(--acg-outline);
  border-radius: 19px 19px 19px 3px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--acg-outline);
  color: #6f657f;
}

.card,
.limit-section,
.app-dialog {
  border: 2px solid var(--acg-outline);
  box-shadow: 5px 5px 0 rgba(52, 38, 77, 0.12), var(--shadow);
}

.card {
  border-radius: 12px 22px 12px 22px;
}

.section-label {
  display: inline-flex;
  width: fit-content;
  padding: 4px 9px 4px 7px;
  border: 1px solid var(--acg-outline);
  border-radius: 3px;
  background: var(--acg-outline);
  color: #fff;
  font-family: Consolas, "Microsoft YaHei UI", sans-serif;
  letter-spacing: 0.08em;
  transform: skewX(-5deg);
}

.status-chip,
.trend-average,
.calendar-month,
.limit-status {
  border: 1px solid var(--acg-outline);
  border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(52, 38, 77, 0.12);
}

.progress-ring {
  border: 2px solid var(--acg-outline);
  box-shadow: 3px 3px 0 rgba(52, 38, 77, 0.14);
}

.check-item,
.plan-card,
.limit-card {
  border-width: 2px;
}

.limit-section {
  border-radius: 12px 24px 12px 24px;
  background:
    radial-gradient(circle at 1px 1px, rgba(239, 127, 141, 0.12) 1px, transparent 1.2px) 0 0 / 14px 14px,
    linear-gradient(145deg, #fffdfd, #fff4f7);
}

.outline-button {
  border: 2px solid var(--acg-outline);
  border-radius: 7px;
  box-shadow: 3px 3px 0 var(--acg-outline);
}

.mobile-nav {
  border-top: 2px solid var(--acg-outline);
}

/* 角色呼吸动画：只做轻微浮动，减少对记录内容的干扰。 */
@keyframes acg-float {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-7px) rotate(0.5deg); }
}

/* 夜间主题：替换设计令牌并局部调整渐变与卡片亮度。 */
body.dark {
  --bg: #211f2d;
  --surface: #2c2939;
  --surface-soft: #332f42;
  --ink: #f2eff9;
  --muted: #aaa4bb;
  --line: #403b50;
  --purple-soft: #3b345b;
  --coral-soft: #4d323d;
  --mint-soft: #29463f;
  --blue-soft: #293d54;
  --yellow-soft: #4b402e;
  --shadow: 0 12px 35px rgba(0,0,0,.18);
  --acg-outline: #171123;
  color-scheme: dark;
}

body.dark .sidebar {
  background: rgba(44, 41, 57, 0.94);
}

body.dark .hero-card {
  border-color: #171123;
  background:
    radial-gradient(circle at 74% 46%, rgba(255, 255, 255, 0.12) 0 1px, transparent 1.4px) 0 0 / 8px 8px,
    linear-gradient(116deg, #383151 0 57%, #244e57 57% 72%, #5a3147 72% 100%);
}

body.dark .hero-copy > p,
body.dark .hero-tags span,
body.dark .sleep-meta,
body.dark .plan-card p,
body.dark .plan-stats {
  color: #bbb5ca;
}

body.dark .hero-tags span,
body.dark .hero-bubble {
  background: rgba(44, 41, 57, .7);
}

body.dark .sidebar {
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 1.2px) 0 0 / 15px 15px,
    rgba(44, 41, 57, 0.97);
}

body.dark .section-label,
body.dark .chapter-badge {
  color: #fff;
}

body.dark .hero-kicker,
body.dark .auth-kicker {
  color: #c5b9ff;
}

body.dark .quote-card {
  border-color: #171123;
  background: linear-gradient(145deg, #312d43, #3b2d3b);
}

body.dark .quote-card p {
  color: #e2ddee;
}

body.dark .check-item {
  background: #312e3f;
}

body.dark .limit-section {
  border-color: #51404a;
  background:
    radial-gradient(circle at 92% 16%, rgba(239, 127, 141, 0.11) 0 46px, transparent 47px),
    linear-gradient(145deg, #302b39, #352b35);
}

body.dark .limit-card,
body.dark .limit-card.reached,
body.dark .limit-card.exceeded {
  background: rgba(44, 41, 57, 0.88);
  border-color: #51444f;
}

body.dark .limit-meter {
  background: #413b4a;
}

body.dark .plan-card {
  filter: brightness(.72) saturate(.85);
}

body.dark .comparison-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(68, 216, 220, 0.1) 0 78px, transparent 79px),
    linear-gradient(145deg, #2c2939, #322d46);
}

body.dark .comparison-current,
body.dark .comparison-leaderboard,
body.dark .comparison-score::before,
body.dark .comparison-alias-row input {
  background: var(--surface);
}

/* 夜间主题降低插画亮度，避免浅色素材形成刺眼的独立色块。 */
body.dark .auth-character-art,
body.dark .hero-character-art {
  filter: brightness(.78) saturate(.82);
}

/* 中等屏幕：压缩插画并把主要数据卡改为单列。 */
@media (max-width: 1120px) {
  .main-content {
    padding-right: 26px;
    padding-left: 26px;
  }

  .hero-art {
    width: 330px;
    min-width: 300px;
  }

  .hero-character-art {
    right: 10px;
    width: 292px;
  }

  .mascot {
    right: 60px;
  }

  .hero-bubble {
    display: none;
  }

  .dashboard-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .plan-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 平板与手机：移除桌面侧栏，启用固定底部导航。 */
@media (max-width: 820px) {
  .auth-screen {
    padding: 22px;
  }

  .auth-card {
    grid-template-columns: 0.95fr 1.05fr;
  }

  .auth-intro {
    padding: 32px;
  }

  .auth-form {
    padding: 42px 34px;
  }

  body.authenticated {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .sidebar {
    display: none;
  }

  .main-content {
    width: 100%;
    padding: 12px 14px 28px;
    margin-left: 0;
  }

  .topbar {
    position: sticky;
    z-index: 24;
    top: 0;
    min-height: 64px;
    padding: 9px 4px 11px;
    margin-bottom: 14px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(16px);
  }

  .icon-button {
    display: grid;
    width: 44px;
    height: 44px;
    border-width: 2px;
    border-radius: 12px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .user-button {
    min-width: 0;
    min-height: 44px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .user-button-copy,
  .chevron {
    display: none;
  }

  .hero-card {
    min-height: 290px;
    padding: 30px;
  }

  .hero-art {
    width: 240px;
    min-width: 220px;
    opacity: .82;
  }

  .hero-character-art {
    right: -4px;
    bottom: -18px;
    width: 242px;
  }

  .hero-panel-tag {
    right: -8px;
  }

  .mascot {
    right: 20px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(66px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 4px 6px env(safe-area-inset-bottom);
    border-top: 2px solid var(--acg-outline);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: 0 -8px 30px rgba(50,43,90,.08);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a {
    display: grid;
    min-height: 50px;
    place-items: center;
    gap: 2px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    touch-action: manipulation;
  }

  .mobile-nav a span {
    font-size: 18px;
  }

  .mobile-nav a.active {
    background: var(--purple-soft);
    color: var(--purple);
  }

  .mobile-nav button {
    width: 49px;
    height: 49px;
    justify-self: center;
    border: 3px solid var(--acg-outline);
    border-radius: 16px;
    background: linear-gradient(145deg, var(--purple), #9787f5);
    box-shadow: 0 7px 18px rgba(124,108,242,.3);
    color: #fff;
    font-size: 24px;
    touch-action: manipulation;
  }

  #overview,
  #today,
  #plans,
  #trends {
    scroll-margin-top: 78px;
  }

  .comparison-layout {
    grid-template-columns: 1fr;
  }
}

/* 小屏手机：进一步收紧卡片、插画和表单布局。 */
@media (max-width: 600px) {
  .auth-screen {
    align-items: start;
    padding: 14px;
    overflow-y: auto;
  }

  .auth-card {
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 23px;
  }

  .auth-intro {
    min-height: 285px;
    padding: 24px;
  }

  .auth-brand {
    margin-bottom: 26px;
  }

  .auth-copy h1 {
    max-width: 172px;
    margin: 10px 0 0;
    font-size: 21px;
    line-height: 1.3;
  }

  .auth-copy p {
    display: none;
  }

  .auth-art {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 210px;
    min-height: 165px;
  }

  .auth-character-art {
    right: -34px;
    bottom: -34px;
    width: 202px;
  }

  .auth-scene-tag {
    bottom: 10px;
    left: -122px;
  }

  .auth-sfx {
    top: 16px;
    right: 8px;
  }

  .auth-cat {
    right: 8px;
    bottom: -25px;
    transform: scale(0.7);
    transform-origin: right bottom;
  }

  .auth-plant {
    right: 104px;
    bottom: 4px;
    transform: scale(0.78) rotate(-5deg);
  }

  .auth-star-one { right: 7px; bottom: 95px; }
  .auth-star-two { right: 139px; bottom: 75px; }

  .auth-form {
    gap: 14px;
    padding: 28px 24px 26px;
  }

  .auth-form h2 {
    font-size: 20px;
  }

  .topbar h1 {
    max-width: 205px;
    overflow: hidden;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-card {
    min-height: 338px;
    padding: 23px 20px;
  }

  .hero-copy {
    z-index: 4;
  }

  .hero-copy h2 {
    max-width: 285px;
    font-size: 25px;
  }

  .hero-copy > p {
    max-width: 225px;
    line-height: 1.6;
  }

  .hero-tags {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 16px;
  }

  .hero-art {
    position: absolute;
    right: -31px;
    bottom: 0;
    width: 205px;
    min-width: 0;
    height: 218px;
    opacity: .64;
  }

  .hero-character-art {
    right: 0;
    bottom: 0;
    width: 198px;
  }

  .hero-panel-tag {
    display: none;
  }

  .hero-sfx {
    display: none;
  }

  .mascot {
    right: 10px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
  }

  .card {
    padding: 18px;
    border-radius: 12px 18px 12px 18px;
  }

  .comparison-card {
    padding: 18px;
  }

  .comparison-heading {
    gap: 10px;
  }

  .comparison-heading h3 {
    max-width: 230px;
    font-size: 16px;
  }

  .comparison-heading > div > p {
    line-height: 1.55;
  }

  .comparison-layout {
    gap: 12px;
    margin-top: 16px;
  }

  .comparison-current,
  .comparison-leaderboard {
    padding: 15px;
  }

  .comparison-current-top {
    align-items: flex-start;
    gap: 13px;
  }

  .comparison-score {
    width: 86px;
    height: 86px;
  }

  .comparison-score strong {
    font-size: 25px;
  }

  .comparison-rank-copy h4 {
    font-size: 15px;
  }

  .comparison-metrics {
    gap: 6px;
    margin: 15px 0;
  }

  .comparison-metrics > span {
    padding: 9px 5px;
  }

  .comparison-alias-row {
    flex-wrap: wrap;
  }

  .comparison-alias-row input {
    width: 100%;
    min-height: 44px;
    flex-basis: 100%;
  }

  .comparison-alias-row .small-button {
    flex: 1;
  }

  .leaderboard-user small {
    white-space: normal;
  }

  .sleep-content {
    gap: 14px;
    padding: 20px 0 18px;
  }

  .sleep-orbit {
    width: 78px;
    height: 78px;
  }

  .moon {
    width: 51px;
    height: 51px;
    font-size: 35px;
  }

  .sleep-value strong {
    font-size: 33px;
  }

  .sleep-footer {
    align-items: flex-end;
    gap: 12px;
  }

  .sleep-meta {
    flex-direction: column;
    gap: 5px;
  }

  .section-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .section-header h2 {
    font-size: 16px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .limit-section {
    padding: 21px;
  }

  .limit-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .limit-create-button {
    width: 100%;
  }

  .limit-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .plan-card {
    min-height: 158px;
  }

  .check-item {
    min-height: 58px;
  }

  .plan-menu,
  .limit-delete-button,
  .dialog-close {
    width: 44px;
    height: 44px;
  }

  .small-button,
  .outline-button,
  .limit-record-button,
  .limit-undo-button {
    min-height: 44px;
  }

  .app-dialog {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    margin: auto auto 0;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  .app-dialog form {
    gap: 16px;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .icon-picker {
    flex-wrap: wrap;
  }

  .page-footer {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .toast {
    right: 15px;
    bottom: 82px;
    left: 15px;
    min-width: 0;
  }
}

/* 无障碍动效偏好：尊重系统的减少动画设置。 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
