html { color-scheme: dark; }
html body { --bg: #212121; --panel: #171717; --text: #ececec; --sub: #b4b4b4; --accent: #ececec; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif; }
html body * { box-sizing: border-box; }
html body .app { height: 100dvh; overflow: hidden; flex-direction: row; min-height: 0; }
html body button { font: inherit; }
html body button:focus-visible, html body select:focus-visible, html body .chat-item:focus-visible { outline: 2px solid #777; outline-offset: 3px; }
html body .sidebar { width: 260px; flex: 0 0 260px; padding: 14px 12px; border-right: 1px solid #292929; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding: 0 8px; }
.brand-mark { font-size: 34px; line-height: 40px; }
html body .icon-button { border: 0; background: transparent; color: #b4b4b4; cursor: pointer; width: 36px; height: 36px; border-radius: 8px; }
html body .icon-button:hover { background: #303030; }
html body .new-chat { color: #ececec; border: 0; text-align: left; padding: 10px 12px; border-radius: 9px; font-size: 14px; display: flex; gap: 12px; align-items: center; }
html body .new-chat:hover, html body .chat-item:hover { background: #292929; }
.history-label { color: #a0a0a0; font-size: 12px; padding: 28px 12px 8px; }
html body .chat-list { margin: 0; display: block; white-space: normal; min-height: 0; }
html body .chat-item { padding: 10px 12px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
html body .chat-item.active { background: #303030; }
html body .sidebar-notice { background: #242424; color: #b4b4b4; font-size: 11px; line-height: 1.7; padding: 12px; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 16px 8px 4px; font-size: 13px; }
.profile-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #414141; }
.sidebar-profile small { display: block; color: #a0a0a0; font-size: 11px; margin-top: 3px; }
html body .main { min-width: 0; position: relative; }
html body .header { height: 64px; flex-shrink: 0; border: 0; display: flex; align-items: center; gap: 12px; padding: 12px 24px; }
.header-brand { font-size: 20px; font-weight: 600; color: #ececec; }
.header-chevron { font-size: 18px; color: #999; }
html body .header select { background: #212121; border: 1px solid #424242; color: #b4b4b4; font-size: 12px; max-width: 180px; width: auto; border-radius: 16px; }
.training-badge { margin-left: auto; border: 1px solid #424242; border-radius: 20px; padding: 6px 12px; font-size: 12px; color: #b4b4b4; white-space: nowrap; }
html body .chat-box { max-width: 820px; min-height: 0; padding: 30px 28px; margin: 0 auto; }
html body .msg { margin-bottom: 28px; gap: 0; }
html body .avatar { display: none; }
html body .content { min-width: 0; max-width: 100%; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
html body .content a { color: #7ab7ff; }
html body .content a:hover { color: #a8d0ff; }
html body .user { justify-content: flex-end; }
html body .user .content { background: #303030; border-radius: 24px; padding: 10px 20px; max-width: 80%; }
html body .content p:first-child { margin-top: 0; }
html body .content p:last-child { margin-bottom: 0; }
html body .bot .content { width: 100%; padding: 8px 0; }
html body .input-area { background: #212121; padding: 12px 24px 10px; position: static; }
html body .input-wrapper { max-width: 768px; background: #303030; border: 1px solid #424242; border-radius: 28px; padding: 14px 16px 14px 22px; align-items: flex-end; gap: 12px; box-shadow: 0 2px 8px #00000014; }
#msg { width: 100%; min-width: 0; resize: none; border: 0; outline: none; background: transparent; color: #ececec; font: inherit; font-size: 16px; line-height: 28px; max-height: 180px; }
#msg::placeholder { color: #b4b4b4; opacity: 1; }
html body .input-wrapper:focus-within { border-color: #666; }
html body .input-wrapper button { border-radius: 50%; width: 36px; height: 36px; padding: 0; flex: 0 0 36px; font-size: 24px; background: #ececec; color: #171717; }
html body .input-wrapper button:disabled { opacity: .3; cursor: wait; }
.composer-note { flex-shrink: 0; text-align: center; color: #a0a0a0; font-size: 11px; line-height: 1.6; padding: 10px 24px max(10px, env(safe-area-inset-bottom)); }
.composer-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.welcome { text-align: center; margin-top: auto; padding: 20px; }
.welcome[hidden] { display: none; }
.welcome h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 500; margin: 0 0 12px; letter-spacing: -.7px; }
html body .empty-chat .chat-box { display: none; }
html body .empty-chat .input-area { margin-bottom: auto; padding-bottom: 64px; }
.sidebar-backdrop { display: none; }
html body .sidebar-collapsed .sidebar { display: none; }
@media (max-width: 768px) {
    html body .sidebar { position: absolute; inset: 0 auto 0 0; height: 100dvh; z-index: 5; }
    html body .sidebar-backdrop { display: block; position: fixed; inset: 0; background: #0005; border: 0; z-index: 4; }
    html body .sidebar-collapsed .sidebar-backdrop { display: none; }
    html body .header { padding: 10px 12px; gap: 8px; }
    html body .header select { max-width: 110px; }
    .training-badge { padding: 5px 8px; font-size: 10px; }
    html body .chat-box { padding: 20px 16px; }
    html body .input-area { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
    .composer-note { font-size: 10px; padding-left: 12px; padding-right: 12px; }
}
