/* 余额继续使用原按钮和事件；只收紧手机头部，横屏结构不变。 */
.header-resources {display:contents}
body.hd2d-preview #app-view .rpg-topline {display:flex;align-items:center;justify-content:space-between}
body.hd2d-preview #app-view .rpg-topline .rpg-adventure-emblem {display:block;width:56px;height:56px;object-fit:contain;filter:drop-shadow(0 3px 5px #07183270)}
body.hd2d-preview #app-view .rpg-topline .page-help-button {margin-left:auto;flex:none}
body.hd2d-preview #app-view .family-rpg .rpg-nav {display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
body.hd2d-preview #app-view .family-rpg .rpg-nav button {min-width:0;white-space:nowrap}
body.hd2d-preview #app-view .family-rpg .rpg-page-heading [data-action=adventure-map] {display:none}
body.hd2d-preview #app-view #weekly-review-view .wr-heading {display:flex;align-items:center;justify-content:space-between;gap:12px}
body.hd2d-preview #app-view #weekly-review-view .wr-heading .page-heading-actions {display:flex;flex:none}
body.hd2d-preview #app-view .family-rpg .rpg-map-page .rpg-v11-map-chapter {margin:16px 0;border:1px solid var(--glass-line);border-radius:12px;padding:14px;background:var(--glass-card)}
body.hd2d-preview #app-view .family-rpg .rpg-map-page summary {min-height:44px;cursor:pointer;font-size:19px;line-height:1.5}
@media(max-width:767px) {
  body.hd2d-preview #app-view .rpg-topline .rpg-adventure-emblem {width:36px;height:36px}
  body.hd2d-preview:has(#app-view) #app-view .topbar {
    display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:auto auto;
    gap:2px 6px;align-items:center;min-height:0;padding:6px 12px;margin-bottom:10px;
    background:transparent;border:0;box-shadow:none;backdrop-filter:none;
  }
  body.hd2d-preview:has(#app-view) #app-view .topbar .brand-heading {grid-column:1;grid-row:1;min-height:44px;min-width:0;width:auto;background:transparent;border:0;box-shadow:none}
  body.hd2d-preview:has(#app-view) #app-view .topbar #site-title {font-size:14px;line-height:1.4;white-space:normal;margin:0}
  body.hd2d-preview:has(#app-view) #app-view .topbar #site-title>span {display:block;white-space:nowrap}
  body.hd2d-preview:has(#app-view) #app-view .topbar .top-actions {display:contents;background:transparent;border:0;padding:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
  body.hd2d-preview:has(#app-view) #app-view .topbar .header-resources {display:flex;grid-column:2;grid-row:1;align-items:center;gap:2px;min-width:0}
  body.hd2d-preview:has(#app-view) #app-view .topbar .top-actions .balance {display:flex;align-items:center;justify-content:center;gap:4px;min-width:44px;min-height:44px;width:auto;padding:4px 6px;border:0;background:transparent;box-shadow:none;border-radius:10px}
  body.hd2d-preview:has(#today-workspace:not(.hidden)) #app-view .topbar .top-actions .balance {min-height:44px;padding:4px 6px}
  body.hd2d-preview:has(#app-view) #app-view .topbar .balance img {width:21px;height:21px;flex:none}
  body.hd2d-preview:has(#app-view) #app-view .topbar .balance strong {font-size:18px;line-height:1.2;white-space:nowrap;overflow-wrap:normal}
  body.hd2d-preview:has(#app-view) #app-view .topbar .balance span {display:none}
  body.hd2d-preview:has(#app-view) #app-view .topbar #role-action {grid-column:3;grid-row:1;min-height:44px;padding:6px 8px;font-size:14px;border-radius:8px;background:var(--fg-raised);border:1px solid var(--fg-border);white-space:nowrap}
  body.hd2d-preview:has(#app-view) #app-view .topbar .current-child-context {grid-column:1/-1;grid-row:2;min-height:22px;gap:6px;font-size:13px;line-height:1.5;flex-wrap:wrap}
  body.hd2d-preview:has(#app-view) #app-view .topbar #current-parent-mode {font-size:11px;padding:1px 5px}
  body.hd2d-preview:has(#app-view) #app-view .topbar #child-switcher {max-width:100%;min-height:32px}
  /* 仅保留卡片内日期选择器；隐藏旧顶部日期栏和旧文本副本。 */
  body.hd2d-preview #app-view #mobile-date-bar,
  body.hd2d-preview #app-view #today-workspace #record-date-label {display:none}
  body.hd2d-preview #app-view .family-rpg .rpg-nav button {padding:9px 4px;gap:4px;font-size:16px}
}
/* 大额余额允许在自己的资源组内换行，不把家长入口挤出屏幕。 */
@media(max-width:359px) {
  body.hd2d-preview:has(#app-view) #app-view .topbar {column-gap:3px}
  body.hd2d-preview:has(#app-view) #app-view .topbar .header-resources {flex-wrap:wrap;max-width:142px;justify-content:flex-end}
  body.hd2d-preview:has(#app-view) #app-view .topbar .top-actions .balance {padding:4px}
  body.hd2d-preview:has(#today-workspace:not(.hidden)) #app-view .topbar .top-actions .balance {padding:4px}
}
