.prompt-library-root { display: contents; }
.prompt-library-dialog { width: min(1120px, calc(100vw - 32px)); height: min(790px, 90vh); max-width: none; max-height: 90vh; padding: 0; overflow: hidden; color: #10233e; background: #fff; border: 1px solid #d9e5e6; border-radius: 24px; box-shadow: 0 28px 90px rgba(27, 54, 74, .24); }
.prompt-library-dialog::backdrop { background: rgba(15, 29, 45, .42); backdrop-filter: blur(4px); }
.prompt-library-frame { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; }
.prompt-library-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid #deeaeb; }
.prompt-library-header small, .prompt-memo-editor small { color: #0a9e75; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.prompt-library-header h2 { margin: 3px 0 0; font-size: 24px; }
.prompt-library-header-actions, .prompt-library-detail-actions, .prompt-memo-editor-actions { display: flex; align-items: center; gap: 8px; }
.prompt-library-new-memo, .prompt-library-refresh, .prompt-library-edit, .prompt-library-delete, .prompt-library-copy-all, .prompt-memo-editor-actions button, .prompt-memo-confirm button { min-height: 36px; padding: 8px 13px; color: #526579; background: #fff; border: 1px solid #d8e4e5; border-radius: 10px; font-weight: 700; cursor: pointer; }
.prompt-library-new-memo, .prompt-memo-save { color: #087a5d !important; background: #e6f8f2 !important; border-color: #9bdcc8 !important; }
.prompt-library-delete, .prompt-memo-delete-confirm { color: #b23a48 !important; background: #fff6f7 !important; border-color: #efc2c7 !important; }
.prompt-library-copy-all:disabled { opacity: .45; cursor: not-allowed; }
.prompt-library-close { width: 40px; min-width: 40px; height: 40px; padding: 0; color: #526579; background: #f3f8f7; border: 1px solid #dce7e6; border-radius: 50%; font-size: 25px; line-height: 1; cursor: pointer; }
.prompt-library-layout { display: grid; grid-template-columns: minmax(260px, 34%) minmax(0, 66%); min-height: 0; overflow: hidden; }
.prompt-library-sidebar { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); min-width: 0; min-height: 0; padding: 20px; overflow: hidden; background: #f7faf9; border-right: 1px solid #deeaeb; }
.prompt-library-search-label { display: grid; gap: 7px; color: #526579; font-size: 13px; font-weight: 700; }
.prompt-library-search { width: 100%; min-height: 44px; padding: 0 14px; color: #10233e; background: #fff; border: 1px solid #d5e2e3; border-radius: 12px; outline: none; box-sizing: border-box; }
.prompt-library-search:focus { border-color: #12ad80; box-shadow: 0 0 0 3px rgba(18, 173, 128, .12); }
.prompt-library-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.prompt-library-filters button { min-height: 34px; padding: 7px 12px; color: #526579; background: #fff; border: 1px solid #d8e4e5; border-radius: 9px; font-weight: 700; cursor: pointer; }
.prompt-library-filters button.active { color: #087a5d; background: #e6f8f2; border-color: #9bdcc8; }
.prompt-library-list-status { margin: 14px 2px 8px; color: #728195; font-size: 12px; }
.prompt-library-list { min-height: 0; overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; padding-right: 6px; }
.prompt-library-list-item { display: grid; gap: 5px; width: 100%; min-height: 64px; margin-bottom: 7px; padding: 10px 12px; text-align: left; color: #21354f; background: #fff; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.prompt-library-list-item:hover { border-color: #c4dfd7; }
.prompt-library-list-item.selected { background: #eaf8f4; border-color: #80ceb7; }
.prompt-library-list-item strong { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.prompt-library-list-item span { color: #7a899a; font-size: 11px; }
.prompt-library-detail { min-width: 0; min-height: 0; padding: 22px 24px; overflow: hidden; }
.prompt-library-empty-detail { display: grid; place-content: center; justify-items: center; gap: 8px; height: 100%; color: #7a899a; text-align: center; }
.prompt-library-empty-detail[hidden], .prompt-library-detail-content[hidden], .prompt-library-raw[hidden], .prompt-library-no-content[hidden] { display: none !important; }
.prompt-library-empty-detail strong { color: #33485f; font-size: 18px; }
.prompt-library-detail-content { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 14px; height: 100%; min-height: 0; overflow: hidden; }
.prompt-library-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 13px; border-bottom: 1px solid #e1eaeb; }
.prompt-library-detail-heading > div:first-child { min-width: 0; }
.prompt-library-detail-type { color: #09956f; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.prompt-library-detail-name { margin: 4px 0; font-size: 22px; overflow-wrap: anywhere; }
.prompt-library-detail-filename { color: #7b8998; font-size: 12px; }
.prompt-library-detail-actions { flex-wrap: wrap; justify-content: flex-end; }
.prompt-library-content-scroll { min-height: 0; overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; padding-right: 7px; }
.prompt-library-raw { min-height: 100%; margin: 0; padding: 16px; box-sizing: border-box; color: #1b3048; background: #fff; border: 1px solid #dde8e9; border-radius: 14px; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.prompt-library-no-content { display: grid; min-height: 180px; place-items: center; color: #7a899a; background: #f8fbfa; border: 1px dashed #c9d9d8; border-radius: 14px; }
.prompt-library-toast { position: absolute; right: 24px; bottom: 20px; z-index: 8; padding: 9px 14px; opacity: 0; color: #fff; background: #0a8f6b; border-radius: 10px; pointer-events: none; transform: translateY(8px); transition: .18s ease; }
.prompt-library-toast.visible { opacity: 1; transform: translateY(0); }
.prompt-memo-overlay, .prompt-memo-delete-overlay { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 18px; background: rgba(15, 29, 45, .42); }
.prompt-memo-overlay[hidden], .prompt-memo-delete-overlay[hidden] { display: none; }
.prompt-memo-editor, .prompt-memo-confirm { display: grid; gap: 15px; width: min(570px, 100%); max-height: calc(90vh - 48px); padding: 22px; overflow-y: auto; box-sizing: border-box; background: #fff; border: 1px solid #d9e5e6; border-radius: 18px; box-shadow: 0 18px 60px rgba(20, 45, 65, .24); }
.prompt-memo-editor h3, .prompt-memo-confirm h3 { margin: 3px 0 0; font-size: 21px; }
.prompt-memo-editor label { display: grid; gap: 7px; color: #526579; font-size: 13px; font-weight: 700; }
.prompt-memo-editor input, .prompt-memo-editor textarea { width: 100%; padding: 11px 13px; box-sizing: border-box; color: #10233e; background: #fff; border: 1px solid #d5e2e3; border-radius: 11px; font: inherit; resize: vertical; }
.prompt-memo-editor textarea { min-height: 190px; line-height: 1.55; }
.prompt-memo-editor .prompt-memo-share-label { display: flex; align-items: center; gap: 9px; width: fit-content; color: #33485f; cursor: pointer; }
.prompt-memo-editor .prompt-memo-shared { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: #0a9e75; }
.prompt-memo-error { min-height: 18px; margin: -4px 0 0; color: #b23a48; font-size: 12px; }
.prompt-memo-editor-actions, .prompt-memo-confirm > div { justify-content: flex-end; }
.prompt-memo-confirm { width: min(430px, 100%); }
.prompt-memo-confirm p { margin: 0; color: #66788a; }
.prompt-library-launch { min-width: 116px !important; }
@media (max-width: 720px) {
  .prompt-library-dialog { width: calc(100vw - 16px); height: calc(100vh - 16px); max-height: calc(100vh - 16px); border-radius: 16px; }
  .prompt-library-header { padding: 15px 16px; }
  .prompt-library-new-memo { padding-inline: 9px; font-size: 12px; }
  .prompt-library-layout { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 46%) minmax(0, 1fr); }
  .prompt-library-sidebar { grid-template-rows: auto auto auto minmax(0, 1fr); padding: 14px; overflow: hidden; border-right: 0; border-bottom: 1px solid #deeaeb; }
  .prompt-library-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; height: auto; min-height: 0; overflow: visible; }
  .prompt-library-filters button { width: 100%; min-width: 0; padding-inline: 6px; white-space: nowrap; }
  .prompt-library-list { min-height: 0; overflow-x: hidden; overflow-y: auto; }
  .prompt-library-detail { padding: 15px; }
  .prompt-library-detail-heading { display: grid; }
  .prompt-library-detail-actions { justify-content: flex-start; }
  .prompt-library-detail-name { font-size: 18px; }
}
@media (max-width: 480px) {
  .prompt-library-dialog { width: calc(100vw - 12px); height: calc(100vh - 12px); height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 16px; }
  .prompt-library-frame { min-height: 0; padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }
  .prompt-library-header { padding: 12px 14px; }
  .prompt-library-layout { grid-template-rows: minmax(340px, 58%) minmax(0, 1fr); min-height: 0; }
  .prompt-library-sidebar { grid-template-rows: auto auto auto minmax(0, 1fr); min-height: 0; padding: 12px; }
  .prompt-library-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); height: auto; max-height: none; overflow: visible; }
  .prompt-library-list-status { margin: 9px 2px 6px; }
  .prompt-library-list { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .prompt-library-detail { min-height: 0; padding: 12px; }
  .prompt-library-detail-content { min-height: 0; }
  .prompt-library-detail-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; padding-bottom: 8px; }
  .prompt-library-detail-heading > div:first-child { min-width: 0; }
  .prompt-library-detail-actions { align-self: start; flex-wrap: nowrap; justify-content: flex-end; gap: 5px; }
  .prompt-library-detail-actions button { min-height: 34px; padding: 7px 9px; white-space: nowrap; }
  .prompt-library-copy-all { font-size: 0; }
  .prompt-library-copy-all::after { content: "复制"; font-size: 13px; }
  .prompt-library-detail-name { margin-block: 2px; line-height: 1.3; }
  .prompt-library-content-scroll { min-height: 0; overflow-y: auto; }
}
