/* 页眉、卡框和价签沿用鱼获卡的纸面与墨线。 */
.page.card-page:not(#page-play) {
  container-type:inline-size;
  padding-block:8px 24px;
}
.folio-cover {
  position:relative;
  isolation:isolate;
  display:flex;
  align-items:end;
  min-height:clamp(116px,26cqw,230px);
  padding:clamp(12px,3cqw,28px);
  overflow:hidden;
  border:2px solid #342f24;
  border-radius:14px 14px 5px 5px;
  background:#3e5040;
  box-shadow:0 4px 8px #4f3b291f;
  color:#fff1cf;
}
.folio-cover img,.folio-cover::after {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}
.folio-cover img { z-index:-2; object-fit:cover; object-position:center 54%; }
#shop-cover { object-position:center 46%; }
.folio-cover::after {
  content:"";
  z-index:-1;
  background:linear-gradient(16deg,#22251be8 1%,#22251b73 32%,transparent 62%);
  box-shadow:inset 0 0 0 1px #f6d59baf,inset 0 0 0 4px #3d332a66;
}
.folio-cover h2 {
  font-size:clamp(23px,5cqw,43px);
  line-height:1.18;
  letter-spacing:.08em;
  text-shadow:0 2px 8px #161e16;
}
.folio-heading {
  margin:16px 0 9px;
  padding-bottom:4px;
  border-bottom:1px solid #a68b5c;
  color:#4b3a24;
  font:700 16px/1.4 LocalSerif,"Songti SC",serif;
  letter-spacing:.04em;
}
.card-page .list-toolbar {
  margin:10px 0;
  padding:7px 9px;
  border:1px solid #9f875d;
  border-radius:4px;
  background:#f6e6be;
  color:#4b3a24;
}
.card-page :is(.list-toolbar,.shop-shelf-nav) button {
  min-height:34px;
  padding:4px 10px;
  border:1px solid #8b734c;
  border-radius:4px;
  background:linear-gradient(#fcf0d1,#dfca99);
  color:#463721;
  font-weight:700;
}
.card-page :is(.list-toolbar,.shop-shelf-nav) button:hover:enabled { background:#fdf0cc; }
.keepnet-toolbar-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; }
.card-page .list-toolbar #keepnet-select-mode[aria-pressed="true"] { background:#354a39; color:#fff1c8; }
.keepnet-batch-panel {
  position:sticky; top:0; z-index:2;
  display:grid; gap:6px; margin-bottom:9px; padding:7px;
  border:1px solid #8e754b; border-radius:6px; box-shadow:0 3px 8px #392a2140;
  background:#f2e1ba; color:#43331f;
}
.keepnet-batch-panel[hidden] { display:none; }
.keepnet-batch-heading { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:5px; }
.keepnet-batch-heading > div { display:flex; gap:6px; flex-wrap:wrap; }
.keepnet-batch-heading .field-button { min-height:36px; }
.keepnet-batch-panel p { font-size:12px; color:#753a28; }
.keepnet-batch-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
.keepnet-batch-actions button { padding-inline:2px; }
.fish-album,.shop-shelf {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(7px,2cqw,16px);
}
@container (min-width:520px) {
  .fish-album,.shop-shelf { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@container (min-width:790px) {
  .fish-album,.shop-shelf { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
.fish-album .empty {
  grid-column:1 / -1;
  padding:22px;
  border:1px dashed #a88d5b;
  border-radius:6px;
  background:#f8ecd0;
  color:#665238;
}
.illustrated-catch:is(.album-card,.shelf-card) {
  min-width:0;
  aspect-ratio:auto;
  padding:7px;
  gap:4px;
  border-radius:9px;
  text-align:left;
  box-shadow:inset 0 0 0 1px var(--card-highlight),inset 0 0 0 3px var(--card-shadow),0 3px 6px #3a2b2442;
}
.illustrated-catch.album-card { grid-template-rows:auto auto auto 1fr; }
.album-card:hover {
  box-shadow:inset 0 0 0 1px var(--card-highlight),inset 0 0 0 3px var(--card-shadow),0 5px 12px #3a2b2475;
  transform:translateY(-1px);
}
.album-card .catch-heading,.shelf-card .catch-heading {
  min-height:28px;
  padding:2px 4px;
  gap:2px 3px;
  flex-wrap:wrap;
}
.album-card .catch-heading strong,.shelf-card h4 {
  margin:0;
  font:700 clamp(12px,3.6cqw,16px)/1.23 LocalSerif,"Songti SC",serif;
}
.album-card .catch-rarity,.shelf-badge {
  gap:3px;
  padding:1px 3px;
  font-size:9px;
}
.album-card .catch-rarity::before { width:4px; height:4px; }
.album-card .catch-artwork,.shelf-card .catch-artwork { width:100%; border-width:1px; }
.album-card[data-undiscovered="true"] .fish-portrait { filter:saturate(.54) sepia(.13); }
.album-stats,.shelf-metrics {
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(0,1fr);
  border:1px solid var(--card-rule);
  border-radius:2px;
  background:#242e23;
  color:#fff1d1;
  text-align:center;
  font-variant-numeric:tabular-nums;
}
.album-stats > span,.shelf-metrics > span { padding:3px 1px; }
.album-stats > span + span,.shelf-metrics > span + span { border-left:1px solid var(--card-rule); }
.album-stats :is(small,b) { display:block; line-height:1.35; }
.album-stats small { color:#eed7a6; font-size:9px; }
.album-stats b { font-size:clamp(9px,2.8cqw,12px); }
.album-card[data-kind="fish"] .album-stats {
  background:var(--card-shadow);
  color:var(--card-copy,#fff1d1);
}
.album-card[data-kind="fish"] .album-stats small,
.album-card[data-kind="fish"] .album-caption { color:var(--card-gilt); }
.album-unit { font-size:.87em; white-space:nowrap; }
.album-caption {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:3px;
  padding:1px 2px;
  color:#ffedc0;
  font-size:10px;
  line-height:1.3;
}
.album-caption > :last-child { font:17px/1 Georgia,serif; }
.album-caption .album-pick-mark {
  display:grid; place-items:center; flex:none; width:19px; height:19px;
  border:1px solid #dfc895; border-radius:3px; background:#28352a;
}
.album-card[data-keepnet-select][aria-pressed="true"] {
  outline:2px solid #735927; outline-offset:1px;
}
.album-card[data-keepnet-select]:focus-visible { outline:3px dashed #a45b28; outline-offset:2px; }
.album-card[aria-pressed="true"] .album-pick-mark { background:#e7ca88; color:#26392c; }
.album-card[aria-pressed="true"] .album-pick-mark::before { content:"✓"; }
.shop-shelf-nav { display:flex; gap:7px; margin-top:10px; }
.shop-shelf-nav button { flex:1; }
.tackle-loadout { margin:12px 0 4px; }
.tackle-loadout .field-inset { padding:10px; }
#loadout-slots { display:grid; grid-template-columns:repeat(auto-fit,minmax(92px,1fr)); gap:6px; margin:8px 0; }
#loadout-slots > div { min-width:0; padding:4px 6px; border-left:2px solid var(--field-brass); background:#89653318; }
#loadout-slots > [data-rarity] { border-left-color:var(--card-frame); }
#loadout-slots dt { font-size:10px; color:#604b32; }
#loadout-slots dd { margin:2px 0 0; color:var(--field-ink); font-size:12px; font-weight:700; }
#loadout-slots .item-grade-tag { margin-top:3px; }
#loadout-totals { padding-top:6px; border-top:1px solid #a5844c88; font-size:12px; }
.shelf-badge { color:#fff1d4; background:#4b573f; border-radius:3px; white-space:nowrap; }
.shelf-tags { display:flex; flex-wrap:wrap; gap:3px; align-items:center; }
.shelf-tags .item-grade-tag { gap:4px; padding:1px 4px; font-size:9px; }
.shelf-tags .item-grade-tag::before { width:4px; height:4px; }
.shelf-card .catch-description { padding:4px 6px; font-size:11px; }
.shelf-card .shelf-metrics { font-size:clamp(10px,2.9cqw,13px); font-weight:700; }
.shelf-card[data-rarity] .shelf-metrics { background:var(--card-shadow); color:var(--card-copy,#fff1d1); }
.shelf-card[data-gear-inspect] { cursor:pointer; }
.shelf-card [data-gear-open]:focus-visible { outline:2px solid #986533; outline-offset:1px; }
.gear-detail-dialog { width:min(390px,calc(100vw - 24px)); }
.gear-detail-dialog .shelf-card { padding:10px; gap:7px; grid-template-rows:none; }
.gear-detail-dialog .catch-heading h4 { flex:1 1 auto; font-size:18px; }
.gear-detail-dialog .shelf-actions { font-size:13px; }
.shelf-art {
  /* 九幅商品画共用一张贴图，每格的比例和插画窗口一致。 */
  background:var(--tackle-atlas) var(--art-x,0%) var(--art-y,0%) / 300% 300% no-repeat #e5cf9d;
}
.shelf-art:is([data-tackle="reel"],[data-tackle="keepnet"],[data-tackle="protection_card"]) { --art-x:50%; }
.shelf-art:is([data-tackle="line"],[data-tackle="fish_hook"],[data-tackle="bait"],[data-tackle="capacity"]) { --art-x:100%; }
.shelf-art:is([data-tackle="landing_net"],[data-tackle="keepnet"],[data-tackle="bait"]) { --art-y:50%; }
.shelf-art:is([data-tackle="drag_clip"],[data-tackle="protection_card"],[data-tackle="capacity"]) { --art-y:100%; }
.shelf-actions,.fish-detail-actions { display:flex; flex-wrap:wrap; gap:4px; }
.shelf-actions .small-button,.fish-detail-actions .small-button {
  flex:1 0 auto;
  min-height:34px;
  padding:3px 5px;
  border:1px solid #a89061;
  border-radius:4px;
  background:linear-gradient(#f9ecc8,#dbc293);
  color:#382e20;
  font-size:11px;
  font-weight:700;
}
.shelf-actions .small-button:hover:enabled,.fish-detail-actions .small-button:hover:enabled { background:#fff0c4; }
.fish-detail-actions .small-button[aria-pressed="true"] { background:#554733; color:#fff1cc; }
.shelf-actions .small-button.danger { color:#712e22; }
.illustrated-catch.fish-detail-card {
  aspect-ratio:auto;
  grid-template-rows:none;
}
.fish-detail-dialog { max-height:calc(100dvh - 24px); }
.fish-detail-heading-actions { display:flex; gap:6px; align-items:center; }
.fish-detail-card .catch-footer { font-size:11px; }
.card-page :is(.ledger-list,.extra-entry,.order-panel,.gear-materials) {
  border:1px solid #ae976d;
  border-radius:5px;
  background:#f8ecd1;
}
.card-page .gear-materials { padding:6px 8px; color:#54462b; }
.card-page .ledger-row { border-color:#e4d2a8; color:#594932; }

/* 鱼护和商店的交易确认采用带描边的纸质票面。 */
body:has(.app:is([data-view="net"],[data-view="shop"])) #confirm-dialog {
  border:2px solid #413627;
  border-radius:9px;
  background:#f6e9c9;
  color:#40331f;
  box-shadow:inset 0 0 0 3px #ccb287,inset 0 0 0 4px #675236,0 12px 35px #151e17a0;
}
body:has(.app:is([data-view="net"],[data-view="shop"])) #confirm-dialog :is(.sheet-heading button,.outline-button) {
  border:1px solid #9e835d;
  background:#eadaad;
  color:#41361f;
}
body:has(.app:is([data-view="net"],[data-view="shop"])) #confirm-content p { color:#59472e; }

/* 卡册在窄屏占用两整列，功能入口移到下沿。 */
@media (max-width:760px) {
  .app[data-view]:not([data-view="play"]) .page.card-page:not(#page-play) {
    inset:calc(122px + var(--safe-top)) 0 calc(60px + var(--safe-bottom));
    padding-inline:max(12px,env(safe-area-inset-left,0px)) max(12px,env(safe-area-inset-right,0px));
    scrollbar-gutter:auto;
  }
  .app:not([data-view="play"]) .scene-tools {
    inset:auto 0 0;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:4px;
    padding:5px 8px calc(5px + var(--safe-bottom));
    border-top:1px solid #a58a5f;
    background:#e7d4ab;
  }
  .app:not([data-view="play"]) .scene-tool-bank { display:contents; }
  .app:not([data-view="play"]) .scene-icon { min-width:0; min-height:44px; background:#f4e5c3; }
  .app:not([data-view="play"]) .scene-icon.selected { background:#3c503d; color:#fff1d0; }
  .app:not([data-view="play"]) .toast { top:calc(9px + var(--safe-top)); }
}
@media (prefers-reduced-motion:reduce) {
  .album-card { transition:none; }
  .album-card:hover { transform:none; }
}
