/* S20 · 私人记录创建／编辑：保存后才可进入 S21，公开快照与私人原文独立。 */
.record-editor-page { min-height: calc(100svh - 76px); padding-block: var(--space-7) var(--space-10); }
.record-editor-heading { max-width: 960px; }
.record-editor-heading h1 { margin-top: var(--space-2); color: var(--forest); font-size: clamp(31px, 3.25vw, 42px); }
.record-editor-heading > p:not(.eyebrow) { max-width: 870px; margin-top: var(--space-4); color: var(--ink-soft); font-size: 15px; line-height: 1.72; }
.record-editor-mobile-header, .record-editor-mobile-save-bar { display: none; }
.record-editor-status { min-height: 22px; margin-top: var(--space-4); color: var(--moss-strong); font-size: 11px; font-weight: 750; line-height: 1.55; }
.record-editor-workbench { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); align-items: start; gap: clamp(18px, 3vw, 34px); margin-top: var(--space-4); padding: clamp(18px, 2.8vw, 30px); border-radius: var(--radius-md); background: var(--glass-c-bg); border-top: 1px solid var(--glass-c-border-top); border-left: 1px solid var(--glass-c-border-left); border-right: 1px solid var(--glass-c-border-right); border-bottom: 1px solid var(--glass-c-border-bottom); box-shadow: var(--glass-c-shadow), var(--glass-c-highlight); backdrop-filter: var(--glass-c-blur); -webkit-backdrop-filter: var(--glass-c-blur); }
.record-editor-form-panel, .record-editor-summary { min-width: 0; display: grid; gap: 14px; }
.record-editor-form-panel > header, .record-editor-summary > header { display: grid; gap: 5px; }
.record-editor-form-panel > header .eyebrow, .record-editor-summary > header .eyebrow { margin-bottom: 0; }
.record-editor-form-panel h2, .record-editor-summary h2 { color: var(--forest); font-size: clamp(23px, 2.4vw, 31px); }
.record-editor-form-panel > header > p:not(.eyebrow), .record-editor-summary > header > p:not(.eyebrow) { color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.record-editor-private-note { display: grid; gap: 4px; padding: 14px 15px; color: #824419; background: rgba(252, 243, 235, .84); border: 1px solid rgba(188, 111, 60, .38); border-radius: var(--radius-xs); }
.record-editor-private-note .eyebrow { margin-bottom: 0; color: #824419; font-size: 10px; }
.record-editor-private-note strong { color: #824419; font-size: 14px; line-height: 1.45; }
.record-editor-private-note span { color: #824419; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.record-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.record-editor-field { min-width: 0; display: grid; gap: 5px; }
.record-editor-field--log { grid-column: 1 / -1; }
.record-editor-field label { color: var(--forest); font-size: 11px; font-weight: 800; line-height: 1.45; }
.record-editor-field label b { color: #824419; }
.record-editor-field label span { color: var(--ink-faint); font-weight: 650; }
.record-editor-field input, .record-editor-field textarea, .record-editor-field select { width: 100%; min-width: 0; color: var(--ink); background: rgba(255, 255, 255, .88); border: 1px solid rgba(39, 103, 63, .30); border-radius: 12px; outline: none; box-shadow: inset 0 1px 2px rgba(16, 46, 26, .04); transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.record-editor-field input, .record-editor-field select { min-height: 50px; padding: 11px 14px; }
.record-editor-field textarea { min-height: 94px; padding: 11px 14px; resize: vertical; line-height: 1.6; }
.record-editor-field input:focus, .record-editor-field textarea:focus, .record-editor-field select:focus { background: rgba(255, 255, 255, .98); border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(34, 154, 71, .16); }
.record-editor-field input[aria-invalid="true"], .record-editor-field textarea[aria-invalid="true"] { color: #824419; background: rgba(255, 250, 246, .92); border-color: rgba(188, 111, 60, .78); box-shadow: 0 0 0 3px rgba(188, 111, 60, .1); }
.record-editor-field-hint, .record-editor-field-error { font-size: 10px; line-height: 1.52; overflow-wrap: anywhere; }
.record-editor-field-hint { color: var(--ink-faint); }
.record-editor-field-error { color: #824419; font-weight: 800; }
.record-editor-weight-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.record-editor-unmeasured { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--ink-soft); background: rgba(248, 252, 245, .86); border: 1px solid rgba(39, 103, 63, .24); border-radius: 12px; font-size: 10px !important; font-weight: 750 !important; white-space: nowrap; }
.record-editor-unmeasured input { width: 17px; min-width: 17px; height: 17px; min-height: 17px; padding: 0; accent-color: var(--brand-primary); }
.record-editor-cover-picker { display: grid; gap: 10px; padding: 14px; background: rgba(248, 252, 245, .86); border: 1px solid rgba(39, 103, 63, .24); border-radius: var(--radius-sm); }
.record-editor-cover-picker header { display: grid; gap: 4px; }
.record-editor-cover-picker .eyebrow { margin-bottom: 0; font-size: 10px; }
.record-editor-cover-picker h3 { color: var(--forest); font-size: 15px; line-height: 1.38; }
.record-editor-cover-picker p:not(.eyebrow) { color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.record-editor-cover-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.record-editor-cover-options button { min-width: 0; min-height: 116px; display: grid; grid-template-rows: 82px auto; overflow: hidden; padding: 0; color: var(--forest); background: rgba(255, 255, 255, .88); border: 1px solid rgba(39, 103, 63, .24); border-radius: 11px; text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.record-editor-cover-options button:hover { transform: translateY(-1px); border-color: var(--moss-strong); }
.record-editor-cover-options button[aria-pressed="true"] { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(34, 154, 71, .16); }
.record-editor-cover-options img { width: 100%; height: 82px; object-fit: cover; }
.record-editor-cover-options span { display: block; padding: 7px 8px; overflow: hidden; color: var(--forest); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.record-editor-save-note, .record-editor-saving, .record-editor-save-error, .record-editor-confirmed { display: grid; gap: 5px; padding: 14px 15px; border-radius: var(--radius-xs); }
.record-editor-save-note { color: var(--forest); background: rgba(232, 244, 226, .68); border: 1px solid rgba(39, 103, 63, .24); }
.record-editor-saving, .record-editor-confirmed { color: var(--forest); background: rgba(232, 244, 226, .82); border: 1px solid rgba(39, 103, 63, .32); }
.record-editor-save-error { color: #824419; background: rgba(252, 243, 235, .86); border: 1px solid rgba(188, 111, 60, .42); }
.record-editor-save-note strong, .record-editor-saving strong, .record-editor-save-error strong, .record-editor-confirmed strong { font-size: 12px; }
.record-editor-save-note span, .record-editor-saving span, .record-editor-save-error span, .record-editor-confirmed span { font-size: 10px; line-height: 1.55; }
.record-editor-save-error .button, .record-editor-confirmed .button { justify-self: start; margin-top: 3px; }
.record-editor-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 2px; }
.record-editor-actions .button { flex: 1 1 150px; min-height: 48px; }
.record-editor-private-card { display: grid; grid-template-columns: minmax(118px, .72fr) minmax(0, 1.28fr); gap: 14px; padding: 14px; background: rgba(255, 255, 255, .88); border: 1px solid rgba(39, 103, 63, .24); border-radius: var(--radius-sm); }
.record-editor-private-card figure { position: relative; min-height: 158px; overflow: hidden; margin: 0; border-radius: 13px; background: var(--soft-moss); }
.record-editor-private-card figure img { width: 100%; height: 100%; object-fit: cover; }
.record-editor-private-card figcaption { position: absolute; top: 8px; left: 8px; padding: 4px 7px; color: #824419; background: rgba(255, 250, 246, .92); border: 1px solid rgba(188, 111, 60, .33); border-radius: 999px; font-size: 9px; font-weight: 800; }
.record-editor-private-card > div { min-width: 0; display: grid; align-content: start; gap: 8px; }
.record-editor-private-card > div > p:first-child { color: #824419; font-size: 10px; font-weight: 800; }
.record-editor-private-card h3 { color: var(--forest); font-size: 19px; line-height: 1.35; }
.record-editor-private-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; margin: 0; }
.record-editor-private-card dt { color: var(--ink-faint); font-size: 10px; }
.record-editor-private-card dd { min-width: 0; margin: 0; color: var(--ink); font-size: 11px; font-weight: 750; line-height: 1.45; overflow-wrap: anywhere; }
.record-editor-private-card__log { padding-top: 8px; color: var(--ink-soft); border-top: 1px solid rgba(39, 103, 63, .16); font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.record-editor-share-gate, .record-editor-snapshot, .record-editor-delete-boundary { display: grid; gap: 6px; padding: 14px 15px; border: 1px solid rgba(39, 103, 63, .24); border-radius: var(--radius-xs); background: rgba(248, 252, 245, .86); }
.record-editor-share-gate .eyebrow, .record-editor-snapshot .eyebrow, .record-editor-delete-boundary .eyebrow { margin-bottom: 0; font-size: 10px; }
.record-editor-share-gate h3, .record-editor-snapshot h3, .record-editor-delete-boundary h3 { color: var(--forest); font-size: 15px; line-height: 1.4; }
.record-editor-share-gate p:not(.eyebrow), .record-editor-snapshot p:not(.eyebrow), .record-editor-delete-boundary p:not(.eyebrow) { color: var(--ink-soft); font-size: 10px; line-height: 1.58; }
.record-editor-share-gate .button, .record-editor-snapshot .button, .record-editor-delete-boundary .button { width: 100%; margin-top: 3px; }
.record-editor-share-gate .button[disabled] { color: rgba(47, 49, 46, .46); background: rgba(229, 236, 229, .76); border-color: transparent; cursor: not-allowed; }
.record-editor-flow-note { display: grid; gap: 4px; padding: 12px 14px; color: var(--forest); background: rgba(232, 244, 226, .68); border: 1px solid rgba(39, 103, 63, .24); border-radius: var(--radius-xs); }
.record-editor-flow-note .eyebrow { margin-bottom: 0; font-size: 10px; }
.record-editor-flow-note p:not(.eyebrow) { color: var(--ink-soft); font-size: 10px; line-height: 1.58; }
.record-editor-snapshot { background: rgba(232, 244, 226, .74); }
.record-editor-delete-boundary { color: #824419; background: rgba(252, 243, 235, .84); border-color: rgba(188, 111, 60, .38); }
.record-editor-delete-boundary .eyebrow, .record-editor-delete-boundary h3 { color: #824419; }
.record-editor-delete-boundary .button { color: #824419; border-color: rgba(188, 111, 60, .5); }
.record-editor-delete-confirm, .record-editor-delete-failure { display: grid; gap: 8px; padding: 14px 15px; color: #824419; background: rgba(255, 250, 246, .94); border: 1px solid rgba(188, 111, 60, .5); border-radius: var(--radius-xs); }
.record-editor-delete-confirm strong, .record-editor-delete-failure strong { font-size: 13px; }
.record-editor-delete-confirm span, .record-editor-delete-failure span { font-size: 10px; line-height: 1.58; }
.record-editor-delete-confirm > div { display: flex; flex-wrap: wrap; gap: 8px; }
.record-editor-delete-confirm .button { flex: 1 1 130px; }
.record-editor-f20 { display: grid; gap: 15px; margin-top: var(--space-7); padding: clamp(18px, 2.6vw, 28px); border-top: 1px solid var(--glass-b-border-top); border-left: 1px solid var(--glass-b-border-left); border-right: 1px solid var(--glass-b-border-right); border-bottom: 1px solid var(--glass-b-border-bottom); border-radius: var(--radius-md); background: var(--glass-b-bg); box-shadow: var(--glass-b-shadow), var(--glass-b-highlight); backdrop-filter: var(--glass-b-blur); -webkit-backdrop-filter: var(--glass-b-blur); }
.record-editor-f20 > header { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.record-editor-f20 h2 { color: var(--forest); font-size: clamp(19px, 2.1vw, 26px); }
.record-editor-f20 header > p { max-width: 430px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.record-editor-f20-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.record-editor-f20-grid article { min-width: 0; display: grid; align-content: start; gap: 6px; padding: 14px; background: var(--glass-c-bg); border: 1px solid var(--glass-c-border); border-radius: var(--radius-xs); box-shadow: var(--glass-c-highlight); }
.record-editor-f20-grid article > span { color: var(--moss-strong); font-size: 10px; font-weight: 800; }
.record-editor-f20-grid article h3 { color: var(--forest); font-size: 14px; line-height: 1.4; }
.record-editor-f20-grid article p { color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.record-editor-f20-grid .button { width: 100%; margin-top: 2px; }
.record-editor-f20-grid__warning { background: rgba(252, 243, 235, .84) !important; border-color: rgba(188, 111, 60, .36) !important; }
.record-editor-f20-grid__warning > span, .record-editor-f20-grid__warning h3 { color: #824419 !important; }
.record-editor-no-pet { max-width: 740px; display: grid; gap: 11px; margin-top: var(--space-5); padding: clamp(20px, 3.2vw, 34px); text-align: center; background: var(--glass-c-bg); border-top: 1px solid var(--glass-c-border-top); border-left: 1px solid var(--glass-c-border-left); border-right: 1px solid var(--glass-c-border-right); border-bottom: 1px solid var(--glass-c-border-bottom); border-radius: var(--radius-md); box-shadow: var(--glass-c-shadow), var(--glass-c-highlight); }
.record-editor-no-pet > span { width: 44px; height: 44px; display: grid; place-items: center; justify-self: center; color: #824419; background: rgba(252, 243, 235, .88); border: 1px solid rgba(188, 111, 60, .35); border-radius: 50%; font-weight: 900; }
.record-editor-no-pet h2 { color: var(--forest); font-size: clamp(22px, 3vw, 31px); }
.record-editor-no-pet p { max-width: 520px; justify-self: center; color: var(--ink-soft); font-size: 13px; line-height: 1.68; }
.record-editor-no-pet .button { justify-self: center; min-width: min(100%, 240px); }
.record-editor-leave { position: fixed; z-index: 70; top: 50%; left: 50%; width: min(520px, calc(100vw - 32px)); display: grid; gap: 9px; padding: 24px; transform: translate(-50%, -50%); color: var(--forest); background: var(--glass-c-bg); border-top: 1px solid var(--glass-c-border-top); border-left: 1px solid var(--glass-c-border-left); border-right: 1px solid var(--glass-c-border-right); border-bottom: 1px solid var(--glass-c-border-bottom); border-radius: var(--radius-md); box-shadow: 0 26px 70px rgba(14, 38, 22, .24); }
.record-editor-leave::before { position: fixed; z-index: -1; inset: -200vmax; background: rgba(15, 32, 20, .32); content: ""; }
.record-editor-leave .eyebrow { margin-bottom: 0; }
.record-editor-leave h2 { color: var(--forest); font-size: clamp(22px, 3vw, 29px); }
.record-editor-leave > p:not(.eyebrow) { color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.record-editor-leave > div { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
.record-editor-leave .button { flex: 1 1 150px; }

@media (max-width: 980px) {
  .record-editor-workbench { grid-template-columns: 1fr; }
  .record-editor-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .record-editor-summary > header, .record-editor-private-card, .record-editor-share-gate, .record-editor-snapshot, .record-editor-delete-boundary, .record-editor-delete-confirm, .record-editor-delete-failure { grid-column: 1 / -1; }
  .record-editor-f20-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { display: none; }
  .record-editor-page { min-height: 100svh; padding: 0 14px calc(104px + env(safe-area-inset-bottom, 0px)); }
  .record-editor-heading { display: none; }
  .record-editor-mobile-header { min-height: 58px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .record-editor-mobile-header a { width: 44px; min-height: 44px; display: grid; place-items: center; color: var(--forest); font-size: 23px; text-decoration: none; }
  .record-editor-mobile-header strong { overflow: hidden; color: var(--forest); font-size: 16px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .record-editor-mobile-header span { min-width: 44px; color: var(--moss-strong); font-size: 10px; font-weight: 800; text-align: right; }
  .record-editor-status { min-height: 18px; margin-top: 2px; font-size: 10px; }
  .record-editor-workbench { gap: 14px; margin-top: 10px; padding: 13px; border-radius: 18px; }
  .record-editor-form-panel, .record-editor-summary { gap: 12px; }
  .record-editor-form-panel h2, .record-editor-summary h2 { font-size: 23px; }
  .record-editor-fields, .record-editor-summary { grid-template-columns: 1fr; }
  .record-editor-field--log { grid-column: auto; }
  .record-editor-field input, .record-editor-field textarea, .record-editor-field select { font-size: 16px; }
  .record-editor-field input, .record-editor-field select { min-height: 48px; }
  .record-editor-weight-row { grid-template-columns: 1fr; }
  .record-editor-unmeasured { width: 100%; }
  .record-editor-cover-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .record-editor-cover-options button { min-height: 96px; grid-template-rows: 66px auto; }
  .record-editor-cover-options img { height: 66px; }
  .record-editor-cover-options span { padding-inline: 6px; font-size: 9px; }
  .record-editor-actions { display: none; }
  .record-editor-private-card { grid-template-columns: 102px minmax(0, 1fr); gap: 11px; padding: 11px; }
  .record-editor-private-card figure { min-height: 130px; }
  .record-editor-private-card h3 { font-size: 17px; }
  .record-editor-private-card dl { gap: 5px 8px; }
  .record-editor-f20 { display: none; }
  .record-editor-no-pet { margin-top: 18px; padding: 24px 17px; }
  .record-editor-mobile-save-bar { position: fixed; z-index: 50; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.35fr); gap: 8px; align-items: center; padding: 10px 14px max(10px, env(safe-area-inset-bottom, 0px)); background: var(--glass-b-bg); border-top: 1px solid var(--glass-b-border); box-shadow: 0 -10px 24px rgba(18, 35, 22, 0.14), var(--glass-b-highlight); backdrop-filter: var(--glass-b-blur); -webkit-backdrop-filter: var(--glass-b-blur); }
  .record-editor-mobile-save-bar > span { min-width: 35px; color: var(--moss-strong); font-size: 10px; font-weight: 800; }
  .record-editor-mobile-save-bar .button { min-width: 0; min-height: 44px; padding-inline: 10px; font-size: 12px; }
  .record-editor-leave { width: min(520px, calc(100vw - 24px)); padding: 20px; }
}

@media (max-width: 380px) {
  .record-editor-cover-options { gap: 6px; }
  .record-editor-cover-options span { font-size: 8px; }
  .record-editor-mobile-save-bar { gap: 6px; padding-inline: 10px; }
  .record-editor-mobile-save-bar .button { padding-inline: 7px; font-size: 11px; }
  .record-editor-mobile-save-bar > span { display: none; }
  .record-editor-mobile-save-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
}
/* Explicitly preserve semantic hidden states against component display declarations. */
.record-editor-page [hidden], .record-editor-leave[hidden] { display: none !important; }
