/* 倒数日 · Days Matter — pixel-careful styles */
:root {
  /* brand */
  --color-primary: #2196f3;
  --color-primary-dark: #1e88e5;
  --color-primary-light: #64b5f6;

  /* surfaces */
  --color-surface: #ffffff;
  --color-surface-2: #f5f5f5;
  --color-text: #212121;
  --color-text-secondary: #757575;
  --color-text-muted: #9e9e9e;
  --color-text-on-primary: #ffffff;
  --color-divider: #e0e0e0;
  --color-divider-dot: #bdbdbd;
  --color-danger: #e53935;
  --color-overlay: rgba(0, 0, 0, 0.4);
  --color-shadow: rgba(0, 0, 0, 0.18);
  --color-card-footer: #fafafa;

  /* wood desk */
  --wood-base: #e8d5b5;
  --wood-mid: #d4b896;
  --wood-dark: #c4a574;
  --wood-light: #f0e4d0;
  --wood-line: rgba(139, 105, 60, 0.08);

  /* type — soft modern sans, not stiff Kai/serif */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC",
    "Noto Sans SC", "Microsoft YaHei UI", "Segoe UI", system-ui, -apple-system,
    sans-serif;
  --font-num: "SF Pro Display", "Helvetica Neue", "PingFang SC",
    system-ui, sans-serif;
  /* Classic Days Matter hero digit — huge & light */
  --fs-hero: clamp(124px, 38vw, 168px);
  --fw-hero: 300;
  --fw-body: 400;
  --fw-ui: 500;
  --ls-tight: 0.01em;
  --ls-ui: 0.02em;

  /* shape */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --card-width: 86%;
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-fab: 0 6px 16px rgba(33, 150, 243, 0.4);

  /* layout */
  --fab-size: 56px;
  --touch-min: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-max: 480px;
  --detail-nav-h: 52px;
  --detail-actions-h: 72px;

  /* aliases used in components */
  --blue: var(--color-primary-dark);
  --blue-dark: #1565c0;
  --text: var(--color-text);
  --text-muted: var(--color-text-muted);
  --card: var(--color-surface);
  --card-footer: var(--color-card-footer);
  --shadow: var(--shadow-card);
  --radius: var(--radius-lg);
  --font: var(--font-sans);
  --num-font: var(--font-num);
}

[data-theme="dark"] {
  --color-primary: #42a5f5;
  --color-primary-dark: #1e88e5;
  --color-surface: #2c2c2c;
  --color-surface-2: #383838;
  --color-text: #f5f5f5;
  --color-text-secondary: #b0b0b0;
  --color-text-muted: #8a8a8a;
  --color-divider: #424242;
  --color-divider-dot: #616161;
  --color-overlay: rgba(0, 0, 0, 0.6);
  --color-shadow: rgba(0, 0, 0, 0.45);
  --color-card-footer: #242424;
  --wood-base: #2a2218;
  --wood-mid: #1f1912;
  --wood-dark: #16120c;
  --wood-light: #3a3024;
  --wood-line: rgba(0, 0, 0, 0.2);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-fab: 0 6px 16px rgba(33, 150, 243, 0.35);
  --blue: #42a5f5;
  --blue-dark: #1e88e5;
  --text: #f5f5f5;
  --text-muted: #8a8a8a;
  --card: #2c2c2c;
  --card-footer: #242424;
  --shadow: var(--shadow-card);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  width: 100%;
  overflow: hidden; /* 文档不滚：内部 .event-list / .page-scroll 自己滚 */
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  max-height: 100%;
  max-height: 100dvh;
  max-width: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--fw-body);
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
  background-color: var(--wood-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden; /* 锁视口，避免整页滚把 fixed 底栏“带跑”的体感 */
  overflow-x: hidden;
  overscroll-behavior: none;
  width: 100%;
  position: relative;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* ── Wood desk background (CSS only, no image) ───────────────────── */
.wood-bg {
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  max-height: 100%;
  max-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--wood-base);
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 2px,
      var(--wood-line) 2px,
      var(--wood-line) 3px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 48px,
      rgba(180, 140, 90, 0.06) 48px,
      rgba(180, 140, 90, 0.06) 50px
    ),
    linear-gradient(
      160deg,
      var(--wood-light) 0%,
      var(--wood-base) 40%,
      var(--wood-mid) 75%,
      var(--wood-dark) 100%
    );
  /* fixed is janky / can cause h-scroll on iOS; scroll is safer for PWA */
  background-attachment: scroll;
  position: relative;
}

.wood-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: multiply;
  z-index: 0;
}

[data-theme="dark"] .wood-bg::before {
  opacity: 0.25;
  mix-blend-mode: soft-light;
}

.app {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0; /* flex 子项可收缩 → 内部列表才能 overflow 滚动 */
  max-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  box-sizing: border-box;
  margin: 0 auto;
}

/* ── Screens ─────────────────────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.screen.active {
  display: flex;
  min-height: 0;
  overflow: hidden; /* 内部 .event-list / .page-scroll 自己滚 */
}

/* 首页：顶栏固定在屏内流，列表区域滚动，底栏/加号 fixed 视口 */
#screen-list.screen.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── List (home) ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  gap: 10px;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.topbar-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, transform 0.1s;
}

.icon-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.35);
}

.search-bar {
  margin: 0 auto 12px;
  padding: 0 16px;
  position: relative;
  max-width: var(--page-max);
  width: 100%;
  box-sizing: border-box;
}

.search-bar input {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  padding: 0 14px 0 40px;
  font-size: 16px; /* avoid iOS zoom */
  background: rgba(255, 255, 255, 0.88);
  color: var(--color-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  outline: none;
  font-family: inherit;
}

[data-theme="dark"] .search-bar input {
  background: rgba(44, 44, 46, 0.92);
  color: #f5f5f5;
}

.search-bar::before {
  content: "⌕";
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.toolbar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.toolbar::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: #fff;
  color: var(--color-primary-dark);
  font-weight: 600;
}

[data-theme="dark"] .chip.active {
  color: #1565c0;
}

.event-list {
  flex: 1 1 auto;
  min-height: 0; /* 关键：flex 子项才能内部滚动 */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* 首页顶栏/筛选不参与收缩，把剩余高度留给 .event-list */
#screen-list > .topbar,
#screen-list > .stats,
#screen-list > .search-bar,
#screen-list > .toolbar {
  flex-shrink: 0;
}

.event-card {
  display: flex;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  min-height: 72px;
  /* 允许列表纵向滑动；拖动中由 JS 锁页 */
  touch-action: pan-y;
}

.event-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

.event-card.pinned {
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.22);
}

.event-color {
  width: 4px;
  flex-shrink: 0;
}

.event-body {
  flex: 1;
  padding: 14px 14px 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.event-meta {
  min-width: 0;
  flex: 1;
}

.event-title {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text);
}

.event-title .emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.event-title .pin-badge {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.event-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-count {
  text-align: right;
  flex-shrink: 0;
}

.event-count .num {
  font-size: 26px;
  font-weight: 300;
  font-family: var(--font-num);
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.event-count .label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.event-count.is-today .num {
  color: var(--color-primary);
  font-weight: 400;
}

.event-count.is-past .num {
  color: var(--color-text-muted);
}

.badge-yearly {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(33, 150, 243, 0.12);
  color: var(--color-primary-dark);
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 500;
}

[data-theme="dark"] .badge-yearly {
  background: rgba(66, 165, 245, 0.18);
  color: #90caf9;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: rgba(255, 255, 255, 0.92);
}

.empty-state .big {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.9;
}

.empty-state p {
  opacity: 0.9;
  font-size: 15px;
  line-height: 1.5;
}

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--safe-bottom));
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
  z-index: 20;
  display: grid;
  place-items: center;
  transition: transform 0.1s, background 0.1s;
}

.fab:active {
  transform: scale(0.92);
  background: var(--color-primary-dark);
}

/* ── Detail (screenshot-faithful Days Matter card) ───────────────── */
/* Shell already applies safe-area — do NOT add env() again here. */
#screen-detail {
  flex: 1;
  min-height: 0;
  width: 100%;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  /* room for floating nav + action row; card stays vertically centered */
  padding: var(--detail-nav-h) 18px var(--detail-actions-h);
}

.detail-nav {
  position: absolute;
  top: 6px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}

.detail-nav .icon-btn {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

/* The card — classic Days Matter on wood desk */
.days-card {
  width: var(--card-width);
  max-width: 360px;
  background: #ffffff;
  background: var(--color-surface);
  border-radius: var(--radius-lg); /* 20px */
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* tall “desk card” proportions, not a stub */
  min-height: min(54dvh, 400px);
  max-height: min(72dvh, 560px);
  animation: card-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Blue #2196F3 header bar — single-line white title (type pill optional corner) */
.days-card-header {
  position: relative;
  background: var(--header-color, #2196f3);
  color: #ffffff;
  text-align: center;
  padding: 0 16px;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 0;
}

.days-card-header h2 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #fff;
  margin: 0;
  padding: 0 4px;
}

.days-card-body {
  flex: 1 1 auto;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 12px;
  background: var(--color-surface);
}

/* Hero day number — screenshot star (huge light “0”) */
.days-number {
  font-family: var(--font-num);
  font-size: var(--fs-hero); /* clamp(120px, 36vw, 160px) */
  font-weight: var(--fw-hero); /* 300 */
  line-height: 0.9;
  color: var(--color-text); /* #212121 */
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  user-select: none;
  margin: 0;
  padding: 0;
}

.days-unit {
  margin-top: 2px;
  font-size: 18px;
  color: var(--color-text-secondary);
  font-weight: 400;
  line-height: 1.2;
}

.days-unit[hidden],
.days-hint[hidden],
.days-note[hidden],
.days-label[hidden] {
  display: none !important;
}

.days-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  min-height: 0;
  text-align: center;
  max-width: 92%;
}

.days-note {
  margin-top: 12px;
  max-width: 90%;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.45;
  word-break: break-word;
}

/* Dotted divider — classic Days Matter bead line */
.days-card-divider {
  border: none;
  height: 1px;
  margin: 4px 22px 0;
  flex-shrink: 0;
  background-image: radial-gradient(
    circle,
    var(--color-divider-dot) 1px,
    transparent 1.2px
  );
  background-size: 8px 2px;
  background-repeat: repeat-x;
  background-position: center;
  border-top: none;
}

/* 目标日 footer */
.days-card-footer {
  background: var(--color-surface);
  padding: 14px 16px 18px;
  text-align: center;
  flex-shrink: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.days-card-footer .target-label {
  font-size: 13px;
  color: var(--color-text-muted); /* #9E9E9E */
  letter-spacing: 0.01em;
  line-height: 1.4;
  font-weight: 400;
}

.detail-actions {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  flex-wrap: wrap;
  z-index: 5;
}

.detail-actions .action-btn {
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .detail-actions .action-btn {
  background: rgba(44, 44, 46, 0.92);
  color: #f5f5f5;
}

.detail-actions .action-btn.danger {
  color: var(--color-danger);
}

.detail-actions .action-btn.primary {
  background: var(--color-primary);
  color: #fff;
}

.detail-actions .action-btn.primary.done {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.event-sub-soft {
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Type picker on form */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--color-surface-2);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--color-text);
  transition: border-color 0.15s, background 0.15s;
}

.type-opt .t-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.type-opt .t-name {
  font-size: 15px;
  font-weight: 600;
}

.type-opt .t-hint {
  font-size: 11px;
  color: var(--color-text-muted);
}

.type-opt.selected {
  border-color: var(--color-primary);
  background: rgba(33, 150, 243, 0.1);
}

[data-theme="dark"] .type-opt.selected {
  background: rgba(66, 165, 245, 0.14);
}

/* More sheet */
.more-sheet {
  max-width: 320px;
  padding-bottom: 12px;
}

.more-sheet h4 {
  margin-bottom: 12px;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 10px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 15px;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
}

.menu-item:active {
  background: var(--color-surface-2);
}

.menu-item.active {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.menu-item.ghost {
  margin-top: 6px;
  color: var(--color-text-muted);
  text-align: center;
}

.menu-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 6px 4px;
}

/* ── Form sheet ──────────────────────────────────────────────────── */
#screen-form {
  background: var(--color-overlay);
  justify-content: flex-end;
  position: fixed;
  inset: 0;
  z-index: 30;
  padding-top: var(--safe-top);
}

.sheet {
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 12px 20px calc(24px + var(--safe-bottom));
  animation: sheet-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--color-divider);
  border-radius: 2px;
  margin: 4px auto 16px;
}

.sheet h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 18px;
  text-align: center;
  color: var(--color-text);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.field input[type="text"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--color-surface-2);
  color: var(--color-text);
  outline: none;
  transition: box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
  padding: 0;
}

.color-swatch.selected {
  border-color: var(--color-text);
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-primary);
}

.emoji-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.emoji-pick {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--color-surface-2);
  font-size: 1.25rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.emoji-pick.selected {
  border-color: var(--color-primary);
  background: rgba(33, 150, 243, 0.12);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  gap: 12px;
}

.toggle-row > span,
.toggle-row > div > span {
  font-size: 15px;
  color: var(--color-text);
}

.toggle-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 31px;
  cursor: pointer;
  transition: 0.2s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: var(--color-primary);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:active {
  background: var(--color-primary-dark);
}

.btn-ghost {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  margin-top: 12px;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-danger-solid {
  background: var(--color-danger);
  color: #fff;
  border: none;
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* Modal confirm */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-root[hidden] {
  display: none !important;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}

.modal-card {
  position: relative;
  background: var(--color-surface);
  border-radius: 16px;
  max-width: 300px;
  width: 100%;
  padding: 20px 18px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  animation: card-in 0.2s ease-out;
}

.modal-card h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.modal-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(33, 33, 33, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 100;
  white-space: nowrap;
  /* avoid 100vw horizontal scroll on mobile browsers */
  max-width: min(320px, calc(100% - 32px));
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Stats strip on list */
.stats {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.stat-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  color: #fff;
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stat-pill:active { transform: scale(0.97); }
.stat-pill.is-active {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85);
}

.stat-pill .n {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-num);
}

.stat-pill .l {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Narrow phones */
@media (max-width: 320px) {
  .days-card {
    width: 90%;
  }

  .days-number {
    font-size: clamp(96px, 30vw, 120px);
  }
}

/* ── Type system (精简扩展) ───────────────────────────────────────── */
.type-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-secondary);
  margin-right: 4px;
  font-weight: 500;
}

[data-theme="dark"] .type-tag {
  background: rgba(255, 255, 255, 0.1);
}

.event-count.is-streak .num {
  color: #ef6c00;
  font-weight: 400;
}

.event-card.need-check {
  box-shadow: 0 4px 16px rgba(239, 108, 0, 0.2);
}

.pin-badge {
  font-size: 0.75rem;
  margin-left: 2px;
}

/*
 * Type pill: classic Days Matter header is title-only.
 * Keep pill for a11y/JS but out of the visual chrome (no column stack).
 */
.type-pill {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Status line above number — quiet secondary, not competing with hero “0” */
.days-label {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  min-height: 0;
  line-height: 1.3;
  text-align: center;
}

.days-label:empty {
  display: none;
}

.progress-wrap {
  width: 80%;
  margin-top: 18px;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

[data-theme="dark"] .progress-bar {
  background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffa726, #ef6c00);
  border-radius: 3px;
  transition: width 0.35s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 6px;
  text-align: center;
}

.action-btn.primary {
  background: linear-gradient(145deg, #42a5f5, #1e88e5);
  color: #fff;
  font-weight: 600;
}

.action-btn.primary.done {
  background: rgba(255, 255, 255, 0.88);
  color: #ef6c00;
  font-weight: 600;
}

[data-theme="dark"] .action-btn.primary.done {
  background: rgba(44, 44, 46, 0.95);
}

/* Type picker grid */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-opt {
  border: 1.5px solid var(--color-divider);
  background: var(--color-surface);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  color: var(--color-text);
}

.type-opt:active {
  transform: scale(0.97);
}

.type-opt.selected {
  border-color: var(--color-primary);
  background: rgba(33, 150, 243, 0.08);
}

.type-opt .t-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.type-opt .t-name {
  font-size: 15px;
  font-weight: 600;
}

.type-opt .t-hint {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* More menu */
.more-sheet {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
}

.more-sheet h4 {
  margin-bottom: 8px;
  text-align: center;
}

.menu-item {
  width: 100%;
  height: 48px;
  border: none;
  background: var(--color-surface-2);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  text-align: center;
}

.menu-item:active {
  opacity: 0.85;
}

.menu-item.ghost {
  background: transparent;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.btn-danger-solid {
  background: var(--color-danger);
  color: #fff;
  border: none;
  border-radius: 12px;
  height: 48px;
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.modal-root[hidden] {
  display: none !important;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}

.modal-card {
  position: relative;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px;
  width: min(340px, 100%);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
}

.modal-card h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.modal-card p {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.event-sub-soft {
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-text-muted);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item.active {
  color: var(--color-primary-dark);
  font-weight: 600;
}

/* ── 静态壁纸层（旧版逻辑：fixed，不随列表滑动） ───── */
.bg-photo {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* 禁止 attachment 动画/视差，壁纸钉死在视口 */
  background-attachment: scroll;
  pointer-events: none;
  transform: translateZ(0);
}

/* 未 hidden 时强制可见，避免个别 WebView 仍当 display:none */
#bg-photo.bg-photo:not([hidden]) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

/* 有自定义/样例类时即使 data-bg 稍晚写入，也保证壁纸层在木纹之上、UI 之下 */
.wood-bg.has-custom-bg > #bg-photo:not([hidden]) {
  z-index: 0 !important;
}

.wood-bg.has-custom-bg {
  /* 壁纸在 #bg-photo，木纹容器本身不画背景图 → 滚列表时图不跟着跑 */
  background-image: none !important;
  background-color: #1a1a1a;
  min-height: 100%;
  min-height: 100dvh;
}

/* 轻遮罩在壁纸之上，仍固定不跟滚 */
.wood-bg.has-custom-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.16;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.12) 0%,
    rgba(0, 0, 0, 0.03) 45%,
    rgba(0, 0, 0, 0.14) 100%
  );
  background-image: none !important;
  mix-blend-mode: normal;
  pointer-events: none;
}

/* ── Announcement popup ──────────────────────────────────────────── */
/* 全屏固定层，操作栏钉死在视口底部，Edge 主屏幕 / 任意页都能看见「我知道了」 */
.announce-root {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.announce-root[hidden] {
  display: none !important;
}

.announce-root .modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.announce-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  /* 给底部固定操作栏腾位置，正文在卡片内滑动 */
  max-height: calc(100dvh - 88px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px));
  max-height: calc(100svh - 88px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px));
  display: flex;
  flex-direction: column;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px 14px;
  animation: sheet-up 0.28s ease-out;
  overflow: hidden;
  box-sizing: border-box;
  background: #ffffff !important;
  color: #111;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .announce-card {
  background: #1c1c1e !important;
  color: #f5f5f7;
}

@media (min-width: 480px) {
  .announce-root {
    justify-content: center;
    padding: 24px !important;
  }
  .announce-card {
    border-radius: 18px;
    max-height: min(70dvh, 560px);
    animation: card-in 0.28s ease-out;
  }
}

.announce-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y !important;
  padding: 0 4px 20px;
  cursor: default;
}

.announce-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.announce-badge.soft {
  background: linear-gradient(135deg, #66bb6a, #43a047);
}

.announce-card h4 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #111 !important;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

[data-theme="dark"] .announce-card h4 {
  color: #f5f5f7 !important;
}

.announce-body {
  overflow: visible;
  flex: none;
  min-height: 0;
  padding-right: 2px;
}

/* 操作栏：固定贴视口底，任何机型 / Edge 主屏幕都能点到 */
.announce-actions {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 100000 !important;
  display: flex !important;
  gap: 10px;
  margin: 0 !important;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px) + 10px) !important;
  /* 不透明底，避免自定义背景透上来看不清字 */
  background: #ffffff !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.14);
  box-sizing: border-box;
  max-width: 480px;
  margin-left: auto !important;
  margin-right: auto !important;
}

[data-theme="dark"] .announce-actions {
  background: #1c1c1e !important;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.announce-root[hidden] .announce-actions {
  display: none !important;
}

.announce-actions .btn {
  flex: 1;
  min-height: 50px !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em;
  border-radius: 14px !important;
  line-height: 1.2 !important;
}

/*
 * 强制高对比：必须压过 data-ui 皮肤（neon/scifi/mech…）与 data-bg=custom 的
 * transparent / 白边按钮规则。选择器含 html[data-ui] 以提高 specificity。
 */
html .announce-actions .btn-primary,
html[data-ui] .announce-actions .btn-primary,
html[data-bg] .announce-actions .btn-primary,
html[data-theme] .announce-actions .btn-primary,
html[data-ui][data-bg] .announce-actions .btn-primary,
html[data-ui][data-theme] .announce-actions .btn-primary,
html[data-bg="custom"] .announce-root .btn-primary {
  background: #1e88e5 !important;
  background-image: none !important;
  border: none !important;
  color: #ffffff !important;
  text-shadow: none !important;
  box-shadow: 0 4px 14px rgba(30, 136, 229, 0.35) !important;
  opacity: 1 !important;
  filter: none !important;
}

html .announce-actions .btn-primary:active,
html[data-ui] .announce-actions .btn-primary:active,
html[data-bg] .announce-actions .btn-primary:active {
  background: #1565c0 !important;
  color: #ffffff !important;
}

html .announce-actions .btn-ghost,
html[data-ui] .announce-actions .btn-ghost,
html[data-bg] .announce-actions .btn-ghost,
html[data-theme] .announce-actions .btn-ghost,
html[data-ui][data-bg] .announce-actions .btn-ghost,
html[data-ui][data-theme] .announce-actions .btn-ghost,
html[data-bg="custom"] .announce-root .btn-ghost {
  background: #f0f2f5 !important;
  background-image: none !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #1a1a1a !important;
  text-shadow: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
}

html[data-theme="dark"] .announce-actions .btn-ghost,
html[data-theme="dark"][data-ui] .announce-actions .btn-ghost,
html[data-theme="dark"][data-bg] .announce-actions .btn-ghost {
  background: #2c2c2e !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .announce-actions .btn-primary,
html[data-theme="dark"][data-ui] .announce-actions .btn-primary,
html[data-theme="dark"][data-bg] .announce-actions .btn-primary {
  background: #42a5f5 !important;
  color: #0a1628 !important;
  font-weight: 800 !important;
}

.announce-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.announce-top-row .announce-badge {
  margin-bottom: 0;
}

.announce-ver-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  background: rgba(33, 150, 243, 0.12);
  border: 1px solid rgba(33, 150, 243, 0.28);
  padding: 3px 9px;
  border-radius: 999px;
}

.announce-lead {
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.55;
  color: #3a3a3c !important;
  margin: 0 0 14px;
}

[data-theme="dark"] .announce-lead {
  color: #d1d1d6 !important;
}

/* 彩蛋重点卡 */
.announce-easter {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin: 0 0 14px;
  background: linear-gradient(
    145deg,
    rgba(30, 20, 60, 0.95) 0%,
    rgba(20, 40, 90, 0.92) 45%,
    rgba(80, 30, 90, 0.9) 100%
  );
  border: 1px solid rgba(180, 160, 255, 0.35);
  box-shadow:
    0 10px 28px rgba(80, 40, 160, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #fff;
}

.announce-easter-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  right: -30px;
  top: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 180, 255, 0.45), transparent 70%);
  pointer-events: none;
}

.announce-easter-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.announce-easter-stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: announce-twinkle 2.4s ease-in-out infinite;
}

.announce-easter-stars span:nth-child(1) {
  left: 12%;
  top: 22%;
  animation-delay: 0s;
}
.announce-easter-stars span:nth-child(2) {
  left: 28%;
  top: 58%;
  width: 2px;
  height: 2px;
  animation-delay: 0.4s;
}
.announce-easter-stars span:nth-child(3) {
  left: 62%;
  top: 30%;
  animation-delay: 0.8s;
}
.announce-easter-stars span:nth-child(4) {
  left: 78%;
  top: 62%;
  width: 2px;
  height: 2px;
  animation-delay: 1.1s;
}
.announce-easter-stars span:nth-child(5) {
  left: 48%;
  top: 18%;
  animation-delay: 1.5s;
}

@keyframes announce-twinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.announce-easter-tag {
  position: relative;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff80ab, #7c4dff, #448aff);
  margin-bottom: 8px;
}

.announce-easter-title {
  position: relative;
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.announce-easter-body {
  position: relative;
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.announce-easter-step {
  position: relative;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #b3e5fc;
  letter-spacing: 0.02em;
}

.announce-section-h {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #111 !important;
  margin: 6px 0 10px;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .announce-section-h {
  color: #f5f5f7 !important;
}

.announce-list-tight {
  margin-bottom: 14px;
}

.announce-list-tight li {
  margin-bottom: 8px;
}

.announce-body h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin: 14px 0 8px;
}

.announce-list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 14.5px !important;
  line-height: 1.7 !important;
  color: #2c2c2e !important;
  font-weight: 500;
}

[data-theme="dark"] .announce-list {
  color: #e5e5ea !important;
}

.announce-list li {
  margin-bottom: 6px;
}

.announce-list.ordered {
  padding-left: 1.3em;
}

.announce-list strong {
  color: var(--color-text);
  font-weight: 600;
}

.announce-credits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.announce-credits > div {
  background: var(--color-surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.announce-credits span {
  font-size: 12px;
  font-weight: 600;
  color: #6e6e73;
}

.announce-credits b {
  font-size: 15px;
  font-weight: 800;
  color: #111;
}

[data-theme="dark"] .announce-credits span {
  color: #98989f;
}

[data-theme="dark"] .announce-credits b {
  color: #f5f5f7;
}

.announce-foot {
  margin-top: 14px;
  font-size: 13px !important;
  font-weight: 600;
  line-height: 1.55;
  color: #555 !important;
}

[data-theme="dark"] .announce-foot {
  color: #aeaeb2 !important;
}

.announce-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
}

.announce-note code {
  display: inline-block;
  margin: 4px 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--color-surface-2);
  font-size: 12.5px;
  word-break: break-all;
}

/* （公告操作栏样式见上方 fixed 定义，勿再覆盖 position） */

/* ── 背景裁剪 / 视频片段裁剪 ───────────────────────────────────── */
#screen-bg-crop,
#screen-video-trim {
  position: relative;
  z-index: 60;
  background: #0d0d0f;
  color: #fff;
  display: none;
  flex-direction: column;
}

#screen-bg-crop.active,
#screen-video-trim.active {
  display: flex;
}

#screen-bg-crop .page-header,
#screen-bg-crop .crop-header,
#screen-video-trim .page-header,
#screen-video-trim .crop-header {
  background: rgba(20, 20, 24, 0.92) !important;
  color: #fff;
}

#screen-bg-crop .crop-header h1,
#screen-video-trim .crop-header h1 {
  color: #fff !important;
}

#screen-bg-crop .nav-back,
#screen-video-trim .nav-back {
  color: #fff;
}

.bg-crop-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 calc(12px + var(--safe-bottom));
  box-sizing: border-box;
}

.bg-crop-viewport {
  position: relative;
  flex: 1;
  min-height: 220px;
  margin: 8px 12px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  touch-action: none;
  user-select: none;
}

.bg-crop-img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  max-height: none;
  will-change: transform;
  pointer-events: none;
  transform-origin: 0 0;
}

.bg-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 四边暗角用 box-shadow 镂空裁剪框 */
}

.bg-crop-frame {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
}

.bg-crop-frame.is-avatar {
  border-radius: 50%;
  border-width: 3px;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.58),
    0 0 0 4px rgba(66, 165, 245, 0.45);
}

.bg-crop-hint {
  text-align: center;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  margin: 8px 16px 4px;
  line-height: 1.4;
}

.bg-crop-tips {
  margin: 8px 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.bg-crop-tip-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.bg-crop-tip-list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.bg-crop-tip-list li {
  margin-bottom: 2px;
}

.modal-body-text {
  white-space: pre-line;
  line-height: 1.55;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-body-text.maker-site-body {
  word-break: break-all;
  font-size: 14px;
}

.maker-site-row .sr-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#modal-root .modal-card {
  max-width: min(360px, 92vw);
}

.bg-crop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 4px;
}

.bg-crop-zoom-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

#bg-crop-zoom {
  flex: 1;
  accent-color: #42a5f5;
}

.bg-crop-actions {
  display: flex;
  gap: 10px;
  padding: 10px 16px 4px;
}

.bg-crop-actions .btn {
  flex: 1;
  min-height: 46px;
}

#screen-bg-crop .btn-ghost,
#screen-video-trim .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── Video trim (clip export) ───────────────────────────────────── */
#screen-video-trim {
  background: #0a0a0c;
  color: #fff;
}

.video-trim-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 calc(12px + var(--safe-bottom));
  box-sizing: border-box;
}

.video-trim-viewport {
  position: relative;
  flex: 1;
  min-height: 200px;
  margin: 8px 12px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-trim-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-trim-meta {
  margin: 8px 16px 4px;
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}

.video-trim-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 16px 8px;
}

.video-trim-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 4px;
}

.video-trim-val {
  font-variant-numeric: tabular-nums;
  color: #90caf9;
  font-size: 12.5px;
}

#video-trim-start,
#video-trim-end {
  width: 100%;
  accent-color: #42a5f5;
}

/* ── Background history ─────────────────────────────────────────── */
.bg-hist-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.bg-hist-item {
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.bg-hist-item:active {
  transform: scale(0.96);
}

.bg-hist-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Diary ──────────────────────────────────────────────────────── */
.diary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 88px;
}

.diary-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  cursor: pointer;
  padding: 14px 16px;
  color: inherit;
  font: inherit;
}

.diary-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.diary-mood {
  font-size: 20px;
}

.diary-date {
  font-size: 12px;
  color: var(--color-text-muted);
}

.diary-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.diary-card-preview {
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* diary-fab rules defined with screen-diary block */

.diary-form textarea {
  min-height: 180px;
  resize: vertical;
}

.diary-mood-row {
  flex-wrap: wrap;
}

/* ── Music dock ─────────────────────────────────────────────────── */
.music-dock {
  position: fixed;
  left: 12px;
  bottom: calc(var(--tab-h, 56px) + var(--safe-bottom) + 14px);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: min(240px, calc(100vw - 96px));
  padding: 4px 4px 4px 4px;
  border-radius: 999px;
  background: rgba(28, 28, 30, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.tab-hidden .music-dock {
  bottom: calc(18px + var(--safe-bottom));
}

.music-dock[hidden] {
  display: none !important;
}

.music-dock.is-playing {
  box-shadow: 0 8px 28px rgba(33, 150, 243, 0.35);
}

.music-dock-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 6px 8px 6px 10px;
  text-align: left;
  font: inherit;
}

.music-ico {
  font-size: 18px;
  flex-shrink: 0;
}

.music-dock-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.music-dock-title {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.music-dock-state {
  font-size: 10.5px;
  opacity: 0.75;
}

.music-dock-mini {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

.music-dock-mini:active {
  transform: scale(0.94);
}

.toggle-in-row .switch {
  flex-shrink: 0;
  margin-left: 8px;
}

.settings-row[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.menu-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 6px 0;
  border: none;
}

/* ═══════════════════════════════════════════════════════════════
   v1.3 — Tab bar · Settings stack · Me · livelier chrome
   ═══════════════════════════════════════════════════════════════ */

:root {
  --tab-h: 56px;
  --page-bg-solid: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] {
  --page-bg-solid: rgba(28, 28, 30, 0.94);
}

/* App body offset for tab bar */
.app {
  padding-bottom: 0;
}

.tab-screen {
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px);
}

.event-list {
  padding-bottom: calc(100px + var(--safe-bottom)) !important;
}

.fab {
  bottom: calc(var(--tab-h) + 16px + var(--safe-bottom)) !important;
}

body.tab-hidden .fab {
  bottom: calc(24px + var(--safe-bottom)) !important;
}

/* ── Bottom tab bar ──────────────────────────────────────────── */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  background: var(--page-bg-solid);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
  max-width: 100%;
}

[data-theme="dark"] .tab-bar {
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.tab-bar.hidden {
  display: none !important;
}

.tab-item {
  flex: 1;
  max-width: 120px;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  border-radius: 14px;
  transition: color 0.2s, transform 0.15s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  padding: 4px 0;
}

.tab-item:active {
  transform: scale(0.94);
}

.tab-item.active {
  color: var(--color-primary-dark);
}

.tab-item.active .tab-ico {
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 2px 6px rgba(33, 150, 243, 0.35));
}

.tab-ico {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.tab-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tab-item.active .tab-label {
  font-weight: 600;
}

/* ── Glass / page headers ────────────────────────────────────── */
.glass-bar {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar.glass-bar {
  align-items: flex-start;
}

.topbar-title-wrap h1 {
  margin: 0;
}

.topbar-sub {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header.solid {
  background: var(--page-bg-solid);
  border-bottom: 1px solid var(--color-divider);
}

.page-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.nav-back-header {
  justify-content: space-between;
}

.nav-back {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
  padding: 0 0 2px;
}

.nav-spacer {
  width: 40px;
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.settings-scroll {
  padding: 12px 16px calc(var(--tab-h) + var(--safe-bottom) + 24px);
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

#screen-settings-sub .settings-scroll,
#screen-auth .settings-scroll {
  padding-bottom: calc(24px + var(--safe-bottom));
}

/* ── Announce button ─────────────────────────────────────────── */
.announce-btn {
  position: relative;
}

.announce-btn .announce-icon {
  font-size: 1.05rem;
}

.announce-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5252;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
  animation: pulse-dot 1.6s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

/* ── Stats livelier ──────────────────────────────────────────── */
.stat-pill {
  transition: transform 0.15s;
}

.stat-pill.accent {
  background: linear-gradient(145deg, rgba(255, 167, 38, 0.35), rgba(255, 255, 255, 0.18));
}

.stat-pill.warm {
  background: linear-gradient(145deg, rgba(66, 165, 245, 0.35), rgba(255, 255, 255, 0.18));
}

.event-card {
  animation: card-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.event-card:nth-child(1) { animation-delay: 0.02s; }
.event-card:nth-child(2) { animation-delay: 0.05s; }
.event-card:nth-child(3) { animation-delay: 0.08s; }
.event-card:nth-child(4) { animation-delay: 0.11s; }
.event-card:nth-child(5) { animation-delay: 0.14s; }

.fab {
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s !important;
}

.fab:active {
  transform: scale(0.9) rotate(90deg) !important;
}

/* ── Settings rows ───────────────────────────────────────────── */
.settings-group {
  margin-bottom: 20px;
}

.settings-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  margin: 0 4px 8px;
  text-transform: none;
}

.settings-card {
  background: var(--color-surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.settings-card.pad {
  padding: 16px;
}

.settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: none;
  border-bottom: 1px solid var(--color-divider);
  background: transparent;
  font-family: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row:not(.static):active {
  background: var(--color-surface-2);
}

.settings-row.selected {
  background: rgba(33, 150, 243, 0.08);
}

.sr-icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.sr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-title {
  font-size: 15px;
  font-weight: 500;
}

.sr-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.sr-chevron {
  color: var(--color-text-muted);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.sr-check {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.settings-footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 8px 0 24px;
  opacity: 0.9;
}

/* Settings pages on solid-ish surface over wood */
#screen-settings,
#screen-settings-sub,
#screen-me,
#screen-auth,
#screen-diary,
#screen-diary-edit {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.35) 100%
  );
}

[data-theme="dark"] #screen-settings,
[data-theme="dark"] #screen-settings-sub,
[data-theme="dark"] #screen-me,
[data-theme="dark"] #screen-auth,
[data-theme="dark"] #screen-diary,
[data-theme="dark"] #screen-diary-edit {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

/* 日记 / 设置子页：保证可滚动、可点 */
#screen-diary,
#screen-diary-edit,
#screen-settings-sub {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#screen-diary .page-scroll,
#screen-diary-edit .page-scroll,
#screen-settings-sub .page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.diary-fab {
  display: grid !important;
  place-items: center;
  bottom: calc(20px + var(--safe-bottom)) !important;
  z-index: 30;
}

/* ── Todo / notes / mood / random ─────────────────────────────── */
.header-text-btn {
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 4px;
  min-width: 40px;
  cursor: pointer;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 96px;
}

.todo-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 12px 4px 6px;
  letter-spacing: 0.02em;
}

.todo-section-title.todo-section-done {
  margin-top: 20px;
  opacity: 0.85;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 10px;
}

.todo-main {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.todo-text-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.todo-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-word;
}

.todo-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.todo-due-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
}

.todo-due-tag.is-today {
  background: rgba(33, 150, 243, 0.16);
  color: #1565c0;
}

.todo-due-tag.is-soon {
  background: rgba(255, 152, 0, 0.16);
  color: #ef6c00;
}

.todo-due-tag.is-overdue {
  background: rgba(239, 83, 80, 0.16);
  color: #c62828;
}

.todo-note-preview {
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.todo-item.pri-high {
  box-shadow: inset 3px 0 0 #ef5350;
}

.todo-item.pri-low {
  opacity: 0.92;
}

.todo-edit-form .field {
  margin-bottom: 14px;
}

.todo-edit-form .field:last-child {
  margin-bottom: 0;
}

.todo-edit-form input[type="text"],
.todo-edit-form input[type="date"],
.todo-edit-form input[type="time"],
.todo-edit-form textarea,
.todo-edit-form .field-select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-divider);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: var(--color-surface-2);
  color: var(--color-text);
}

.todo-edit-form textarea {
  resize: vertical;
  min-height: 72px;
}

.todo-edit-card {
  margin-bottom: 4px;
}

.todo-pri-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.todo-pri-chip {
  flex: 1;
  min-width: 72px;
  border: 1px solid var(--color-divider);
  background: var(--color-surface-2);
  color: var(--color-text);
  border-radius: 12px;
  padding: 10px 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.todo-pri-chip.selected {
  border-color: var(--color-primary);
  background: rgba(33, 150, 243, 0.14);
  color: var(--color-primary);
  font-weight: 600;
}

.todo-edit-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

.todo-edit-actions .btn {
  flex: 1;
}

#screen-todo-edit {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.35) 100%
  );
}

[data-theme="dark"] #screen-todo-edit {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

.sfx-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sfx-chip {
  border: 1px solid var(--color-divider);
  background: var(--color-surface-2);
  color: var(--color-text);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sfx-chip.selected {
  border-color: var(--color-primary);
  background: rgba(33, 150, 243, 0.14);
  color: var(--color-primary);
  font-weight: 600;
}

.music-lib-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.music-lib-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  background: var(--color-surface-2);
  padding: 4px 6px 4px 4px;
}

.music-lib-item.is-active {
  box-shadow: inset 0 0 0 1.5px var(--color-primary);
}

.music-lib-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 8px;
}

.music-lib-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.music-lib-ren {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  color: var(--color-text-secondary);
}

.todo-check {
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-item.is-done .todo-check {
  background: var(--color-primary);
  color: #fff;
}

.todo-item.is-done .todo-text {
  text-decoration: line-through;
  opacity: 0.55;
}

.todo-del {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  flex-shrink: 0;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 88px;
}

.mood-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mood-hist-row {
  display: grid;
  grid-template-columns: 28px 100px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.mood-hist-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.random-input {
  width: 100%;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--color-divider);
  padding: 12px;
  font: inherit;
  min-height: 160px;
  resize: vertical;
  background: var(--color-surface-2);
  color: var(--color-text);
  box-sizing: border-box;
}

.random-result {
  margin-top: 18px;
  text-align: center;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.12), rgba(236, 64, 122, 0.12));
  animation: card-in 0.28s ease-out;
}

.random-result-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.random-result-text {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

#screen-todo,
#screen-notes,
#screen-note-edit,
#screen-mood,
#screen-random {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.35) 100%
  );
}

[data-theme="dark"] #screen-todo,
[data-theme="dark"] #screen-notes,
[data-theme="dark"] #screen-note-edit,
[data-theme="dark"] #screen-mood,
[data-theme="dark"] #screen-random {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

/* type grid: 5 types — allow wrap */
#type-grid.type-grid,
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 380px) {
  .type-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mode-pick-grid {
  padding-bottom: 32px;
}

/* ── Me ──────────────────────────────────────────────────────── */
.me-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #42a5f5 0%, #7e57c2 55%, #ec407a 100%);
  border-radius: 20px;
  box-shadow: 0 8px 28px rgba(33, 150, 243, 0.28);
  color: #fff;
  animation: card-in 0.4s ease;
}

.me-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 600;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

.me-name {
  font-size: 20px;
  font-weight: 700;
}

.me-meta {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

/* ── Auth ────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--color-surface);
  padding: 4px;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.auth-tab {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 11px;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: 0.18s;
}

.auth-tab.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.35);
}

.auth-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 4px 0 16px;
}

.btn-block {
  width: 100%;
}

.auth-form .field {
  margin-bottom: 14px;
}

/* ── About / install sub ─────────────────────────────────────── */
.about-page,
.install-page {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.about-logo {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #42a5f5, #7e57c2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.about-tag {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.install-page h5 {
  margin: 14px 0 8px;
  font-size: 14px;
  color: var(--color-text);
}

.install-page .announce-list {
  color: var(--color-text-secondary);
}

/* Chip polish */
.chip {
  transition: transform 0.12s, background 0.15s, color 0.15s;
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}

/* ── Catalog tab ─────────────────────────────────────────────────── */
.catalog-scroll {
  padding-top: 8px;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.catalog-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.catalog-select {
  flex: 1;
  min-width: 140px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  padding: 0 12px;
}

.btn-sm {
  height: 40px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  flex: 0 0 auto;
}

.catalog-export-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.chip-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  cursor: pointer;
}

.chip-btn:active {
  transform: scale(0.96);
}

.catalog-section {
  margin-bottom: 18px;
}

.catalog-section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 4px 8px;
}

.catalog-section-h h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.catalog-section-h span {
  font-size: 12px;
  color: var(--color-text-muted);
}

.catalog-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--color-divider);
  background: transparent;
  font-family: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.catalog-row:last-child {
  border-bottom: none;
}

.catalog-row:active {
  background: var(--color-surface-2);
}

.cr-emoji {
  font-size: 1.35rem;
  width: 28px;
  text-align: center;
}

.cr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cr-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-num {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 300;
  text-align: right;
  line-height: 1;
}

.cr-num small {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.empty-state.solid {
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border-radius: 16px;
  margin-top: 12px;
}

#screen-catalog {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.35) 100%
  );
}

[data-theme="dark"] #screen-catalog {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

/* Top title smaller on narrow screens for long app name */
.topbar h1 {
  font-size: clamp(15px, 4.2vw, 18px) !important;
  max-width: 70vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   UI modes: simple (简约) vs zone (花哨)
   ═══════════════════════════════════════════════════════════════ */

/* ── Mode picker cards ───────────────────────────────────────── */
.mode-pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  position: relative;
  border: 2px solid var(--color-divider);
  border-radius: 18px;
  background: var(--color-surface);
  padding: 12px 10px 14px;
  text-align: left;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}

.mode-card:active {
  transform: scale(0.97);
}

.mode-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 8px 28px rgba(33, 150, 243, 0.25);
}

.mode-card-preview {
  height: 72px;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.simple-preview {
  background: linear-gradient(180deg, #f5f5f5, #e8e8e8);
  border: 1px solid #e0e0e0;
}

.simple-preview::after {
  content: "";
  display: block;
  width: 60%;
  height: 10px;
  margin: 28px auto 0;
  background: #cfcfcf;
  border-radius: 4px;
}

.zone-preview {
  background:
    radial-gradient(circle at 20% 30%, #ff80ab, transparent 45%),
    radial-gradient(circle at 80% 70%, #82b1ff, transparent 50%),
    linear-gradient(135deg, #7c4dff, #00bcd4);
  animation: zone-preview-shift 3s ease infinite alternate;
}

@keyframes zone-preview-shift {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(25deg); }
}

.mode-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.mode-card-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.mode-card-check {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--color-primary);
  font-weight: 800;
}

/* ── Zone ambient orbs ───────────────────────────────────────── */
.zone-orbs {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

html[data-ui="zone"] .zone-orbs {
  display: block;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: orb-float 12s ease-in-out infinite;
}

.orb.o1 {
  width: 220px;
  height: 220px;
  left: -40px;
  top: 12%;
  background: #ff80ab;
  animation-delay: 0s;
}

.orb.o2 {
  width: 260px;
  height: 260px;
  right: -60px;
  top: 40%;
  background: #82b1ff;
  animation-delay: -4s;
}

.orb.o3 {
  width: 180px;
  height: 180px;
  left: 30%;
  bottom: 8%;
  background: #b388ff;
  animation-delay: -7s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -24px) scale(1.08); }
}

/* ── Zone flashy polish ──────────────────────────────────────── */
html[data-ui="zone"] {
  --color-primary: #7c4dff;
  --color-primary-dark: #651fff;
  --color-primary-light: #b388ff;
  --shadow-fab: 0 8px 28px rgba(124, 77, 255, 0.5);
  --blue: #7c4dff;
  --blue-dark: #651fff;
}

html[data-ui="zone"][data-theme="dark"] {
  --color-primary: #b388ff;
  --color-primary-dark: #7c4dff;
  --blue: #b388ff;
}

html[data-ui="zone"] .wood-bg:not(.has-custom-bg) {
  background-image:
    radial-gradient(ellipse at 10% 0%, rgba(255, 128, 171, 0.35), transparent 50%),
    radial-gradient(ellipse at 90% 20%, rgba(130, 177, 255, 0.4), transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(179, 136, 255, 0.3), transparent 50%),
    linear-gradient(165deg, #1a1040 0%, #2d1b69 35%, #0d47a1 70%, #006064 100%);
  background-color: #1a1040;
}

html[data-ui="zone"][data-theme="light"] .wood-bg:not(.has-custom-bg) {
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(255, 171, 199, 0.55), transparent 45%),
    radial-gradient(ellipse at 100% 10%, rgba(140, 198, 255, 0.5), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(206, 147, 255, 0.4), transparent 45%),
    linear-gradient(160deg, #f3e5f5 0%, #e3f2fd 40%, #e8eaf6 70%, #fce4ec 100%);
  background-color: #e8eaf6;
}

html[data-ui="zone"] .wood-bg:not(.has-custom-bg)::before {
  opacity: 0.08;
}

html[data-ui="zone"] .topbar h1 {
  background: linear-gradient(90deg, #fff 0%, #e1bee7 40%, #bbdefb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

html[data-ui="zone"][data-theme="light"] .topbar h1 {
  background: linear-gradient(90deg, #4a148c, #1565c0, #c2185b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: none;
}

html[data-ui="zone"][data-theme="light"] .topbar-sub {
  color: rgba(74, 20, 140, 0.75);
  text-shadow: none;
}

html[data-ui="zone"] .stat-pill {
  background: linear-gradient(145deg, rgba(255,255,255,0.28), rgba(255,255,255,0.1));
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-ui="zone"] .stat-pill.accent {
  background: linear-gradient(145deg, rgba(255, 128, 171, 0.45), rgba(255,255,255,0.15));
}

html[data-ui="zone"] .stat-pill.warm {
  background: linear-gradient(145deg, rgba(130, 177, 255, 0.45), rgba(255,255,255,0.15));
}

html[data-ui="zone"] .chip.active {
  background: linear-gradient(135deg, #7c4dff, #448aff);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 77, 255, 0.4);
}

html[data-ui="zone"] .event-card {
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 8px 28px rgba(80, 40, 160, 0.12), 0 2px 8px rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
}

html[data-ui="zone"] .event-card.pinned {
  box-shadow: 0 8px 32px rgba(124, 77, 255, 0.28);
  border-color: rgba(124, 77, 255, 0.35);
}

html[data-ui="zone"] .fab {
  background: linear-gradient(145deg, #ea80fc, #7c4dff 50%, #448aff);
  box-shadow: 0 10px 32px rgba(124, 77, 255, 0.55);
}

html[data-ui="zone"] .fab:active {
  transform: scale(0.9) rotate(90deg) !important;
}

html[data-ui="zone"] .tab-bar {
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(124, 77, 255, 0.12);
  box-shadow: 0 -8px 32px rgba(100, 60, 200, 0.1);
}

html[data-ui="zone"][data-theme="dark"] .tab-bar {
  background: rgba(30, 20, 50, 0.88);
}

html[data-ui="zone"] .tab-item.active {
  color: #7c4dff;
}

html[data-ui="zone"] .tab-item.active .tab-ico {
  filter: drop-shadow(0 2px 8px rgba(124, 77, 255, 0.5));
}

html[data-ui="zone"] .me-hero {
  background: linear-gradient(135deg, #ea80fc 0%, #7c4dff 40%, #448aff 75%, #18ffff 100%);
  background-size: 200% 200%;
  animation: me-hero-shift 8s ease infinite;
  box-shadow: 0 12px 40px rgba(124, 77, 255, 0.4);
}

@keyframes me-hero-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

html[data-ui="zone"] .settings-card,
html[data-ui="zone"] .catalog-section .settings-card {
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 8px 28px rgba(80, 40, 160, 0.1);
}

html[data-ui="zone"] .days-card {
  box-shadow: 0 16px 48px rgba(80, 40, 180, 0.25), 0 4px 16px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.4);
}

html[data-ui="zone"] .days-card-header {
  background: linear-gradient(
    120deg,
    var(--header-color, #7c4dff),
    color-mix(in srgb, var(--header-color, #7c4dff) 60%, #448aff)
  );
}

html[data-ui="zone"] .announce-card {
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 20px 60px rgba(80, 40, 180, 0.3);
}

html[data-ui="zone"] .announce-badge {
  background: linear-gradient(135deg, #ea80fc, #7c4dff, #448aff);
}

html[data-ui="zone"] .btn-primary {
  background: linear-gradient(135deg, #7c4dff, #448aff);
  box-shadow: 0 6px 18px rgba(124, 77, 255, 0.35);
}

html[data-ui="zone"] .search-bar input {
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 16px rgba(80, 40, 160, 0.1);
}

html[data-ui="zone"] .icon-btn {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

html[data-ui="zone"] .catalog-select {
  border-color: rgba(124, 77, 255, 0.25);
  box-shadow: 0 2px 10px rgba(80, 40, 160, 0.08);
}

/* ── Simple mode: calm & clean ───────────────────────────────── */
html[data-ui="simple"] .zone-orbs {
  display: none !important;
}

html[data-ui="simple"] .wood-bg:not(.has-custom-bg) {
  background: #f0ebe3;
  background-image:
    linear-gradient(180deg, #f5f0e8 0%, #ebe4d8 100%);
}

html[data-ui="simple"][data-theme="dark"] .wood-bg:not(.has-custom-bg) {
  background: #1c1c1e;
  background-image: none;
}

html[data-ui="simple"] .wood-bg::before {
  opacity: 0.04;
}

html[data-ui="simple"] .topbar h1 {
  background: none;
  color: #fff;
  filter: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

html[data-ui="simple"] .stat-pill {
  background: rgba(255,255,255,0.2);
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

html[data-ui="simple"] .event-card {
  animation: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border: none;
  backdrop-filter: none;
}

html[data-ui="simple"] .fab {
  background: var(--color-primary);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

html[data-ui="simple"] .fab:active {
  transform: scale(0.94) !important;
}

html[data-ui="simple"] .me-hero {
  animation: none;
  background: #546e7a;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

html[data-ui="simple"] .chip.active {
  box-shadow: none;
}

html[data-ui="simple"] .tab-item.active .tab-ico {
  filter: none;
  transform: none;
}

html[data-ui="simple"] .days-card {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border: none;
}

html[data-ui="simple"] .days-card-header {
  background: var(--header-color, var(--color-primary));
}

html[data-ui="simple"] #screen-settings,
html[data-ui="simple"] #screen-catalog,
html[data-ui="simple"] #screen-me,
html[data-ui="simple"] #screen-settings-sub,
html[data-ui="simple"] #screen-auth {
  background: transparent;
}

html[data-ui="simple"] .settings-card {
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
}

/* ═══════════════════════════════════════════════════════════════
   Multi-skin + click FX  (zone / simple / mech / scifi / neon)
   ═══════════════════════════════════════════════════════════════ */

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.fx-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  pointer-events: none;
  animation: fx-ripple 0.55s ease-out forwards;
  z-index: 5;
}

.fx-ripple-zone { background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(124,77,255,0.4) 50%, transparent 70%); }
.fx-ripple-simple { background: rgba(33,150,243,0.35); }
.fx-ripple-mech { background: radial-gradient(circle, #ffd54f, rgba(255,193,7,0.2) 60%, transparent); box-shadow: 0 0 0 1px #424242; }
.fx-ripple-scifi { background: radial-gradient(circle, #18ffff, rgba(0,229,255,0.25) 55%, transparent); }
.fx-ripple-neon { background: radial-gradient(circle, #ff80ab, rgba(0,255,255,0.35) 50%, transparent); }

@keyframes fx-ripple {
  to { transform: scale(18); opacity: 0; }
}

.fx-spark {
  position: fixed;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  pointer-events: none;
  animation: fx-spark 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.fx-spark-zone { background: #e1bee7; box-shadow: 0 0 8px #7c4dff; }
.fx-spark-simple { background: #90caf9; }
.fx-spark-mech { background: #ffc107; border-radius: 1px; width: 5px; height: 5px; }
.fx-spark-scifi { background: #18ffff; box-shadow: 0 0 10px #00e5ff; border-radius: 0; transform: rotate(45deg); }
.fx-spark-neon { background: #00e5ff; box-shadow: 0 0 12px #ff4081, 0 0 4px #00e5ff; }

@keyframes fx-spark {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0) rotate(var(--rot)); opacity: 0; }
}

.fx-burst {
  position: fixed;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  pointer-events: none;
  animation: fx-burst 0.45s ease-out forwards;
}

.fx-burst-zone { border-color: #ce93d8; box-shadow: 0 0 20px #7c4dff; }
.fx-burst-mech { border-color: #ffc107; border-radius: 2px; }
.fx-burst-scifi { border-color: #18ffff; border-radius: 0; box-shadow: 0 0 16px #00e5ff; }
.fx-burst-neon { border-color: #ff80ab; box-shadow: 0 0 18px #00e5ff; }

@keyframes fx-burst {
  to { transform: scale(4); opacity: 0; }
}

button.fx-press,
.chip.fx-press,
.tab-item.fx-press,
.event-card.fx-press,
.settings-row.fx-press,
.mode-card.fx-press {
  transform: scale(0.96);
  transition: transform 0.08s;
}

html[data-ui="zone"] button.fx-press,
html[data-ui="neon"] button.fx-press {
  filter: brightness(1.15);
}

html[data-ui="mech"] button.fx-press {
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.45) !important;
  transform: translateY(1px) scale(0.98);
}

html[data-ui="scifi"] button.fx-press {
  box-shadow: 0 0 16px #18ffff, inset 0 0 8px rgba(0,229,255,0.4) !important;
}

/* overflow for ripples */
button, .chip, .tab-item, .settings-row, .mode-card, .action-btn, .type-opt {
  overflow: hidden;
}

.mode-pick-grid-3 {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 400px) {
  .mode-pick-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

.mode-flagship {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff80ab, #7c4dff, #448aff);
  color: #fff;
}

/* previews */
.mech-preview {
  background:
    repeating-linear-gradient(90deg, #5d4037 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #9e9e9e, #616161 40%, #424242);
  box-shadow: inset 0 0 0 2px #37474f;
}
.mech-preview::after {
  content: "";
  display: block;
  width: 40%;
  height: 14px;
  margin: 28px auto 0;
  background: linear-gradient(180deg, #ffd54f, #ff8f00);
  border: 2px solid #212121;
  border-radius: 2px;
}

.scifi-preview {
  background:
    linear-gradient(rgba(0,229,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.08) 1px, transparent 1px),
    linear-gradient(180deg, #0a192f, #020c1b);
  background-size: 12px 12px, 12px 12px, auto;
}
.scifi-preview::after {
  content: "";
  display: block;
  width: 50%;
  height: 8px;
  margin: 32px auto 0;
  background: #18ffff;
  box-shadow: 0 0 12px #00e5ff;
}

.neon-preview {
  background: #0d0221;
  box-shadow: inset 0 0 20px #ff00aa44;
}
.neon-preview::after {
  content: "";
  display: block;
  width: 55%;
  height: 10px;
  margin: 30px auto 0;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 12px #00f0ff, inset 0 0 8px #ff00aa;
  border-radius: 4px;
}

.hud-grid {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(0,229,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.5) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── MECH skin ───────────────────────────────────────────────── */
html[data-ui="mech"] {
  --color-primary: #ff8f00;
  --color-primary-dark: #ef6c00;
  --color-surface: #eceff1;
  --color-surface-2: #cfd8dc;
  --color-text: #263238;
  --blue: #ff8f00;
  --radius-lg: 6px;
  --radius-md: 4px;
  --font-sans: "DIN Alternate", "Roboto Condensed", "PingFang SC", system-ui, sans-serif;
}

html[data-ui="mech"] .zone-orbs { display: none !important; }

html[data-ui="mech"] .wood-bg:not(.has-custom-bg) {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px),
    linear-gradient(180deg, #78909c 0%, #546e7a 40%, #455a64 100%);
}

html[data-ui="mech"] .topbar h1 {
  background: none;
  color: #fff8e1;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #212121;
  filter: none;
}

html[data-ui="mech"] .chip,
html[data-ui="mech"] .btn,
html[data-ui="mech"] .icon-btn,
html[data-ui="mech"] .tab-item,
html[data-ui="mech"] .fab,
html[data-ui="mech"] .action-btn,
html[data-ui="mech"] .settings-row,
html[data-ui="mech"] .event-card {
  border-radius: 4px !important;
  border: 2px solid #37474f !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 3px 0 #263238 !important;
  font-weight: 700;
}

html[data-ui="mech"] .chip.active,
html[data-ui="mech"] .btn-primary,
html[data-ui="mech"] .fab {
  background: linear-gradient(180deg, #ffd54f, #ff8f00) !important;
  color: #212121 !important;
}

html[data-ui="mech"] .event-card {
  background: linear-gradient(180deg, #fafafa, #cfd8dc);
}

html[data-ui="mech"] .stat-pill {
  border: 2px solid #37474f;
  border-radius: 4px;
  background: rgba(38,50,56,0.45);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

html[data-ui="mech"] .tab-bar {
  background: #546e7a;
  border-top: 3px solid #263238;
}

html[data-ui="mech"] .tab-item { color: #eceff1; }
html[data-ui="mech"] .tab-item.active { color: #ffd54f; }

html[data-ui="mech"] .me-hero {
  animation: none;
  background: linear-gradient(180deg, #90a4ae, #455a64);
  border: 3px solid #263238;
  border-radius: 6px;
  box-shadow: 0 4px 0 #212121;
}

html[data-ui="mech"] .days-card {
  border: 3px solid #37474f;
  border-radius: 6px;
  box-shadow: 0 6px 0 #263238;
}

html[data-ui="mech"] .days-card-header {
  background: linear-gradient(180deg, #ffd54f, #ff8f00) !important;
  color: #212121;
}

/* ── SCIFI skin ──────────────────────────────────────────────── */
html[data-ui="scifi"] {
  --color-primary: #00e5ff;
  --color-primary-dark: #00b8d4;
  --color-surface: rgba(8, 24, 48, 0.88);
  --color-surface-2: rgba(0, 40, 70, 0.9);
  --color-text: #e0f7fa;
  --color-text-secondary: #80deea;
  --color-text-muted: #4dd0e1;
  --color-divider: rgba(0, 229, 255, 0.2);
  --blue: #00e5ff;
  --page-bg-solid: rgba(4, 12, 28, 0.92);
  --font-sans: "SF Mono", "Menlo", "Consolas", "PingFang SC", monospace;
}

html[data-ui="scifi"] .zone-orbs { display: none !important; }
html[data-ui="scifi"] .hud-grid { display: block; }

html[data-ui="scifi"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,229,255,0.2), transparent 50%),
    linear-gradient(180deg, #020617 0%, #0a192f 50%, #020c1b 100%);
}

html[data-ui="scifi"] .topbar h1 {
  background: none;
  color: #18ffff;
  text-shadow: 0 0 12px #00e5ff, 0 0 24px #00b8d4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 14px !important;
  filter: none;
}

html[data-ui="scifi"] .topbar-sub { color: #4dd0e1; text-shadow: none; }

html[data-ui="scifi"] .chip,
html[data-ui="scifi"] .btn,
html[data-ui="scifi"] .icon-btn,
html[data-ui="scifi"] .action-btn,
html[data-ui="scifi"] .settings-row {
  border: 1px solid rgba(0,229,255,0.45) !important;
  border-radius: 2px !important;
  background: rgba(0, 40, 60, 0.55) !important;
  color: #e0f7fa !important;
  box-shadow: 0 0 12px rgba(0,229,255,0.12), inset 0 0 12px rgba(0,229,255,0.05);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

html[data-ui="scifi"] .chip.active,
html[data-ui="scifi"] .btn-primary,
html[data-ui="scifi"] .fab {
  background: rgba(0, 229, 255, 0.2) !important;
  color: #18ffff !important;
  box-shadow: 0 0 20px rgba(0,229,255,0.45), inset 0 0 10px rgba(0,229,255,0.2) !important;
  border-color: #18ffff !important;
}

html[data-ui="scifi"] .event-card,
html[data-ui="scifi"] .settings-card,
html[data-ui="scifi"] .days-card {
  background: rgba(6, 20, 40, 0.85);
  border: 1px solid rgba(0,229,255,0.35);
  border-radius: 2px;
  box-shadow: 0 0 24px rgba(0,229,255,0.1);
  color: #e0f7fa;
}

html[data-ui="scifi"] .days-card-header {
  background: linear-gradient(90deg, #003344, #006680) !important;
  border-bottom: 1px solid #18ffff;
}

html[data-ui="scifi"] .tab-bar {
  background: rgba(2, 10, 24, 0.92);
  border-top: 1px solid rgba(0,229,255,0.3);
}

html[data-ui="scifi"] .tab-item { color: #4dd0e1; }
html[data-ui="scifi"] .tab-item.active {
  color: #18ffff;
  text-shadow: 0 0 10px #00e5ff;
}

html[data-ui="scifi"] .me-hero {
  animation: none;
  background: linear-gradient(135deg, #001a2e, #003d5c);
  border: 1px solid #18ffff;
  box-shadow: 0 0 28px rgba(0,229,255,0.25);
  border-radius: 4px;
}

html[data-ui="scifi"] .stat-pill {
  background: rgba(0, 40, 60, 0.5);
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: 2px;
  color: #e0f7fa;
}

html[data-ui="scifi"] .search-bar input {
  background: rgba(0, 20, 40, 0.8);
  color: #e0f7fa;
  border: 1px solid rgba(0,229,255,0.35);
  border-radius: 2px;
}

/* scanline */
html[data-ui="scifi"] .wood-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0.12) 3px
  );
  opacity: 0.35;
  animation: scan-move 8s linear infinite;
}

@keyframes scan-move {
  from { background-position: 0 0; }
  to { background-position: 0 100px; }
}

/* ── NEON skin ───────────────────────────────────────────────── */
html[data-ui="neon"] {
  --color-primary: #ff2bd6;
  --color-primary-dark: #d500f9;
  --color-surface: rgba(20, 4, 40, 0.9);
  --color-surface-2: rgba(40, 0, 60, 0.95);
  --color-text: #fff0ff;
  --color-text-secondary: #ff80ab;
  --color-text-muted: #80deea;
  --color-divider: rgba(255, 0, 200, 0.2);
  --blue: #00f0ff;
  --page-bg-solid: rgba(12, 0, 28, 0.92);
}

html[data-ui="neon"] .zone-orbs { display: block; }
html[data-ui="neon"] .orb.o1 { background: #ff00aa; opacity: 0.45; }
html[data-ui="neon"] .orb.o2 { background: #00f0ff; opacity: 0.4; }
html[data-ui="neon"] .orb.o3 { background: #d500f9; opacity: 0.35; }

html[data-ui="neon"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,0,170,0.35), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(0,240,255,0.3), transparent 45%),
    linear-gradient(160deg, #0d0221 0%, #1a0533 50%, #05010f 100%);
}

html[data-ui="neon"] .topbar h1 {
  background: linear-gradient(90deg, #ff80ab, #00f0ff, #ea80fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255,0,200,0.6));
  animation: neon-title 3s ease infinite alternate;
}

@keyframes neon-title {
  from { filter: drop-shadow(0 0 8px #ff00aa); }
  to { filter: drop-shadow(0 0 16px #00f0ff); }
}

html[data-ui="neon"] .chip.active,
html[data-ui="neon"] .btn-primary,
html[data-ui="neon"] .fab {
  background: transparent !important;
  border: 2px solid #00f0ff !important;
  color: #00f0ff !important;
  box-shadow: 0 0 16px #00f0ff, inset 0 0 12px rgba(0,240,255,0.2), 0 0 28px rgba(255,0,170,0.35) !important;
  text-shadow: 0 0 8px #00f0ff;
}

html[data-ui="neon"] .event-card,
html[data-ui="neon"] .settings-card,
html[data-ui="neon"] .days-card {
  background: rgba(20, 4, 40, 0.85);
  border: 1px solid rgba(255, 0, 200, 0.45);
  box-shadow: 0 0 24px rgba(255, 0, 170, 0.15), inset 0 0 20px rgba(0,240,255,0.05);
  color: #fff0ff;
}

html[data-ui="neon"] .days-card-header {
  background: linear-gradient(90deg, #ff00aa, #7c4dff) !important;
  box-shadow: 0 0 20px rgba(255,0,170,0.5);
}

html[data-ui="neon"] .tab-bar {
  background: rgba(12, 0, 28, 0.9);
  border-top: 1px solid rgba(0,240,255,0.35);
  box-shadow: 0 -4px 24px rgba(255,0,170,0.15);
}

html[data-ui="neon"] .tab-item { color: #ff80ab; }
html[data-ui="neon"] .tab-item.active {
  color: #00f0ff;
  text-shadow: 0 0 12px #00f0ff;
}

html[data-ui="neon"] .me-hero {
  background: linear-gradient(135deg, #ff00aa, #7c4dff, #00f0ff);
  background-size: 200% 200%;
  animation: me-hero-shift 6s ease infinite;
  box-shadow: 0 0 40px rgba(255,0,170,0.45);
}

html[data-ui="neon"] .stat-pill {
  border: 1px solid rgba(0,240,255,0.4);
  background: rgba(255,0,170,0.15);
  box-shadow: 0 0 12px rgba(0,240,255,0.15);
}

/* Auth gate polish */
#screen-auth .auth-form {
  animation: card-in 0.35s ease;
}

html[data-ui="zone"] #screen-auth,
html[data-ui="neon"] #screen-auth,
html[data-ui="scifi"] #screen-auth {
  background: rgba(0,0,0,0.25);
}

/* ═══════════════════════════════════════════════════════════════
   Contrast fixes — readable text on home + settings (mobile)
   ═══════════════════════════════════════════════════════════════ */

/* Home stats: solid cards, never white-on-white */
.stat-pill {
  background: rgba(255, 255, 255, 0.94) !important;
  color: #1a1a1a !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stat-pill .n {
  color: #111 !important;
  font-weight: 700 !important;
}

.stat-pill .l {
  color: #444 !important;
  opacity: 1 !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.02em;
}

.stat-pill.accent {
  background: linear-gradient(160deg, #fff3e0 0%, #ffe0b2 100%) !important;
  border-color: rgba(239, 108, 0, 0.2) !important;
}

.stat-pill.accent .n {
  color: #e65100 !important;
}

.stat-pill.warm {
  background: linear-gradient(160deg, #e3f2fd 0%, #bbdefb 100%) !important;
  border-color: rgba(25, 118, 210, 0.2) !important;
}

.stat-pill.warm .n {
  color: #1565c0 !important;
}

/* Dark theme home stats */
[data-theme="dark"] .stat-pill {
  background: rgba(40, 40, 44, 0.94) !important;
  color: #f5f5f5 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .stat-pill .n {
  color: #fff !important;
}

[data-theme="dark"] .stat-pill .l {
  color: #c8c8c8 !important;
}

[data-theme="dark"] .stat-pill.accent {
  background: linear-gradient(160deg, #3e2723 0%, #4e342e 100%) !important;
  border-color: rgba(255, 183, 77, 0.35) !important;
}

[data-theme="dark"] .stat-pill.accent .n {
  color: #ffb74d !important;
}

[data-theme="dark"] .stat-pill.warm {
  background: linear-gradient(160deg, #0d2137 0%, #1565c0 160%) !important;
  border-color: rgba(100, 181, 246, 0.35) !important;
}

[data-theme="dark"] .stat-pill.warm .n {
  color: #90caf9 !important;
}

/* Home filter chips: readable on both light & dark zone bg */
.chip {
  background: rgba(255, 255, 255, 0.88) !important;
  color: #1a1a1a !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.chip.active {
  background: linear-gradient(135deg, #5e35b1, #1e88e5) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 3px 12px rgba(94, 53, 177, 0.35) !important;
}

[data-theme="dark"] .chip {
  background: rgba(50, 50, 54, 0.92) !important;
  color: #f0f0f0 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .chip.active {
  background: linear-gradient(135deg, #7c4dff, #42a5f5) !important;
  color: #fff !important;
}

/* Topbar greeting on light zone */
html[data-ui="zone"][data-theme="light"] .topbar-sub {
  color: #3d1a5c !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

html[data-ui="zone"][data-theme="light"] .topbar h1 {
  /* solid fallback if gradient clip fails on some devices */
  color: #4a148c !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  filter: none !important;
  font-weight: 800 !important;
}

html[data-ui="zone"][data-theme="dark"] .topbar h1 {
  color: #fff !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45) !important;
  filter: none !important;
}

html[data-ui="zone"][data-theme="dark"] .topbar-sub {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 500 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

/* Default (non-zone) topbar keep white with stronger shadow */
.topbar h1 {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.2) !important;
}

.topbar-sub {
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Settings / theme pages: high contrast rows */
.settings-card {
  background: #ffffff !important;
  color: #1a1a1a !important;
}

.settings-row {
  color: #1a1a1a !important;
  background: transparent !important;
}

.settings-row .sr-title {
  color: #111111 !important;
  font-weight: 600 !important;
}

.settings-row .sr-desc {
  color: #555555 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

.settings-row .sr-chevron,
.settings-row .sr-check {
  color: #5e35b1 !important;
  opacity: 1 !important;
}

.settings-row.selected {
  background: #ede7f6 !important;
}

.settings-row.selected .sr-title {
  color: #311b92 !important;
}

.settings-group-title {
  color: #424242 !important;
  font-weight: 700 !important;
}

.page-header.solid {
  background: rgba(255, 255, 255, 0.96) !important;
}

.page-header h1 {
  color: #111 !important;
  font-weight: 800 !important;
}

.settings-footer-note {
  color: #555 !important;
  font-weight: 500 !important;
}

/* Dark theme settings */
[data-theme="dark"] .settings-card {
  background: #2c2c2e !important;
  color: #f5f5f5 !important;
}

[data-theme="dark"] .settings-row {
  color: #f5f5f5 !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .settings-row .sr-title {
  color: #ffffff !important;
}

[data-theme="dark"] .settings-row .sr-desc {
  color: #bdbdbd !important;
}

[data-theme="dark"] .settings-row .sr-chevron,
[data-theme="dark"] .settings-row .sr-check {
  color: #b388ff !important;
}

[data-theme="dark"] .settings-row.selected {
  background: rgba(124, 77, 255, 0.22) !important;
}

[data-theme="dark"] .settings-group-title {
  color: #e0e0e0 !important;
}

[data-theme="dark"] .page-header.solid {
  background: rgba(28, 28, 30, 0.96) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .page-header h1 {
  color: #fff !important;
}

[data-theme="dark"] .settings-footer-note {
  color: #b0b0b0 !important;
}

/* Theme option rows: explicit readable labels */
.theme-opt .sr-title,
.lang-opt .sr-title,
.sort-opt .sr-title {
  color: #111 !important;
  font-size: 16px !important;
}

.theme-opt .sr-desc,
.lang-opt .sr-desc,
.sort-opt .sr-desc {
  color: #555 !important;
}

[data-theme="dark"] .theme-opt .sr-title,
[data-theme="dark"] .lang-opt .sr-title,
[data-theme="dark"] .sort-opt .sr-title {
  color: #fff !important;
}

[data-theme="dark"] .theme-opt .sr-desc,
[data-theme="dark"] .lang-opt .sr-desc,
[data-theme="dark"] .sort-opt .sr-desc {
  color: #c0c0c0 !important;
}

/* Sci-fi / neon skins force light text — keep settings readable */
html[data-ui="scifi"] .settings-card,
html[data-ui="neon"] .settings-card {
  background: rgba(8, 20, 40, 0.95) !important;
  border: 1px solid rgba(0, 229, 255, 0.35) !important;
}

html[data-ui="scifi"] .settings-row .sr-title,
html[data-ui="neon"] .settings-row .sr-title {
  color: #e8ffff !important;
}

html[data-ui="scifi"] .settings-row .sr-desc,
html[data-ui="neon"] .settings-row .sr-desc {
  color: #9adce8 !important;
}

html[data-ui="scifi"] .page-header h1,
html[data-ui="neon"] .page-header h1 {
  color: #e8ffff !important;
}

html[data-ui="scifi"] .settings-group-title,
html[data-ui="neon"] .settings-group-title {
  color: #80deea !important;
}

html[data-ui="scifi"] .stat-pill,
html[data-ui="neon"] .stat-pill {
  background: rgba(0, 30, 50, 0.88) !important;
  border: 1px solid rgba(0, 229, 255, 0.4) !important;
  color: #e8ffff !important;
}

html[data-ui="scifi"] .stat-pill .n,
html[data-ui="neon"] .stat-pill .n {
  color: #18ffff !important;
}

html[data-ui="scifi"] .stat-pill .l,
html[data-ui="neon"] .stat-pill .l {
  color: #b2ebf2 !important;
}

html[data-ui="scifi"] .chip,
html[data-ui="neon"] .chip {
  background: rgba(0, 40, 60, 0.85) !important;
  color: #e0f7fa !important;
  border-color: rgba(0, 229, 255, 0.4) !important;
}

html[data-ui="scifi"] .chip.active,
html[data-ui="neon"] .chip.active {
  color: #021018 !important;
  background: #18ffff !important;
}

/* Mech: dark labels on metal pills */
html[data-ui="mech"] .stat-pill {
  background: linear-gradient(180deg, #fafafa, #cfd8dc) !important;
  color: #212121 !important;
  border: 2px solid #37474f !important;
}

html[data-ui="mech"] .stat-pill .n {
  color: #212121 !important;
}

html[data-ui="mech"] .stat-pill .l {
  color: #455a64 !important;
}

html[data-ui="mech"] .chip {
  background: #eceff1 !important;
  color: #212121 !important;
  border: 2px solid #37474f !important;
}

html[data-ui="mech"] .chip.active {
  background: linear-gradient(180deg, #ffd54f, #ff8f00) !important;
  color: #212121 !important;
}

/* Catalog section headers */
.catalog-section-h h3 {
  color: #111 !important;
  font-weight: 800 !important;
}

.catalog-section-h span {
  color: #555 !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .catalog-section-h h3 {
  color: #fff !important;
}

[data-theme="dark"] .catalog-section-h span {
  color: #c0c0c0 !important;
}

.catalog-label {
  color: #222 !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .catalog-label {
  color: #eee !important;
}

.cr-title {
  color: #111 !important;
  font-weight: 700 !important;
}

.cr-sub {
  color: #555 !important;
}

.cr-num {
  color: #111 !important;
}

[data-theme="dark"] .cr-title,
[data-theme="dark"] .cr-num {
  color: #fff !important;
}

[data-theme="dark"] .cr-sub {
  color: #c0c0c0 !important;
}

/* Search input contrast */
.search-bar input {
  color: #111 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500;
}

.search-bar input::placeholder {
  color: #666 !important;
  opacity: 1 !important;
}

[data-theme="dark"] .search-bar input {
  color: #fff !important;
  background: rgba(40, 40, 44, 0.95) !important;
}

[data-theme="dark"] .search-bar input::placeholder {
  color: #aaa !important;
}

/* Tab bar labels a bit stronger */
.tab-item {
  color: #616161 !important;
  font-weight: 600;
}

.tab-item.active {
  color: #5e35b1 !important;
  font-weight: 700;
}

[data-theme="dark"] .tab-item {
  color: #b0b0b0 !important;
}

[data-theme="dark"] .tab-item.active {
  color: #ce93d8 !important;
}

/* Mode cards on settings */
.mode-card-title {
  color: #111 !important;
  font-weight: 800 !important;
}

.mode-card-desc {
  color: #555 !important;
  font-weight: 500 !important;
}

[data-theme="dark"] .mode-card {
  background: #2c2c2e !important;
}

[data-theme="dark"] .mode-card-title {
  color: #fff !important;
}

[data-theme="dark"] .mode-card-desc {
  color: #c0c0c0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Semi-transparent glass UI — custom bg shows through
   ═══════════════════════════════════════════════════════════════ */

/* Stats pills */
.stat-pill {
  background: rgba(255, 255, 255, 0.38) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
  backdrop-filter: blur(14px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.2) !important;
  color: #111 !important;
}

.stat-pill .n {
  color: #0d0d0d !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.stat-pill .l {
  color: #222 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.stat-pill.accent {
  background: rgba(255, 183, 77, 0.38) !important;
  border-color: rgba(255, 152, 0, 0.4) !important;
}

.stat-pill.warm {
  background: rgba(100, 181, 246, 0.38) !important;
  border-color: rgba(30, 136, 229, 0.35) !important;
}

[data-theme="dark"] .stat-pill {
  background: rgba(20, 20, 24, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

[data-theme="dark"] .stat-pill .n {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .stat-pill .l {
  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .stat-pill.accent {
  background: rgba(255, 152, 0, 0.28) !important;
}

[data-theme="dark"] .stat-pill.warm {
  background: rgba(33, 150, 243, 0.3) !important;
}

/* Filter chips */
.chip {
  background: rgba(255, 255, 255, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #111 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

.chip.active {
  background: rgba(94, 53, 177, 0.78) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

[data-theme="dark"] .chip {
  background: rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #f5f5f5 !important;
}

[data-theme="dark"] .chip.active {
  background: rgba(124, 77, 255, 0.72) !important;
  color: #fff !important;
}

/* Search bar */
.search-bar input {
  background: rgba(255, 255, 255, 0.42) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
  color: #111 !important;
}

[data-theme="dark"] .search-bar input {
  background: rgba(0, 0, 0, 0.42) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

/* Event list cards */
.event-card {
  background: rgba(255, 255, 255, 0.52) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(16px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.15) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
}

.event-card .event-title,
.event-card .num {
  color: #111 !important;
}

.event-card .event-sub,
.event-card .event-sub-soft,
.event-card .label {
  color: #333 !important;
}

[data-theme="dark"] .event-card {
  background: rgba(20, 20, 28, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .event-card .event-title,
[data-theme="dark"] .event-card .num {
  color: #fff !important;
}

[data-theme="dark"] .event-card .event-sub,
[data-theme="dark"] .event-card .event-sub-soft,
[data-theme="dark"] .event-card .label {
  color: rgba(255, 255, 255, 0.78) !important;
}

/* Icon buttons on home */
.icon-btn {
  background: rgba(255, 255, 255, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-ui="zone"][data-theme="light"] .icon-btn {
  color: #3d1a5c !important;
  text-shadow: none;
}

[data-theme="dark"] .icon-btn {
  background: rgba(0, 0, 0, 0.35) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

/* FAB */
.fab {
  background: rgba(94, 53, 177, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Tab bar glass */
.tab-bar {
  background: rgba(255, 255, 255, 0.55) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(22px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.3) !important;
}

[data-theme="dark"] .tab-bar {
  background: rgba(18, 18, 22, 0.55) !important;
  border-top-color: rgba(255, 255, 255, 0.12) !important;
}

/* Settings cards + rows */
.settings-card {
  background: rgba(255, 255, 255, 0.48) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(18px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08) !important;
}

.settings-row {
  background: transparent !important;
  border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

.settings-row .sr-title {
  color: #111 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.settings-row .sr-desc {
  color: #333 !important;
}

.settings-row.selected {
  background: rgba(94, 53, 177, 0.14) !important;
}

.page-header.solid {
  background: rgba(255, 255, 255, 0.5) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
}

.page-header h1 {
  color: #111 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .settings-card {
  background: rgba(24, 24, 30, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .settings-row .sr-title {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .settings-row .sr-desc {
  color: rgba(255, 255, 255, 0.78) !important;
}

[data-theme="dark"] .page-header.solid {
  background: rgba(18, 18, 24, 0.5) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .page-header h1 {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Mode cards */
.mode-card {
  background: rgba(255, 255, 255, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.mode-card.selected {
  border-color: rgba(94, 53, 177, 0.7) !important;
  background: rgba(237, 231, 246, 0.55) !important;
}

[data-theme="dark"] .mode-card {
  background: rgba(24, 24, 30, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

/* Catalog */
.catalog-select {
  background: rgba(255, 255, 255, 0.42) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #111 !important;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: #222 !important;
}

.catalog-row {
  background: transparent !important;
  border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="dark"] .catalog-select,
[data-theme="dark"] .chip-btn {
  background: rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

/* Auth form card */
.auth-form.settings-card,
.settings-card.pad {
  background: rgba(255, 255, 255, 0.5) !important;
}

/* Type options in form */
.type-opt {
  background: rgba(255, 255, 255, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.type-opt.selected {
  background: rgba(94, 53, 177, 0.2) !important;
  border-color: rgba(94, 53, 177, 0.55) !important;
}

/* Sheet / form panel */
.sheet {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(22px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.2) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .sheet {
  background: rgba(22, 22, 28, 0.78) !important;
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* Detail action buttons */
.action-btn {
  background: rgba(255, 255, 255, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #111 !important;
}

.action-btn.primary {
  background: rgba(94, 53, 177, 0.78) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] .action-btn {
  background: rgba(0, 0, 0, 0.4) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

/* Days Matter detail card — slightly glass so bg peeks at edges */
.days-card {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
}

[data-theme="dark"] .days-card {
  background: rgba(30, 30, 34, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Sci-fi / neon keep glass but tinted */
html[data-ui="scifi"] .stat-pill,
html[data-ui="neon"] .stat-pill {
  background: rgba(0, 40, 60, 0.45) !important;
  border: 1px solid rgba(0, 229, 255, 0.4) !important;
  color: #e8ffff !important;
}

html[data-ui="scifi"] .stat-pill .n,
html[data-ui="neon"] .stat-pill .n {
  color: #18ffff !important;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

html[data-ui="scifi"] .stat-pill .l,
html[data-ui="neon"] .stat-pill .l {
  color: #b2ebf2 !important;
  text-shadow: none;
}

html[data-ui="scifi"] .chip,
html[data-ui="neon"] .chip,
html[data-ui="scifi"] .event-card,
html[data-ui="neon"] .event-card,
html[data-ui="scifi"] .settings-card,
html[data-ui="neon"] .settings-card {
  background: rgba(4, 20, 40, 0.48) !important;
  border-color: rgba(0, 229, 255, 0.35) !important;
  color: #e8ffff !important;
}

html[data-ui="scifi"] .chip.active,
html[data-ui="neon"] .chip.active {
  background: rgba(0, 229, 255, 0.35) !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4) !important;
}

html[data-ui="scifi"] .event-card .event-title,
html[data-ui="neon"] .event-card .event-title,
html[data-ui="scifi"] .event-card .num,
html[data-ui="neon"] .event-card .num {
  color: #e8ffff !important;
}

html[data-ui="mech"] .stat-pill,
html[data-ui="mech"] .chip,
html[data-ui="mech"] .event-card,
html[data-ui="mech"] .settings-card {
  background: rgba(236, 239, 241, 0.55) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* ═══════════════════════════════════════════════════════════════
   Background-aware UI
   - default  → frosted glass (毛玻璃)
   - custom   → fully transparent frames (全透明框，背景全露)
   ═══════════════════════════════════════════════════════════════ */

/* ── 自定义/样例：固定壁纸 + 全透明框（彩蛋原版，不是毛玻璃） ─ */
html[data-bg="custom"] .wood-bg.has-custom-bg {
  background-color: #111 !important;
  background-image: none !important;
}

html[data-bg="custom"] .wood-bg.has-custom-bg::before {
  opacity: 0.22 !important;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.18) 0%,
    rgba(0, 0, 0, 0.06) 40%,
    rgba(0, 0, 0, 0.16) 100%
  ) !important;
  background-image: none !important;
  mix-blend-mode: normal !important;
  backdrop-filter: none !important;
}

html[data-bg="custom"] .zone-orbs,
html[data-bg="custom"] .hud-grid {
  display: none !important;
}

html[data-bg="custom"] .wood-bg::after {
  display: none !important;
}

/* 内容层在壁纸之上；切勿把 tab-bar / fab 改成 relative（会跟着滚、像“没了”） */
html[data-bg="custom"] .app {
  position: relative;
  z-index: 2;
  /* 保持视口锁高；勿用 min-height:auto 撑开整页 */
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

html[data-bg="custom"] .wood-bg,
html[data-bg="custom"] .wood-bg.has-custom-bg {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

html[data-bg="custom"] .screen {
  z-index: 2;
}

html[data-bg="custom"] .fx-ambient {
  z-index: 1;
}

/* 底栏 + 加号：永远固定在视口，自定义背景也不例外（禁止 relative / display:none） */
html[data-bg="custom"] .tab-bar,
.tab-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 50 !important;
}

html[data-bg="custom"] .fab,
.fab {
  position: fixed !important;
  right: 20px !important;
  z-index: 45 !important;
  /* display 由 JS 控制 grid/none；此处绝不写 none/relative */
}

/* 自定义背景：加号保持以前的透明玻璃感 */
html[data-bg="custom"] .fab {
  background: rgba(255, 255, 255, 0.22) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
  color: #fff !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 全透明框：背景全露（默认木纹才是毛玻璃） */
html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card,
html[data-bg="custom"] .icon-btn,
html[data-bg="custom"] .settings-card,
html[data-bg="custom"] .mode-card,
html[data-bg="custom"] .catalog-select,
html[data-bg="custom"] .chip-btn,
html[data-bg="custom"] .type-opt,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .page-header.solid,
html[data-bg="custom"] .tab-bar,
html[data-bg="custom"] .sheet,
html[data-bg="custom"] .auth-tabs,
html[data-bg="custom"] .me-hero {
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card,
html[data-bg="custom"] .settings-card,
html[data-bg="custom"] .mode-card,
html[data-bg="custom"] .type-opt,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .catalog-select,
html[data-bg="custom"] .chip-btn {
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
}

html[data-bg="custom"] .icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75) !important;
}

/* 透明框上：白字 + 轻阴影，保证可读 */
html[data-bg="custom"] .topbar h1,
html[data-bg="custom"] .topbar-sub,
html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .stat-pill .n,
html[data-bg="custom"] .stat-pill .l,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card .event-title,
html[data-bg="custom"] .event-card .num,
html[data-bg="custom"] .event-card .event-sub,
html[data-bg="custom"] .event-card .event-sub-soft,
html[data-bg="custom"] .event-card .label,
html[data-bg="custom"] .settings-row .sr-title,
html[data-bg="custom"] .settings-row .sr-desc,
html[data-bg="custom"] .settings-group-title,
html[data-bg="custom"] .page-header h1,
html[data-bg="custom"] .settings-footer-note,
html[data-bg="custom"] .mode-card-title,
html[data-bg="custom"] .mode-card-desc,
html[data-bg="custom"] .catalog-label,
html[data-bg="custom"] .catalog-section-h h3,
html[data-bg="custom"] .catalog-section-h span,
html[data-bg="custom"] .cr-title,
html[data-bg="custom"] .cr-sub,
html[data-bg="custom"] .cr-num,
html[data-bg="custom"] .tab-item,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .type-opt .t-name,
html[data-bg="custom"] .type-opt .t-hint,
html[data-bg="custom"] .me-name,
html[data-bg="custom"] .me-meta {
  color: #fff !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.45) !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  filter: none !important;
}

html[data-bg="custom"] .search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.75) !important;
}

html[data-bg="custom"] .search-bar::before {
  color: rgba(255, 255, 255, 0.85) !important;
}

html[data-bg="custom"] .chip.active {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: #fff !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: none !important;
}

html[data-bg="custom"] .settings-row.selected,
html[data-bg="custom"] .type-opt.selected,
html[data-bg="custom"] .mode-card.selected {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}

html[data-bg="custom"] .settings-row {
  border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}

html[data-bg="custom"] .sr-chevron,
html[data-bg="custom"] .sr-check {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

html[data-bg="custom"] .tab-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 50 !important;
  /* 不可 relative；不可 display:none（.tab-bar.hidden 仍可藏） */
  border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
  /* 轻微可用：极轻底，仍透背景，但不会“像没了” */
  background: rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* custom 下列表仍必须内部滚动 */
html[data-bg="custom"] .event-list,
html[data-bg="custom"] #event-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

html[data-bg="custom"] .tab-item {
  color: rgba(255, 255, 255, 0.75) !important;
}

html[data-bg="custom"] .tab-item.active {
  color: #fff !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6), 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* 拖动时只锁列表；切勿用 body overflow 锁死整页 */
body.wm-drag-lock #event-list {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

/* fab 样式见上方统一 fixed 规则，勿再改 position */

/* Detail card: keep mostly opaque for classic Days Matter look,
   but slightly translucent so photo peeks through edges */
html[data-bg="custom"] .days-card {
  background: rgba(255, 255, 255, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(2px) !important;
  -webkit-backdrop-filter: blur(2px) !important;
}

html[data-bg="custom"] .days-card .days-number,
html[data-bg="custom"] .days-card .days-label,
html[data-bg="custom"] .days-card .target-label,
html[data-bg="custom"] .days-card .days-hint,
html[data-bg="custom"] .days-card .days-note {
  text-shadow: none !important;
  color: inherit !important;
}

/* Form fields on transparent sheet */
html[data-bg="custom"] .sheet {
  background: rgba(0, 0, 0, 0.35) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
}

html[data-bg="custom"] .sheet h3,
html[data-bg="custom"] .field label,
html[data-bg="custom"] .toggle-row span {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

html[data-bg="custom"] .field input,
html[data-bg="custom"] .field select,
html[data-bg="custom"] .field textarea {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: #fff !important;
  backdrop-filter: none !important;
}

html[data-bg="custom"] .btn-ghost {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
}

html[data-bg="custom"] .btn-primary {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid #fff !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* Me hero transparent with ring */
html[data-bg="custom"] .me-hero {
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  animation: none !important;
}

/* 自定义背景：不要用 background 简写，否则会冲掉头像的 background-image / 子 img */
html[data-bg="custom"] .me-avatar {
  background-color: rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.75) !important;
  color: #fff !important;
}

html[data-bg="custom"] .me-avatar.has-photo {
  background-color: transparent !important;
  color: transparent !important;
}

html[data-bg="custom"] .me-avatar .me-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Screens that had solid tints — clear them so photo shows */
html[data-bg="custom"] #screen-settings,
html[data-bg="custom"] #screen-settings-sub,
html[data-bg="custom"] #screen-me,
html[data-bg="custom"] #screen-auth,
html[data-bg="custom"] #screen-catalog,
html[data-bg="custom"] #screen-diary,
html[data-bg="custom"] #screen-diary-edit {
  background: transparent !important;
}

/* 日记卡片在自定义背景上可读 */
html[data-bg="custom"] .diary-card-title,
html[data-bg="custom"] .diary-card-preview,
html[data-bg="custom"] .diary-date {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* Default bg: keep frosted glass (already defined above).
   Ensure data-bg=default is explicit for clarity. */
html[data-bg="default"] .stat-pill,
html[data-bg="default"] .chip:not(.active),
html[data-bg="default"] .settings-card {
  /* glass retained from previous rules */
}

/* ═══════════════════════════════════════════════════════════════
   Typography polish — lively but grounded, no heavy outline
   ═══════════════════════════════════════════════════════════════ */

body,
button,
input,
select,
textarea {
  font-family: var(--font-sans) !important;
}

/* Soft hierarchy — avoid 700/800 “stamp” weights */
.topbar h1,
.page-header h1,
.me-name,
.catalog-section-h h3,
.sr-title,
.mode-card-title,
.event-title,
.cr-title {
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
}

.topbar h1 {
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  /* soft glow, not hard outline */
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12) !important;
}

.topbar-sub,
.stat-pill .l,
.chip,
.sr-desc,
.event-sub,
.event-sub-soft,
.cr-sub,
.catalog-label,
.settings-group-title,
.settings-footer-note {
  font-weight: 400 !important;
  letter-spacing: 0.04em !important;
}

.stat-pill .n,
.event-count .num,
.cr-num,
.days-number {
  font-family: var(--font-num) !important;
  font-weight: 400 !important;
  letter-spacing: -0.02em !important;
  font-variant-numeric: tabular-nums;
}

.days-number {
  font-weight: 300 !important;
  letter-spacing: -0.04em !important;
}

.chip,
.tab-item,
.btn,
.action-btn,
.settings-row {
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
}

.tab-label {
  font-weight: 400 !important;
  letter-spacing: 0.06em !important;
  font-size: 11px !important;
}

/* Kill harsh multi-layer shadows from earlier contrast passes */
.stat-pill .n,
.stat-pill .l,
.chip,
.event-card .event-title,
.event-card .num,
.event-card .event-sub,
.event-card .label,
.settings-row .sr-title,
.settings-row .sr-desc,
.page-header h1,
.mode-card-title,
.mode-card-desc,
.cr-title,
.cr-sub,
.cr-num,
.catalog-section-h h3,
.me-name,
.me-meta {
  text-shadow: none !important;
}

/* 透明框上保留轻阴影，保证白字在照片上可读 */
html[data-bg="custom"] .event-card .event-title,
html[data-bg="custom"] .event-card .num,
html[data-bg="custom"] .event-card .event-sub,
html[data-bg="custom"] .event-card .event-sub-soft,
html[data-bg="custom"] .event-card .label,
html[data-bg="custom"] .stat-pill .n,
html[data-bg="custom"] .stat-pill .l,
html[data-bg="custom"] .chip {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.4) !important;
  font-weight: 500 !important;
}

html[data-bg="custom"] .topbar h1 {
  font-weight: 600 !important;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(0, 0, 0, 0.45) !important;
}

/* Slight bounce for titles — lively, not floaty */
.topbar h1,
.page-header h1 {
  font-optical-sizing: auto;
}

/* Zone light title: soft color, no gradient clip weirdness */
html[data-ui="zone"][data-theme="light"] .topbar h1 {
  color: #4a3080 !important;
  background: none !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

html[data-ui="zone"][data-theme="dark"] .topbar h1 {
  color: #f3e8ff !important;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.25) !important;
}

/* Mech: still industrial but not brick-stiff type */
html[data-ui="mech"] {
  --font-sans: "Noto Sans SC", "PingFang SC", system-ui, sans-serif !important;
}

html[data-ui="mech"] body,
html[data-ui="mech"] button {
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}

/* Sci-fi: keep mono numbers, softer UI labels */
html[data-ui="scifi"] {
  --font-sans: "Noto Sans SC", "DM Sans", "PingFang SC", system-ui, sans-serif !important;
}

html[data-ui="scifi"] .chip,
html[data-ui="scifi"] .btn,
html[data-ui="scifi"] .settings-row {
  text-transform: none !important;
  letter-spacing: 0.03em !important;
  font-size: inherit;
}

.field-select,
.field input[type="time"] {
  width: 100%;
  height: 46px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.field-select:focus,
.field input[type="time"]:focus {
  border-color: var(--color-primary);
}

.toggle-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
  font-weight: 400;
}

/* In-app reminder banner (fallback for WeChat etc.) */
.inapp-remind-host {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.inapp-remind-card {
  pointer-events: auto;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(30, 30, 36, 0.88);
  color: #fff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-family: inherit;
  cursor: pointer;
  animation: ir-in 0.35s ease;
}

.inapp-remind-card .ir-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.inapp-remind-card .ir-body {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.4;
}

@keyframes ir-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Ambient FX + new skins + avatar + readable text all modes
   ═══════════════════════════════════════════════════════════════ */

.fx-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

html[data-bg="custom"] .fx-ambient {
  opacity: 1;
  z-index: 1;
}
html[data-bg="custom"] .fx-ambient-on-photo .amb-star {
  box-shadow: 0 0 8px rgba(255,255,255,0.95), 0 0 2px #fff;
}
html[data-bg="custom"] .fx-ambient-on-photo .amb-moon {
  text-shadow: 0 0 12px rgba(255,255,200,0.9), 0 2px 8px rgba(0,0,0,0.6);
  opacity: 0.9;
}

/* Rising stars / dots */
.amb-star,
.amb-dot {
  position: absolute;
  bottom: -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  animation: amb-rise linear infinite;
}

.amb-dot {
  background: rgba(180, 220, 255, 0.9);
  box-shadow: 0 0 8px rgba(100, 200, 255, 0.7);
}

@keyframes amb-rise {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  10% { opacity: 1; }
  100% {
    transform: translate(var(--sx, 0), -110vh) scale(1);
    opacity: 0;
  }
}

/* Sakura petals */
.amb-petal {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 10px;
  background: radial-gradient(circle at 30% 30%, #ffc0d9, #ff80ab 70%);
  border-radius: 80% 0 80% 0;
  animation: amb-fall linear infinite;
  opacity: 0.85;
}

@keyframes amb-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.9; }
  100% {
    transform: translate(var(--drift, 40px), 110vh) rotate(360deg);
    opacity: 0.2;
  }
}

/* Aurora bands */
.amb-aurora {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 40%;
  filter: blur(40px);
  opacity: 0.45;
  animation: amb-aurora 12s ease-in-out infinite alternate;
}
.amb-aurora.a1 {
  top: 5%;
  background: linear-gradient(90deg, transparent, #00e676, #18ffff, transparent);
}
.amb-aurora.a2 {
  top: 25%;
  background: linear-gradient(90deg, transparent, #ea80fc, #7c4dff, transparent);
  animation-delay: -4s;
  opacity: 0.35;
}
.amb-aurora.a3 {
  top: 45%;
  background: linear-gradient(90deg, transparent, #82b1ff, #00bcd4, transparent);
  animation-delay: -7s;
  opacity: 0.3;
}

@keyframes amb-aurora {
  from { transform: translateX(-8%) skewX(-6deg); }
  to { transform: translateX(8%) skewX(6deg); }
}

.amb-neon-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px #ff00aa, 0 0 4px #00f0ff;
  animation: amb-twinkle 2.4s ease-in-out infinite;
}

@keyframes amb-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.4); }
}

.amb-ink-blot {
  position: absolute;
  width: 120px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,30,30,0.08), transparent 70%);
  animation: amb-ink 10s ease-in-out infinite alternate;
}

@keyframes amb-ink {
  from { transform: scale(1); opacity: 0.5; }
  to { transform: scale(1.2); opacity: 0.25; }
}

/* Mode previews */
.aurora-preview {
  background: linear-gradient(120deg, #0a1628, #123 40%, #1a3a4a);
  position: relative;
  overflow: hidden;
}
.aurora-preview::after {
  content: "";
  position: absolute;
  inset: 20% -10%;
  background: linear-gradient(90deg, transparent, #00e67688, #18ffff88, transparent);
  filter: blur(8px);
}

.starry-preview {
  background: radial-gradient(circle at 30% 20%, #1a237e, #000 70%);
}
.starry-preview::after {
  content: "✦ · ✧ · ✦";
  display: block;
  text-align: center;
  padding-top: 28px;
  color: #fff;
  font-size: 10px;
  letter-spacing: 4px;
  opacity: 0.85;
}

.sakura-preview {
  background: linear-gradient(180deg, #fff0f5, #f8bbd0 50%, #fce4ec);
}
.sakura-preview::after {
  content: "❀";
  display: block;
  text-align: center;
  padding-top: 24px;
  font-size: 22px;
  opacity: 0.7;
}

.ink-preview {
  background: linear-gradient(160deg, #f5f0e8, #e8e0d4 50%, #d7cfc4);
}
.ink-preview::after {
  content: "";
  display: block;
  width: 50%;
  height: 2px;
  margin: 34px auto 0;
  background: #5d4037;
  opacity: 0.4;
}

/* ── AURORA skin ─────────────────────────────────────────────── */
html[data-ui="aurora"] {
  --color-primary: #26a69a;
  --color-primary-dark: #00897b;
  --color-text: #e8fff8;
  --color-text-secondary: #b2dfdb;
  --color-text-muted: #80cbc4;
  --color-surface: rgba(8, 28, 32, 0.72);
  --color-surface-2: rgba(12, 40, 44, 0.85);
  --color-divider: rgba(0, 230, 180, 0.2);
  --page-bg-solid: rgba(6, 18, 24, 0.88);
  --blue: #26c6da;
}

html[data-ui="aurora"] .zone-orbs { display: none !important; }

html[data-ui="aurora"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 230, 118, 0.35), transparent 45%),
    radial-gradient(ellipse at 80% 30%, rgba(0, 229, 255, 0.28), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(124, 77, 255, 0.25), transparent 45%),
    linear-gradient(180deg, #041018 0%, #0a2030 50%, #061820 100%);
}

html[data-ui="aurora"] .topbar h1 {
  color: #e0fff6 !important;
  background: none !important;
  text-shadow: 0 0 16px rgba(0, 230, 180, 0.45) !important;
  font-weight: 600 !important;
}

html[data-ui="aurora"] .topbar-sub {
  color: #b2dfdb !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4) !important;
}

html[data-ui="aurora"] .chip.active,
html[data-ui="aurora"] .btn-primary,
html[data-ui="aurora"] .fab {
  background: linear-gradient(135deg, #26a69a, #00bcd4) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(0, 188, 212, 0.35) !important;
}

html[data-ui="aurora"] .tab-item { color: #80cbc4 !important; }
html[data-ui="aurora"] .tab-item.active { color: #e0f7fa !important; }

/* ── STARRY skin ─────────────────────────────────────────────── */
html[data-ui="starry"] {
  --color-primary: #7e57c2;
  --color-primary-dark: #5e35b1;
  --color-text: #f3e5f5;
  --color-text-secondary: #e1bee7;
  --color-text-muted: #ce93d8;
  --color-surface: rgba(16, 12, 40, 0.75);
  --color-surface-2: rgba(28, 20, 56, 0.88);
  --color-divider: rgba(179, 136, 255, 0.22);
  --page-bg-solid: rgba(10, 8, 28, 0.9);
  --blue: #b388ff;
}

html[data-ui="starry"] .zone-orbs { display: none !important; }

html[data-ui="starry"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(63, 81, 181, 0.35), transparent 50%),
    radial-gradient(circle at 20% 30%, rgba(103, 58, 183, 0.25), transparent 35%),
    linear-gradient(180deg, #050510 0%, #0d0a24 45%, #12082a 100%);
}

html[data-ui="starry"] .topbar h1 {
  color: #f8e8ff !important;
  background: none !important;
  text-shadow: 0 0 18px rgba(179, 136, 255, 0.5) !important;
  font-weight: 600 !important;
}

html[data-ui="starry"] .topbar-sub {
  color: #e1bee7 !important;
}

html[data-ui="starry"] .chip.active,
html[data-ui="starry"] .btn-primary,
html[data-ui="starry"] .fab {
  background: linear-gradient(135deg, #7e57c2, #5c6bc0) !important;
  color: #fff !important;
  box-shadow: 0 6px 22px rgba(126, 87, 194, 0.4) !important;
  border: none !important;
}

html[data-ui="starry"] .tab-item { color: #b39ddb !important; }
html[data-ui="starry"] .tab-item.active { color: #f3e5f5 !important; }

/* ── SAKURA skin ─────────────────────────────────────────────── */
html[data-ui="sakura"] {
  --color-primary: #ec407a;
  --color-primary-dark: #d81b60;
  --color-text: #4a148c;
  --color-text-secondary: #6a1b9a;
  --color-text-muted: #8e24aa;
  --color-surface: rgba(255, 255, 255, 0.72);
  --color-surface-2: rgba(255, 240, 246, 0.9);
  --color-divider: rgba(236, 64, 122, 0.15);
  --page-bg-solid: rgba(255, 250, 252, 0.9);
  --blue: #ec407a;
}

html[data-ui="sakura"] .zone-orbs { display: none !important; }

html[data-ui="sakura"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(ellipse at 10% 0%, rgba(255, 192, 203, 0.55), transparent 40%),
    radial-gradient(ellipse at 90% 20%, rgba(255, 224, 230, 0.5), transparent 40%),
    linear-gradient(165deg, #fff5f8 0%, #fce4ec 40%, #f3e5f5 100%);
}

html[data-ui="sakura"] .topbar h1 {
  color: #880e4f !important;
  background: none !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5) !important;
  font-weight: 600 !important;
}

html[data-ui="sakura"] .topbar-sub {
  color: #ad1457 !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

html[data-ui="sakura"] .chip {
  color: #4a148c !important;
  background: rgba(255,255,255,0.65) !important;
}

html[data-ui="sakura"] .chip.active,
html[data-ui="sakura"] .btn-primary,
html[data-ui="sakura"] .fab {
  background: linear-gradient(135deg, #f48fb1, #ec407a) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(236, 64, 122, 0.3) !important;
}

html[data-ui="sakura"] .tab-item { color: #8e24aa !important; }
html[data-ui="sakura"] .tab-item.active { color: #c2185b !important; }

html[data-ui="sakura"] .settings-row .sr-title,
html[data-ui="sakura"] .page-header h1 {
  color: #4a148c !important;
}

html[data-ui="sakura"] .settings-row .sr-desc {
  color: #6a1b9a !important;
}

/* ── INK skin ────────────────────────────────────────────────── */
html[data-ui="ink"] {
  --color-primary: #5d4037;
  --color-primary-dark: #3e2723;
  --color-text: #2c2416;
  --color-text-secondary: #5d4e37;
  --color-text-muted: #6d5c4d;
  --color-surface: rgba(255, 252, 245, 0.82);
  --color-surface-2: rgba(245, 240, 230, 0.92);
  --color-divider: rgba(93, 64, 55, 0.12);
  --page-bg-solid: rgba(250, 247, 240, 0.92);
  --blue: #6d4c41;
}

html[data-ui="ink"] .zone-orbs { display: none !important; }

html[data-ui="ink"] .wood-bg:not(.has-custom-bg) {
  background:
    linear-gradient(165deg, #faf6ef 0%, #f0e9dc 50%, #e6dfd0 100%);
}

html[data-ui="ink"] .topbar h1 {
  color: #3e2723 !important;
  background: none !important;
  text-shadow: none !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
}

html[data-ui="ink"] .topbar-sub {
  color: #5d4037 !important;
  text-shadow: none !important;
}

html[data-ui="ink"] .chip {
  color: #3e2723 !important;
  background: rgba(255,255,255,0.55) !important;
  border-color: rgba(93,64,55,0.15) !important;
}

html[data-ui="ink"] .chip.active,
html[data-ui="ink"] .btn-primary,
html[data-ui="ink"] .fab {
  background: #5d4037 !important;
  color: #faf6ef !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(62, 39, 35, 0.25) !important;
}

html[data-ui="ink"] .tab-item { color: #6d4c41 !important; }
html[data-ui="ink"] .tab-item.active { color: #3e2723 !important; font-weight: 600 !important; }

html[data-ui="ink"] .settings-row .sr-title,
html[data-ui="ink"] .page-header h1 {
  color: #2c2416 !important;
}

html[data-ui="ink"] .settings-row .sr-desc {
  color: #5d4e37 !important;
}

/* Avatar photo */
.me-avatar {
  cursor: pointer;
  overflow: hidden;
  position: relative;
  padding: 0;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  transition: transform 0.15s, box-shadow 0.2s;
  border: 2px solid rgba(255, 255, 255, 0.55);
  font-family: inherit;
  color: #fff;
}

.me-avatar .me-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  pointer-events: none;
}

.me-avatar.has-photo {
  color: transparent !important;
}

.me-avatar:active {
  transform: scale(0.96);
}

/* Flagship corner tag on mode cards */
.mode-flagship {
  display: inline-block !important;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c4dff, #448aff);
  color: #fff !important;
  text-shadow: none !important;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(68, 138, 255, 0.35);
}

/* ── Readable text: all dark skins ───────────────────────────── */
html[data-ui="aurora"] .settings-card,
html[data-ui="starry"] .settings-card,
html[data-ui="scifi"] .settings-card,
html[data-ui="neon"] .settings-card {
  background: rgba(10, 16, 28, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

html[data-ui="aurora"] .settings-row .sr-title,
html[data-ui="starry"] .settings-row .sr-title,
html[data-ui="scifi"] .settings-row .sr-title,
html[data-ui="neon"] .settings-row .sr-title,
html[data-ui="aurora"] .page-header h1,
html[data-ui="starry"] .page-header h1,
html[data-ui="scifi"] .page-header h1,
html[data-ui="neon"] .page-header h1,
html[data-ui="aurora"] .mode-card-title,
html[data-ui="starry"] .mode-card-title {
  color: #f5f9ff !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35) !important;
  font-weight: 600 !important;
}

html[data-ui="aurora"] .settings-row .sr-desc,
html[data-ui="starry"] .settings-row .sr-desc,
html[data-ui="scifi"] .settings-row .sr-desc,
html[data-ui="neon"] .settings-row .sr-desc,
html[data-ui="aurora"] .mode-card-desc,
html[data-ui="starry"] .mode-card-desc {
  color: rgba(230, 240, 255, 0.82) !important;
}

html[data-ui="aurora"] .page-header.solid,
html[data-ui="starry"] .page-header.solid,
html[data-ui="scifi"] .page-header.solid,
html[data-ui="neon"] .page-header.solid {
  background: rgba(8, 12, 24, 0.55) !important;
  border-bottom-color: rgba(255,255,255,0.1) !important;
}

html[data-ui="aurora"] .chip:not(.active),
html[data-ui="starry"] .chip:not(.active) {
  background: rgba(255,255,255,0.12) !important;
  color: #f0f7ff !important;
  border-color: rgba(255,255,255,0.22) !important;
}

html[data-ui="aurora"] .event-card,
html[data-ui="starry"] .event-card {
  background: rgba(12, 18, 36, 0.55) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
}

html[data-ui="aurora"] .event-card .event-title,
html[data-ui="starry"] .event-card .event-title,
html[data-ui="aurora"] .event-card .num,
html[data-ui="starry"] .event-card .num {
  color: #f5f9ff !important;
}

html[data-ui="aurora"] .event-card .event-sub,
html[data-ui="starry"] .event-card .event-sub,
html[data-ui="aurora"] .event-card .label,
html[data-ui="starry"] .event-card .label {
  color: rgba(220, 230, 255, 0.8) !important;
}

html[data-ui="aurora"] .stat-pill,
html[data-ui="starry"] .stat-pill {
  background: rgba(255,255,255,0.12) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
}

html[data-ui="aurora"] .stat-pill .n,
html[data-ui="starry"] .stat-pill .n {
  color: #fff !important;
}

html[data-ui="aurora"] .stat-pill .l,
html[data-ui="starry"] .stat-pill .l {
  color: rgba(255,255,255,0.88) !important;
}

html[data-ui="aurora"] .search-bar input,
html[data-ui="starry"] .search-bar input {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.22) !important;
}

html[data-ui="aurora"] .search-bar input::placeholder,
html[data-ui="starry"] .search-bar input::placeholder {
  color: rgba(255,255,255,0.55) !important;
}

/* Light skins readable */
html[data-ui="sakura"] .event-card .event-title,
html[data-ui="ink"] .event-card .event-title,
html[data-ui="sakura"] .event-card .num,
html[data-ui="ink"] .event-card .num {
  color: #2c1810 !important;
}

html[data-ui="sakura"] .event-card .event-sub,
html[data-ui="ink"] .event-card .event-sub {
  color: #5d4037 !important;
}

html[data-ui="sakura"] .stat-pill .n,
html[data-ui="ink"] .stat-pill .n {
  color: #3e2723 !important;
}

html[data-ui="sakura"] .stat-pill .l,
html[data-ui="ink"] .stat-pill .l {
  color: #5d4037 !important;
}

/* Custom bg: keep ambient particles visible */
html[data-bg="custom"] .fx-ambient {
  display: block !important;
  opacity: 1 !important;
}

/* Zone flagship badge — corner tag only */
.mode-flagship {
  display: inline-block !important;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c4dff, #448aff);
  color: #fff !important;
  text-shadow: none !important;
  box-shadow: 0 2px 8px rgba(68, 138, 255, 0.35);
  line-height: 1.4;
}

/* Simple mode: title / greeting never white-on-light */
html[data-ui="simple"] .topbar h1 {
  color: #1a237e !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) !important;
  filter: none !important;
  font-weight: 600 !important;
}

html[data-ui="simple"] .topbar-sub {
  color: #283593 !important;
  text-shadow: none !important;
  font-weight: 500 !important;
  opacity: 1 !important;
}

html[data-ui="simple"][data-theme="dark"] .topbar h1 {
  color: #e8eaf6 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45) !important;
}

html[data-ui="simple"][data-theme="dark"] .topbar-sub {
  color: #c5cae9 !important;
}

/* Simple light: slightly deeper wood so navy title pops */
html[data-ui="simple"][data-theme="light"] .wood-bg:not(.has-custom-bg) {
  background: linear-gradient(180deg, #ebe4d6 0%, #e0d6c6 100%) !important;
}

html[data-ui="simple"] .icon-btn {
  color: #1a237e !important;
  text-shadow: none !important;
  background: rgba(255, 255, 255, 0.55) !important;
  border-color: rgba(26, 35, 126, 0.15) !important;
}

html[data-ui="simple"][data-theme="dark"] .icon-btn {
  color: #fff !important;
  background: rgba(0, 0, 0, 0.35) !important;
}

.install-callout {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

.install-callout.warn {
  background: rgba(255, 243, 224, 0.9);
  border-color: rgba(255, 152, 0, 0.35);
}

.install-callout h5 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.install-callout .announce-note {
  margin: 0;
}

[data-theme="dark"] .install-callout {
  background: rgba(40, 40, 44, 0.75);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .install-callout.warn {
  background: rgba(80, 50, 10, 0.55);
  border-color: rgba(255, 183, 77, 0.35);
}

.install-page h5 {
  margin-top: 16px;
}

/* Rising moons + sparkles */
.amb-moon {
  position: absolute;
  bottom: -24px;
  color: #fff8e1;
  opacity: 0.75;
  animation: amb-rise-moon linear infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 236, 179, 0.8));
  line-height: 1;
  z-index: 1;
}

@keyframes amb-rise-moon {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  12% { opacity: 0.85; }
  100% {
    transform: translate(var(--sx, 0), -115vh) rotate(25deg) scale(1.1);
    opacity: 0;
  }
}

.amb-sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px #fff;
  animation: amb-twinkle 2.8s ease-in-out infinite;
  pointer-events: none;
}

.fx-ambient-on-photo .amb-star {
  z-index: 1;
}

/* Stronger stars on photo backgrounds */
html[data-bg="custom"] .amb-star {
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 4px #ffe082;
}

/* ── Motion background: video + GIF/WebP/APNG ─────────────────── */
/* 媒体层 z-index:0；压暗 ::before 在上方 z-index:1（须压过 data-bg=custom 规则） */
.bg-video,
.bg-anim,
.bg-anim-freeze {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  /* 省电：独立合成层，减少重绘 */
  transform: translateZ(0);
  contain: strict;
}

.bg-anim-freeze {
  image-rendering: auto;
}

/* 动态背景时不要再用 CSS 静态图；specificity 须 ≥ html[data-bg=custom] .has-custom-bg */
html[data-bg="custom"] .wood-bg.has-custom-bg.has-video-bg,
.wood-bg.has-video-bg {
  background-image: none !important;
  background-color: #0a0a0c !important;
  background-attachment: scroll !important;
}

/* 压暗层须盖在 video / 动图 / 定格 canvas 之上 */
html[data-bg="custom"] .wood-bg.has-custom-bg.has-video-bg::before,
.wood-bg.has-video-bg::before {
  z-index: 1;
  opacity: 0.35 !important;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.42) 100%
  ) !important;
  background-image: none !important;
  mix-blend-mode: normal !important;
  backdrop-filter: none !important;
}

html[data-bg="custom"] .wood-bg.has-video-bg .zone-orbs,
html[data-bg="custom"] .wood-bg.has-video-bg .hud-grid,
html[data-bg="custom"] .wood-bg.has-video-bg .fx-ambient,
.wood-bg.has-video-bg .zone-orbs,
.wood-bg.has-video-bg .hud-grid,
.wood-bg.has-video-bg .fx-ambient {
  z-index: 2;
}

/* 定格帧与 live 媒体同层，仍在压暗层之下 */
.wood-bg.motion-frozen .bg-anim-freeze {
  z-index: 0;
}

/* ── 设置页「自定义排序」拖动列表 ─────────────────────────────── */
.sort-custom-hint {
  margin: 0 16px 8px;
  opacity: 0.75;
}

.sort-reorder-list {
  overflow: hidden;
  padding: 0 !important;
}

.sort-reorder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 6px;
  min-height: 48px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.12);
  background: transparent;
  touch-action: pan-y;
  position: relative;
  user-select: none;
}

.sort-reorder-item:last-child {
  border-bottom: none;
}

.sort-reorder-emoji {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.sort-reorder-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text, inherit);
}

/* 拖动源：留在原位半透明 */
.sort-reorder-item.is-drag-source,
.event-card.is-drag-source {
  opacity: 0.32;
  filter: grayscale(0.15);
  touch-action: none;
  user-select: none;
}

/* 跟随手指的幽灵 */
.event-card-ghost {
  position: fixed !important;
  z-index: 10050 !important;
  margin: 0 !important;
  pointer-events: none !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28) !important;
  transform: scale(1.02);
  opacity: 0.96;
  touch-action: none;
  user-select: none;
  background: var(--color-surface, #fff) !important;
  border-radius: var(--radius-md, 12px);
}

html[data-theme="dark"] .event-card-ghost {
  background: var(--color-surface, #2a2a2a) !important;
}

/* 设置页紧凑拖动手把（非主页整列灰条） */
.event-drag-handle,
.sort-drag-handle {
  position: relative;
  left: auto;
  top: auto;
  bottom: auto;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  z-index: 5;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--color-text-muted, #888);
  font-size: 15px;
  letter-spacing: -2px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  border-radius: 8px;
}

.event-drag-handle:active,
.sort-drag-handle:active {
  cursor: grabbing;
  color: #42a5f5;
  background: rgba(66, 165, 245, 0.15);
}

/* 历史背景：角标删除 */
.bg-hist-item-wrap {
  position: relative;
  display: block;
  aspect-ratio: 1;
  min-width: 0;
}

.bg-hist-item-wrap .bg-hist-item {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.bg-hist-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.bg-hist-del:active {
  background: rgba(198, 40, 40, 0.9);
}

/* 主页卡片色条恢复贴边，不再为拖动手把让位 */

/* ── Announce：纯滑动阅读（已取消拖拽卡片） ─────────────────── */
.announce-drag-bar {
  display: none !important;
}

.announce-card {
  touch-action: pan-y !important;
  cursor: default !important;
  will-change: auto;
}

.announce-card.is-dragging {
  touch-action: pan-y !important;
  cursor: default !important;
  transform: none !important;
}

.announce-top-row,
#announce-title,
.announce-lead,
#announce-scroll,
.announce-list,
.announce-easter,
.announce-credits,
.announce-foot {
  touch-action: pan-y !important;
  cursor: default !important;
}
  touch-action: pan-y;
}

/* ── Announce high-contrast (file-end override：压过全部 UI 皮肤) ── */
html[data-ui] .announce-actions .btn-primary,
html[data-bg] .announce-actions .btn-primary,
html[data-theme] .announce-actions .btn-primary {
  background: #1e88e5 !important;
  background-image: none !important;
  border: none !important;
  color: #fff !important;
  text-shadow: none !important;
  box-shadow: 0 4px 14px rgba(30, 136, 229, 0.35) !important;
  filter: none !important;
  opacity: 1 !important;
}
html[data-ui] .announce-actions .btn-ghost,
html[data-bg] .announce-actions .btn-ghost,
html[data-theme] .announce-actions .btn-ghost {
  background: #f0f2f5 !important;
  background-image: none !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #1a1a1a !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .announce-actions .btn-primary,
html[data-theme="dark"][data-ui] .announce-actions .btn-primary {
  background: #42a5f5 !important;
  color: #0a1628 !important;
  font-weight: 800 !important;
}
html[data-theme="dark"] .announce-actions .btn-ghost,
html[data-theme="dark"][data-ui] .announce-actions .btn-ghost {
  background: #2c2c2e !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f5f5f7 !important;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE LAYOUT CRITICAL (file-end ironclad)
   - tab-bar / fab: position:fixed !important（含 data-bg=custom）
   - 禁止把二者改成 relative / 误 hide（.tab-bar.hidden 除外）
   - event-list: min-height:0 + overflow-y:auto 内部滚动
   ═══════════════════════════════════════════════════════════════ */
html[data-bg="custom"] .tab-bar,
html[data-bg] .tab-bar,
.tab-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 50 !important;
}

html[data-bg="custom"] .fab,
html[data-bg] .fab,
.fab {
  position: fixed !important;
  z-index: 45 !important;
}

/* 显式 hidden 时仍可隐藏底栏（高于上方 display 若被写死） */
.tab-bar.hidden {
  display: none !important;
}

.event-list,
#event-list {
  min-height: 0 !important;
  overflow-y: auto !important;
}

#screen-list.screen.active {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* ═══════════════════════════════════════════════════════════════
   Custom / sample photo FINAL overrides (file-end)
   - #bg-photo fixed wallpaper
   - fully transparent UI frames (NOT frosted glass)
   - beats all later UI skins (zone/simple/scifi/…)
   - default wood keeps frosted glass (untouched)
   ═══════════════════════════════════════════════════════════════ */

/* Fixed wallpaper layer — never scroll with list */
html[data-bg="custom"] .bg-photo,
html[data-bg="custom"][data-ui] .bg-photo,
html[data-bg="custom"][data-theme] .bg-photo,
.wood-bg.has-custom-bg > .bg-photo {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
  pointer-events: none !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

html[data-bg="custom"] .wood-bg.has-custom-bg,
html[data-bg="custom"][data-ui] .wood-bg.has-custom-bg {
  background-image: none !important;
  background-color: #111 !important;
}

/* Kill glass-bar frost on photo (topbar + page headers) */
html[data-bg="custom"] .glass-bar,
html[data-bg="custom"] .topbar.glass-bar,
html[data-bg="custom"] .page-header.glass-bar,
html[data-bg="custom"][data-ui] .glass-bar,
html[data-bg="custom"][data-ui] .topbar.glass-bar,
html[data-bg="custom"][data-ui] .page-header.glass-bar,
html[data-bg="custom"][data-theme] .glass-bar,
html[data-bg="custom"][data-ui][data-theme] .glass-bar,
html[data-bg="custom"][data-ui][data-theme] .topbar.glass-bar,
html[data-bg="custom"][data-ui][data-theme] .page-header.glass-bar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Transparent frames — no frost, photo fully visible through UI chrome */
html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card,
html[data-bg="custom"] .icon-btn,
html[data-bg="custom"] .settings-card,
html[data-bg="custom"] .mode-card,
html[data-bg="custom"] .catalog-select,
html[data-bg="custom"] .chip-btn,
html[data-bg="custom"] .type-opt,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .page-header.solid,
html[data-bg="custom"] .tab-bar,
html[data-bg="custom"] .sheet,
html[data-bg="custom"] .auth-tabs,
html[data-bg="custom"] .me-hero,
html[data-bg="custom"] .nav-back,
html[data-bg="custom"] .install-callout,
html[data-bg="custom"] .diary-card,
html[data-bg="custom"][data-ui] .stat-pill,
html[data-bg="custom"][data-ui] .chip,
html[data-bg="custom"][data-ui] .search-bar input,
html[data-bg="custom"][data-ui] .event-card,
html[data-bg="custom"][data-ui] .icon-btn,
html[data-bg="custom"][data-ui] .settings-card,
html[data-bg="custom"][data-ui] .mode-card,
html[data-bg="custom"][data-ui] .catalog-select,
html[data-bg="custom"][data-ui] .chip-btn,
html[data-bg="custom"][data-ui] .type-opt,
html[data-bg="custom"][data-ui] .action-btn,
html[data-bg="custom"][data-ui] .page-header.solid,
html[data-bg="custom"][data-ui] .tab-bar,
html[data-bg="custom"][data-ui] .sheet,
html[data-bg="custom"][data-ui] .auth-tabs,
html[data-bg="custom"][data-ui] .me-hero,
html[data-bg="custom"][data-ui] .nav-back,
html[data-bg="custom"][data-theme] .stat-pill,
html[data-bg="custom"][data-theme] .chip,
html[data-bg="custom"][data-theme] .search-bar input,
html[data-bg="custom"][data-theme] .event-card,
html[data-bg="custom"][data-theme] .icon-btn,
html[data-bg="custom"][data-theme] .settings-card,
html[data-bg="custom"][data-theme] .mode-card,
html[data-bg="custom"][data-theme] .page-header.solid,
html[data-bg="custom"][data-theme] .tab-bar,
html[data-bg="custom"][data-theme] .sheet,
html[data-bg="custom"][data-ui][data-theme] .stat-pill,
html[data-bg="custom"][data-ui][data-theme] .chip,
html[data-bg="custom"][data-ui][data-theme] .search-bar input,
html[data-bg="custom"][data-ui][data-theme] .event-card,
html[data-bg="custom"][data-ui][data-theme] .icon-btn,
html[data-bg="custom"][data-ui][data-theme] .settings-card,
html[data-bg="custom"][data-ui][data-theme] .mode-card,
html[data-bg="custom"][data-ui][data-theme] .catalog-select,
html[data-bg="custom"][data-ui][data-theme] .chip-btn,
html[data-bg="custom"][data-ui][data-theme] .type-opt,
html[data-bg="custom"][data-ui][data-theme] .action-btn,
html[data-bg="custom"][data-ui][data-theme] .page-header.solid,
html[data-bg="custom"][data-ui][data-theme] .tab-bar,
html[data-bg="custom"][data-ui][data-theme] .sheet,
html[data-bg="custom"][data-ui][data-theme] .me-hero,
html[data-bg="custom"][data-ui][data-theme] .nav-back {
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

/* Light border so frames remain visible */
html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card,
html[data-bg="custom"] .settings-card,
html[data-bg="custom"] .mode-card,
html[data-bg="custom"] .type-opt,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .catalog-select,
html[data-bg="custom"] .chip-btn,
html[data-bg="custom"] .icon-btn,
html[data-bg="custom"] .nav-back,
html[data-bg="custom"][data-ui] .stat-pill,
html[data-bg="custom"][data-ui] .chip,
html[data-bg="custom"][data-ui] .event-card,
html[data-bg="custom"][data-ui] .settings-card,
html[data-bg="custom"][data-ui] .mode-card,
html[data-bg="custom"][data-ui] .icon-btn,
html[data-bg="custom"][data-ui][data-theme] .stat-pill,
html[data-bg="custom"][data-ui][data-theme] .chip,
html[data-bg="custom"][data-ui][data-theme] .event-card,
html[data-bg="custom"][data-ui][data-theme] .settings-card,
html[data-bg="custom"][data-ui][data-theme] .mode-card,
html[data-bg="custom"][data-ui][data-theme] .icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
}

/* White text + shadow on photo — beats zone light / simple navy titles */
html[data-bg="custom"] .topbar h1,
html[data-bg="custom"] .topbar-sub,
html[data-bg="custom"] .page-header h1,
html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .stat-pill .n,
html[data-bg="custom"] .stat-pill .l,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card .event-title,
html[data-bg="custom"] .event-card .num,
html[data-bg="custom"] .event-card .event-sub,
html[data-bg="custom"] .event-card .event-sub-soft,
html[data-bg="custom"] .event-card .label,
html[data-bg="custom"] .settings-row .sr-title,
html[data-bg="custom"] .settings-row .sr-desc,
html[data-bg="custom"] .settings-group-title,
html[data-bg="custom"] .mode-card-title,
html[data-bg="custom"] .mode-card-desc,
html[data-bg="custom"] .catalog-label,
html[data-bg="custom"] .catalog-section-h h3,
html[data-bg="custom"] .catalog-section-h span,
html[data-bg="custom"] .cr-title,
html[data-bg="custom"] .cr-sub,
html[data-bg="custom"] .cr-num,
html[data-bg="custom"] .tab-item,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .type-opt .t-name,
html[data-bg="custom"] .type-opt .t-hint,
html[data-bg="custom"] .me-name,
html[data-bg="custom"] .me-meta,
html[data-bg="custom"] .nav-back,
html[data-bg="custom"] .diary-card-title,
html[data-bg="custom"] .diary-card-preview,
html[data-bg="custom"] .diary-date,
html[data-bg="custom"] .empty-state,
html[data-bg="custom"] .empty-state p,
html[data-bg="custom"] .sr-chevron,
html[data-bg="custom"] .sr-check,
html[data-bg="custom"][data-ui] .topbar h1,
html[data-bg="custom"][data-ui] .topbar-sub,
html[data-bg="custom"][data-ui] .page-header h1,
html[data-bg="custom"][data-ui] .stat-pill,
html[data-bg="custom"][data-ui] .stat-pill .n,
html[data-bg="custom"][data-ui] .stat-pill .l,
html[data-bg="custom"][data-ui] .chip,
html[data-bg="custom"][data-ui] .event-card .event-title,
html[data-bg="custom"][data-ui] .event-card .num,
html[data-bg="custom"][data-ui] .event-card .event-sub,
html[data-bg="custom"][data-ui] .event-card .label,
html[data-bg="custom"][data-ui] .settings-row .sr-title,
html[data-bg="custom"][data-ui] .settings-row .sr-desc,
html[data-bg="custom"][data-ui] .settings-group-title,
html[data-bg="custom"][data-ui] .tab-item,
html[data-bg="custom"][data-ui] .me-name,
html[data-bg="custom"][data-ui] .me-meta,
html[data-bg="custom"][data-ui] .nav-back,
html[data-bg="custom"][data-theme] .topbar h1,
html[data-bg="custom"][data-theme] .topbar-sub,
html[data-bg="custom"][data-theme] .page-header h1,
html[data-bg="custom"][data-theme] .stat-pill .n,
html[data-bg="custom"][data-theme] .event-card .event-title,
html[data-bg="custom"][data-theme] .settings-row .sr-title,
html[data-bg="custom"][data-ui][data-theme] .topbar h1,
html[data-bg="custom"][data-ui][data-theme] .topbar-sub,
html[data-bg="custom"][data-ui][data-theme] .page-header h1,
html[data-bg="custom"][data-ui][data-theme] .stat-pill,
html[data-bg="custom"][data-ui][data-theme] .stat-pill .n,
html[data-bg="custom"][data-ui][data-theme] .stat-pill .l,
html[data-bg="custom"][data-ui][data-theme] .chip,
html[data-bg="custom"][data-ui][data-theme] .event-card .event-title,
html[data-bg="custom"][data-ui][data-theme] .event-card .num,
html[data-bg="custom"][data-ui][data-theme] .event-card .event-sub,
html[data-bg="custom"][data-ui][data-theme] .event-card .label,
html[data-bg="custom"][data-ui][data-theme] .settings-row .sr-title,
html[data-bg="custom"][data-ui][data-theme] .settings-row .sr-desc,
html[data-bg="custom"][data-ui][data-theme] .settings-group-title,
html[data-bg="custom"][data-ui][data-theme] .mode-card-title,
html[data-bg="custom"][data-ui][data-theme] .mode-card-desc,
html[data-bg="custom"][data-ui][data-theme] .tab-item,
html[data-bg="custom"][data-ui][data-theme] .action-btn,
html[data-bg="custom"][data-ui][data-theme] .me-name,
html[data-bg="custom"][data-ui][data-theme] .me-meta,
html[data-bg="custom"][data-ui][data-theme] .nav-back,
html[data-bg="custom"][data-ui][data-theme] .icon-btn {
  color: #fff !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.45) !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  filter: none !important;
}

/* Topbar title weight — readable on any photo */
html[data-bg="custom"] .topbar h1,
html[data-bg="custom"][data-ui] .topbar h1,
html[data-bg="custom"][data-ui][data-theme] .topbar h1 {
  font-weight: 600 !important;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(0, 0, 0, 0.45) !important;
}

/* Tab bar: slight dim only (still transparent frame, not frost) */
html[data-bg="custom"] .tab-bar,
html[data-bg="custom"][data-ui] .tab-bar,
html[data-bg="custom"][data-ui][data-theme] .tab-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 50 !important;
  background: rgba(0, 0, 0, 0.22) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-bg="custom"] .tab-item.active,
html[data-bg="custom"][data-ui] .tab-item.active,
html[data-bg="custom"][data-ui][data-theme] .tab-item.active {
  color: #fff !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6), 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

html[data-bg="custom"] .chip.active,
html[data-bg="custom"][data-ui] .chip.active,
html[data-bg="custom"][data-ui][data-theme] .chip.active {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: #fff !important;
  color: #fff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) !important;
}

/* FAB：固定 + 透明玻璃感（勿 solid 蓝） */
html[data-bg="custom"] .fab,
html[data-bg="custom"][data-ui] .fab,
html[data-bg="custom"][data-ui][data-theme] .fab {
  position: fixed !important;
  z-index: 45 !important;
  background: rgba(255, 255, 255, 0.22) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
  color: #fff !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
}

/* Screens transparent so photo shows */
html[data-bg="custom"] #screen-settings,
html[data-bg="custom"] #screen-settings-sub,
html[data-bg="custom"] #screen-me,
html[data-bg="custom"] #screen-auth,
html[data-bg="custom"] #screen-catalog,
html[data-bg="custom"] #screen-diary,
html[data-bg="custom"] #screen-diary-edit,
html[data-bg="custom"] #screen-calc,
html[data-bg="custom"] #screen-pomodoro,
html[data-bg="custom"] #screen-calendar,
html[data-bg="custom"] #screen-todo,
html[data-bg="custom"] #screen-notes,
html[data-bg="custom"] #screen-mood,
html[data-bg="custom"] #screen-sites,
html[data-bg="custom"][data-ui] #screen-settings,
html[data-bg="custom"][data-ui] #screen-me,
html[data-bg="custom"][data-ui] #screen-calc,
html[data-bg="custom"][data-ui] #screen-pomodoro {
  background: transparent !important;
}

/* Sheet form fields stay transparent frames */
html[data-bg="custom"] .sheet,
html[data-bg="custom"][data-ui] .sheet,
html[data-bg="custom"][data-ui][data-theme] .sheet {
  background: rgba(0, 0, 0, 0.35) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-bg="custom"] .field input,
html[data-bg="custom"] .field select,
html[data-bg="custom"] .field textarea,
html[data-bg="custom"][data-ui] .field input,
html[data-bg="custom"][data-ui][data-theme] .field input {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: #fff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Video/anim path: keep dark scrim, no static photo layer conflict */
html[data-bg="custom"] .wood-bg.has-video-bg,
html[data-bg="custom"][data-ui] .wood-bg.has-video-bg {
  background-image: none !important;
  background-color: #0a0a0c !important;
}

/* ═══════════════════════════════════════════════════════════════
   ABSOLUTE LAST — mobile layout critical (wins everything above)
   Tab bar + FAB: position:fixed !important always (incl. data-bg=custom)
   NEVER position:relative / display:none on them here.
   Event-list: min-height:0 + overflow-y:auto (internal scroll)
   ═══════════════════════════════════════════════════════════════ */
html,
body {
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100dvh !important;
}

.wood-bg,
html[data-bg="custom"] .wood-bg,
html[data-bg="custom"] .wood-bg.has-custom-bg {
  height: 100% !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.app,
html[data-bg="custom"] .app {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#screen-list.screen.active {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.event-list,
#event-list,
html[data-bg="custom"] .event-list,
html[data-bg="custom"] #event-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

html[data-bg="custom"] .tab-bar,
html[data-bg="custom"][data-ui] .tab-bar,
html[data-bg="custom"][data-theme] .tab-bar,
html[data-bg="custom"][data-ui][data-theme] .tab-bar,
html[data-bg] .tab-bar,
.tab-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 50 !important;
}

html[data-bg="custom"] .fab,
html[data-bg="custom"][data-ui] .fab,
html[data-bg="custom"][data-theme] .fab,
html[data-bg="custom"][data-ui][data-theme] .fab,
html[data-bg] .fab,
.fab {
  position: fixed !important;
  z-index: 45 !important;
}

/* intentional hide only via .hidden class (detail / form screens) */
.tab-bar.hidden {
  display: none !important;
}
