/* 网址导航的编辑状态 */
.operations-switch { display:flex; align-items:center; gap:7px; color:#69758a; font-size:13px; font-weight:700; white-space:nowrap; cursor:pointer; }
.operations-switch input { position:absolute; opacity:0; pointer-events:none; }
.operations-switch span { position:relative; display:block; width:34px; height:20px; border-radius:99px; background:#d7dce5; transition:.18s; }
.operations-switch span:after { content:""; position:absolute; top:3px; left:3px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #63708455; transition:.18s; }
.operations-switch input:checked + span { background:var(--brand); }
.operations-switch input:checked + span:after { transform:translateX(14px); }
.primary-action:disabled { cursor:not-allowed; opacity:.45; box-shadow:none; transform:none; }
.group-heading h3 { cursor: text; }
.group-heading h3:hover { color: var(--brand); }
.inline-edit { width: 180px; padding: 4px 7px; border: 1px solid #aaaaf0; border-radius: 6px; font: inherit; font-size: 16px; font-weight: 700; }
.move-up, .move-down { width: 27px; height: 27px; padding: 0; border: 1px solid #e0e3ee; border-radius: 7px; background: #fff; color: #657086; font-weight: 800; }
.move-up:hover, .move-down:hover { border-color: #c5c6f8; background: #f3f3ff; color: var(--brand); }
.site-move, .site-delete { position: absolute; top: 6px; display: none; width: 19px; height: 19px; padding: 0; border-radius: 50%; font-size: 12px; line-height: 1; }
.site-move { background: #edf0ff; color: #5051bb; }
.site-move-up { right: 52px; }.site-move-down { right: 29px; }
.site-delete { right: 6px; background: #f7dfe3; color: #be4256; font-size: 14px; }
.site-card:hover .site-move:not([hidden]), .site-card:hover .site-delete { display: block; }

/* 提示词库：树状分类工作台 */
.prompt-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; min-height: 660px; }
.prompt-sidebar, .prompt-workspace { border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px #27324708; }
.prompt-sidebar { padding: 18px 14px; }
.prompt-sidebar-head, .prompt-workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 3px 5px 16px; }
.prompt-sidebar h2, .prompt-workspace h2 { margin: 6px 0 0; font-size: 18px; letter-spacing: -.4px; }
.tree-add { display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: 19px; }
.prompt-category-creator { display: none; gap: 9px; margin: 0 0 14px; padding: 12px; border: 1px solid #dedfff; border-radius: 11px; background: #fafaff; }
.prompt-category-creator.visible { display: grid; }
.prompt-category-creator label { display: grid; gap: 5px; color: #788397; font-size: 12px; font-weight: 700; }
.prompt-category-creator div { display: flex; gap: 7px; }
.prompt-category-creator button { padding: 7px 9px; font-size: 12px; }
.secondary-button { background: #eef1f5; color: #606c7f; }
.tree-hint { margin: 0 5px 10px; color: #a0a9b7; font-size: 12px; }
.prompt-tree, .prompt-tree .category-children { margin: 0; padding: 0; list-style: none; }
.prompt-tree .category-children { margin: 3px 0 3px 13px; padding-left: 10px; border-left: 1px solid #e5e8ef; }
.prompt-tree-item { position: relative; display: flex; align-items: center; gap: 6px; min-height: 33px; margin: 2px 0; padding: 6px 7px; border-radius: 8px; color: #536075; cursor: pointer; font-size: 13px; }
.prompt-tree-item:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c8ced9; }
.prompt-tree-item:hover { background: #f4f5fb; color: #363b82; }
.prompt-tree-item.selected { background: var(--brand-soft); color: #4f50bf; font-weight: 700; }
.prompt-tree-item.selected:before { background: var(--brand); }
.tree-node-label { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.prompt-tree-item .delete { display: none; width: 20px; height: 20px; padding: 0; border-radius: 6px; background: #fff0f1; color: #cd5362; font-size: 13px; }
.prompt-tree-item:hover > .delete { display: block; }
.prompt-workspace { padding: 20px; }
.prompt-editor { display: grid; gap: 10px; margin: 0 0 20px; padding: 14px; border: 1px solid #e7e8fa; border-radius: 13px; background: #fbfbff; }
.prompt-editor button { justify-self: start; }
.prompt-list > div { padding: 14px 4px; }
@media (max-width: 800px) { .prompt-layout { grid-template-columns: 1fr; } .prompt-sidebar { max-height: 430px; overflow: auto; } }

/* 目录树节点与长内容编辑器 */
.prompt-tree-item { display: block; min-height: 0; margin: 2px 0; padding: 0; background: transparent; }
.prompt-tree-item:before { display: none; }
.tree-node-row { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 7px; border-radius: 8px; }
.tree-node-row:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c8ced9; }
.prompt-tree-item:hover .tree-node-row { background: #f4f5fb; color: #363b82; }
.prompt-tree-item.selected > .tree-node-row { background: var(--brand-soft); color: #4f50bf; font-weight: 700; }
.prompt-tree-item.selected > .tree-node-row:before { background: var(--brand); }
.prompt-management-enabled .prompt-tree-item[draggable="true"] > .tree-node-row { cursor: grab; }
.prompt-management-enabled .prompt-tree-item.is-dragging { opacity: .42; }
.prompt-management-enabled .tree-node-row.drop-as-child { outline: 2px solid #6967df; background: #eeefff; color: #4543ac; }
.prompt-management-enabled .tree-node-row.drop-as-child:after { content: "松开后移动到此分类下"; margin-left: auto; color: #6967df; font-size: 11px; font-weight: 700; }
.prompt-tree.drop-at-root { outline: 2px dashed #6967df; outline-offset: 5px; border-radius: 8px; }
.tree-node-add, .prompt-tree-item .delete { display: none; width: 21px; height: 21px; padding: 0; border-radius: 6px; font-size: 14px; line-height: 1; }
.tree-node-add[hidden], .prompt-tree-item .delete[hidden], #add-root-prompt-category[hidden] { display: none !important; }
.tree-node-add { background: #ececff; color: var(--brand); }
.prompt-tree-item .delete { background: #fff0f1; color: #cd5362; }
.prompt-tree-item:hover > .tree-node-row .tree-node-add, .prompt-tree-item:hover > .tree-node-row .delete { display: block; }
.prompt-editor { grid-template-rows: auto minmax(380px, 1fr) auto; min-height: 540px; }
.prompt-editor > label { display: grid; gap: 7px; color: #6e798b; font-size: 12px; font-weight: 700; }
.prompt-content-label { min-height: 0; }
.prompt-editor textarea { height: 100%; min-height: 390px; padding: 14px; border-color: #dde1ee; background: #fff; font-family: "SFMono-Regular", Consolas, "Microsoft YaHei", monospace; font-size: 14px; line-height: 1.7; }
.prompt-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #8c96a5; font-size: 12px; }
.prompt-editor.is-disabled { opacity: .55; }
.prompt-editor.is-disabled textarea, .prompt-editor.is-disabled input { cursor: not-allowed; background: #f4f5f8; }

/* 树内就地新增与编辑 */
.prompt-tree-tools { display: flex; align-items: center; gap: 8px; }
.prompt-tree-tools .operations-switch { font-size: 12px; }
.tree-inline-creator { display: block; margin: 4px 0; padding: 0; }
.tree-inline-creator form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; margin: 0; padding: 6px; border: 1px solid #d7d8ff; border-radius: 8px; background: #fbfbff; }
.tree-inline-creator input, .tree-inline-input { min-width: 0; padding: 6px 7px; border: 1px solid #cdd0eb; border-radius: 6px; font-size: 12px; outline-color: var(--brand); }
.tree-inline-creator button { padding: 5px 7px; border-radius: 6px; font-size: 11px; }
.tree-inline-input { flex: 1; width: 100%; font-size: 13px; }
.tree-node-label { cursor: pointer; }
.tree-node-label.is-editable { border-bottom: 1px dashed #aaaaf0; color: #4f50bf; }
.tree-node-label.is-editable:hover { color: #3334a3; }
.prompt-management-enabled .prompt-tree-item { user-select: none; }

/* 提示词列表：浏览模式与管理模式 */
.prompt-list-item { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 13px 5px; border-bottom: 1px solid var(--line); }
.prompt-title { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.prompt-list-item .drag { flex: 1; }
.copy-prompt, .edit-prompt { padding: 6px 9px; border-radius: 7px; background: #eef0ff; color: #5152bc; font-size: 12px; white-space: nowrap; }
.edit-prompt { background: #f4f5fb; color: #5e687a; }
.prompt-list-item .delete { padding: 6px 9px; border-radius: 7px; font-size: 12px; white-space: nowrap; }
.prompt-list-item .content { width: 100%; margin: 7px 0 0; padding: 12px; border: 1px solid #edf0f4; border-radius: 9px; background: #fafbfc; white-space: pre-wrap; color: #4c586a; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.65; }
.prompt-item-editor { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; width: 100%; margin: 0; }
.prompt-item-editor textarea { grid-column: 1 / -1; min-height: 260px; font-family: "SFMono-Regular", Consolas, monospace; line-height: 1.6; }

/* 按需展开的提示词编辑器 */
.prompt-editor { grid-template-rows: auto auto minmax(160px, auto) auto; min-height: 0; }
.prompt-editor-title { display: flex; align-items: center; justify-content: space-between; color: #4c5668; font-size: 14px; }
.prompt-editor textarea { min-height: 160px; max-height: 620px; resize: none; }
.prompt-workspace-head > .primary-action { align-self: center; }
#prompt-form[hidden] { display: none !important; }
.markdown-hint { margin-top: 2px; color: #8791a2; font-size: 11px; font-weight: 400; line-height: 1.55; }

/* 提示词工作台的紧凑布局 */
.prompt-layout { grid-template-columns: 286px minmax(0, 1fr); gap: 18px; min-height: 600px; }
.prompt-sidebar { padding: 17px 13px; }
.prompt-workspace { padding: 0; overflow: hidden; }
.prompt-workspace-head { align-items: center; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff 0%, #f9f9ff 100%); }
.prompt-workspace-head h2 { font-size: 21px; }
#prompt-editor-hint { margin: 5px 0 0; color: #8791a2; font-size: 12px; }
.prompt-list { padding: 8px 24px 24px; }
.prompt-list-item { min-height: 56px; margin: 3px 0; padding: 10px 11px; border: 1px solid transparent; border-radius: 10px; }
.prompt-list-item:hover { border-color: #e3e4f5; background: #fafaff; }
.prompt-title, .prompt-list-item .drag { font-size: 14px; color: #354054; }
.prompt-list-item .drag { color: #4e4fae; }
.copy-prompt, .edit-prompt, .prompt-list-item .delete { padding: 6px 9px; border-radius: 7px; font-size: 12px; }
.show-prompt { padding: 6px 9px; border-radius: 7px; background: #f4f5fb; color: #596579; font-size: 12px; white-space: nowrap; }
.prompt-detail { width: 100%; max-height: 420px; margin: 4px 0 0; padding: 13px; overflow: auto; border: 1px solid #e8eaf0; border-radius: 9px; background: #fafbfc; color: #455166; font-family: "SFMono-Regular", Consolas, "Microsoft YaHei", monospace; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.prompt-detail[hidden] { display: none; }
.prompt-empty { display: grid; justify-items: center; gap: 7px; padding: 58px 18px; color: #8b95a5; text-align: center; }
.prompt-empty span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #efefff; color: var(--brand); }
.prompt-empty strong { color: #596477; font-size: 14px; }.prompt-empty small { font-size: 12px; }
.prompt-editor.is-open { display: grid; gap: 11px; margin: 18px 24px; padding: 17px; border: 1px solid #dedfff; border-radius: 13px; background: #fcfcff; box-shadow: 0 8px 20px #5b5bd60c; }
.prompt-editor-title { padding-bottom: 3px; }
.prompt-editor textarea { min-height: 160px; }
@media (max-width: 800px) { .prompt-layout { grid-template-columns: 1fr; } .prompt-workspace-head, .prompt-list { padding-left: 16px; padding-right: 16px; } .prompt-editor.is-open { margin: 14px 16px; } }

/* 全页提示词工作台与导出入口 */
#prompts.tab { max-width: none; min-height: calc(100vh - 1px); margin: 0; padding: 0; }
#prompts .prompt-layout { grid-template-columns: 304px minmax(0, 1fr); min-height: calc(100vh - 1px); gap: 0; }
#prompts .prompt-sidebar { border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
#prompts .prompt-workspace { border: 0; border-radius: 0; box-shadow: none; }
.prompt-workspace-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.export-button { padding: 8px 10px; border: 1px solid #d9dcef; background: #fff; color: #5658ac; font-size: 12px; font-weight: 700; }
.export-button:hover { border-color: #bbbdf5; background: #f4f4ff; }
@media (max-width: 800px) { #prompts .prompt-layout { grid-template-columns: 1fr; } #prompts .prompt-sidebar { border-right: 0; border-bottom: 1px solid var(--line); } .prompt-workspace-actions { justify-content: flex-start; } }

/* 我的笔记：与提示词库一致的全页分类工作台 */
#notes.tab.active { display: block; max-width: none; min-height: 100vh; margin: 0; padding: 0; }
#notes .prompt-layout { display: grid !important; grid-template-columns: 304px minmax(0, 1fr); width: 100%; min-height: 100vh; gap: 0; }
#notes .prompt-sidebar { padding: 17px 13px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: #fff; box-shadow: none; }
#notes .prompt-workspace { overflow: hidden; padding: 0; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
#notes .prompt-workspace h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.4px; }
#notes .prompt-workspace .prompt-workspace-head { align-items: center; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff 0%, #f9f9ff 100%); }
#notes #note-editor-hint { margin: 5px 0 0; color: #8791a2; font-size: 12px; }
#notes #note-list { padding: 8px 24px 24px; }
#notes #note-form.is-open { display: grid; gap: 11px; margin: 18px 24px; padding: 17px; border: 1px solid #dedfff; border-radius: 13px; background: #fcfcff; box-shadow: 0 8px 20px #5b5bd60c; }
#note-form[hidden] { display: none !important; }
body:not(.note-management-enabled) #notes .tree-node-add,
body:not(.note-management-enabled) #notes .prompt-tree-item .delete,
body:not(.note-management-enabled) #notes #add-root-note-category { display: none !important; }
@media (max-width: 800px) { #notes .prompt-layout { grid-template-columns: 1fr; } #notes .prompt-sidebar { border-right: 0; border-bottom: 1px solid var(--line); } #notes .prompt-workspace .prompt-workspace-head, #notes #note-list { padding-left: 16px; padding-right: 16px; } #notes #note-form.is-open { margin: 14px 16px; } }

/* 我的日记：简洁的日期时间线 */
#diaries.diary-page { max-width: none; min-height: 100vh; margin: 0; padding: 0; }
.diary-shell { width: min(940px, calc(100% - 64px)); margin: 0 auto; padding: 64px 0 88px; }
.diary-hero { display: flex; align-items: end; justify-content: space-between; gap: 22px; padding: 0 4px 29px; border-bottom: 1px solid var(--line); }
.diary-hero h2 { margin: 8px 0 7px; font-size: 31px; letter-spacing: -1.2px; }
.diary-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.diary-editor { display: none; gap: 15px; margin: 24px 0 30px; padding: 22px; border: 1px solid #dedfff; border-radius: 16px; background: #fff; box-shadow: 0 12px 30px #34386b0b; }
.diary-editor.is-open { display: grid; }
#diary-form[hidden] { display: none !important; }
.diary-editor-head, .diary-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.diary-editor-head { color: #404b60; font-size: 15px; }
.diary-editor label { display: grid; gap: 7px; color: #727d8e; font-size: 12px; font-weight: 700; }
.diary-date-field { width: 190px; }
.diary-editor input { background: #fbfcff; }
.diary-editor textarea { min-height: 260px; padding: 14px; resize: vertical; border-color: #dde1ee; background: #fbfcff; color: #3d485a; line-height: 1.8; }
.diary-editor-footer { color: #939dab; font-size: 12px; }
.diary-list { display: grid; gap: 12px; }
.diary-entry { position: relative; display: grid; grid-template-columns: 175px minmax(0, 1fr); gap: 20px; padding: 23px 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 6px 18px #26334b06; transition: border-color .18s, box-shadow .18s, transform .18s; }
.diary-entry:hover { border-color: #d7d9f4; box-shadow: 0 10px 25px #353a790b; transform: translateY(-1px); }
.diary-entry-date { color: #5355b9; font-size: 14px; font-weight: 800; line-height: 1.6; }
.diary-entry-content { min-width: 0; padding-right: 62px; color: #404b5e; font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.diary-entry-actions { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; opacity: 0; transition: opacity .18s; }
.diary-entry:hover .diary-entry-actions { opacity: 1; }
.edit-diary, .diary-entry .delete { padding: 5px 8px; border-radius: 7px; font-size: 12px; }
.edit-diary { background: #f1f2ff; color: #5557bb; }.diary-entry .delete { background: #fff0f2; color: #ca5060; }
.diary-empty { display: grid; justify-items: center; gap: 8px; padding: 100px 18px; color: #8c96a5; text-align: center; }
.diary-empty span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #efefff; color: var(--brand); }
.diary-empty strong { color: #566174; font-size: 15px; }.diary-empty small { font-size: 12px; }
@media (max-width: 700px) { .diary-shell { width: min(100% - 32px, 940px); padding-top: 34px; } .diary-hero { align-items: flex-start; flex-direction: column; } .diary-entry { grid-template-columns: 1fr; gap: 9px; padding: 18px; } .diary-entry-content { padding-right: 0; } .diary-entry-actions { opacity: 1; } .diary-editor { padding: 16px; } }

/* 日记的沉浸式独立阅读与书写页面 */
.diary-shell { width: min(1020px, calc(100% - 80px)); padding-top: 54px; }
.diary-hero { position: relative; overflow: hidden; padding: 42px 44px; border: 1px solid #e3e4f4; border-radius: 22px; background: radial-gradient(circle at 88% 18%, #eceaff 0, transparent 30%), linear-gradient(130deg, #fff 0%, #fafaff 68%, #f5f6ff 100%); }
.diary-hero:after { content: "✦"; position: absolute; right: 54px; bottom: -32px; color: #e0e0fb; font-size: 140px; line-height: 1; }
.diary-hero > * { position: relative; z-index: 1; }
.diary-hero h2 { font-size: 34px; }.diary-hero p { max-width: 460px; line-height: 1.8; }
.diary-list { gap: 14px; padding-top: 25px; }
.diary-entry { grid-template-columns: 185px minmax(0, 1fr); min-height: 126px; padding: 27px 28px; border-radius: 17px; }
.diary-entry-date { display: flex; align-items: flex-start; gap: 9px; font-size: 15px; }.diary-entry-date:before { content: ""; flex: 0 0 9px; width: 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: #6969d9; box-shadow: 0 0 0 5px #efefff; }
.diary-entry-content { display: -webkit-box; overflow: hidden; padding: 0 152px 0 0; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: #4d586b; }
.diary-entry-actions { top: auto; right: 25px; bottom: 24px; opacity: 1; }
.show-diary, .edit-diary, .diary-entry .delete { padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.show-diary { background: #5b5bd6; color: #fff; }.edit-diary { background: #f1f2ff; color: #5557bb; }
.diary-focus { min-height: calc(100vh - 108px); padding: 5px 0 36px; }
.diary-focus-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px 26px; }
.back-button { padding: 8px 0; background: transparent; color: #59657a; font-size: 13px; font-weight: 700; }.back-button:hover { color: var(--brand); transform: translateX(-2px); }
.diary-focus > .diary-editor, .diary-reader { display: grid; min-height: calc(100vh - 205px); margin: 0; padding: clamp(28px, 5vw, 66px); border: 1px solid #e5e6f1; border-radius: 23px; background: linear-gradient(145deg, #fff 0%, #fcfcff 100%); box-shadow: 0 16px 45px #34386b0c; }
.diary-focus > .diary-editor { grid-template-rows: auto auto minmax(380px, 1fr) auto; align-content: stretch; }
.diary-focus > .diary-editor.is-open { display: grid; }
.diary-editor-head strong { display: block; color: #293249; font-size: 25px; letter-spacing: -.7px; }.diary-editor-head small { display: block; margin-top: 8px; color: #97a0ae; font-size: 13px; }
.diary-date-field { width: 205px; margin-top: 32px; }.diary-editor textarea { min-height: 380px; margin-top: 6px; padding: 20px; border: 0; border-radius: 12px; background: #f8f9fd; font-size: 15px; line-height: 2; }.diary-editor textarea:focus { outline: 2px solid #d7d7ff; background: #fff; }
.diary-editor-footer { padding-top: 20px; }
.diary-reader { align-content: start; grid-template-rows: auto 1fr auto; }
#diary-reader[hidden] { display: none !important; }
.diary-reader-meta { display: grid; gap: 11px; padding-bottom: 30px; border-bottom: 1px solid #eceef4; }.diary-reader-meta span { color: #7778d9; font-size: 11px; font-weight: 800; letter-spacing: 1.4px; }.diary-reader-meta time { color: #283249; font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -1px; }
.diary-reader-content { max-width: 780px; padding: 40px 0 56px; color: #3e4859; font-size: 16px; line-height: 2.05; white-space: pre-wrap; }
.diary-reader footer { display: flex; gap: 9px; padding-top: 22px; border-top: 1px solid #eceef4; }.diary-reader footer .delete { background: #fff0f2; color: #ca5060; }
@media (max-width: 700px) { .diary-shell { width: min(100% - 32px, 1020px); } .diary-hero { padding: 31px 25px; } .diary-hero:after { right: 14px; font-size: 96px; } .diary-entry { grid-template-columns: 1fr; } .diary-entry-content { padding-right: 0; } .diary-entry-actions { position: static; margin-top: 6px; } .diary-focus > .diary-editor, .diary-reader { min-height: calc(100vh - 145px); padding: 27px 22px; border-radius: 17px; } .diary-focus > .diary-editor { grid-template-rows: auto auto minmax(320px, 1fr) auto; } .diary-editor textarea { min-height: 320px; } }

/* 日记页面最终视觉：暖白纸张、明确的阅读层级 */
#diaries.diary-page { background: linear-gradient(120deg, #f7f8fb 0%, #f9fafc 55%, #f5f5fb 100%); }
#diaries .diary-shell { width: min(960px, calc(100% - 72px)); padding-top: 48px; }
#diaries .diary-hero { align-items: center; padding: 38px 42px; border: 0; border-radius: 20px; background: linear-gradient(125deg, #313763 0%, #5456a6 57%, #7373c5 100%); box-shadow: 0 18px 38px #36396a20; color: #fff; }
#diaries .diary-hero:after { content: ""; right: 0; bottom: 0; width: 270px; height: 100%; border-radius: 48% 0 0 0; background: linear-gradient(135deg, transparent, #ffffff15); }
#diaries .diary-hero .eyebrow, #diaries .diary-hero p { color: #e3e5ff; }
#diaries .diary-hero h2 { color: #fff; font-size: 34px; }.diary-hero .primary-action { background: #fff; color: #4749a0; box-shadow: none; }
#diaries .diary-entry { grid-template-columns: 150px minmax(0, 1fr); min-height: 118px; padding: 24px 26px; border: 0; border-radius: 14px; box-shadow: 0 7px 20px #28314a0b; }
#diaries .diary-entry:hover { border: 0; box-shadow: 0 12px 28px #28314a12; transform: translateY(-2px); }
#diaries .diary-entry-date { color: #4d51a6; font-size: 14px; }.diary-entry-date:before { background: #7174c8; box-shadow: 0 0 0 5px #f1f2ff; }
#diaries .diary-entry-content { padding: 0 150px 0 0; color: #4b5260; font-size: 14px; line-height: 1.9; }
#diaries .diary-entry-actions { right: 22px; bottom: 21px; }.show-diary { background: #5457b2; }.edit-diary { background: #f0f1f8; color: #5c6575; }
#diaries .diary-focus { min-height: calc(100vh - 96px); padding-top: 2px; }
#diaries .diary-focus-head { padding: 6px 0 20px; }.back-button { padding: 8px 11px; border-radius: 8px; background: #ececff; color: #5558b6; }.back-button:hover { background: #e0e0ff; transform: translateX(-2px); }
#diaries .diary-focus > .diary-editor, #diaries .diary-reader { min-height: calc(100vh - 170px); padding: clamp(34px, 5vw, 58px); border: 0; border-radius: 18px; background: #fffdf9; box-shadow: 0 14px 42px #31395a12; }
#diaries .diary-focus > .diary-editor { grid-template-rows: auto auto minmax(410px, 1fr) auto; }
#diaries .diary-editor-head { display: block; padding-bottom: 27px; border-bottom: 1px solid #ece9e0; }.diary-editor-head strong { color: #292e3e; font-family: Georgia, "Microsoft YaHei", serif; font-size: 28px; }.diary-editor-head small { margin-top: 10px; color: #97948d; }
#diaries .diary-date-field { width: 210px; margin-top: 25px; color: #79766f; }.diary-editor input { border-color: #e5e1d9; background: #fff; }
#diaries .diary-content-field { margin-top: 16px; color: #79766f; }.diary-editor textarea { min-height: 410px; padding: 22px 4px; border: 0; border-radius: 0; border-top: 1px solid #ece9e0; border-bottom: 1px solid #ece9e0; background: transparent; color: #3f423f; font-family: Georgia, "Microsoft YaHei", serif; font-size: 16px; line-height: 2.1; }.diary-editor textarea:focus { outline: 0; border-color: #bcb99f; background: #fffefa; }
#diaries .diary-editor-footer { padding-top: 20px; color: #aaa69d; }.diary-editor-footer button { padding: 10px 17px; background: #3d4359; }
#diaries .diary-reader { display: flex !important; flex-direction: column; align-items: stretch; }.diary-reader[hidden] { display: none !important; }
#diaries .diary-reader-meta { display: block; padding: 0 0 30px; border-bottom: 1px solid #ece9e0; }.diary-reader-meta span { display: block; margin-bottom: 13px; color: #8388c7; font-size: 11px; letter-spacing: 1.8px; }.diary-reader-meta time { display: block; color: #292e3e; font-family: Georgia, "Microsoft YaHei", serif; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.8px; }
#diaries .diary-reader-content { flex: 1; max-width: 760px; padding: 42px 0 58px; color: #3f423f; font-family: Georgia, "Microsoft YaHei", serif; font-size: 17px; line-height: 2.15; }
#diaries .diary-reader footer { display: flex; gap: 9px; padding-top: 20px; border-top: 1px solid #ece9e0; }.diary-reader footer .secondary-button { background: #eff0f5; color: #596170; }.diary-reader footer .delete { background: #fff0f2; color: #ce5060; }
@media (max-width: 700px) { #diaries .diary-shell { width: min(100% - 28px, 960px); } #diaries .diary-hero { padding: 30px 25px; } #diaries .diary-entry { grid-template-columns: 1fr; } #diaries .diary-entry-content { padding-right: 0; } #diaries .diary-entry-actions { position: static; margin-top: 10px; } #diaries .diary-focus > .diary-editor, #diaries .diary-reader { min-height: calc(100vh - 126px); padding: 27px 22px; } #diaries .diary-focus > .diary-editor { grid-template-rows: auto auto minmax(330px, 1fr) auto; } #diaries .diary-editor textarea { min-height: 330px; } }

/* 日期查询与云朵日记卡片 */
.diary-filter { display: flex; align-items: end; gap: 9px; margin: 22px 2px 12px; }
.diary-filter label { display: grid; gap: 6px; color: #777b8a; font-size: 12px; font-weight: 700; }.diary-filter input { width: 175px; background: #fff; }
.diary-filter .secondary-button { padding: 8px 10px; font-size: 12px; }
#diaries .diary-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); align-items: start; gap: 28px 22px; padding: 21px 4px 44px; }
#diaries .diary-entry { display: flex; flex-direction: column; min-height: 252px; padding: 42px 26px 23px; border: 1px solid #e4e5f2; border-radius: 47% 53% 45% 55% / 35% 36% 64% 65%; background: linear-gradient(145deg, #fff 0%, #fcfcff 100%); box-shadow: 0 12px 25px #353b6c10; overflow: visible; }
#diaries .diary-entry:nth-child(3n + 2) { margin-top: 24px; border-radius: 52% 48% 58% 42% / 41% 43% 57% 59%; background: linear-gradient(145deg, #fff 0%, #f8f8ff 100%); }
#diaries .diary-entry:nth-child(3n) { margin-top: 7px; border-radius: 43% 57% 48% 52% / 39% 48% 52% 61%; background: linear-gradient(145deg, #fff 0%, #fffdf8 100%); }
#diaries .diary-entry:before, #diaries .diary-entry:after { content: ""; position: absolute; z-index: -1; border-radius: 50%; background: inherit; border: 1px solid #e4e5f2; }
#diaries .diary-entry:before { width: 62px; height: 62px; top: -13px; left: 38px; }.diary-entry:after { width: 48px; height: 48px; top: -6px; right: 40px; }
#diaries .diary-entry:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 18px 31px #353b6c18; }
#diaries .diary-entry-date { display: block; color: #565ab3; font-size: 14px; }.diary-entry-date:before { display: none; }
#diaries .diary-entry-content { display: -webkit-box; flex: 1; overflow: hidden; padding: 17px 0 12px; -webkit-box-orient: vertical; -webkit-line-clamp: 5; color: #535b68; line-height: 1.8; }
#diaries .diary-entry-actions { position: static; display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }.show-diary, .edit-diary, .diary-entry .delete { padding: 6px 8px; font-size: 11px; }
#diaries.diary-focus-active .diary-shell { width: 100%; max-width: none; margin: 0; padding: 26px 42px 54px; }
#diaries.diary-focus-active .diary-focus { width: 100%; min-height: calc(100vh - 80px); }.diary-focus-active .diary-focus-head { max-width: none; padding: 0 0 20px; }
#diaries.diary-focus-active .diary-focus > .diary-editor, #diaries.diary-focus-active .diary-reader { min-height: calc(100vh - 132px); border-radius: 20px; }
@media (max-width: 700px) { .diary-filter { align-items: flex-start; flex-direction: column; }.diary-filter input { width: 100%; } #diaries .diary-list { grid-template-columns: 1fr; gap: 26px; } #diaries .diary-entry, #diaries .diary-entry:nth-child(3n + 2), #diaries .diary-entry:nth-child(3n) { margin-top: 0; min-height: 225px; } #diaries.diary-focus-active .diary-shell { padding: 18px 14px 34px; } }

/* 阅读和编辑为互斥状态，避免同时出现两个内容画布 */
#diaries #diary-form[hidden],
#diaries #diary-reader[hidden] { display: none !important; }

/* 日记列表：规整、克制的日期卡片 */
#diaries .diary-hero { min-height: 118px; padding: 25px 30px; border: 1px solid #e3e6ed; border-radius: 15px; background: #fff; box-shadow: 0 7px 20px #28314a08; color: var(--ink); }
#diaries .diary-hero:after { display: none; } #diaries .diary-hero .eyebrow { color: #6568c5; }.diary-hero h2 { margin: 5px 0 3px; color: #263047 !important; font-size: 25px !important; }.diary-hero p { color: #8a94a5 !important; font-size: 13px; }
.diary-hero-actions { display: flex; align-items: end; gap: 10px; }.diary-filter { display: flex; align-items: end; gap: 7px; margin: 0; }.diary-filter label { gap: 4px; color: #8791a1; font-size: 11px; font-weight: 700; }.diary-filter input { width: 143px; padding: 8px 9px; font-size: 12px; }.diary-filter .secondary-button { padding: 8px 9px; border: 1px solid #e1e5ec; background: #f7f8fb; color: #687486; font-size: 12px; }
#diaries .diary-hero .primary-action { padding: 10px 13px; border-radius: 9px; background: #5b5bd6; color: #fff; box-shadow: 0 5px 12px #5b5bd624; font-size: 13px; }
#diaries .diary-list { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 15px; padding: 25px 0 48px; }
#diaries .diary-entry, #diaries .diary-entry:nth-child(3n + 2), #diaries .diary-entry:nth-child(3n) { display: flex; flex-direction: column; min-height: 152px; margin: 0; padding: 21px 20px 18px; border: 1px solid #e3e6ed; border-radius: 13px; background: #fff; box-shadow: 0 5px 15px #27344b07; }
#diaries .diary-entry:before, #diaries .diary-entry:after { display: none; }
#diaries .diary-entry:hover { border-color: #cbcdef; box-shadow: 0 10px 22px #363a790f; transform: translateY(-2px); }
#diaries .diary-entry-date { padding-bottom: 15px; color: #3e418e; font-size: 15px; font-weight: 800; }.diary-entry-date:before { display: none; }
#diaries .diary-entry-actions { position: static; display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 13px; border-top: 1px solid #eef0f4; }.show-diary, .edit-diary, .diary-entry .delete { padding: 6px 8px; border-radius: 7px; font-size: 11px; }.show-diary { background: #5b5bd6; }.edit-diary { background: #f1f2f8; color: #616d7e; }
#diaries .diary-entry:hover .diary-entry-date { color: #686bc0; }

/* 用户登录与注册 */
.auth-gate { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #2e335f 0%, #6568c7 100%); }
.auth-card { width: min(390px, 100%); padding: 38px; border-radius: 20px; background: #fff; box-shadow: 0 24px 65px #11142f42; }.auth-card h2 { margin: 8px 0; color: #252d45; font-size: 28px; }.auth-card p { margin: 0 0 24px; color: #8a94a5; font-size: 13px; line-height: 1.7; }.auth-card form { display: grid; gap: 10px; margin: 0; }.auth-card input { width: 100%; padding: 12px; }.auth-card form button { margin-top: 4px; padding: 12px; }.auth-switch { width: 100%; margin-top: 12px; background: transparent; color: #5b5bd6; font-size: 13px; }.auth-switch:hover { transform: none; }.auth-card small { display: block; min-height: 18px; margin-top: 4px; color: #d25363; }
@media (max-width: 700px) { #diaries .diary-hero { align-items: flex-start; flex-direction: column; padding: 23px 20px; }.diary-hero-actions { align-items: end; width: 100%; }.diary-filter { flex: 1; }.diary-filter label { flex: 1; }.diary-filter input { width: 100%; } #diaries .diary-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }.diary-entry-actions { gap: 4px; } }

/* 紧凑日记看板：贴近导航，减少无意义留白 */
#diaries .diary-shell { width: 100%; max-width: none; margin: 0; padding: 28px 34px 54px 26px; }
#diaries .diary-hero { min-height: 0; padding: 20px 24px; border-radius: 12px; }.diary-hero h2 { margin: 3px 0 2px; font-size: 23px !important; }.diary-hero p { font-size: 12px; }
#diaries .diary-list { grid-template-columns: repeat(auto-fill, minmax(190px, 230px)); gap: 12px; padding: 17px 0 36px; }
#diaries .diary-entry, #diaries .diary-entry:nth-child(3n + 2), #diaries .diary-entry:nth-child(3n) { min-height: 106px; padding: 15px 16px 13px; border-radius: 10px; box-shadow: none; }
#diaries .diary-entry:hover { box-shadow: 0 7px 16px #363a7910; transform: translateY(-1px); }
#diaries .diary-entry-date { padding-bottom: 10px; font-size: 14px; }
#diaries .diary-entry-actions { gap: 5px; padding-top: 10px; }.show-diary, .edit-diary, .diary-entry .delete { padding: 5px 7px; border-radius: 6px; font-size: 11px; }
@media (max-width: 700px) { #diaries .diary-shell { padding: 18px 16px 35px; } #diaries .diary-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; } #diaries .diary-entry { min-height: 100px; padding: 13px; } }
.auth-contact { margin-top: 16px; padding: 10px; border-radius: 8px; background: #f4f5ff; color: #687387; font-size: 12px; line-height: 1.6; }.auth-contact strong { color: #5052ba; }.logout-button { position: absolute; right: 16px; bottom: 22px; left: 16px; padding: 9px; background: #f5f6fa; color: #6d7788; font-size: 12px; }

/* 测试登录页：渐变光影与玻璃卡片 */
.auth-gate { overflow: hidden; background: radial-gradient(circle at 15% 20%, #8889ef 0, transparent 28%), radial-gradient(circle at 83% 78%, #ffb7d1 0, transparent 27%), linear-gradient(135deg, #171a43 0%, #373b83 48%, #7878c8 100%); }
.auth-gate:before, .auth-gate:after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; animation: authFloat 9s ease-in-out infinite; }.auth-gate:before { width: 330px; height: 330px; top: -115px; right: 8%; background: #bfc1ff55; }.auth-gate:after { width: 260px; height: 260px; bottom: -95px; left: 7%; background: #ffcee055; animation-delay: -4s; }
.auth-card { position: relative; z-index: 1; padding: 42px 40px 36px; border: 1px solid #ffffff88; border-radius: 24px; background: #ffffffed; box-shadow: 0 28px 75px #11142f55; backdrop-filter: blur(18px); }.auth-card:before { content: "✦"; position: absolute; top: 20px; right: 25px; color: #dedfff; font-size: 34px; }.auth-card h2 { margin: 10px 0 8px; color: #252b58; font-size: 30px; letter-spacing: -1px; }.auth-card p { color: #788397; }.auth-card input { border-color: #e0e2f0; background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s; }.auth-card input:focus { border-color: #7879df; box-shadow: 0 0 0 4px #7879df1c; transform: translateY(-1px); }.auth-card form button { background: linear-gradient(100deg, #5859cf, #7777e2); box-shadow: 0 10px 22px #5c5ed240; }.auth-card form button:hover { filter: brightness(1.05); transform: translateY(-2px); }.auth-contact { border: 1px solid #e5e5ff; background: linear-gradient(90deg, #f5f5ff, #fbf8ff); }.auth-card small { margin-top: 8px; }
@keyframes authFloat { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-14px, 22px, 0) scale(1.08); } }

/* 当前用户与响应式布局 */
.current-user { position: absolute; right: 16px; bottom: 63px; display: flex; align-items: center; gap: 9px; margin: 0; padding: 9px 10px; border: 1px solid #eceeff; border-radius: 10px; background: #fafaff; }.user-avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: linear-gradient(135deg, #5b5bd6, #8586e8); color: #fff; font-size: 13px; font-weight: 800; }.current-user strong { display: block; max-width: 125px; overflow: hidden; color: #414b60; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.current-user small { color: #9aa2b1; font-size: 10px; }
.current-user { width: calc(100% - 20px); color: inherit; text-align: left; }.current-user:hover { transform: none; background: #f2f3ff; }.profile-edit { margin-left: auto; color: #7779cf; font-size: 11px; }
.admin-shell { width: min(900px, calc(100% - 48px)); margin: 42px auto; }.admin-shell header { padding: 26px; border-radius: 15px; background: #fff; }.admin-shell h2 { margin: 7px 0; }.admin-shell p { color: #8791a2; font-size: 13px; }.admin-shell input { width: min(360px, 100%); margin-top: 10px; }.admin-user-list { display: grid; gap: 10px; margin-top: 15px; }.admin-user-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }.admin-user-card div { flex: 1; }.admin-user-card small { display: block; margin-top: 4px; color: #8e97a7; }.user-status { padding: 4px 8px; border-radius: 99px; font-size: 11px; }.user-status.active { background: #e8f7ef; color: #36805b; }.user-status.disabled { background: #fff0f2; color: #c45461; }
.admin-tools { display: flex; align-items: end; gap: 9px; }.admin-tools input { margin-top: 10px; }
.admin-user-empty { padding: 46px; color: #8d97a7; text-align: center; }
.admin-form-page { min-height: calc(100vh - 110px); padding-top: 8px; }.admin-form-page > .back-button { margin-bottom: 18px; }.admin-form-page form { display: grid; gap: 17px; max-width: 760px; margin: 0; padding: 42px; border-radius: 18px; background: #fff; box-shadow: 0 12px 32px #30375c0c; }.admin-form-page h2 { margin: 7px 0; font-size: 28px; }.admin-form-page p { color: #8791a2; font-size: 13px; }.admin-form-page label { display: grid; gap: 7px; color: #687386; font-size: 12px; font-weight: 700; }.admin-form-page input { padding: 12px; }.admin-form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 10px; } #admin-user-form-page[hidden] { display: none !important; }

/* 全页用户管理列表 */
#admin.tab.active { display: block; max-width: none; min-height: 100vh; margin: 0; padding: 0; }.admin-shell { width: 100%; margin: 0; padding: 34px 38px; }.admin-shell header { display: flex; align-items: end; justify-content: space-between; gap: 25px; padding: 0 0 22px; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; }.admin-shell header h2 { margin: 7px 0 4px; font-size: 27px; }.admin-tools { flex: 0 0 auto; }.admin-tools input { width: 280px; }.admin-user-list { gap: 0; margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }.admin-user-table-head, .admin-user-card { display: grid; grid-template-columns: minmax(205px,1.35fr) minmax(145px,1fr) 100px minmax(175px,1.1fr) 72px minmax(210px,auto); align-items: center; column-gap: 18px; }.admin-user-table-head { padding: 12px 20px; color: #8791a2; font-size: 12px; font-weight: 700; letter-spacing: .03em; background: #f8f9ff; }.admin-user-card { margin: 0; padding: 17px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }.admin-user-card:last-child { border-bottom: 0; }.admin-user-card:hover { background: #fafaff; }.admin-user-main strong { display: block; color: #303a50; }.admin-user-main small, .admin-user-date { display: block; margin-top: 4px; color: #8c96a5; font-size: 12px; }.admin-user-phone, .admin-user-role { color: #687487; font-size: 13px; }.admin-user-date { margin: 0; line-height: 1.65; }.admin-user-actions { display: flex; justify-content: flex-end; gap: 8px; }.admin-user-card .delete, .admin-user-card .edit-diary, .admin-user-card .primary-action { padding: 7px 9px; font-size: 12px; white-space: nowrap; }.admin-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 16px 2px; color: #8993a4; font-size: 12px; }.admin-pagination span { margin-right: auto; }.admin-pagination button { min-width: 32px; padding: 6px 9px; color: #596173; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }.admin-pagination button.active { color: #fff; border-color: #5c5bd7; background: #5c5bd7; }.admin-pagination button:disabled { cursor: not-allowed; opacity: .45; }
@media (max-width: 900px) { .admin-shell { padding: 22px 18px; }.admin-shell header { align-items: flex-start; flex-direction: column; }.admin-tools { width: 100%; }.admin-tools input { flex: 1; width: auto; }.admin-user-table-head { display: none; }.admin-user-card { grid-template-columns: 1fr auto; gap: 10px; }.admin-user-phone, .admin-user-role, .admin-user-date, .admin-user-actions { grid-column: 1 / -1; }.admin-user-actions { justify-content: flex-start; }.admin-user-card .user-status { grid-column: 2; grid-row: 1; }.current-user { position: static; margin: 8px 10px; } }
@media (max-width: 800px) { body { padding-top: 62px; } .sidebar { display: flex; align-items: center; gap: 10px; overflow-x: auto; width: 100%; height: 62px; padding: 10px 12px; }.sidebar h1 { flex: 0 0 auto; margin: 0; font-size: 15px; }.sidebar h1:before { margin-right: 4px; }.current-user { flex: 0 0 auto; margin: 0; padding: 5px 7px; border: 0; background: transparent; }.current-user small { display: none; }.current-user strong { max-width: 62px; }.sidebar nav { display: flex; flex: 0 0 auto; gap: 2px; }.sidebar nav button { padding: 7px 8px; font-size: 12px; white-space: nowrap; }.logout-button { position: static; flex: 0 0 auto; padding: 7px 8px; white-space: nowrap; }.content { min-width: 0; } .nav-tools, .prompt-workspace-actions { gap: 7px; } .search { width: 100%; } .nav-hero { gap: 16px; } .auth-card { padding: 32px 25px; }.auth-gate { padding: 16px; } }
