/* 开发者补充样式（在 theme.css 之后引入）。theme.css 是设计师的，不改；这里只补页面上用到的小件。
   颜色一律用 theme.css 的变量，不写色值。 */

[hidden] { display: none !important; }          /* theme.css 里不少类写了 display，hidden 属性要压过它们 */

/* 列表里逾期行下方的小日期 */
.due-sub { font-size: var(--fs-xs); }

/* 板块页右上「显示已完成」 */
.toggle-done { font-size: var(--fs-sm); min-height: 0; }

/* 已结束项目里的空提示 */
.project-empty { margin: 8px 16px 12px; }

/* 月历点日期 / 点账单滚到列表：避开吸顶的页头 */
.bill-list .item { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (max-width: 600px) {
  .cal__day[data-day] { cursor: pointer; }
}

/* 详情页 */
.detail-notice { margin-bottom: var(--sp-4); }
.detail-countdown { margin-bottom: var(--sp-4); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--sp-2); }
.detail-stamp { font-size: var(--fs-xs); margin: 0 4px; }
.pay-panel__link { font-size: var(--fs-sm); }
.pay-panel__form .field { margin-bottom: 0; }

/* 按钮样式的「‹ 返回」 */
.back-link.link-btn { color: var(--ink-3); }
.back-link.link-btn:hover { color: var(--ink); }

/* 设置面板里的保存按钮不吸底 */
.form-actions--static { position: static; background: none; }
.affix--narrow { max-width: 160px; }
.input--date-narrow { max-width: 220px; }

/* 搜索 */
.search-hero__btn { height: 48px; flex: none; }
.search-more { margin-top: var(--sp-3); }

/* 列表行 meta：分类路径后面跟一个「·」（样稿写法），只有路径一项时不加 */
.item__meta > .meta-path:not(:last-child)::after { content: " ·"; color: var(--ink-4); }

/* 分类页：右侧设置面板顶端对齐；设置格子的板块名不折行 */
.cat-layout > .panel + .panel { margin-top: 0; }
.settings-grid .affix__pre { white-space: nowrap; }

/* 分类树：新建 / 改名时的行内输入 */
.tree__row .tree__rename { flex: 1 1 160px; }

/* 生活：快加框展开后，补充栏占满一行 */
.quick-add .quick-add__extra .input { flex: 1 1 140px; width: auto; }

/* v1.1 垃圾回收（主体样式在 theme.css「v1.1 garbage」段）：搜索无结果行不要分隔线。
   生活页入口 1.3 起是 theme.css H4/H5 的 .tile-grid 磁贴，旧的 .garbage-hint 留距规则已删。 */
.gb-results .section__empty { border: 0; }

/* 垃圾页长文本折行（DESIGN_SPEC §6 / §10.4）：正式数据的要点 / 说明里有整串 URL（回收箱位置：https://…），
   不折行会把 390 宽页面撑到 431（手机上整页变宽，连带 .tabbar 越界）。只在放不下时断词，不影响短文本。 */
.gb-card__how li, .gb-card__rule, .gb-card__note, .gb-fold__list li,
.gb-result__how > *, .gb-result__kana, .gb-day__meta > *,
.gb-flow li, .gb-sodai dd, .gb-notes .notice > span { overflow-wrap: anywhere; min-width: 0; }

/* v1.5 子任务（契约 1.5）：步骤行 = 勾选框 + 标题 + 归属徽标 + 期限；有准备物 / 提出先 / 連絡先 / 費用 时用原生 details 展开。
   期限等级用 theme.css 的 [data-level] 变量（--lv / --lv-wash），左侧色条同列表行 .item。 */
.check-item[data-level] { position: relative; }
.check-item[data-level]::before {
  content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--lv);
}
.check-item[data-level="normal"]::before { opacity: .55; }
.check-item[data-level="overdue"] { background: var(--overdue-wash); }
.check-item__sub .badge { height: 18px; padding: 0 6px; }
.step-due { font-variant-numeric: tabular-nums; white-space: nowrap; }
.check-item.is-done .step-due { text-decoration: line-through; text-decoration-color: var(--ink-4); }
.step-more { min-width: 0; }
.step-more > summary { display: block; position: relative; padding-right: 24px; list-style: none; cursor: pointer; }
.step-more > summary::-webkit-details-marker { display: none; }
.step-more > summary::after {
  content: ""; position: absolute; right: 0; top: 2px; width: 16px; height: 16px;
  background: var(--chev-img) center / 16px no-repeat; transition: transform var(--dur) var(--ease);
}
.step-more[open] > summary::after { transform: rotate(180deg); }
.step-more > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.step-detail {
  display: grid; gap: var(--sp-2); margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
}
.step-block { min-width: 0; }
.step-block__label { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: .05em; margin-bottom: 2px; }
.step-block__list { margin: 0; padding-left: 1.2em; }
.step-block__list li, .step-block__text { overflow-wrap: anywhere; min-width: 0; }
.step-block__note { white-space: pre-wrap; }
.step-block__kv { grid-template-columns: 5em minmax(0, 1fr); gap: 4px var(--sp-3); }

/* ------------------------------------------------------------------ 契约 1.7 界面双语 */
/* 「中 / 日」按钮与日文防撑爆的样式在 theme.css「v1.8 login & lang」段（DESIGN_SPEC §12），这里只补一处：
   theme.css 的「.field__label :lang(ja)」原意是把标签里的日文注音缩小变灰；日文界面下整页都是 ja，标签不能被它缩小 */
html:lang(ja) .field__label :lang(ja):not(.field__req):not(.field__opt):not(.field__ja) { font-weight: inherit; color: inherit; font-size: inherit; }
/* 日文标签后的说明（field__opt）较长：整体换到下一行，而不是把标签本身挤成竖排（390 宽「対象月」） */
html:lang(ja) .field__label { flex-wrap: wrap; row-gap: 0; }

/* ------------------------------------------------------------------ 契约 1.8 登录 */
/* 登录 / 设密码页的样式全在 theme.css「v1.8 login & lang」段；这里只补页眉的「登出」按钮（只在经隧道登录时出现） */
.logout-form { display: inline-flex; margin: 0; }
.logout-btn svg { display: block; }
@media (max-width: 600px) {
  .header-actions .logout-btn { width: 32px; }
}

/* ------------------------------------------------------------------ 契约 1.9 初始密码提示条 */
/* 只在「当前是 CLI --initial 设的初始密码」时出现，不挡操作；放在 tabbar 与 main 之间 */
.initpw-wrap { padding-top: var(--sp-4); }
.initpw-bar { align-items: center; flex-wrap: wrap; }
.initpw-bar__text { flex: 1 1 14em; min-width: 0; overflow-wrap: anywhere; }
.initpw-wrap + .page { padding-top: var(--sp-4); }
.set-account { border-top: 1px solid var(--line); }
