:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: #233044; background: #101724; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
button, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, summary:focus-visible, section:focus-visible { outline: 3px solid #577bb8; outline-offset: 3px; }
[hidden] { display: none !important; }
.chat-app { width: min(920px, 100%); height: min(960px, calc(100dvh - 48px)); min-height: 420px; background: #f7f8fa; border: 1px solid #2d3746; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px #0003; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 30px; border-bottom: 1px solid #e1e5ea; flex-shrink: 0; background: #fff; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { flex-shrink: 0; }
h1 { font-size: 19px; font-weight: 650; margin: 0; letter-spacing: .01em; }
.brand p { font-size: 14px; line-height: 1.5; color: #637083; margin: 4px 0 0; }
.reset-button { font-size: 14px; min-height: 44px; color: #4d5c70; background: transparent; border: 1px solid #dce2e9; padding: 8px 14px; border-radius: 10px; flex-shrink: 0; }
.reset-button:hover { background: #f0f3f8; }
.messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 30px 34px; scrollbar-width: thin; scrollbar-color: #c6ceda transparent; }
.message { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 26px; }
.speaker { color: #637083; font-size: 14px; margin: 0 2px 8px; }
.bubble { max-width: min(680px, 92%); padding: 17px 20px; border-radius: 4px 16px 16px 16px; border: 1px solid #e2e6ed; background: #fff; }
.bubble p { font-size: 16px; line-height: 1.85; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { align-items: flex-end; }
.user .bubble { border-radius: 16px 4px 16px 16px; background: #263853; color: #fff; border-color: #263853; }
.pending .bubble p:empty::before { content: "正在想一想…"; color: #637083; }
.message-error { display: flex; align-items: center; gap: 10px; margin-top: 8px; max-width: 100%; color: #814d34; font-size: 14px; line-height: 1.6; }
.message-error button { border: 1px solid #ccd4e0; border-radius: 7px; color: #263853; background: #fff; padding: 9px 12px; min-height: 44px; white-space: nowrap; }
.composer-area { flex-shrink: 0; background: #f7f8fa; padding: 0 30px 17px; }
.composer { border: 1px solid #bfc9d7; border-radius: 15px; padding: 14px 14px 11px; background: #fff; box-shadow: 0 4px 16px #213b5810; }
.composer:focus-within { border-color: #6986b2; box-shadow: 0 0 0 3px #6986b21a; }
textarea { display: block; width: 100%; resize: none; min-height: 56px; max-height: 140px; border: none; outline: none; background: transparent; color: #233044; font-size: 16px; line-height: 1.6; padding: 0 3px; }
textarea::placeholder { color: #6c7787; }
.composer-bottom { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
#input-hint { font-size: 14px; color: #637083; flex: 1; }
#count { font-size: 14px; color: #637083; margin-left: auto; }
#send { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 94px; min-height: 44px; padding: 8px 16px; background: #263853; color: #fff; border: none; border-radius: 9px; font-size: 15px; }
#send:hover:not(:disabled) { background: #354d70; }
#send-icon { font-size: 21px; line-height: 1; }
.app-footer { display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: #637083; padding-top: 13px; text-align: center; }
.app-footer details { max-width: 600px; }
.app-footer summary { cursor: pointer; }
.app-footer details p { margin: 10px 0 0; line-height: 1.65; }
.app-footer a { color: #586a83; line-height: 1.5; }
.notice { color: #72462f; padding: 12px 24px; background: #fcf2e6; font-size: 14px; line-height: 1.65; }
.notice button { color: #263853; background: #fff; border: 1px solid #d2c4b6; border-radius: 6px; margin-left: 10px; padding: 8px 12px; min-height: 44px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  body { display: block; padding: 0; background: #f7f8fa; }
  .chat-app { width: 100%; height: 100dvh; min-height: 320px; border: none; border-radius: 0; box-shadow: none; }
  .app-header { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; gap: 10px; }
  .brand { gap: 10px; }
  .brand-mark { width: 36px; height: 36px; }
  h1 { font-size: 18px; }
  .brand p { display: none; }
  .reset-button { padding: 8px 11px; }
  .messages { padding: 24px 16px 10px; }
  .bubble { max-width: 96%; padding: 14px 16px; }
  .bubble p { line-height: 1.8; }
  .composer-area { padding: 0 12px calc(12px + env(safe-area-inset-bottom)); }
  .composer { padding: 12px; }
  #input-hint { visibility: hidden; font-size: 0; }
  textarea { min-height: 50px; }
  .app-footer { padding-top: 10px; }
}
@media (max-height: 520px) and (min-width: 601px) {
  body { padding: 0; }
  .chat-app { height: 100dvh; min-height: 300px; border-radius: 0; }
  .app-header { padding: 12px 24px; }
  .brand p { display: none; }
}
