/* 传世账房：官方卷轴横轴与物品素材，配原创九宫格铜石护框。 */
@media screen {
  :root {
    --legend-frame: url("assets/legend-window-frame.svg");
    --legend-command: url("assets/legend-command-frame.svg");
    --legend-item: url("assets/legend-gold-scroll.png");
    --legend-stone: #211f1a;
    --legend-seam: #78603e;
  }

  /* Fixed corner geometry; only the straight metal rails stretch. */
  .panel, .entry-panel, .wallet-panel, .settings-card,
  .funds-summary > .merchant-funds, .funds-secondary, .overview-ledger-totals,
  .wallet-breakdown-grid {
    position: relative;
    border: 1px solid transparent;
    border-radius: 0;
    border-image: var(--legend-frame) 48 / 24px / 0 stretch;
    background-color: var(--legend-stone);
    background-image: linear-gradient(115deg, #34302738, transparent 42%, #080d0a24);
    box-shadow: inset 0 0 0 6px #0e120e, inset 0 0 0 7px #7460444d;
  }
  .panel, .entry-panel, .wallet-panel, .settings-card { padding: 26px; }
  .panel.table-panel { padding: 0; }
  .panel::after, .wallet-panel::after, .settings-card::after {
    content: "";
    position: absolute;
    z-index: 3;
    inset: -1px;
    border: 1px solid transparent;
    border-image: var(--legend-frame) 48 / 24px / 0 stretch;
    pointer-events: none;
  }
  .panel::before, .wallet-panel::before {
    content: "";
    position: absolute;
    z-index: 2;
    inset: auto 8px 2px;
    height: 17px;
    border: solid transparent;
    border-width: 0 18px;
    border-image: url("assets/legend-scroll-bottom.png") 0 24 fill / 0 18px / 0 stretch;
    opacity: .7;
    pointer-events: none;
  }
  .funds-summary > .merchant-funds {
    padding: 34px 30px 32px;
    background-color: #20271f;
    background-image: linear-gradient(125deg, #3a3a2645, transparent 60%, #14190e66);
  }
  .funds-summary > .merchant-funds::before,
  .funds-secondary::before,
  .overview-ledger-totals::before {
    content: "";
    position: absolute;
    inset: 2px 8px auto;
    height: 20px;
    z-index: 2;
    pointer-events: none;
    border: solid transparent;
    border-width: 0 18px;
    border-image: url("assets/legend-scroll-top.png") 0 24 fill / 0 18px / 0 stretch;
    opacity: .85;
  }
  .funds-summary > .merchant-funds::after,
  .funds-secondary::after,
  .overview-ledger-totals::after {
    content: "";
    position: absolute;
    inset: auto 8px 2px;
    width: auto;
    height: 17px;
    z-index: 2;
    pointer-events: none;
    border: solid transparent;
    border-width: 0 18px;
    border-image: url("assets/legend-scroll-bottom.png") 0 24 fill / 0 18px / 0 stretch;
    opacity: .7;
  }

  /* Title plaques and item sockets come from one piece of window furniture. */
  .funds-heading > h2,
  .panel > .section-heading h2,
  .wallet-panel > .section-heading h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    padding: 4px 15px 4px 6px;
    border: 1px solid transparent;
    border-image: var(--legend-command) 24 / 8px / 0 stretch;
    background: linear-gradient(#572c22, #301c16);
    color: #f1dcae;
    font-family: var(--guild-serif);
    font-weight: 700;
    letter-spacing: .07em;
    line-height: 1.5;
  }
  .funds-heading > h2::before,
  .panel > .section-heading h2::before,
  .wallet-panel > .section-heading h2::before {
    content: "";
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid #806b46;
    background: var(--legend-item) center / 30px 30px no-repeat, #0d110d;
    box-shadow: inset 0 1px 5px #000c, 0 1px #a58c5040;
  }
  .funds-heading > h2 > svg,
  .panel > .section-heading h2 > svg { display: none; }
  .merchant-funds .funds-heading > h2 { --legend-item: url("assets/legend-coin.svg"); font-size: 18px; }
  .funds-secondary > .own-funds { padding: 31px 26px 17px; --legend-item: url("assets/legend-jade-stone.png"); }
  .funds-secondary > .own-funds .funds-heading { align-items: center; gap: 10px; }
  .funds-secondary > .own-funds .funds-heading > h2 { font-size: 16px; }
  .funds-secondary > .personal-flow-summary {
    border-top: 1px solid var(--legend-seam);
    background: #161a1455;
  }
  .personal-flow-summary > .funds-group { padding: 17px 24px 29px; }
  .personal-flow-summary > .funds-group + .funds-group { border-left-color: #756040; }
  .personal-flow-summary .funds-heading > h2 {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
    letter-spacing: .015em;
    gap: 7px;
  }
  .personal-flow-summary .funds-heading > h2::before { flex-basis: 24px; width: 24px; height: 24px; background-size: 23px; }
  .personal-income .funds-heading > h2 { --legend-item: url("assets/legend-coin.svg"); }
  .personal-spending .funds-heading > h2 { --legend-item: url("assets/legend-gold-scroll.png"); }
  .personal-flow-summary .funds-value { margin-top: 11px; }
  .merchant-funds .overview-trade-summary { border-top-color: #89704c; box-shadow: 0 -1px #0a100a; }
  .merchant-funds .funds-wallets { border-left-color: #89704c; }
  .funds-split-details > summary, .funds-source-details > summary { color: #c6bea3; }
  .overview-ledger-totals > .wallet-cash-module,
  .ledger-combined > div { padding-top: 27px; padding-bottom: 25px; }
  .overview-ledger-totals > div + div,
  .ledger-combined > div + div { border-left-color: #756040; box-shadow: -1px 0 #10120d; }
  .overview-ledger-totals .overview-stat-heading > span { color: #c9bea0; }
  .overview-ledger-totals .overview-stat-heading svg { color: #b69b63; }

  /* The record windows are unrolled ledgers, rather than flat header strips. */
  #view-overview .panel { padding: 26px; }
  #view-overview .entry-panel,
  #view-overview .simple-recent-panel { background-color: #24231c; }
  .panel > .section-heading:first-child,
  .wallet-panel > .section-heading:first-child,
  #view-overview .entry-panel > .section-heading,
  .simple-recent-panel > .recent-heading {
    position: relative;
    margin: -26px -26px 24px;
    padding: 29px 25px 17px;
    border-bottom: 1px solid #8d7046;
    background: linear-gradient(180deg, #383027, #29251e);
    box-shadow: 0 1px #10130e;
  }
  .panel > .section-heading:first-child::before,
  .wallet-panel > .section-heading:first-child::before {
    content: "";
    position: absolute;
    inset: 2px 7px auto;
    height: 21px;
    border: solid transparent;
    border-width: 0 18px;
    border-image: url("assets/legend-scroll-top.png") 0 24 fill / 0 18px / 0 stretch;
    pointer-events: none;
  }
  .panel.table-panel > .section-heading { margin: 0; padding: 29px 25px 17px; }
  #view-overview .entry-panel > .section-heading h2,
  .recent-heading > h2 { font-size: 19px; }
  .recent-heading .subtle { color: #c5bca3; letter-spacing: 0; }
  .simple-recent-panel > .recent-heading,
  .simple-recent-panel > .recent-heading.multi-wallets { margin-bottom: 0; gap: 17px 12px; }
  .field input:not([type="checkbox"]):not([type="radio"]),
  .field select, .field textarea, .entry-day input {
    border-color: transparent;
    border-image: var(--legend-command) 24 / 6px / 0 stretch;
    background-color: #10140f;
    color: #ebe7d5;
    padding-inline: 12px;
    box-shadow: inset 0 2px 7px #000b;
  }
  #view-overview .simple-entry-fields #tx-amount { border-color: transparent; background: #171b11; }
  .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-color: #d9b870; }
  .field input[readonly]:not([type="checkbox"]):not([type="radio"]) { background: #2b2a21; color: #b9b49e; }
  .field input[aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]), .field select[aria-invalid="true"], .field textarea[aria-invalid="true"],
  #view-overview .simple-entry-fields #tx-amount[aria-invalid="true"] {
    border-image: none;
    border-color: #de9978;
    background: #34231b;
  }
  .simple-work-grid .more-fields,
  #view-overview .simple-work-grid .form-footer,
  .recent-pagination { border-top-color: #766443; }
  .simple-work-grid .form-footer { padding-bottom: 6px; }
  .simple-recent-list > .empty-state { min-height: 256px; }
  .simple-recent-list > .empty-state > svg { display: none; }
  .simple-recent-list > .empty-state::before {
    content: "";
    width: 52px;
    height: 52px;
    border: 1px solid #7f6941;
    background: url("assets/legend-gold-scroll.png") center / 42px no-repeat, #12150f;
    box-shadow: inset 0 2px 7px #000c, 0 1px #aa8c4b55;
  }
  .simple-recent-list > .empty-state > h3 { margin-top: 15px; color: #d8c89f; }
  .simple-recent-list > .empty-state > p { color: #bdb79f; }
  .recent-pagination { padding-bottom: 5px; }

  /* Copper-edged command plates and inventory-style selection tabs. */
  .button.primary, .button.secondary, .button.text.recent-sort,
  .recent-wallet-filter > button[aria-pressed="true"] {
    border: 1px solid transparent;
    border-image: var(--legend-command) 24 / 8px / 0 stretch;
    border-radius: 0;
    background-clip: padding-box;
    box-shadow: inset 0 1px #dcc48a3b, inset 0 -2px #080c08;
  }
  .button.primary { background-image: linear-gradient(#9c4b32, #6d3024 48%, #492118); color: #ffedbf; }
  .button.primary:hover:not(:disabled) { background-image: linear-gradient(#ad5e3b, #87422b 48%, #5b2a1d); }
  .button.secondary, .button.text.recent-sort { background: linear-gradient(#46402c, #29281d); color: #e4d3a6; }
  .button.secondary:hover:not(:disabled), .button.text.recent-sort:hover { background: linear-gradient(#5c4d31, #343022); }
  .recent-heading > .recent-wallet-filter,
  .recent-heading.multi-wallets > .recent-wallet-filter { border-color: #806943; background: #12180f; box-shadow: inset 0 2px 5px #0009; }
  .recent-wallet-filter > button { color: #c1bba1; }
  .recent-wallet-filter > button[aria-pressed="true"] { color: #ffe3a9; background: linear-gradient(#6e3527, #3f231a); }
  .recent-wallet-filter > button:hover { background-color: #3c3524; }
  .button:active:not(:disabled) { box-shadow: inset 0 2px 6px #070a07aa; }
}

@media screen and (max-width: 1250px) {
  .funds-summary > .merchant-funds { padding: 34px 28px 32px; }
  .funds-secondary > .own-funds { padding: 30px 24px 25px; }
  .funds-secondary > .personal-flow-summary { border-left-color: #756040; }
  .personal-flow-summary > .funds-group { padding: 29px 22px 26px; }
}
@media screen and (max-width: 1050px) {
  .funds-secondary > .personal-flow-summary { border-left: 0; }
  .funds-secondary > .own-funds { padding-bottom: 17px; }
  .personal-flow-summary > .funds-group { padding-top: 18px; }
}
@media screen and (max-width: 720px) {
  .panel, .entry-panel, .wallet-panel, .settings-card,
  .funds-summary > .merchant-funds, .funds-secondary, .overview-ledger-totals { border-image-width: 20px; }
  .panel::after, .wallet-panel::after, .settings-card::after { border-image-width: 20px; }
  .funds-summary > .merchant-funds { padding: 31px 22px 28px; }
  .funds-secondary > .own-funds { padding: 30px 22px 18px; }
  .personal-flow-summary > .funds-group { padding: 17px 18px 27px; }
  .funds-heading > h2 { gap: 8px; }
  .personal-flow-summary .funds-heading > h2 { gap: 5px; }
  .personal-flow-summary .funds-heading > h2::before { flex-basis: 20px; width: 20px; height: 20px; background-size: 20px; }
  .overview-ledger-totals > .wallet-cash-module, .ledger-combined > div { padding-top: 25px; padding-bottom: 23px; }
  #view-overview .panel { padding: 24px 20px; }
  #view-overview .entry-panel > .section-heading,
  .simple-recent-panel > .recent-heading { margin: -24px -20px 22px; padding: 28px 19px 16px; }
  .simple-recent-panel > .recent-heading,
  .simple-recent-panel > .recent-heading.multi-wallets { margin-bottom: 0; gap: 12px 6px; }
  #view-overview .entry-panel > .section-heading h2,
  .recent-heading > h2 { font-size: 17px; letter-spacing: .035em; }
  .panel > .section-heading h2::before { width: 28px; height: 28px; flex-basis: 28px; background-size: 27px; }
  .entry-day { flex-wrap: wrap; }
  .entry-day input { width: 140px; }
  .simple-work-grid .form-footer { padding-bottom: 4px; }
}
@media screen and (max-width: 374px) {
  .personal-flow-summary > .funds-group + .funds-group { border-top-color: #756040; }
  .entry-day { margin-left: 0; width: 100%; justify-content: space-between; }
}
