:root { --topper-bar-height: 68px; --topper-accent: #4b61e9; --topper-line: #e7eaf1; --topper-bg: #f8fafc; --topper-text: #18223b; --topper-muted: #64748b; --topper-card: #fff; }
.dark { --topper-line: #303849; --topper-bg: #111722; --topper-text: #e7edf8; --topper-muted: #a2aec4; --topper-card: #1b2332; }
body.topper-ui { overflow: hidden; color: var(--topper-text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
.topper-ui #root { position:fixed; top:var(--topper-bar-height); left:0; width:100%; height:calc(var(--topper-vh,100dvh) - var(--topper-bar-height)); }
.topper-ui #root > div:first-child { height:100% !important; margin-top:0; }
.topper-bar { position: fixed; inset: 0 0 auto; height: var(--topper-bar-height); z-index: 70; box-sizing: border-box; background: var(--topper-card); border-bottom: 1px solid var(--topper-line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; }
.topper-brand { display:flex; align-items:center; gap:10px; min-width:0; text-decoration:none; color:var(--topper-text); font-size:19px; font-weight:750; letter-spacing:-.4px; }
.topper-brand img { width:32px; height:32px; flex-shrink:0; }
.topper-brand small { font-size:12px; font-weight:400; color:var(--topper-muted); letter-spacing:0; padding-left:8px; border-left:1px solid var(--topper-line); }
.topper-wallet { display:flex; align-items:center; gap:12px; white-space:nowrap; }
.topper-balance { font-size:14px; color:var(--topper-text); font-variant-numeric:tabular-nums; }
.topper-balance-label { color:var(--topper-muted); margin-right:5px; font-size:12px; }
.topper-recharge { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:0 18px; border-radius:12px; background:var(--topper-accent); color:white; text-decoration:none; font-size:14px; font-weight:600; box-shadow:0 4px 12px #4b61e91c; }
.topper-recharge:hover { background:#3d50cc; }
.topper-recharge:focus-visible,.topper-brand:focus-visible { outline:3px solid #8e9df6; outline-offset:3px; }
.topper-status { display:none; position:fixed; z-index:65; inset:auto 16px 16px; max-width:580px; margin:auto; border:1px solid var(--topper-line); background:var(--topper-card); color:var(--topper-text); border-radius:14px; padding:14px 18px; box-shadow:0 8px 35px #11182718; font-size:14px; }
.topper-status[data-show='true'] { display:block; }
.topper-status a { color:var(--topper-accent); text-decoration:underline; margin-left:6px; }
.topper-ui [data-testid='nav-panel-conversations'] { color:var(--topper-accent); }
.topper-ui [id='endpoint-河对岸AI-settings'],.topper-ui [id='endpoint-河对岸AI-settings'],.topper-ui [aria-label='使用麦克风'],.topper-ui [aria-label='Use microphone'],.topper-ui [aria-label='Attach and tools'],.topper-ui [aria-label='附件和工具'],.topper-ui [aria-label='大声朗读'],.topper-ui [aria-label='Read aloud'] { display:none !important; }
.topper-ui .topper-empty-projects { display:none !important; }
.topper-ui [id='endpoint-河对岸AI-menu'] { display:none !important; }
.topper-ui #prompt-textarea { font-size:16px; line-height:1.65; padding-top:16px; padding-bottom:16px; }
.topper-ui #prompt-textarea::placeholder { color:var(--topper-muted); }
.topper-ui form:has(#prompt-textarea) { max-width:860px; margin-inline:auto; }
.topper-ui .markdown { line-height:1.85; }
.topper-ui .markdown pre { max-width:100%; overflow-x:auto; border-radius:12px; }
.topper-ui .markdown table { display:block; max-width:100%; overflow-x:auto; }
@media (max-width:640px) {
  :root { --topper-bar-height:60px; }
  .topper-bar { padding:8px 12px; gap:8px; }
  .topper-brand { gap:7px; font-size:17px; }
  .topper-brand img { width:28px; height:28px; }
  .topper-brand small { display:none; }
  .topper-wallet { gap:8px; }
  .topper-balance { font-size:13px; }
  .topper-balance-label { font-size:11px; margin-right:3px; }
  .topper-recharge { min-height:38px; padding:0 13px; border-radius:10px; font-size:13px; }
  .topper-ui #prompt-textarea { min-height:58px; max-height:32dvh; padding:13px 14px; }
  .topper-ui .markdown { font-size:16px; line-height:1.8; overflow-wrap:anywhere; }
  .topper-ui form:has(#prompt-textarea) { padding-bottom:env(safe-area-inset-bottom,0px); }
  .topper-status { bottom:calc(12px + env(safe-area-inset-bottom,0px)); }
}
@media (prefers-reduced-motion:reduce) { .topper-ui *, .topper-ui *::before, .topper-ui *::after { animation-duration:0.01ms !important; transition-duration:0.01ms !important; } }

.topper-effort { display:flex; align-items:center; gap:8px; color:var(--topper-muted); font-size:12px; margin-left:auto; }
.topper-effort select { border:1px solid var(--topper-line); border-radius:10px; background:var(--topper-bg); color:var(--topper-text); min-height:38px; padding:0 26px 0 10px; font-size:13px; }
.topper-effort select:focus-visible { outline:2px solid var(--topper-accent); outline-offset:2px; }
@media(max-width:640px) { .topper-effort { gap:0; margin:0; } .topper-effort > span { display:none; } .topper-effort select { max-width:80px; padding-left:8px; font-size:12px; min-height:38px; } .topper-wallet { gap:6px; } .topper-bar { gap:6px; } }
/* Composer controls use the same surface tokens as the rest of the chat. */
.topper-ui [data-testid='model-selector-button'] { position:absolute!important; width:1px!important; height:1px!important; overflow:hidden!important; opacity:0!important; pointer-events:none!important; }
.topper-switching [role='listbox'],.topper-switching [role='option'] { opacity:0!important; }
.topper-ui div:has(> .topper-composer-tools) { position:relative!important; display:flex!important; flex-direction:column; }
.topper-ui div:has(> .topper-composer-tools) #prompt-textarea { min-height:128px!important; padding-bottom:62px!important; }
.topper-composer-tools { position:absolute; left:12px; right:56px; bottom:12px; display:flex; align-items:center; gap:7px; z-index:25; min-height:36px; color:var(--topper-text); }
.topper-composer-tools button { border:1px solid var(--topper-line); background:var(--topper-card); color:var(--topper-text); border-radius:20px; height:36px; padding:0 11px; font-size:13px; cursor:pointer; }
.topper-composer-tools button:hover { background:var(--topper-bg); }
.topper-composer-tools button:focus-visible { outline:2px solid var(--topper-accent); outline-offset:2px; }
.topper-composer-tools .topper-attach { font-size:24px; width:36px; padding:0; border-color:transparent; }
.topper-thinking { display:flex; gap:7px; align-items:center; min-width:0; }
.topper-mode-name { max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topper-effort-name { color:var(--topper-muted); white-space:nowrap; }
.topper-composer-tools .topper-voice { border:0; width:36px; padding:8px; }
.topper-voice[data-listening='true'] { color:#dc2626; background:#fff0f0; }
.topper-upload-status { font-size:12px; color:var(--topper-muted); }
.topper-think-panel { position:fixed; width:330px; max-width:calc(100vw - 20px); box-sizing:border-box; padding:20px; z-index:100; border:1px solid var(--topper-line); border-radius:26px; background:var(--topper-card); color:var(--topper-text); box-shadow:0 12px 38px #11182720; }
.topper-think-panel[hidden] { display:none; }
.topper-panel-heading { display:flex; justify-content:space-between; align-items:center; font-size:20px; }
.topper-panel-heading>span { font-size:30px; color:var(--topper-text); }
.topper-panel-heading button { border:0; background:none; color:var(--topper-muted); font-size:27px; width:36px; height:36px; }
.topper-mode-label { display:flex; flex-direction:column; align-items:center; font-size:12px; color:var(--topper-muted); gap:5px; }
.topper-mode-label select { background:transparent; color:var(--topper-text); border:0; font-size:17px; text-align:center; min-height:36px; max-width:100%; }
#topper-mode-detail { text-align:center; margin:0 0 14px; font-size:12px; color:var(--topper-muted); }
.topper-range-label { display:block; font-size:13px; color:var(--topper-muted); }
.topper-range-label input { display:block; width:100%; height:36px; accent-color:var(--topper-text); cursor:pointer; }
.topper-range-ticks { display:flex; justify-content:space-between; font-size:11px; color:var(--topper-muted); }
.topper-panel-help { font-size:11px; line-height:1.6; color:var(--topper-muted); margin:14px 0 0; }
@media(max-width:640px){ .topper-composer-tools { left:8px; right:52px; gap:3px; bottom:9px; } .topper-mode-name { max-width:100px; } .topper-ui div:has(> .topper-composer-tools) #prompt-textarea { min-height:125px!important; } .topper-composer-tools .topper-thinking {padding:0 9px;font-size:12px;} .topper-upload-status{max-width:45px;overflow:hidden;white-space:nowrap;} }
.topper-upload-chips { position:relative; display:flex; flex:0 0 auto; flex-wrap:wrap; gap:6px; margin:12px 14px 0; max-height:100px; overflow:auto; }
.topper-upload-chips[hidden] { display:none; }
.topper-upload-chips>span { flex-shrink:0; display:inline-flex; align-items:center; white-space:nowrap; max-width:240px; border:1px solid var(--topper-line); border-radius:8px; padding:4px 7px; background:var(--topper-bg); font-size:12px; color:var(--topper-text); }
.topper-upload-chips>span>span { overflow:hidden; text-overflow:ellipsis; }
.topper-upload-chips button { background:transparent; border:0; font-size:16px; margin-left:5px; color:var(--topper-muted); }

/* Keep attachments left and model/dictation controls beside Send. */
.topper-composer-tools .topper-attach { order:0; }
.topper-upload-status { order:1; margin-right:auto; }
.topper-composer-tools .topper-thinking { order:2; }
.topper-composer-tools .topper-voice { order:3; }
/* Explicit model selection and a compact, readable strength panel. */
.topper-think-panel { width:350px; padding:18px; border-radius:20px; }
.topper-panel-heading { margin-bottom:16px; font-size:16px; }
.topper-panel-heading button { font-size:24px; width:28px; height:28px; line-height:1; }
.topper-mode-label { align-items:stretch; gap:7px; font-size:12px; }
.topper-mode-label select { appearance:auto; -webkit-appearance:menulist; width:100%; min-height:44px; border:1px solid var(--topper-line); border-radius:10px; background:var(--topper-bg); color:var(--topper-text); font-size:14px; text-align:left; padding:8px 10px; }
#topper-mode-detail { margin:7px 0 20px; font-size:12px; text-align:left; }
.topper-strength-heading { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--topper-muted); }
.topper-strength-heading strong { margin-left:auto; color:var(--topper-text); padding:3px 8px; border-radius:6px; background:var(--topper-bg); font-size:12px; }
.topper-strength-heading button { background:none; border:0; color:var(--topper-muted); cursor:pointer; font-size:11px; padding:4px; }
.topper-range-label input { appearance:none; -webkit-appearance:none; height:8px; border:0; border-radius:10px; margin:20px 0 16px; background:linear-gradient(to right,var(--topper-text) var(--effort-progress,0%),var(--topper-line) var(--effort-progress,0%)); }
.topper-range-label input::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:22px; height:22px; border-radius:50%; background:var(--topper-card); border:1px solid var(--topper-line); box-shadow:0 2px 7px #11182725; }
.topper-range-label input::-moz-range-thumb { width:22px; height:22px; border-radius:50%; background:var(--topper-card); border:1px solid var(--topper-line); box-shadow:0 2px 7px #11182725; }
.topper-think-panel[data-claude='true'] .topper-range-label,.topper-think-panel[data-claude='true'] .topper-range-ticks { opacity:.45; }
.topper-panel-help { margin:14px 0 0; font-size:12px; line-height:1.65; }
/* Scope the confirmation design to conversation deletion only. */
.topper-ui #delete-conversation-dialog { width:calc(100vw - 32px)!important; max-width:420px!important; min-height:0; height:auto; padding:24px; gap:16px; border:1px solid var(--topper-line); border-radius:20px; background:var(--topper-card); color:var(--topper-text); box-shadow:0 18px 65px #11182726; }
.topper-ui #delete-conversation-dialog>div:first-child { text-align:left; margin:0; }
.topper-ui #delete-conversation-dialog h2 { font-size:18px; font-weight:650; line-height:1.4; margin:0; }
.topper-ui #delete-conversation-description { white-space:normal; overflow-wrap:anywhere; overflow:visible; text-overflow:clip; font-size:14px; line-height:1.7; color:var(--topper-muted); }
.topper-ui #delete-conversation-description strong { color:var(--topper-text); font-weight:600; margin-right:4px; }
.topper-ui #delete-conversation-description::after { content:'删除后无法恢复，请确认是否继续。'; display:block; margin-top:8px; font-size:12px; }
.topper-ui #delete-conversation-dialog>div:last-of-type { display:flex; flex-direction:row; justify-content:flex-end; gap:10px; padding-top:4px; }
.topper-ui #delete-conversation-dialog button:not(.sr-only) { min-height:40px; min-width:78px; padding:8px 16px; border-radius:10px; font-size:14px; font-weight:600; }
.topper-ui #delete-conversation-dialog button:disabled { cursor:wait; }
.topper-ui #delete-conversation-dialog button[disabled] svg { width:18px; height:18px; }
@media(max-width:480px) { .topper-ui #delete-conversation-dialog { padding:20px; border-radius:18px; } .topper-ui #delete-conversation-dialog>div:last-of-type { padding-top:8px; } .topper-ui #delete-conversation-dialog button:not(.sr-only) { min-height:44px; } }
.topper-send-attachments { position:absolute; right:8px; bottom:8px; z-index:30; display:flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border:0; border-radius:50%; background:var(--topper-text); color:var(--topper-card); cursor:pointer; }
.topper-send-attachments[hidden] { display:none; }
.topper-send-attachments:focus-visible { outline:3px solid var(--topper-accent); outline-offset:3px; }
.topper-ui #delete-conversation-dialog button:disabled:not(.sr-only)::after { content:'删除中…'; margin-left:6px; }
