/* ============================================================
   小事 · 习惯打卡 —— 视觉层
   设计语言：暖米白底 + 大圆角白卡 + 彩色圆点打卡
   ============================================================ */

:root {
  --bg: #FBF7F1;
  --bg-deep: #F4EDE3;
  --card: #FFFFFF;
  --ink: #2B2622;
  --ink-2: #6F655C;
  --ink-3: #A79A8C;
  --line: #EFE7DC;
  --line-2: #E6DAC8;
  --shadow: 0 10px 28px rgba(92, 64, 38, .07), 0 2px 6px rgba(92, 64, 38, .04);
  --shadow-sm: 0 4px 14px rgba(92, 64, 38, .06);
  --shadow-tab: 0 -2px 24px rgba(92, 64, 38, .08);
  --radius: 26px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  --num: "SF Pro Display", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overscroll-behavior-y: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

h1, h2, h3, p { margin: 0; }

.app {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 18px calc(104px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  padding-top: calc(14px + env(safe-area-inset-top));
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: -8px;
}

.date-nav .nav {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ink-3);
  font-size: 19px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.date-nav .nav:disabled { opacity: .28; }
.date-nav .nav:active:not(:disabled) { background: rgba(0, 0, 0, .04); }

.date-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .2px;
  padding: 2px 4px;
}
.date-label .sub {
  font-weight: 500;
  color: var(--ink-3);
  font-size: 12px;
  margin-left: 5px;
}

.tools { display: flex; align-items: center; gap: 4px; }

.tool {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 1px 0 rgba(90, 64, 40, .04);
  border: 1px solid rgba(239, 231, 220, .9);
}
.tool:active { transform: scale(.94); }

.headrow {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 14px 0 14px;
}

.headrow h1 {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -.4px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.headrow h1 .h1-emoji { font-size: 21px; transform: translateY(-1px); }

.count {
  font-size: 12.5px;
  color: var(--ink-3);
  padding-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.count b { font-size: 17px; color: var(--ink); font-weight: 700; margin: 0 1px; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  border-radius: 30px;
  padding: 16px 20px 13px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(122deg, #FFF8EE 0%, #FFEEDC 48%, #FBE3CB 100%);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "num side" "foot foot";
  column-gap: 12px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -60px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 68%);
  pointer-events: none;
}

.hero-main { grid-area: num; }
.hero-num {
  display: flex;
  align-items: baseline;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  line-height: 1;
  color: #4A3423;
}
.hero-num b { font-size: 54px; font-weight: 750; }
.hero-num i { font-style: normal; font-size: 22px; font-weight: 600; color: #B99B7C; letter-spacing: -.5px; margin-left: 2px; }

.hero-cap {
  font-size: 12px;
  color: #9C7E60;
  margin-top: 6px;
  letter-spacing: .3px;
}

.cloud {
  grid-area: cloud;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: center;
  justify-content: flex-end;
  max-height: 92px;
  overflow: hidden;
  padding-top: 2px;
}
.cloud i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
  opacity: .92;
  animation: pop .35s cubic-bezier(.2, .9, .3, 1.4) both;
}
.cloud .empty { font-size: 12px; color: #B99B7C; }

@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: .92; } }

.hero-foot {
  grid-area: foot;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed rgba(160, 120, 80, .22);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: #9C7E60;
  font-variant-numeric: tabular-nums;
}
.hero-foot b { color: #6B4A2E; font-weight: 700; }
.hero-foot .sep { opacity: .45; }

/* ---------------- 打卡网格 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 6px;
  padding: 24px 2px 4px;
}

.habit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dot {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #FFFDFA;
  border: 1.5px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.habit:active .dot { transform: scale(.93); }

.dot .emoji { font-size: 27px; line-height: 1; transform: translateY(-1px); }
.dot .mark { display: none; font-size: 27px; font-weight: 700; color: #fff; line-height: 1; }

.habit.done .dot {
  background: var(--c);
  border-color: var(--c);
  box-shadow: 0 8px 18px rgba(90, 64, 40, .16), 0 2px 4px rgba(90, 64, 40, .08);
}
.habit.done .dot .emoji { display: none; }
.habit.done .dot .mark { display: block; }

.habit.fail .dot {
  background: #FCEEE9;
  border-color: #F1CBBD;
  box-shadow: none;
}
.habit.fail .dot .emoji { display: none; }
.habit.fail .dot .mark { display: block; color: #C9583B; }

.habit.muted { opacity: .38; }

.hname {
  font-size: 12.5px;
  line-height: 1.28;
  text-align: center;
  color: #463E37;
  max-width: 76px;
  word-break: break-word;
}
.habit.done .hname { color: var(--ink); font-weight: 600; }

.hmeta {
  font-size: 10.5px;
  color: #B3A695;
  margin-top: -3px;
  letter-spacing: .1px;
  white-space: nowrap;
}

.habit.add .dot {
  border-style: dashed;
  border-color: #DCCBB4;
  background: transparent;
  box-shadow: none;
  color: #B9A68E;
  font-size: 26px;
  font-weight: 300;
}
.habit.add .hname { color: var(--ink-3); }

/* ---------------- 记录 ---------------- */
.note {
  margin-top: 18px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.note-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 17px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
}
.note-head .note-ico { font-size: 15px; }
.note-head .note-opt { color: var(--ink-3); font-size: 11.5px; margin-left: 2px; }
.note-head .chev {
  margin-left: auto;
  color: #C9BBA9;
  font-size: 12px;
  transition: transform .2s ease;
}
.note.open .chev { transform: rotate(180deg); }

.note-body {
  padding: 0 14px 14px;
  animation: fade .2s ease;
}
.note-body textarea {
  width: 100%;
  min-height: 78px;
  resize: none;
  border: 1px dashed var(--line-2);
  background: #FCFAF6;
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.6;
  outline: none;
}
.note-body textarea::placeholder { color: #C3B6A5; }
.note-body textarea:focus { border-color: #D9C4A8; background: #FFFDF9; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- 底部 tab ---------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.tabbar-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 398px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 7px 5px;
  border-radius: 24px;
  background: rgba(255, 253, 250, .92);
  border: 1px solid rgba(239, 231, 220, .95);
  box-shadow: var(--shadow-tab);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 2px 5px;
  border-radius: 18px;
  color: #A2937F;
  transition: background-color .18s ease, color .18s ease;
}
.tab:active { transform: scale(.97); }
.tab .temoji { font-size: 19px; line-height: 1.2; filter: saturate(.65); transition: filter .18s; }
.tab .tlabel { font-size: 10.5px; letter-spacing: .4px; }
.tab .tcount {
  font-size: 9px;
  color: #B9AB99;
  font-variant-numeric: tabular-nums;
  height: 11px;
}
.tab.active {
  background: var(--tint);
  color: var(--accent);
}
.tab.active .temoji { filter: none; }
.tab.active .tlabel { font-weight: 650; }
.tab.active .tcount { color: var(--accent); opacity: .75; }

/* ---------------- 子页面 ---------------- */
.subhead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: calc(12px + env(safe-area-inset-top));
  margin-bottom: 16px;
}
.subhead .back {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 20px;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  line-height: 1;
}
.subhead h2 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.subhead .spacer { flex: 1; }
.subhead .sub-meta { font-size: 12px; color: var(--ink-3); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h3 { font-size: 14.5px; font-weight: 700; letter-spacing: .2px; }
.card-head span { font-size: 11.5px; color: var(--ink-3); }

/* 统计头卡 */
.stats-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 18px;
}
.stats-hero .pct {
  font-family: var(--num);
  font-size: 54px;
  font-weight: 750;
  letter-spacing: -2.5px;
  line-height: 1;
  color: #B4715A;
  font-variant-numeric: tabular-nums;
}
.stats-hero .pct i { font-style: normal; font-size: 21px; margin-left: 1px; }
.stats-hero .cap { font-size: 12px; color: var(--ink-3); margin-top: 7px; }
.stats-hero .right { text-align: right; padding-bottom: 3px; }
.stats-hero .frac { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-hero .cap2 { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* 进度条 */
.bar + .bar { margin-top: 15px; }
.bar-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.bar-top .dotc {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}
.bar-top b {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.track {
  margin-top: 7px;
  height: 7px;
  border-radius: 99px;
  background: #F4EDE4;
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--c);
  transition: width .4s cubic-bezier(.2, .8, .3, 1);
}
.bar-foot {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* 连续打卡 */
.streak {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.streak .flame { font-size: 17px; }
.streak b { font-size: 17px; color: #C9583B; font-weight: 750; margin: 0 2px; }
.streak .tip { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

/* 本周矩阵 */
.matrix { display: flex; flex-direction: column; gap: 9px; }
.mrow {
  display: grid;
  grid-template-columns: 92px repeat(7, 1fr);
  align-items: center;
}
.mrow.mhead { margin-bottom: 1px; }
.mrow.mhead span {
  text-align: center;
  font-size: 10px;
  color: var(--ink-3);
}
.mname {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-right: 2px;
}
.mname i { font-style: normal; font-size: 13px; }

.mcell {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.4px solid #EFE6D8;
  margin: 0 auto;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #fff;
  line-height: 1;
}
.mcell.future { border-style: dashed; opacity: .35; }
.mcell.done { background: var(--c); border-color: var(--c); }
.mcell.done::after { content: "✓"; font-size: 11px; font-weight: 700; }
.mcell.fail { background: #FBE9E3; border-color: #F2CBBD; color: #C9583B; }
.mcell.fail::after { content: "✕"; font-size: 11px; font-weight: 700; }
.mcell.today { box-shadow: 0 0 0 2px #fff, 0 0 0 3.4px #E3C89F; }

/* 月历 */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}
.cal-week span { text-align: center; font-size: 10px; color: var(--ink-3); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.cal-cell {
  position: relative;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  background: #FCFAF6;
}
.cal-cell.blank { background: transparent; }
.cal-cell.has { background: #F7EBDD; color: #7A5A3C; font-weight: 600; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px #DDBE93; }
.cal-cell .cdot {
  position: absolute;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #C58C5A;
}

/* 单习惯 */
.picker {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  margin: 0 -2px 12px;
}
.picker::-webkit-scrollbar { display: none; }
.picker button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #FBF7F1;
  border: 1.4px solid transparent;
  font-size: 19px;
  display: grid;
  place-items: center;
}
.picker button.sel {
  background: #fff;
  border-color: #DCC7A8;
  box-shadow: var(--shadow-sm);
}

.hweek {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.hweek .d { font-size: 9.5px; color: var(--ink-3); margin-bottom: 5px; }
.hweek .c {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin: 0 auto;
  border: 1.4px solid #EFE6D8;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
}
.hweek .c.done { background: var(--c); border-color: var(--c); }
.hweek .c.done::after { content: "✓"; font-weight: 700; }
.hweek .c.fail { background: #FBE9E3; border-color: #F2CBBD; color: #C9583B; }
.hweek .c.fail::after { content: "✕"; font-weight: 700; }

.hfoot {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.data-card { display: flex; gap: 10px; }
.data-card button {
  flex: 1;
  padding: 12px 8px;
  border-radius: 15px;
  background: #FBF7F1;
  font-size: 13px;
  color: var(--ink-2);
  border: 1px solid #F0E8DC;
}
.data-card button:active { background: #F5EEE3; }
.data-card button.danger { color: #B4593F; }

/* ---------------- 小组件预览 ---------------- */
.device {
  position: relative;
  width: 292px;
  margin: 0 auto 18px;
  border-radius: 44px;
  padding: 12px;
  background: #E9DFD2;
  box-shadow: 0 24px 60px rgba(80, 55, 30, .22), inset 0 0 0 1.5px rgba(255, 255, 255, .7);
}
.dev-screen {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 20% 0%, #F8D9BD 0%, rgba(248, 217, 189, 0) 60%),
    radial-gradient(80% 60% at 90% 30%, #C9D6E8 0%, rgba(201, 214, 232, 0) 55%),
    linear-gradient(160deg, #EAD8C6 0%, #D9C3B0 45%, #CBB9A8 100%);
  padding: 8px 14px 20px;
  min-height: 540px;
}

.dev-status {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: #4A3B2E;
  padding: 4px 6px 0;
  opacity: .8;
}

.dev-date {
  text-align: center;
  margin: 14px 0 12px;
  color: #4A3B2E;
}
.dev-date .d { font-size: 11px; opacity: .75; }
.dev-date .t { font-family: var(--num); font-size: 40px; font-weight: 300; letter-spacing: -1.5px; line-height: 1.1; }

.dev-widget {
  background: rgba(255, 252, 247, .82);
  border-radius: 22px;
  padding: 13px;
  box-shadow: 0 8px 24px rgba(80, 55, 30, .12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.dw-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dw-title { font-size: 10.5px; font-weight: 700; color: #6B543D; letter-spacing: .3px; }
.dw-streak { font-size: 10px; color: #A5713F; }

.dw-body { display: flex; align-items: center; gap: 12px; }
.ring { width: 62px; height: 62px; flex: 0 0 auto; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .rt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #5B4632;
  font-variant-numeric: tabular-nums;
}

.dw-list { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dw-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #5B4632;
  background: rgba(255, 255, 255, .7);
  border-radius: 10px;
  padding: 5px 8px;
  min-width: 0;
}
.dw-item .e { font-size: 12px; }
.dw-item .n { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dw-item .ok { margin-left: auto; color: #6E9B6E; font-size: 10px; }

.dev-apps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 10px;
  margin-top: 26px;
  padding: 0 4px;
  opacity: .9;
}
.dev-app {
  aspect-ratio: 1;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: rgba(255, 253, 248, .55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.widget-pair { display: flex; gap: 12px; align-items: stretch; }
.widget-small {
  flex: 0 0 108px;
  aspect-ratio: 1;
  border-radius: 22px;
  background: rgba(255, 252, 247, .92);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.widget-small .big { font-family: var(--num); font-size: 30px; font-weight: 700; letter-spacing: -1px; color: #5B4632; }
.widget-small .sm { font-size: 10px; color: #A08C77; }
.widget-lock {
  flex: 1;
  border-radius: 22px;
  background: linear-gradient(150deg, #3A3733, #23211F);
  box-shadow: var(--shadow-sm);
  padding: 13px;
  color: #EDE7DF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.widget-lock .lt { font-size: 9.5px; opacity: .6; letter-spacing: .4px; }
.widget-lock .ln { display: flex; gap: 6px; margin-top: 8px; }
.widget-lock .ln i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: block;
  background: rgba(255, 255, 255, .16);
}
.widget-lock .ln i.on { background: #C8935B; }
.widget-lock .lb { font-size: 10px; opacity: .7; margin-top: auto; }

.explain h3 { font-size: 14px; margin-bottom: 9px; }
.explain ul { margin: 0; padding-left: 17px; color: var(--ink-2); font-size: 12.5px; line-height: 1.75; }
.explain li + li { margin-top: 3px; }
.explain .sig { margin-top: 12px; font-size: 11px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 10px; }

/* ---------------- 弹层 ---------------- */
.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-layer[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(48, 36, 24, .34); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

.sheet {
  position: relative;
  width: 100%;
  max-width: 430px;
  max-height: 90vh;
  overflow-y: auto;
  background: #FDFBF7;
  border-radius: 30px 30px 0 0;
  padding: 8px 20px calc(26px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px rgba(60, 40, 20, .2);
  animation: sheetUp .26s cubic-bezier(.2, .9, .25, 1);
}
@keyframes sheetUp { from { transform: translateY(36px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: #E2D6C5;
  margin: 6px auto 12px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sheet-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.sheet-head .close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #F2EAE0;
  color: var(--ink-2);
  font-size: 16px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.field { margin-bottom: 16px; }
.field .lbl {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 7px;
  letter-spacing: .3px;
}
.field input[type="text"] {
  width: 100%;
  border: 1.4px solid #EDE3D5;
  background: #fff;
  border-radius: 14px;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
}
.field input[type="text"]:focus { border-color: #D8BF9C; }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.emoji-grid button {
  aspect-ratio: 1;
  border-radius: 11px;
  background: #F6EEE3;
  font-size: 18px;
  display: grid;
  place-items: center;
  border: 1.5px solid transparent;
}
.emoji-grid button.sel {
  background: #fff;
  border-color: #C8A87E;
  box-shadow: var(--shadow-sm);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button {
  padding: 8px 13px;
  border-radius: 12px;
  background: #F6EEE3;
  font-size: 13px;
  color: var(--ink-2);
  border: 1.5px solid transparent;
}
.chips button.sel {
  background: #fff;
  border-color: #C8A87E;
  color: var(--ink);
  font-weight: 600;
}

.sheet .primary {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  background: #2B2622;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
}
.sheet .primary:active { opacity: .88; }
.sheet .ghost {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-3);
}

/* 设置列表 */
.set-group { margin-bottom: 18px; }
.set-group .gl {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .5px;
  margin: 0 2px 8px;
}
.set-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 15px;
  padding: 11px 13px;
  margin-bottom: 7px;
  box-shadow: 0 1px 0 rgba(92, 64, 38, .03);
  width: 100%;
  text-align: left;
}
.set-item .se { font-size: 18px; width: 24px; text-align: center; }
.set-item .sn { font-size: 14px; flex: 1; min-width: 0; }
.set-item .sd { font-size: 11px; color: var(--ink-3); }
.set-item .chev { color: #CFC2B0; font-size: 13px; }
.set-item:active { background: #FCFAF6; }

.switch {
  width: 42px;
  height: 25px;
  border-radius: 99px;
  background: #E7DCCD;
  position: relative;
  transition: background .2s;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .2s;
}
.switch.on { background: #8FA77A; }
.switch.on::after { transform: translateX(17px); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 10px);
  z-index: 80;
  background: rgba(43, 38, 34, .92);
  color: #fff;
  font-size: 12.5px;
  padding: 10px 16px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
  max-width: 86vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 桌面预览 ---------------- */
@media (min-width: 480px) {
  body { background: var(--bg-deep); }
  .app {
    background: var(--bg);
    box-shadow: 0 30px 80px rgba(70, 45, 20, .14);
    border-radius: 32px;
    margin: 22px auto;
    min-height: calc(100vh - 44px);
    padding-left: 22px;
    padding-right: 22px;
  }
  .tabbar { padding-bottom: 16px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------- 补充 ---------------- */
.banner {
  margin: 10px 0 0;
  padding: 10px 13px;
  border-radius: 14px;
  background: #FBEDE9;
  color: #B4593F;
  font-size: 12px;
  line-height: 1.5;
}
.date-label:active { opacity: .55; }
.date-label .sub { white-space: nowrap; }
.cal-cell { font-family: inherit; }
.cal-cell:active { transform: scale(.94); }

/* 本周柱状 */
.weekcard { margin-top: 18px; }
.weekcard .card-head { margin-bottom: 10px; }
.bars7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
  padding-top: 2px;
}
.b7 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.b7 .col {
  height: 44px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.b7 .col i {
  width: 58%;
  max-width: 22px;
  min-height: 5px;
  border-radius: 8px;
  background: var(--c);
  opacity: .38;
  display: block;
  transition: height .3s cubic-bezier(.2, .8, .3, 1), opacity .2s;
}
.b7.sel .col i { opacity: 1; }
.b7.future .col i { opacity: .12; }
.b7 .lab { font-size: 10px; color: var(--ink-3); }
.b7.sel .lab { color: var(--ink); font-weight: 600; }
.b7:active .col i { opacity: .8; }

/* 小组件补充 */
.widget-lock .ln i.on { background: var(--cc, #C8935B); }
.dev-screen { min-height: 500px; }
.dev-apps { gap: 13px 10px; }

.hint {
  margin: 12px 4px 0;
  font-size: 10.5px;
  color: #B3A695;
  text-align: center;
  letter-spacing: .2px;
}

.addrow {
  margin: 16px 2px 0;
  width: calc(100% - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border-radius: 15px;
  border: 1.4px dashed #DCCBB4;
  color: #A2907B;
  font-size: 12.5px;
  letter-spacing: .2px;
  background: rgba(255, 253, 250, .5);
}
.addrow .plus { font-size: 15px; font-weight: 400; }
.addrow .sub { font-size: 10.5px; color: #C0B2A0; }
.addrow:active { background: #FBF6EE; }

/* 本周卡紧凑一点，尽量在首屏露出 */
.weekcard { padding: 15px 17px 13px; }
.weekcard .card-head { margin-bottom: 4px; }
.weekcard .bars7 { padding-top: 0; }
.b7 { gap: 6px; }
.b7 .col { height: 36px; }
.hint { margin-top: 10px; }

/* ============================================================
   v2：首页 / 待打卡 / 圆点堆叠 / 周月切换
   ============================================================ */
.hh-days {
  grid-area: side;
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}
.hd {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  color: #A9885F;
  background: rgba(255, 255, 255, .55);
}
.hd.ok { background: #C8935B; color: #fff; font-weight: 700; }
.hd.part { background: rgba(200, 147, 91, .3); color: #8A6437; }
.hd.miss { background: rgba(255, 255, 255, .5); color: #B99B7C; }
.hd.future { border: 1px dashed rgba(185, 155, 124, .5); background: transparent; color: #C6AF94; }

.catrow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 13px;
}
.catcard {
  background: #fff;
  border-radius: 17px;
  padding: 10px 4px 9px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.catcard:active { transform: scale(.96); }
.catcard .ce { font-size: 17px; line-height: 1.2; }
.catcard .cn { font-size: 10.5px; color: var(--ink-2); }
.catcard .cp { font-size: 9.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.matrix-card { margin-top: 16px; }
.matrix-foot {
  margin-top: 12px;
  font-size: 10px;
  color: #B7AA98;
  text-align: center;
  line-height: 1.5;
}

/* 待打卡 chips（替换原来的彩色圆点） */
.pending {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  min-width: 0;
  width: 100%;
}
.pending .pl { font-size: 10px; color: #B08A63; letter-spacing: .3px; margin: 0 2px 2px; }
.pending button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 11px;
  padding: 5px 8px;
  font-size: 11px;
  color: #5B4632;
  min-width: 0;
  text-align: left;
}
.pending button:active { transform: scale(.97); }
.pending .pe { font-size: 12px; line-height: 1; }
.pending .pn { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100px; }
.pending .pd {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--c);
  flex: 0 0 auto;
}
.pending .more { font-size: 10px; color: #B08A63; text-align: right; padding-right: 4px; }
.pending .allok {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(255, 255, 255, .65);
  border-radius: 14px;
  padding: 12px 6px;
  text-align: center;
}
.pending .allok span { font-size: 18px; }
.pending .allok strong { font-size: 12px; color: #6B4A2E; }
.pending .allok em { font-style: normal; font-size: 9.5px; color: #B08A63; }

/* 本周圆点堆叠 */
.stack7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
  padding-top: 2px;
}
.s7 { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.s7 .dots {
  height: 58px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 4px;
}
.s7 .dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
  display: block;
}
.s7 .dots i.base { background: #EFE6D8; }
.s7 .lab { font-size: 10px; color: var(--ink-3); }
.s7.sel .lab { color: var(--ink); font-weight: 600; }
.s7:active .dots i { opacity: .7; }

/* 周 / 月 切换 */
.seg {
  display: flex;
  background: #F2EAE0;
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.seg button { padding: 5px 15px; border-radius: 9px; font-size: 12px; color: var(--ink-2); }
.seg button.sel {
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 4px rgba(90, 64, 38, .1);
}

/* 5 栏 tab 更紧凑 */
.tab { padding: 6px 1px 5px; }
.tab .temoji { font-size: 17px; }
.tab .tlabel { font-size: 10px; }
.tab .tcount { font-size: 8.5px; }

/* Hero 两栏比例修正 */
.hero { grid-template-columns: minmax(0, auto) minmax(0, 1fr); column-gap: 16px; }
.cat-hero .hero-num b { font-size: 46px; }
.cat-hero .hero-num i { font-size: 19px; }
.pending .pn { max-width: 110px; }

/* 圆点稍大一点，计数更清楚 */
.s7 .dots { height: 62px; gap: 5px; }
.s7 .dots i { width: 10px; height: 10px; }
.s7 .dots i.base { width: 9px; height: 9px; }

/* 截图模式：把 tabbar 放到内容末尾，方便长图截全 */
body.capture .tabbar {
  position: static;
  padding: 16px 12px 22px;
}
body.capture .app { padding-bottom: 10px; }

/* ============================================================
   v3：今日重点 / 烟花 / AI 解读 / 图标 / 删除
   ============================================================ */
.tool { color: #8B7B69; }
.tool svg { width: 18px; height: 18px; display: block; }

/* 今日重点 5 个圆框 */
.focus {
  grid-area: side;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}
.focus .fl { font-size: 9.5px; color: #B08A63; letter-spacing: .5px; margin-right: 2px; }
.slots { display: flex; gap: 6px; }
.slot {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 17px;
  padding: 0;
}
.slot.empty {
  border: 1.4px dashed rgba(180, 145, 110, .55);
  background: rgba(255, 255, 255, .35);
  color: #BFA88D;
  font-size: 15px;
  font-weight: 300;
}
.slot.filled {
  background: rgba(255, 255, 255, .9);
  border: 1.6px solid var(--c);
  box-shadow: 0 2px 6px rgba(90, 64, 40, .1);
}
.slot .se { line-height: 1; transform: translateY(-1px); }
.slot .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7FA86B;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}
.slot:active { transform: scale(.94); }

/* 全部完成：烟花 */
.done-celebrate {
  grid-area: side;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.fw { position: relative; width: 76px; height: 76px; display: grid; place-items: center; }
.fw-emoji {
  font-size: 52px;
  line-height: 1;
  animation: fwPop 2.6s ease-in-out infinite;
  filter: drop-shadow(0 5px 12px rgba(200, 140, 60, .25));
}
.fw i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #E8A33D;
  transform-origin: 0 0;
  animation: spark 2.6s ease-out infinite;
  animation-delay: var(--d, 0ms);
}
.fw i:nth-child(3n) { background: #D96C4E; }
.fw i:nth-child(3n+1) { background: #C8935B; }
.fw i:nth-child(5n) { background: #7FA86B; }
@keyframes spark {
  0% { transform: rotate(var(--a)) translateY(0) scale(.3); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: rotate(var(--a)) translateY(-38px) scale(1); opacity: .95; }
  100% { transform: rotate(var(--a)) translateY(-54px) scale(.2); opacity: 0; }
}
@keyframes fwPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.done-text { font-size: 13px; font-weight: 700; color: #6B4A2E; letter-spacing: .2px; }

/* AI 解读 */
.ai-card {
  background: linear-gradient(160deg, #FFFDF9 0%, #FBF5EA 100%);
  border: 1px solid #F0E5D5;
}
.ai-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.ai-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: #8A5A2B;
  background: #F7E7D2;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: .4px;
}
.ai-when { font-size: 10.5px; color: #B3A695; }
.ai-headline { font-size: 15px; color: var(--ink); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.ai-headline b { font-size: 21px; font-weight: 750; }
.ai-headline span { display: block; font-size: 11.5px; color: #A08C77; margin-top: 4px; font-weight: 400; }
.ai-sec { display: flex; gap: 9px; padding: 10px 0; border-top: 1px dashed #EFE4D4; }
.ai-ico {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
  margin-top: 1px;
}
.ai-ico.good { background: #EAF2E4; color: #5F8A4E; }
.ai-ico.warn { background: #FBEEDD; color: #C08A3E; }
.ai-ico.note { background: #EEF1F7; color: #6C82A6; }
.ai-sec b { font-size: 11.5px; color: #8A7A68; font-weight: 600; letter-spacing: .3px; }
.ai-sec p { font-size: 13px; color: var(--ink); line-height: 1.55; margin-top: 3px; }
.ai-quote { font-size: 12.5px; color: #5B4C3D; line-height: 1.6; margin-top: 5px; }
.ai-quote span { display: block; font-size: 10px; color: #B3A695; margin-top: 1px; }
.ai-quote.dim { color: #B3A695; }
.ai-advice {
  margin-top: 12px;
  background: #FFF7EC;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #6B4A2E;
  border: 1px dashed #EED9BF;
}
.ai-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 10px;
  color: #B3A695;
}
.ai-foot button { font-size: 10.5px; color: #A5713F; text-decoration: underline; text-underline-offset: 2px; }

/* 今日重点选择器 */
.focus-hint { font-size: 12px; color: #A08C77; margin-bottom: 12px; }
.focus-current {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.fc-e { font-size: 20px; }
.fc-n { font-size: 13px; flex: 1; min-width: 0; }
.fc-del { font-size: 12px; color: #B4593F; background: #FBEDE9; padding: 6px 11px; border-radius: 9px; }
.focus-list { display: flex; flex-direction: column; gap: 13px; padding-bottom: 4px; }
.fg-title { font-size: 10.5px; color: #A08C77; letter-spacing: .5px; margin: 0 2px 7px; }
.fg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.fitem {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.4px solid #F0E6D8;
  border-radius: 13px;
  padding: 10px 11px;
  font-size: 13px;
  text-align: left;
  min-width: 0;
}
.fitem .fe { font-size: 16px; }
.fitem .fn { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fitem .fd {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #EAF2E4;
  color: #5F8A4E;
  font-size: 9px;
  display: grid;
  place-items: center;
}
.fitem .fu { font-size: 9.5px; color: #B3A695; }
.fitem.used { opacity: .45; }
.fitem:active { border-color: #DCC7A8; }

/* 设置里的删除 */
.set-row { display: flex; gap: 7px; align-items: stretch; margin-bottom: 7px; }
.set-row .set-item { margin-bottom: 0; flex: 1; min-width: 0; }
.del-btn {
  flex: 0 0 44px;
  border-radius: 15px;
  background: #FBEDE9;
  color: #B4593F;
  display: grid;
  place-items: center;
}
.del-btn svg { width: 17px; height: 17px; }
.del-btn:active { transform: scale(.96); }
.sheet .ghost.danger { color: #B4593F; }

/* 烟花改成矢量，不依赖 emoji */
.fw { position: relative; width: 84px; height: 84px; display: grid; place-items: center; color: #D9832F; }
.fw-burst { width: 84px; height: 84px; animation: burst 2.6s ease-in-out infinite; }
.fw-burst path { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.fw-burst path:nth-child(2n) { stroke: #D96C4E; }
.fw-burst path:nth-child(3n) { stroke: #C8935B; }
.fw-burst circle { fill: #E8A33D; }
@keyframes burst {
  0% { transform: scale(.55); opacity: .2; }
  25% { transform: scale(1); opacity: 1; }
  55% { transform: scale(1.05); opacity: .92; }
  100% { transform: scale(.92); opacity: .38; }
}

/* 今日重点框再大一点点 */
.slots { gap: 5px; }
.slot { width: 36px; height: 36px; }
.slot .se { font-size: 18px; }

/* 烟花外圈光点 / 中心 */
.fw-burst .fw-dot { fill: #E8A33D; opacity: .85; }
.fw-burst .fw-core { fill: #D9832F; }
.fw::before {
  content: "";
  position: absolute;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 150, .5) 0%, rgba(255, 213, 150, 0) 68%);
  pointer-events: none;
}

/* 三组烟花 */
.fw-main { width: 84px; height: 84px; }
.fw-mini {
  position: absolute;
  width: 42px;
  height: 42px;
  opacity: .9;
  animation-delay: 1.05s;
}
.fw-mini.one { right: -2px; top: -4px; }
.fw-mini.two { left: -6px; bottom: 0; width: 32px; height: 32px; animation-delay: .55s; }
.fw-mini .fw-dot { opacity: .9; }

.back svg { width: 19px; height: 19px; display: block; margin-left: -1px; }

/* ============================================================
   v4：重点框文字 / 固定 Hero 高度 / 写实烟花
   ============================================================ */
.hero { padding: 15px 18px 12px; column-gap: 12px; }
.home-hero .hero-num b { font-size: 48px; }
.cat-hero { min-height: 154px; }

/* 5 个重点框：圆 + 名字 */
.slots { gap: 2px; align-items: flex-start; }
.slot {
  width: 40px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}
.slot .circle {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.slot.empty .circle {
  border: 1.4px dashed rgba(180, 145, 110, .55);
  background: rgba(255, 255, 255, .35);
  color: #BFA88D;
  font-size: 15px;
  font-weight: 300;
}
.slot.filled .circle {
  background: rgba(255, 255, 255, .9);
  border: 1.6px solid var(--c);
  box-shadow: 0 2px 6px rgba(90, 64, 40, .1);
}
.slot .se { font-size: 18px; line-height: 1; transform: translateY(-1px); }
.slot .sl {
  font-size: 9px;
  line-height: 1.15;
  color: #8A6A4E;
  max-width: 40px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}
.slot.empty .sl { color: #B5A28C; }
.slot .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7FA86B;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}
.focus { gap: 6px; }

/* 写实烟花 */
.fw { width: 72px; height: 72px; }
.fw-main { width: 72px; height: 72px; }
.fw-mini {
  position: absolute;
  width: 34px;
  height: 34px;
  opacity: .95;
  animation-delay: 1.15s;
}
.fw-mini.one { right: -8px; top: -10px; }
.fw-mini.two { left: -10px; bottom: -2px; width: 26px; height: 26px; animation-delay: .55s; }
.fw-burst { animation: fw 2.8s cubic-bezier(.2, .7, .3, 1) infinite; transform-origin: 50% 50%; }
.fw-burst path { fill: none; stroke-linecap: round; }
.fw-burst .ray-glow { stroke: #FF9A4D; stroke-width: 3.4; opacity: .22; }
.fw-burst .ember { fill: #FFB45E; opacity: .9; }
.fw-burst .core { fill: #FFF6E2; }
@keyframes fw {
  0% { transform: scale(.3); opacity: 0; }
  14% { opacity: 1; }
  52% { transform: scale(1); opacity: .98; }
  78% { transform: scale(1.06); opacity: .35; }
  100% { transform: scale(1.1); opacity: 0; }
}
.fw i {
  width: 3px;
  height: 3px;
  background: #FFC46B;
  box-shadow: 0 0 7px 3px rgba(255, 150, 60, .55);
}
.done-text { font-size: 12.5px; }
.done-celebrate { gap: 5px; }

/* 烟花配色加深，避免在米白卡上发灰 */
.fw-burst .ray-glow { stroke: #FF6B35; stroke-width: 4; opacity: .16; }
.fw-burst .ember { fill: #FF8A3D; opacity: 1; }
.fw-burst .core { fill: #FFF3DC; }
.fw i { background: #FF8A3D; box-shadow: 0 0 6px 2px rgba(255, 110, 40, .5); }


.fw-burst .ray { stroke-width: 1.5; opacity: 1; }

/* 烟花：白热中心 + 橙色中段 + 红色尾端，不依赖 SVG 滤镜 */
.fw-burst { filter: drop-shadow(0 0 4px rgba(255, 120, 50, .45)); }
.fw-burst path { fill: none; stroke-linecap: round; }
.fw-burst .ray-in { stroke: #FFE7B8; stroke-width: 1.6; opacity: .98; }
.fw-burst .ray-out { stroke: #E4553F; stroke-width: 1.45; opacity: .9; }
.fw-burst .ray-out.alt { stroke: #D64A6B; }
.fw-burst .ember { fill: #FFB45E; opacity: .95; }
.fw-burst .core { fill: #FFF8E6; }
.fw-burst .halo { fill: rgba(255, 214, 150, .28); }
.fw-burst .ray { stroke: none; }

/* 烟花最终调色：去掉雾感，细亮线 + 饱和尾端 */
.fw, .fw-main { width: 84px; height: 84px; }
.fw-burst { filter: none; }
.fw-burst .ray-in { stroke: #FFF1CE; stroke-width: 2; }
.fw-burst .ray-out { stroke: #E84A32; stroke-width: 1.8; }
.fw-burst .ray-out.alt { stroke: #D23E63; }
.fw-burst .ember { fill: #FF9A3D; }
.fw-burst .halo { fill: rgba(255, 200, 130, .3); }

/* 重点框：边框只放在圆上，按钮本身不要框 */
.slot, .slot.filled, .slot.empty {
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

/* 日期选择（补卡） */
.dchev { margin-left: 4px; font-size: 11px; color: #C0AE99; }
.date-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.date-head b { font-size: 15px; letter-spacing: .2px; }
.date-head .nav {
  width: 34px; height: 34px; border-radius: 50%;
  background: #F4EEE4; color: var(--ink-2); font-size: 18px;
  display: grid; place-items: center;
}
.date-head .nav:disabled { opacity: .3; }
.date-grid .cal-cell { height: 42px; border-radius: 13px; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px #C8935B; font-weight: 700; }
.cal-cell.future { opacity: .32; }
.cal-cell:disabled { color: var(--ink-3); }
.date-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; font-size: 11px; color: var(--ink-3);
}
.date-today { font-size: 12px; color: #A5713F; background: #F7EFE3; padding: 9px 13px; border-radius: 11px; }

/* 拖拽排序 */
.drag {
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: #C9BBA9;
  font-size: 13px;
  letter-spacing: -1px;
  background: none;
  touch-action: none;
  cursor: grab;
}
.set-row { align-items: stretch; }
.set-row.dragging {
  pointer-events: none;
  opacity: .9;
  background: #FFF9F1;
  border-radius: 15px;
  box-shadow: 0 12px 26px rgba(92, 64, 38, .16);
  position: relative;
  z-index: 3;
}

/* 周一提醒条 / AI 配置 / 操作按钮 */
.notice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #FFF4E3;
  border: 1px solid #F3E0C4;
  border-radius: 18px;
  padding: 11px 14px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.notice .ni { font-size: 16px; }
.notice .nt { flex: 1; font-size: 13px; font-weight: 600; color: #6B4A2E; }
.notice .nc { font-size: 11.5px; color: #A5713F; }
.notice:active { transform: scale(.99); }

.ai-hint { font-size: 11.5px; color: #A08C77; line-height: 1.65; margin: 0 0 14px; }
.ai-actions { display: flex; gap: 12px; align-items: center; }
.ai-actions button { font-size: 10.5px; color: #A5713F; text-decoration: underline; text-underline-offset: 2px; }
.ai-actions .ai-local { color: #B3A695; }

/* 全部完成：庆祝层绝对定位，不撑大渐变卡 */
.cat-hero { position: relative; }
.cat-hero .done-celebrate {
  position: absolute;
  top: 10px;
  right: 16px;
  bottom: 44px;
  width: 46%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
}
.fw, .fw-main { width: 64px; height: 64px; }
.fw-mini.one { width: 26px; height: 26px; right: -6px; top: -8px; }
.fw-mini.two { width: 20px; height: 20px; left: -8px; bottom: -2px; }
.done-text { font-size: 12px; line-height: 1.2; }

/* 庆祝层再内收一点，避免被圆角裁掉 */
.cat-hero { min-height: 168px; }
.cat-hero .done-celebrate {
  top: 16px;
  right: 26px;
  bottom: 46px;
  width: 48%;
  gap: 2px;
}
.fw, .fw-main { width: 84px; height: 84px; }
.fw-mini.one { width: 28px; height: 28px; right: 0; top: -2px; }
.fw-mini.two { width: 22px; height: 22px; left: -4px; bottom: 0; }
.done-text { font-size: 12.5px; }

/* 固定 Hero 高度：庆祝内容回到文档流，靠固定高度保证卡片不跳 */
.cat-hero { height: 168px; min-height: 0; }
.cat-hero .done-celebrate {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  gap: 2px;
  pointer-events: auto;
}
.fw, .fw-main { width: 64px; height: 64px; }
.fw-mini.one { width: 26px; height: 26px; right: -6px; top: -6px; }
.fw-mini.two { width: 20px; height: 20px; left: -6px; bottom: 0; }
.done-text { font-size: 12px; }

/* PWA 安装说明 */
.install-steps { margin: 4px 0 14px; padding-left: 20px; color: var(--ink-2); font-size: 13px; line-height: 1.75; }
.install-steps li + li { margin-top: 8px; }
.install-ok {
  background: #EAF2E4; color: #5F8A4E; border-radius: 12px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
}
