* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; overflow-x: clip; overscroll-behavior-y: none; background: #f7f7f8; color: var(--ink-1); font-family: var(--font-sans); }
body { background: #f7f7f8; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
button { font: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { width: min(100%, 460px); min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: #f7f7f8; display: flex; flex-direction: column; }
#app-root { flex: 1; min-height: 0; padding: max(8px, calc(env(safe-area-inset-top, 0px) + 4px)) 16px calc(78px + env(safe-area-inset-bottom, 0px)); }
/* 显化 Story 满屏态：容器 padding 清零，页面底色与 story 一体（含 overscroll 回弹露出的区域） */
body.story-fullscreen { background: #111; }
body.story-fullscreen #app-root { padding: 0; }
.card { background: #fff; border: 1px solid rgba(42,39,36,.08); border-radius: 20px; box-shadow: 0 6px 18px rgba(44,38,32,.045); }
button.card { font: inherit; }
.home-action-card { display: flex; width: 100%; cursor: pointer; text-align: left; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.home-action-card:hover { border-color: rgba(42,39,36,.16); box-shadow: 0 15px 32px rgba(104,58,48,.1); transform: translateY(-2px); }

.home-view { display: flex; flex-direction: column; gap: 10px; }
.home-header { display: flex; align-items: center; justify-content: flex-start; padding: 4px 2px 0; }
.home-header__menu { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(42,39,36,.11); border-radius: 14px; background: rgba(255,255,255,.72); color: var(--ink-2); cursor: pointer; transition: transform .15s ease, background .2s ease; }
.home-header__menu:active { transform: scale(.92); }
.home-header__menu svg { width: 20px; height: 20px; }

/* ===== 今日概览 ===== */
.home-hero { flex-direction: column; gap: 12px; padding: 15px 18px 13px; border-color: rgba(185,79,73,.14); border-radius: 24px; background: #fff; box-shadow: 0 8px 22px rgba(44,38,32,.05); }
.home-hero__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; width: 100%; }
.home-hero__date { display: flex; flex-direction: column; gap: 3px; }
.home-kicker { color: var(--accent); font-size: var(--fs-caption); font-weight: 750; letter-spacing: 2.5px; }
.home-hero__date strong { color: var(--ink-1); font-size: var(--fs-display); font-weight: 650; letter-spacing: -1.2px; line-height: 1; }
.home-hero__date > span:last-child { color: var(--ink-2); font-size: var(--fs-body); font-weight: 550; }
.home-hero__clock { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.home-hero__clock strong { color: var(--ink-1); font-size: var(--fs-title); font-weight: 600; letter-spacing: -1.2px; line-height: 1; }
.home-hero__clock span { color: var(--ink-3); font-size: var(--fs-caption); }
.home-hero__bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid rgba(185,79,73,.12); color: var(--ink-2); font-size: var(--fs-body); font-weight: 600; letter-spacing: .1px; }
.home-hero__thought { border: 0; padding: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: var(--fs-caption); font-weight: 650; white-space: nowrap; }
.home-hero i { font-style: normal; font-size: var(--fs-body); }

/* ===== 时间板块（透明毛玻璃）与今日数据 ===== */
.home-dashboard, .home-dual-feature { display: grid; grid-template-columns: 1.08fr .92fr; gap: 10px; }
.home-dashboard > *, .home-dual-feature > * { min-width: 0; }

.home-time-panel { position: relative; min-height: 220px; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding: 14px 15px 16px; color: var(--ink-1); border-color: rgba(36,35,33,.1); background: linear-gradient(155deg, rgba(255,255,255,.66), rgba(255,255,255,.4)); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 14px 30px rgba(36,35,33,.1); }
.home-time-panel:hover { border-color: rgba(36,35,33,.18); background: linear-gradient(155deg, rgba(255,255,255,.76), rgba(255,255,255,.46)); box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 18px 34px rgba(36,35,33,.14); }
.home-time-panel__phase { align-self: flex-start; color: var(--green-deep); font-size: var(--fs-lead); font-weight: 700; letter-spacing: 1.5px; line-height: 1; }
.home-time-panel__ring { position: relative; display: grid; place-items: center; width: 170px; height: 170px; flex: 0 0 auto; margin: 6px auto 4px; }
.home-time-panel__ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.home-time-panel__ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.home-time-panel__ring-track { stroke: rgba(22,163,74,.16); }
.home-time-panel__ring-fill { stroke: var(--green); transition: stroke-dashoffset .45s ease; }
.home-time-panel__ring b { position: relative; color: var(--green-deep); font-size: var(--fs-ring); font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.home-time-panel__bar { display: flex; gap: 3px; width: 100%; height: 10px; margin-top: auto; }
.home-time-panel__bar i { position: relative; flex: 1 1 0; overflow: hidden; border-radius: 99px; background: rgba(36,35,33,.08); }
.home-time-panel__bar i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--fill, 0%); border-radius: inherit; background: rgba(22,163,74,.4); transition: width .4s ease; }
.home-time-panel__bar i.is-past::after { background: rgba(22,163,74,.55); }
.home-time-panel__bar i.is-current::after { background: var(--green); }

.home-metrics { display: flex; flex-direction: column; gap: 10px; }
.home-metric { min-height: 62px; flex-direction: column; padding: 11px 13px; background: #fff; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-1); font-size: var(--fs-body); font-weight: 650; letter-spacing: .1px; }
.home-section-head small { color: var(--ink-3); font-size: var(--fs-micro); font-weight: 700; letter-spacing: 1.4px; }
.home-habits { display: flex; flex-direction: column; gap: 6px; margin-top: 7px; }
.home-habit { display: flex; align-items: center; gap: 8px; overflow: hidden; color: var(--ink-2); font-size: var(--fs-caption); line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.home-habit__dot { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; border: 0; border-radius: 50%; color: #fff; background: #e9e9ec; font-size: var(--fs-caption); font-weight: 700; }
.home-habit__dot.is-done { background: var(--accent); }
.home-metric__hint { display: none; }
.home-expense { margin: auto 0 3px; color: var(--accent); font-size: var(--fs-title); font-weight: 700; letter-spacing: -.8px; line-height: 1; }
.home-expense__meta { display: flex; justify-content: space-between; gap: 5px; color: var(--ink-3); font-size: var(--fs-caption); }
.home-budget-bar { height: 8px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: #eee1de; }
.home-budget-bar span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.home-empty { color: var(--ink-3); font-size: var(--fs-caption); }

/* ===== 今日卦象（黑图白底）与显化 ===== */
.home-divination { position: relative; min-height: 216px; flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; border-color: rgba(42,39,36,.1); background: #fff; }
.home-divination__visual { display: grid; place-items: center; min-height: 158px; flex: 1 1 70%; background: #fff; }
.home-divination__label { color: var(--ink-3); font-size: var(--fs-micro); letter-spacing: 1.2px; }
.home-divination__symbol { color: var(--ink-1); font-family: serif; font-size: 134px; line-height: .95; text-shadow: 0 8px 18px rgba(36,35,33,.1); }
.home-divination__copy { display: flex; flex: 0 0 64px; flex-direction: column; gap: 3px; padding: 9px 12px 10px; }
.home-divination__name { color: var(--ink-1); font-size: var(--fs-heading); font-weight: 700; }
.home-divination__copy small { display: -webkit-box; overflow: hidden; color: var(--ink-2); font-size: var(--fs-caption); font-weight: 500; line-height: 1.35; text-align: left; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-divination__arrow { position: absolute; right: 12px; bottom: 11px; color: var(--ink-3); font-size: var(--fs-heading); }
.home-manifestation { position: relative; min-height: 184px; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; border-color: rgba(42,39,36,.08); background: #fff; }
.home-manifestation__visual { display: grid; place-items: center; min-height: 128px; flex: 1 1 70%; color: var(--ink-3); background: #f5f5f7; background-position: center; background-size: cover; font-size: var(--fs-caption); }
.home-manifestation__visual--empty { background: #f5f5f7; }
.home-manifestation__copy { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; background: rgba(255,255,255,.15); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); border-radius: 12px; }
.home-manifestation__label { color: var(--ink-3); font-size: var(--fs-micro); letter-spacing: 1px; }
.home-manifestation__copy strong { color: #fff; font-size: var(--fs-heading); font-weight: 700; letter-spacing: -.6px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.home-manifestation__copy small { display: -webkit-box; overflow: hidden; color: rgba(255,255,255,.85); font-size: var(--fs-caption); line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.home-manifestation__arrow { position: absolute; right: 12px; bottom: 11px; color: var(--ink-3); font-size: var(--fs-heading); }

.bottom-nav { position: fixed; z-index: 10; bottom: 8px; left: 50%; width: min(94%, 420px); transform: translateX(-50%); display: flex; justify-content: space-between; gap: 6px; padding: 8px; border: 0; border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: 0 8px 30px rgba(35,35,42,.12); backdrop-filter: blur(20px); }
.nav-item { display: grid; flex: 1 1 0; min-width: 48px; justify-items: center; gap: 3px; border: 0; border-radius: 20px; background: none; color: var(--ink-3); cursor: pointer; font-size: 11px; padding: 8px 5px 7px; transition: background .2s ease, color .2s ease, transform .3s cubic-bezier(.34,1.56,.64,1); }
.nav-item:active { transform: scale(.88); }
.nav-item.is-active { transform: scale(1.04); }
.nav-item:hover { color: var(--ink-1); transform: translateY(-1px); }
.nav-item.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-item span { line-height: 1; }
.nav-mark { width: 18px; height: 18px; margin: 0; color: currentColor; opacity: .86; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-title { margin: 0; color: var(--ink-1); font-size: var(--fs-display); font-weight: 650; }
.page-eyebrow { color: var(--ink-3); font-size: var(--fs-caption); letter-spacing: 1.5px; }

/* ===== 左右滑动切页动效 · 滑动 + 回弹（类 iOS） ===== */
@keyframes pageEnterNext {
  0% { transform: translate3d(28%, 0, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}
@keyframes pageEnterPrev {
  0% { transform: translate3d(-28%, 0, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}
#app-root.page-enter-next,
#app-root.page-enter-prev { will-change: transform, opacity; backface-visibility: hidden; }
#app-root.page-enter-next { animation: pageEnterNext .42s cubic-bezier(.32, .72, 0, 1); }
#app-root.page-enter-prev { animation: pageEnterPrev .42s cubic-bezier(.32, .72, 0, 1); }

/* ===== 项目与设置 抽屉（左侧滑入，默认隐藏在屏外） ===== */
.drawer-overlay { position: fixed; inset: 0; z-index: 20; background: rgba(24,22,20,.42); opacity: 0; pointer-events: none; transition: opacity .28s ease; }
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.app-drawer { position: fixed; top: 0; left: 0; z-index: 30; width: min(84%, 330px); height: 100dvh; display: flex; flex-direction: column; padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px)); background: #fff; box-shadow: 0 0 40px rgba(30,28,26,.18); transform: translateX(-100%); transition: transform .3s cubic-bezier(.22,.61,.36,1); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.app-drawer.is-open { transform: translateX(0); }
body.drawer-locked { overflow: hidden; }

.drawer-head { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px 16px; }
.drawer-head strong { font-size: var(--fs-title); font-weight: 650; color: var(--ink-1); letter-spacing: -.4px; }
.drawer-head span { font-size: var(--fs-caption); color: var(--ink-3); letter-spacing: 1.2px; }

.drawer-group { margin-bottom: 8px; }
.drawer-group--indent { padding-left: 10px; }
.drawer-group__label { margin: 0 8px 6px; font-size: var(--fs-caption); font-weight: 700; letter-spacing: 1.6px; color: var(--ink-3); }

.drawer-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--ink-2); font-size: var(--fs-body); text-align: left; cursor: pointer; transition: background .15s ease, color .15s ease; }
.drawer-row:hover { background: #f5f5f7; }
.drawer-row.is-active { background: var(--accent-bg); color: var(--accent); font-weight: 650; }
.drawer-row__mark { width: 19px; height: 19px; flex: 0 0 auto; color: currentColor; }
.drawer-row span { flex: 1; }
.drawer-row i { font-style: normal; color: var(--ink-3); font-size: var(--fs-heading); line-height: 1; }

.drawer-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #e3e3e8; }
.drawer-foot small { display: block; padding: 8px 10px 0; font-size: var(--fs-caption); color: var(--ink-3); line-height: 1.5; }

@media (max-width: 380px) {
  .app-drawer { width: min(88%, 300px); }
}


@keyframes pageEnterUp {
  0% { transform: translate3d(0, 12%, 0) scale(.98); opacity: 0; }
  100% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}
#app-root.page-enter-up { animation: pageEnterUp .38s cubic-bezier(.32, .72, 0, 1); }
