.account-entry { display: inline-flex; align-items: center; height: 32px; font: inherit; font-size: 13px; font-weight: 600; border: 1px solid #dcd0f7; border-radius: 8px; color: #3c00bd; background: #f1ecff; padding: 0 12px; white-space: nowrap; cursor: pointer; transition: background-color .15s, border-color .15s; }
.account-entry:hover { background: #e9e1ff; border-color: #c4b3f3; }
.account-entry:focus-visible { outline: 2px solid #5423e7; outline-offset: 2px; }
#profile-overlay { position: fixed; inset: 0; z-index: 150; }
#profile-overlay[hidden], #profile-overlay [hidden] { display: none !important; }
.profile-backdrop { position: absolute; inset: 0; width: 100%; background: #21173455; border: 0; color: transparent; cursor: default; }
#profile-drawer { position: absolute; inset: 0 0 0 auto; width: min(620px, 100%); max-width: 100%; overflow: auto; overscroll-behavior: contain; background: #fff; color: #1d1a26; border-left: 1px solid #e6e2ee; box-shadow: -12px 0 40px rgba(36, 16, 66, .14); padding: 24px 28px; font: 14px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; overflow-wrap: anywhere; box-sizing: border-box; }
#profile-drawer *, #profile-drawer *::before, #profile-drawer *::after { box-sizing: border-box; }
#profile-drawer header, .profile-identity { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
#profile-drawer h1 { font-size: 20px; font-weight: 700; margin: 0; }
#profile-drawer h2 { font-size: 17px; font-weight: 650; } #profile-drawer h3 { font-size: 14px; font-weight: 650; margin: 3px 0; }
#profile-drawer p { margin: 6px 0; } #profile-drawer a { color: #3c00bd; text-decoration: underline; text-underline-offset: 3px; }
.profile-status { min-height: 24px; color: #645e72; font-size: 12px; margin: 12px 0 20px !important; }
.profile-status.error { color: #a3313c; }
.profile-muted { color: #645e72; font-size: 12.5px; }
.profile-identity { padding-bottom: 15px; border-bottom: 1px solid #ece8f2; }
.profile-identity p { flex: 1 1 100%; order: 1; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.profile-button { min-height: 34px; border: 1px solid #5423e7; border-radius: 8px; background: #5423e7; padding: 7px 14px; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .15s, border-color .15s; }
.profile-button:hover:not(:disabled) { background: #4519cf; border-color: #4519cf; }
.profile-button.secondary { background: #fff; color: #3c00bd; border-color: #d6d0e2; }
.profile-button.secondary:hover:not(:disabled) { background: #f1ecff; border-color: #c4b3f3; }
.profile-button:disabled { cursor: wait; opacity: .5; }
.profile-card { margin: 12px 0; padding: 16px 18px; border: 1px solid #e6e2ee; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(29, 26, 38, .04); }
.profile-card.conflict { border-color: #ebcc8e; background: #fffbf2; }
.profile-eyebrow { color: #815513; font-size: 11px; font-weight: 650; }
.profile-value { white-space: pre-wrap; font-size: 14px; color: #1d1a26; }
.profile-source { font-size: 12px; color: #645e72; margin-top: 12px; }
.profile-source summary { cursor: pointer; } .profile-source blockquote { border-left: 2px solid #d9caeb; padding-left: 12px; white-space: pre-wrap; margin: 10px 0; }
.profile-section-title { margin: 24px 0 10px; }
.profile-notice { padding: 14px 16px; border: 1px solid #e2d8fb; border-radius: 12px; background: #f6f3ff; font-size: 12.5px; margin: 14px 0; }
.profile-notice .profile-button { margin: 8px 8px 0 0; }
.profile-form { display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin-top: 15px; }
.profile-form > button { align-self: flex-start; }
.profile-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: #474255; }
.profile-field input, .profile-field textarea, .profile-field select { font: inherit; font-size: 14px; font-weight: 400; width: 100%; border: 1px solid #d6d0e2; background: white; color: #1d1a26; border-radius: 8px; padding: 9px 12px; }
.profile-field input:focus, .profile-field textarea:focus, .profile-field select:focus { border-color: #8d74e8; box-shadow: 0 0 0 3px rgba(84, 35, 231, .12); outline: none; }
.profile-field textarea { min-height: 94px; resize: vertical; }
#profile-drawer :focus-visible { outline: 2px solid #5423e7; outline-offset: 2px; }
/* Login state: a centered window instead of the side drawer. */
#profile-overlay.is-login { display: grid; place-items: center; padding: 16px; }
#profile-overlay.is-login .profile-backdrop { background: rgba(33, 23, 52, .4); backdrop-filter: blur(3px); }
#profile-overlay.is-login #profile-drawer { position: relative; inset: auto; width: min(440px, 100%); max-height: calc(100dvh - 32px); padding: 40px 34px 30px; border: 1px solid #e6e2ee; border-radius: 22px; box-shadow: 0 30px 80px rgba(36, 16, 66, .24); animation: profile-login-in .22s ease-out; }
@keyframes profile-login-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
#profile-overlay.is-login #profile-drawer h1 { font-size: 24px; letter-spacing: -.01em; }
#profile-overlay.is-login #btn-close-profile { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #645e72; font-size: 0; }
#profile-overlay.is-login #btn-close-profile::before { content: "×"; font-size: 24px; font-weight: 400; line-height: 38px; }
#profile-overlay.is-login #btn-close-profile:hover { background: #f1ecff; color: #3c00bd; }
#profile-overlay.is-login .profile-status { margin: 8px 0 14px !important; }
#profile-overlay.is-login .profile-form { gap: 14px; margin-top: 22px; }
#profile-overlay.is-login .profile-field input { min-height: 46px; font-size: 15px; }
#profile-overlay.is-login .profile-form button, #profile-overlay.is-login .profile-code-step button { align-self: stretch; width: 100%; min-height: 46px; font-size: 14px; }
#profile-overlay.is-login .profile-code-step { display: flex; flex-direction: column; gap: 12px; }
#profile-overlay.is-login .profile-code-step[hidden] { display: none !important; }
#profile-overlay.is-login input[autocomplete="one-time-code"] { font: 500 20px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .45em; text-align: center; }
@media (prefers-reduced-motion: reduce) { #profile-overlay.is-login #profile-drawer { animation: none; } }
@media (max-width: 640px) { #profile-drawer { padding: 18px; } #chat-pane > header { padding-inline: 12px; gap: 6px; } #chat-pane > header > div:last-child { gap: 5px; } #chat-pane > header button.header-button, #chat-pane > header .account-entry { padding-inline: 8px; font-size: 12px; } #chat-pane > header > div:first-child > span { font-size: 16px; letter-spacing: 0; } }

.profile-code-step { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding-top: 15px; border-top: 1px solid #ece8f2; }
.profile-code-step > button { align-self: flex-start; }
.profile-code-step input { letter-spacing: .16em; font-variant-numeric: tabular-nums; }
.profile-code-step input::placeholder { letter-spacing: normal; }

.profile-entry { padding: 12px 14px; margin: 8px 0; }
.profile-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.profile-fact-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid #eee8f4; }
.profile-fact-body { flex: 1; min-width: 0; }
.profile-field-name { font-size: 12px; color: #62546d; }
.profile-fact-row .profile-value { margin: 2px 0 !important; font-size: 13px; }
.profile-fact-row .profile-source { margin-top: 3px; font-size: 11px; }
.profile-field-actions { flex: none; margin: 0; gap: 3px; }
.profile-field-actions .profile-button { padding: 3px 5px; font-size: 11px; }
.profile-fact-row > .profile-form { width: 100%; margin-top: 0; }
.profile-confirm-button { position: relative; }
.profile-confirm-badge { position: absolute; top: -7px; right: -7px; min-width: 17px; padding: 0 4px; border-radius: 12px; background: #ba283e; color: #fff; font-size: 10px; line-height: 17px; }
@media (max-width: 420px) { .profile-field-actions { flex-direction: column; } .profile-entry-head { align-items: flex-start; } }

.profile-mcp-scopes { border: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-mcp-tasks { margin: 20px 0; }
.profile-mcp-task { min-width: 0; padding: 12px 0; border-bottom: 1px solid #ece8f2; }
.profile-mcp-task-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-mcp-task-heading h4 { margin: 0; font-size: 14px; font-weight: 600; }
.profile-mcp-task-heading .profile-button { flex-shrink: 0; }
.profile-mcp-task-example { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-mcp-task-names { padding-left: 20px; margin: 8px 0 18px; font-size: 13px; }
.profile-mcp-scopes legend { font-size: 12.5px; margin-bottom: 8px; }
.profile-mcp-scopes label { display: flex; align-items: center; gap: 8px; }
.profile-mcp-scopes input { accent-color: #5423e7; }
.profile-mcp-config { margin-top: 12px; }
.profile-mcp-config summary { font-weight: 600; cursor: pointer; }
.profile-mcp-config pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; background: #fff; border: 1px solid #e6e2ee; border-radius: 8px; font-size: 12px; }
.profile-token-once textarea { min-height: 72px; font-family: monospace; }
.profile-mcp-audit { padding-left: 20px; font-size: 12px; }
.profile-inbox-item .profile-source blockquote { margin: 5px 0; }
/* 第十六批：从其他 AI 导入记忆。 */
.profile-memory-import { gap: 14px; }
.profile-memory-import .profile-section-title { margin: 0; }
.profile-memory-step { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid #ece6f7; border-radius: 12px; background: #fcfbff; }
.profile-memory-step > button { align-self: flex-start; }
.profile-memory-step-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1d1a26; }
.profile-memory-step-head strong { font-weight: 600; }
.profile-memory-step-index { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #5423e7; color: #fff; font-size: 11.5px; font-weight: 700; }
.profile-memory-prompt, .profile-memory-answer { width: 100%; font: inherit; font-size: 13px; line-height: 1.6; color: #1d1a26; border: 1px solid #d6d0e2; border-radius: 8px; padding: 9px 12px; background: #fff; resize: vertical; }
.profile-memory-prompt { min-height: 120px; max-height: 220px; font-size: 12px; color: #474255; background: #f7f5fb; }
.profile-memory-answer { min-height: 150px; }
.profile-memory-answer:focus { border-color: #8d74e8; box-shadow: 0 0 0 3px rgba(84, 35, 231, .12); outline: none; }
.profile-memory-hint { margin: 0; font-size: 12px; }
.profile-memory-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-memory-result:empty { display: none; }
.profile-memory-result { padding: 10px 12px; border-radius: 10px; background: #f6f3ff; font-size: 12.5px; color: #3c2a7a; }
.profile-batch-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; background: #f6f3ff; border: 1px solid #e6e2ee; border-radius: 10px; }
.profile-selection { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; cursor: pointer; padding: 5px 0; }
.profile-selection input { flex: none; width: 18px; height: 18px; accent-color: #5423e7; }
.profile-selection span, .profile-confirm-group, .profile-batch-failures, .profile-import-history { min-width: 0; overflow-wrap: anywhere; }
.profile-batch-toolbar > .profile-selection { flex-basis: 100%; }
/* Per-card checkbox sits in the corner; its label stays for screen readers only. */
.profile-selectable { position: relative; padding-right: 48px; }
.profile-selection-compact { position: absolute; top: 12px; right: 12px; padding: 4px; }
.profile-selection-compact span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.profile-confirm-group { margin-top: 16px; }
.profile-batch-failures ul { padding-left: 20px; }
.profile-batch-toolbar button:disabled { opacity: .5; cursor: default; }
.profile-memory-prompt, .profile-memory-answer { box-sizing: border-box; min-width: 0; }
