.fc-journal-btn {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  display: none;
  place-items: center;
  border: 1px solid rgba(90, 78, 60, .10);
  border-radius: 50%;
  background: rgba(233, 227, 214, .42);
  color: #2A2622;
  box-shadow: none;
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 900px) {
  .fc-journal-btn { display: grid; }
}

.fc-journal-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 8px;
  background: #A6392A;
  color: #F7F2E8;
  font: 500 10px/16px var(--font-body);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.fc-journal-badge[hidden], .fc-j-root[hidden] { display: none; }
.fc-j-root {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
}
.fc-j-root button { font-family: inherit; }
.fc-j-root.is-leaving { pointer-events: none; }
.fc-j-veil { position: absolute; inset: 0; background: rgba(42, 38, 34, .24); animation: fcVeilIn .3s ease-out both; }
.fc-j-root.is-leaving .fc-j-veil { animation: fcVeilOut .26s ease-in both; }
.fc-j-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  margin: 0 auto;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  /* 面板只能上下滚，不能左右拖；滚到头也不带动后面的首页 */
  overscroll-behavior: contain;
  touch-action: pan-y;
  border-radius: 22px 22px 0 0;
  background: #ECE6D8;
  color: #2A2622;
  box-shadow: 0 -8px 24px rgba(70, 50, 15, .12);
  transition: min-height .28s cubic-bezier(.4, 0, .2, 1);
  animation: fcSheetUp .38s cubic-bezier(.22, 1, .36, 1) both;
}
.fc-j-sheet.has-cal { min-height: 420px; }
.fc-j-calslot { display: contents; }
.fc-j-toastslot:empty { display: none; }
.fc-j-root.is-leaving .fc-j-sheet { animation: fcSheetDown .26s cubic-bezier(.4, 0, 1, 1) both; }
@keyframes fcSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fcSheetDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes fcVeilIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fcVeilOut { from { opacity: 1; } to { opacity: 0; } }
.fc-j-grip { align-self: center; flex: none; width: 36px; height: 4px; border-radius: 2px; background: #CCC3B0; }
.fc-j-head { position: relative; flex: none; display: flex; align-items: center; justify-content: center; height: 44px; }
.fc-j-tabs { position: relative; display: flex; gap: 2px; padding: 3px; border-radius: 18px; background: rgba(42, 38, 34, .06); }
/* 记事 ⇄ 记账：深色胶囊滑到另一格，带一点回弹；文字颜色渐变 */
.fc-j-tabind { position: absolute; left: 3px; top: 3px; width: 66px; height: 30px; border-radius: 15px; background: #2A2622; transition: transform .42s cubic-bezier(.34, 1.2, .64, 1); }
.fc-j-tabs[data-tab="money"] .fc-j-tabind { transform: translateX(68px); }
.fc-j-tab { position: relative; z-index: 1; width: 66px; height: 30px; padding: 0 0 0 2px; border: 0; border-radius: 15px; background: transparent; color: #6B6357; font-size: 13px; letter-spacing: 2px; cursor: pointer; white-space: nowrap; transition: color .3s ease; }
.fc-j-tab[aria-selected="true"] { background: transparent; color: #EFEAE0; }
.fc-j-date { position: absolute; left: 14px; top: 2px; z-index: 1; height: 44px; padding: 0 6px; border: 0; background: transparent; display: flex; align-items: center; gap: 4px; font-size: 12px; color: #6B6357; letter-spacing: .5px; cursor: pointer; white-space: nowrap; }
.fc-j-close { position: absolute; right: 6px; top: 2px; z-index: 2; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #6B6357; display: grid; place-items: center; cursor: pointer; }
.fc-j-body, .fc-j-group, .fc-j-list { display: flex; flex-direction: column; }
/* 两页所在的窗口：固定裁切，不是滚动容器（clip），手指和程序都拖不动；不依赖 :has()，旧版 iOS 与微信内置浏览器同样生效 */
.fc-j-body { margin: 0 -20px; overflow: hidden; overflow: clip; flex: none; gap: 0; transition: height .46s cubic-bezier(.22, 1, .36, 1); }
/* 两页并排：整体左右平移，面板高度同步过渡到目标页（见 switchTab）；静止时收起另一页，面板只按当前一页撑高 */
.fc-j-track { display: flex; align-items: flex-start; width: 200%; transition: transform .46s cubic-bezier(.22, 1, .36, 1); }
.fc-j-track[data-tab="money"] { transform: translateX(-50%); }
.fc-j-pane { width: 50%; flex: none; box-sizing: border-box; padding: 0 20px; display: flex; flex-direction: column; gap: 14px; transition: opacity .32s ease .1s, visibility 0s linear 0s; }
.fc-j-pane[aria-hidden="true"] { opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .46s; }
.fc-j-body.is-settled .fc-j-pane[aria-hidden="true"] { max-height: 0; overflow: hidden; }
/* 自己写 */
.fc-j-custom { border-style: dashed; border-color: #BFB6A3; color: #6B6357; gap: 4px; }
.fc-j-customfield { flex: 1 1 200px; min-width: 200px; height: 32px; box-sizing: border-box; padding: 0 3px 0 12px; border: 1px solid #2A2622; border-radius: 16px; display: flex; align-items: center; gap: 6px; animation: fcPop .25s ease-out both; }
.fc-j-customfield input { flex: 1; min-width: 0; height: 30px; padding: 0; border: 0; outline: none; background: transparent; color: #2A2622; font: inherit; font-size: 13px; }
.fc-j-customadd { flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 13px; background: #2A2622; color: #EFEAE0; display: grid; place-items: center; cursor: pointer; }

.fc-j-group { gap: 8px; }
.fc-j-label { font-size: 12px; color: #6B6357; letter-spacing: 1px; white-space: nowrap; }
.fc-j-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-j-chip { position: relative; min-height: 32px; padding: 0 12px; border: 1px solid #CCC3B0; border-radius: 16px; background: transparent; color: #2A2622; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fc-j-chip::after { content: ''; position: absolute; inset: -6px 0; }
.fc-j-chip[aria-pressed="true"] { background: #2A2622; color: #EFEAE0; }
.fc-j-dot { width: 6px; height: 6px; border-radius: 3px; flex: none; }
.fc-j-list { gap: 6px; padding-top: 12px; border-top: 1px solid #D6CDBA; }
.fc-j-rows { display: flex; flex-direction: column; max-height: 132px; overflow-y: auto; }
.fc-j-row { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.fc-j-row .t { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #2A2622; }
.fc-j-row .m { font-size: 12px; color: #8A8175; }
.fc-j-del { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; border: 0; background: transparent; color: #8A8175; cursor: pointer; }
.fc-j-note { padding: 10px 12px; border-radius: 12px; background: rgba(214, 205, 186, .45); color: #6B6357; font-size: 12px; line-height: 19px; }
.fc-j-note b { display: block; margin-bottom: 2px; color: #2A2622; font-weight: 500; }
.fc-j-note .hint { color: #A6392A; }
/* 条目时间：可点开改 */
.fc-j-time { flex: none; height: 28px; margin-right: -6px; padding: 0 8px; border: 0; border-radius: 14px; background: rgba(42, 38, 34, .05); color: #6B6357; font-size: 12px; display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.fc-j-timefield { flex: none; display: flex; align-items: center; gap: 4px; margin-right: -6px; animation: fcPop .2s ease-out both; }
.fc-j-timefield input { height: 28px; box-sizing: border-box; padding: 0 8px; border: 1px solid #2A2622; border-radius: 14px; outline: none; background: #F4EFE4; color: #2A2622; font: inherit; font-size: 12px; }
/* 你的规律 / 本月卡片 */
.fc-j-notehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fc-j-note .fc-j-notehead b { margin-bottom: 0; }
.fc-j-notehead em { font-style: normal; font-weight: 500; color: #2A2622; }
.fc-j-notehead em.in { color: #A6392A; }
.fc-j-count { color: #8A8175; font-size: 12px; }
.fc-j-learn { margin-top: 8px; }
.fc-j-learn strong { display: block; color: #2A2622; font-size: 13px; font-weight: 500; line-height: 20px; }
.fc-j-learn span { display: block; margin-top: 2px; color: #8A8175; font-size: 11px; line-height: 16px; }
.fc-j-month, .fc-j-future { display: flex; flex-direction: column; gap: 8px; }
.fc-j-future { align-items: flex-start; }
.fc-j-future .fc-j-add { height: 36px; border-radius: 18px; }
.fc-j-bars { display: flex; flex-direction: column; gap: 6px; }
.fc-j-bar { display: flex; align-items: center; gap: 8px; }
.fc-j-bar .c { flex: none; width: 28px; color: #2A2622; }
.fc-j-bar .track { flex: 1; height: 6px; overflow: hidden; border-radius: 3px; background: rgba(42, 38, 34, .08); }
.fc-j-bar .track i { display: block; height: 100%; border-radius: 3px; background: #2A2622; }
.fc-j-bar .v { flex: none; min-width: 72px; text-align: right; color: #2A2622; }
.fc-j-bar .p { flex: none; width: 30px; text-align: right; color: #8A8175; }
.fc-j-roads { display: flex; gap: 8px; }
.fc-j-roads div { flex: 1; padding: 6px 10px; border-radius: 10px; background: rgba(247, 242, 232, .7); }
.fc-j-roads strong { display: block; font-size: 14px; font-weight: 500; color: #2A2622; }
.fc-j-roads .huang strong { color: #A6392A; }
.fc-j-private { display: flex; align-items: center; gap: 5px; color: #8A8175; font-size: 11px; }
.fc-j-io { display: flex; align-items: center; gap: 8px; }
.fc-j-seg { display: flex; flex-shrink: 0; overflow: hidden; border: 1px solid #CCC3B0; border-radius: 16px; }
.fc-j-seg button { height: 32px; padding: 0 14px; border: 0; background: transparent; color: #2A2622; font-size: 13px; cursor: pointer; white-space: nowrap; }
.fc-j-seg button[aria-pressed="true"] { background: #2A2622; color: #EFEAE0; }
.fc-j-sum { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: #6B6357; font-size: 12px; line-height: 16px; white-space: nowrap; }
.fc-j-sum span { color: #2A2622; font-weight: 500; }
.fc-j-sum span.in { color: #A6392A; }
.fc-j-amt { display: flex; align-items: center; gap: 8px; }
.fc-j-amt input { flex-grow: 1; min-width: 0; height: 44px; box-sizing: border-box; padding: 0 12px; border: 1px solid #CCC3B0; border-radius: 22px; outline: none; background: transparent; color: #2A2622; font-size: 13px; }
.fc-j-amt input:focus-visible { border-color: #355d78; }
.fc-j-add { flex-shrink: 0; height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: #2A2622; color: #EFEAE0; font-size: 13px; cursor: pointer; white-space: nowrap; }
.fc-j-daysum { color: #6B6357; font-size: 12px; }
.fc-j-toast { align-self: center; color: #6B6357; font-size: 12px; animation: fcPop .25s ease-out both; }
.fc-j-calveil { position: absolute; inset: 0; z-index: 5; border-radius: 22px 22px 0 0; }
.fc-j-cal { position: absolute; left: 14px; top: 52px; z-index: 6; transform-origin: 40px 0; width: 294px; padding: 12px 14px 8px; box-sizing: border-box; border-radius: 18px; background: #F4EFE4; box-shadow: 0 12px 30px rgba(70, 50, 15, .18); animation: fcCalIn .24s cubic-bezier(.22, 1, .36, 1) .08s both; }
.fc-j-cal.is-leaving { pointer-events: none; animation: fcCalOut .17s ease-in both; }
@keyframes fcCalIn { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fcCalOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-4px) scale(.97); } }
.fc-j-calhead { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.fc-j-calhead strong { padding-left: 4px; font: 600 16px/1 var(--font-body); letter-spacing: 1px; }
.fc-j-calhead button { width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: #6B6357; cursor: pointer; display: inline-grid; place-items: center; }
.fc-j-week { display: flex; margin-top: 2px; }
.fc-j-week div { width: 38px; height: 26px; display: flex; align-items: center; justify-content: center; color: #8A8175; font-size: 11px; }
.fc-j-days { display: flex; flex-wrap: wrap; width: 266px; }
.fc-j-day { position: relative; width: 38px; height: 38px; padding: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fc-j-day[hidden] { visibility: hidden; display: flex; }
.fc-j-day[disabled] { cursor: default; }
.fc-j-day[disabled] span.n { color: #BDB4A1; }
.fc-j-calhead button[disabled] { opacity: .3; cursor: default; }
.fc-j-day span.n { width: 32px; height: 32px; box-sizing: border-box; border: 1px solid transparent; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #2A2622; font: 400 15px/1 var(--font-body); }
.fc-j-day[aria-pressed="true"] span.n { background: #2A2622; color: #EFEAE0; }
.fc-j-day.is-today span.n { color: #A6392A; }
.fc-j-day.is-today[aria-pressed="false"] span.n { border-color: #A6392A; }
.fc-j-day.is-today[aria-pressed="true"] span.n { color: #EFEAE0; }
.fc-j-day i { position: absolute; left: 17px; bottom: 1px; width: 4px; height: 4px; border-radius: 2px; }
.fc-j-calfoot { display: flex; justify-content: flex-end; margin-top: 6px; border-top: 1px solid rgba(42, 38, 34, .08); }
.fc-j-calfoot button { height: 44px; padding: 0 6px; border: 0; background: transparent; color: #A6392A; font-size: 13px; letter-spacing: 1px; cursor: pointer; }
.fc-j-root :focus-visible { outline: 2px solid rgba(53, 93, 120, .5); outline-offset: 2px; }
.fc-j-root .fc-j-customfield input:focus-visible { outline: none; }
.fc-j-root .fc-j-close:focus-visible, .fc-j-root .fc-j-date:focus-visible { outline-offset: -6px; border-radius: 22px; }
.fc-j-customfield:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(53, 93, 120, .18); }

@media (prefers-reduced-motion: reduce) {
  .fc-j-veil, .fc-j-sheet, .fc-j-toast, .fc-j-cal, .fc-j-customfield, .fc-j-timefield { animation-duration: 1ms; }
  .fc-j-sheet, .fc-j-body, .fc-j-tabind, .fc-j-tab, .fc-j-track, .fc-j-pane, .fc-j-pane[aria-hidden="true"] { transition-duration: 1ms; transition-delay: 0s; }
}
