/* 账户、作者收益与财务：减少层级，保持正文可读。 */
.commerce-page { padding-top: 0; padding-bottom: 0; }
.commerce-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 12px; }
.commerce-heading h1 { font-size: 1.18rem; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
.commerce-heading a { font-size: .9rem; }
.commerce-card { border: 1px solid var(--border); background: var(--bg-card); border-radius: 8px; padding: 16px; margin: 0 0 16px; min-width: 0; }
.commerce-card h1 { margin: 0 0 16px; font-size: 1.18rem; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.commerce-card h2 { font-size: 1rem; margin-bottom: 12px; }
.commerce-amount { display: block; font-size: 2.15rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.4; font-variant-numeric: tabular-nums; }
.wallet-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 2px 0 20px; text-align: left; border-bottom: 1px solid var(--border); }
.wallet-balance { min-width: 0; }
.wallet-balance-label { display: block; color: var(--text-muted); font-size: .85rem; line-height: 1.5; }
.wallet-summary .commerce-amount { font-size: 26px; font-weight: 700; line-height: 1.3; letter-spacing: -.025em; margin: 4px 0 0; overflow-wrap: anywhere; }
.wallet-actions { display: flex; align-items: center; align-self: end; gap: 8px; flex-shrink: 0; margin-bottom: 1px; }
.wallet-actions .btn { height: 32px; min-height: 0; min-width: 58px; padding: 0 12px; font-size: .84rem; font-weight: 600; }
.wallet-pending { grid-column: 1 / -1; display: block; margin: 0; font-size: .85rem; color: var(--text-muted); }
.wallet-menu { margin: 4px 0 0; }
.wallet-menu-item { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.wallet-menu-item:last-child { border-bottom: 0; }
.wallet-menu-item:hover { color: var(--primary); text-decoration: none; }
.wallet-menu-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.wallet-menu-icon { flex-shrink: 0; color: var(--text-muted); }
.wallet-menu-label { flex: 1; font-size: .91rem; font-weight: 550; line-height: 1.5; }
.wallet-menu-arrow { flex-shrink: 0; color: var(--text-muted); opacity: .75; }
.access-level-error { margin: 0; color: var(--accent); font-size: .82rem; line-height: 1.6; }
.commerce-help { margin: 16px 0 0; color: var(--text-muted); font-size: .92rem; line-height: 1.75; }
.commerce-help > summary { cursor: pointer; width: fit-content; }
.commerce-help > p:first-of-type { margin-top: 12px; }
.commerce-help p:last-child { margin-bottom: 0; }
.commerce-hint { color: var(--text-muted); font-size: .94rem; line-height: 1.7; margin: 12px 0 18px; }
.commerce-notice { padding: 12px 14px; background: var(--bg-alt); border-radius: 8px; color: var(--text-muted); font-size: .94rem; margin: 14px 0; line-height: 1.7; }
.commerce-notice strong { color: var(--text); }
.commerce-form { display: flex; flex-direction: column; gap: 12px; }
.commerce-form label, .commerce-channels legend { font-size: .94rem; font-weight: 550; }
.commerce-form label:not(:first-child) { margin-top: 2px; }
.commerce-form input:not([type="checkbox"]):not([type="radio"]), .commerce-form select { width: 100%; min-height: 44px; font-size: 1rem; }
.commerce-form .btn { min-height: 42px; }
.commerce-form .commerce-checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; white-space: nowrap; }
.commerce-form .commerce-hint, .commerce-form .commerce-help { margin: 0; }
.commerce-form .commerce-record-top h2 { margin: 0; }
.commerce-money-input { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 3px 12px; min-width: 0; }
.commerce-money-input > span { color: var(--text-muted); white-space: nowrap; }
.commerce-money-input input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; font-variant-numeric: tabular-nums; }
.commerce-disclosure > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.commerce-disclosure > summary::-webkit-details-marker { display: none; }
.commerce-disclosure > summary::after { content: '+'; color: var(--text-muted); font-size: 1.2rem; }
.commerce-disclosure[open] > summary::after { content: '−'; }
.commerce-disclosure[open] > .commerce-form { margin-top: 20px; }
.commerce-record { padding: 16px 0; border-bottom: 1px solid var(--border); }
.commerce-record:first-child { padding-top: 0; }
.commerce-record:last-child { padding-bottom: 0; border-bottom: 0; }
.commerce-record-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.commerce-record-top > * { min-width: 0; }
.commerce-record-top h2 { margin: 0; }
.commerce-record-top strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.commerce-author-name { font-size: 1rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.commerce-record-meta { color: var(--text-muted); font-size: .91rem; margin: 6px 0 0; display: block; }
.commerce-record-top.commerce-record-meta { display: flex; }
.commerce-record-details { color: var(--text-muted); font-size: .91rem; margin-top: 8px; }
.commerce-record-details > summary { cursor: pointer; width: fit-content; }
.commerce-record-details .commerce-details { margin: 12px 0; }
.bill-events { padding-top: 4px; margin-bottom: 10px; }
.bill-event { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 5px 0; }
.bill-event span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.commerce-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 18px 0; font-size: .94rem; }
.commerce-details dt { color: var(--text-muted); }
.commerce-details dd { margin: 0; overflow-wrap: anywhere; }
.commerce-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .91rem; overflow-wrap: anywhere; }
.wallet-demo-label { color: var(--text-muted); font-size: .78rem; font-weight: 400; white-space: nowrap; }
.commerce-positive { color: #168565; }
[data-theme="dark"] .commerce-positive { color: #67d4ac; }
.commerce-status { display: inline-flex; padding: 3px 9px; border-radius: 99px; font-size: .88rem; color: var(--text-muted); background: var(--bg-alt); white-space: nowrap; }
.commerce-status.is-paid { color: #117253; background: #e5f6ee; }
[data-theme="dark"] .commerce-status.is-paid { color: #80ddba; background: #153d30; }
.commerce-empty { text-align: center; padding: 32px 16px; }
.commerce-empty h2 { margin-bottom: 20px; }
.commerce-empty-line { color: var(--text-muted); text-align: center; padding: 18px 0; margin: 0; }
.commerce-author-checkout .commerce-price { margin: 10px 0 14px; }
.commerce-checkout-actions { display: grid; gap: 8px; }
.commerce-checkout-actions.has-payment { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.commerce-checkout-actions > form { display: grid; min-width: 0; margin: 0; }
.commerce-checkout-actions .btn { min-height: 42px; min-width: 0; text-align: center; white-space: normal; }
.commerce-checkout-hint { margin: 8px 0 0; font-size: .84rem; }
.commerce-price { font-size: 1.65rem; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.4; }
.commerce-price > span { font-size: 1rem; font-weight: 400; color: var(--text-muted); letter-spacing: 0; margin-left: 6px; }
.commerce-recharge-price { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.commerce-recharge-price > strong { font-weight: inherit; }
.commerce-recharge-price > span { margin-left: 0; }
.commerce-checkout-balance { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; color: var(--text-muted); }
.commerce-channels { min-width: 0; padding: 8px 0 0; border: 0; margin: 0; display: grid; gap: 10px; }
.commerce-channels legend { padding: 0; }
.commerce-payment-line-name { display: block; color: var(--text-muted); font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
.commerce-payment-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.commerce-payment-methods label.commerce-channel { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.commerce-channel input { margin: 0; accent-color: var(--primary); }
.commerce-channel:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.commerce-channel:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.commerce-form button:disabled { opacity: .55; cursor: not-allowed; }
.author-tip-btn { color: #fff; background: #dc2626; border-color: #dc2626; }
.author-tip-btn:hover { color: #fff; background: #b91c1c; border-color: #b91c1c; filter: none; }
.author-tip-btn svg { flex-shrink: 0; }
.author-tip-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.profile-tip-period { margin: 0; color: var(--text-muted); font-size: .8rem; }
.profile-tip-period + .profile-empty { margin-top: 12px; }
.profile-tip-ranking > .profile-tip-row:first-child { padding-top: 12px; }
.profile-tip-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); font-size: .88rem; font-weight: 600; }
.profile-tip-user .avatar { width: 38px; height: 38px; flex-shrink: 0; }
.profile-tip-user > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-tip-amount { flex-shrink: 0; font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 间距以可见内容计：标签自带上下留白，不再叠加资料区底边距。
   本人的设置行已有内部垂直留白，外侧相应收减，保持与双入口同样的视觉节奏。 */
.profile-header:has(> .profile-support) { padding-bottom: 0; }
.profile-support { margin: 20px 0 10px; }
.profile-support.is-owner { margin: 10px 0 0; }
.profile-support-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); overflow: hidden; }
.profile-support-choice { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 64px; padding: 10px 8px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; transition: background .15s ease; }
.profile-support-choice + .profile-support-choice { border-left: 1px solid var(--border); }
.profile-support-choice:not(:disabled):hover { background: var(--bg-alt); color: var(--text); text-decoration: none; }
.profile-support-manage:hover, .profile-support-manage:active { color: var(--primary); text-decoration: none; }
.profile-support-choice.is-disabled { color: var(--text-muted); background: var(--bg-alt); cursor: not-allowed; }
.profile-support-choice.is-disabled .profile-support-icon { color: inherit; }
.profile-support-choice:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.profile-support-manage:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.profile-support-icon { flex-shrink: 0; color: var(--primary); }
.profile-support-choice.is-tip .profile-support-icon { color: #dc2626; }
.profile-support-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.profile-support-copy strong, .profile-support-manage-copy strong { font-size: .88rem; font-weight: 600; line-height: 1.4; }
.profile-support-meta { color: var(--text-muted); font-size: .76rem; line-height: 1.4; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-support-manage { display: flex; align-items: center; gap: 10px; min-height: 42px; color: var(--text); background: transparent; box-shadow: none; border-radius: 4px; text-decoration: none; }
.profile-support-manage-copy { display: flex; flex: 1; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.profile-support-chevron { flex-shrink: 0; color: var(--text-muted); }
.novel-preview-body { position: relative; padding-bottom: 8px; }
.app-wrap .novel-preview-body { border-bottom-width: 0; }
.novel-preview-body::after { content: ''; position: absolute; pointer-events: none; inset: auto 0 0; height: 100px; max-height: 100%; background: linear-gradient(to bottom, transparent, var(--bg-card)); }
.subscription-gate { margin: 0 -12px; padding: 16px 12px 20px; background: var(--bg-card); text-align: center; }
.subscription-gate h2 { margin: 0 0 14px; font-size: .94rem; line-height: 1.5; font-weight: 500; color: var(--text-muted); }
.subscription-gate > .btn { min-height: 40px; padding: 8px 18px; gap: 12px; }
.subscription-button-price { font-size: .82rem; font-weight: 500; white-space: nowrap; }
.subscription-gate > .commerce-help { margin-top: 14px; font-size: .8rem; line-height: 1.6; text-align: left; }
.subscription-gate > .commerce-help > summary { margin-inline: auto; }
.subscription-gate > .commerce-help[open] { text-align: left; }
.subscription-gate > button:disabled { color: var(--text-muted); cursor: not-allowed; }
@media (max-width: 380px) {
  .commerce-card { padding: 16px 12px; }
  .commerce-money-input { padding-left: 9px; padding-right: 9px; gap: 6px; }
}
