/* Layout matched to DeepSeek's current public chat client. */
:root { --sider-width: 260px; --msg-max: 800px; --msg-pad: 0px; --radius: 24px; }
body { overflow: hidden; }
.app { height: 100dvh; }
.sidebar { padding: 16px 12px; border-right: 1px solid var(--border-soft); }
.brand { padding: 4px 8px 24px; gap: 7px; }
.brand .logo { width: 30px; height: 30px; }
.brand .name { color: #4d6bfe; font-size: 24px; font-weight: 700; }
.new-chat { justify-content: flex-start; padding: 0 16px; border-radius: 24px; background: var(--nav-active); height: 40px; }
.conv-list { flex: 1; padding-top: 8px; }
.conv-row { display: flex; align-items: center; position: relative; flex-shrink: 0; }
.conv-row .conv-item { padding-right: 28px; }
.conv-menu { position: absolute; right: 4px; top: 6px; z-index: 2; border-radius: 8px; }
.conv-menu summary { list-style: none; cursor: pointer; width: 26px; text-align: center; }
.conv-menu summary::-webkit-details-marker { display: none; }
.conv-menu[open] { background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: 0 6px 18px #0002; }
.conv-menu button { display: block; white-space: nowrap; background: transparent; border: 0; color: var(--text); padding: 8px 16px; cursor: pointer; }
.topbar { height: 64px; padding: 0 24px; gap: 8px; }
.model-pill { margin-right: auto; padding-left: 0; cursor: default; font-size: 18px; color: var(--text); }
.model-pill svg { display: none; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 20px; }
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#sidebarToggle { display: none; }
.main.empty { justify-content: center; padding-bottom: 14vh; }
.main.empty .topbar { position: absolute; top: 0; left: var(--sider-width); right: 0; }
.main.empty .chat { flex: 0 0 auto; overflow: visible; }
.main.empty .chat-inner { padding: 0 24px 24px; }
.welcome { padding-top: 0; }
.welcome .big-logo { width: 46px; height: 46px; margin-bottom: 14px; }
.welcome h1 { font-size: 24px; font-weight: 600; margin: 0; }
.welcome .sub, .chips { display: none; }
.main.empty .composer-wrap { padding-bottom: 0; }
.composer-wrap { padding: 10px 24px 0; }
.composer { padding: 14px 12px 10px 16px; background: var(--bg-input); }
.composer textarea { min-height: 58px; padding: 0 0 16px; font-size: 16px; }
.composer:focus-within { border-color: var(--border); box-shadow: none; }
.composer-foot { gap: 6px; }
.composer-tools { gap: 8px; }
.composer-tools .tool-btn { height: 32px; padding: 0 11px; border-color: var(--border); font-size: 12px; }
.composer-tools .tool-btn.active { border-color: var(--accent); }
.composer-tools .lbl { display: inline; }
.send { width: 34px; height: 34px; }
.disclaimer { text-align: center; font-size: 11px; line-height: 28px; color: var(--text-caption); }
.main.empty .disclaimer { visibility: hidden; }
.chat-inner { max-width: 800px; padding: 20px 0 32px; }
.msg { padding: 20px 0; }
.msg.assistant { gap: 0; }
.msg.assistant .ai-avatar, .msg.assistant .who { display: none; }
.msg.assistant .body { font-size: 16px; line-height: 1.8; }
.msg.user .bubble { border-radius: 20px; padding: 10px 18px; max-width: 85%; white-space: normal; }
.think { background: transparent; border: 0; border-radius: 0; }
.think summary { padding: 4px 0; }
.think summary::before { content: '✧'; }
.think .think-body { border-top: 0; border-left: 2px solid var(--border); padding: 0 0 0 14px; margin-top: 10px; font-size: 14px; }
.think.done summary .lbl::after { content: '已深度思考'; }
.answer-actions { display: flex; gap: 4px; margin-top: 14px; }
.answer-actions button { color: var(--text-tertiary); border: 0; background: transparent; padding: 4px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.answer-actions button:hover { color: var(--text); background: var(--bg-hover); }
.attachments, .sent-files { display: flex; gap: 8px; flex-wrap: wrap; }
.attachments:empty { display: none; }
.attachments { padding-bottom: 12px; }
.attachment { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); padding: 10px 28px 10px 12px; max-width: 240px; min-width: 120px; font-size: 13px; }
.attachment span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment small { display: block; font-size: 11px; color: var(--text-tertiary); }
.attachment button { position: absolute; top: 3px; right: 5px; border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 18px; }
.sent-files { margin-bottom: 8px; }
.dragging { outline: 2px dashed var(--accent); }
.icon-btn.recording { color: #e5484d; background: #e5484d18; animation: blink 1s infinite; }
.sidebar-backdrop { display: none; }
:root[data-theme="light"] { --bg-sidebar: #f9fbff; --bg-input: #f3f4f6; --nav-active: #e9edff; }
@media (max-width: 1150px) { .chat-inner { margin: 0 24px; } }
@media (max-width: 900px) {
  #sidebarToggle { display: inline-flex; }
  .main.empty .topbar { left: 0; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; display: flex; transform: translateX(-100%); transition: transform .2s; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: #0005; border: 0; z-index: 20; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; }
  .main.empty { padding-bottom: 12vh; }
  .welcome h1 { font-size: 20px; }
  .chat-inner { margin: 0 18px; padding-left: 0; padding-right: 0; }
  .main.empty .chat-inner { padding-left: 0; padding-right: 0; }
  .composer-wrap { padding-left: 12px; padding-right: 12px; }
  .composer-tools { gap: 4px; }
  .composer-tools .tool-btn { padding: 0 8px; gap: 4px; }
  .composer-foot { gap: 2px; }
  .icon-btn { width: 28px; }
  .msg.assistant .body { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Measured from the signed-in official client on 2026-11-14. */
:root { --sider-width: 261px; --msg-max: 776px; }
.sidebar { padding: 6px 12px 0; }
.brand { height: 52px; padding: 0 4px; }
.brand .name { font-size: 23px; }
.brand .logo { width: 26px; height: 26px; }
#sideCollapse { margin-left: auto; }
.new-chat { margin-top: 12px; font-size: 14px; }
.topbar { padding: 0 16px; height: 64px; justify-content: flex-start; }
.top-logo { width: 28px; height: 28px; margin-right: 12px; display: none; }
.header-tools { display: none; align-items: center; gap: 2px; background: var(--bg-input); padding: 2px; border: 1px solid var(--border); border-radius: 24px; }
.header-tools .icon-btn { width: 34px; height: 34px; }
#sidebarToggle { display: inline-flex; }
.sidebar-collapsed .sidebar { display: none; }
.sidebar-collapsed .main.empty .topbar { left: 0; }
.sidebar-collapsed .top-logo, .sidebar-collapsed .header-tools { display: flex; }
.side-settings { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 12px; border: none; border-radius: 12px; background: transparent; color: var(--text-secondary); font: inherit; cursor: pointer; }
.side-settings:hover { background: var(--bg-hover); }
.side-settings svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.main.empty { padding-bottom: 64px; }
.main.empty .chat-inner { margin: 0; padding: 0 32px 32px; max-width: none; }
.welcome { flex-direction: row; gap: 10px; justify-content: center; }
.welcome .big-logo { width: 34px; height: 28px; margin: 0; }
.welcome h1 { font-size: 24px; font-weight: 600; line-height: 28px; }
.composer-wrap { width: 100%; max-width: 840px; align-self: center; padding: 10px 32px 0; }
.main.empty .composer-wrap { padding-top: 0; }
.composer { padding: 4px 0 0; border-color: var(--border-soft); }
.composer textarea { min-height: 60px; line-height: 24px; padding: 12px 12px 0 16px; }
.composer-foot { padding: 12px; min-height: 58px; }
.composer-tools .tool-btn { font-size: 13px; }
.composer-tools .tool-btn svg { width: 16px; height: 16px; }
.composer-tools .tool-btn.active { border-color: transparent; }
.attachments { padding: 8px 12px; }
.main.empty .disclaimer { display: none; }
.chat-inner { max-width: 840px; padding: 20px 44px 32px; margin: 0 auto; width: 100%; }
.history-search { width: min(600px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg); color: var(--text); }
.history-search::backdrop { background: #0006; }
.search-heading { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 12px; }
.history-search input { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; padding: 12px; color: var(--text); font: inherit; }
#historyResults { max-height: 50vh; overflow: auto; padding-top: 12px; }
#historyResults button { display: block; width: 100%; text-align: left; border: 0; padding: 10px; border-radius: 8px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
#historyResults button:hover { background: var(--bg-hover); }
@media (max-width: 1023px) { .composer-wrap { max-width: 712px; } .chat-inner { max-width: 712px; padding-left: 36px; padding-right: 36px; } }
@media (max-width: 900px) {
  .header-tools, .top-logo { display: flex; }
  .sidebar-collapsed .sidebar { display: flex; }
}
@media (max-width: 560px) {
  .composer-wrap { padding-left: 16px; padding-right: 16px; }
  .chat-inner { padding-left: 20px; padding-right: 20px; }
  .welcome h1 { font-size: 20px; }
  .welcome .big-logo { width: 28px; height: 24px; }
  .main.empty .chat-inner { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 439px) { .composer textarea { min-height: 42px; } }

/* Reply tools keep their SVGs while labels and playback state change. */
.answer-actions { gap: 4px; align-items: center; }
.answer-actions button { width: 30px; height: 30px; padding: 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.answer-actions button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.answer-actions button:disabled { opacity: .35; cursor: default; }
.version-nav { display: flex; align-items: center; gap: 2px; margin-right: 6px; color: var(--text-tertiary); font-size: 12px; }
.version-nav button { width: 24px; }
.speech-stop { display: none; }
.speech-playing .speech-ready, .speech-loading .speech-ready { display: none; }
.speech-playing .speech-stop { display: block; fill: currentColor; stroke: none; }
.speech-loading { position: relative; }
.speech-loading::after { content: ''; width: 13px; height: 13px; border: 1.6px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.speech-playing { color: var(--accent) !important; }

.speech-loading svg { display: none; }

/* Keep paid speech hidden until this deployment explicitly reports support. */
.answer-actions .speech-button { display: none; }
html[data-tts-enabled="true"] .answer-actions .speech-button { display: inline-flex; }
