* { box-sizing: border-box; }
body { margin: 0; font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
[v-cloak] { display: none; }
.support-app { --bg: #f5f7fb; --panel: #fff; --text: #263246; --muted: #8a94a6; --border: #e7ecf3; --accent: #109cb5; --soft: #eaf8fb; min-height: 100dvh; background: var(--bg); color: var(--text); }
.support-app.dark { --bg: #151e2b; --panel: #202b3b; --text: #e3eaf4; --muted: #a3b0c4; --border: #344154; --accent: #37b9d0; --soft: #233e4a; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--border); color: var(--text); background: var(--panel); border-radius: 6px; padding: 7px 12px; }
button:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { cursor: not-allowed; opacity: .55; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
input, select, textarea { border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 10px 12px; border-radius: 6px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
a { color: var(--accent); text-decoration: none; }
small { color: var(--muted); }
h1, h2, p { margin: 0; }
.login-page { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; place-items: center; padding: 20px; background: radial-gradient(at 20% 20%, #cceaf0, transparent 60%); }
.login-card { width: 400px; max-width: 100%; min-width: 0; padding: 32px; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); box-shadow: 0 18px 80px #172b4d15; }
.brand-mark { background: var(--soft); color: var(--accent); border-radius: 12px; width: 60px; height: 60px; display: grid; place-items: center; font-weight: bold; margin: 0 auto 20px; }
.login-card h1 { text-align: center; font-size: 24px; }
.login-card p { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 0 28px; }
.login-card label, .settings-card label { display: block; margin-bottom: 18px; line-height: 1.8; }
.login-card input, .settings-card textarea { display: block; width: 100%; margin-top: 6px; }
.login-card > button { width: 100%; padding: 12px; }
.login-card > a { display: block; text-align: center; margin-top: 20px; font-size: 12px; }
.workbench { display: grid; grid-template-columns: 350px minmax(0, 1fr); height: 100dvh; overflow: hidden; }
.workbench.chat-open { grid-template-columns: 350px minmax(0, 1fr) 300px; }
.sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--panel); }
.sidebar-heading { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-heading h1 { font-size: 20px; margin-bottom: 14px; }
.header-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.header-actions button { padding: 5px 9px; font-size: 12px; }
.identity { display: flex; gap: 10px; align-items: center; padding: 18px; }
.identity > div { min-width: 0; }
.identity strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.identity small { display: block; margin-top: 5px; font-size: 11px; }
.avatar { display: inline-grid; flex-shrink: 0; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--soft); color: var(--accent); font-weight: bold; }
.connection { margin-left: auto; font-size: 10px; color: #2e9b77; white-space: nowrap; }
.connection.failed { color: #d87862; }
.search { display: flex; gap: 7px; padding: 0 16px 14px; }
.search input { flex: 1; width: 0; font-size: 12px; }
.conversation-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 16px; }
.conversation-tabs button { flex: 1; border: 0; border-radius: 0; padding: 12px 6px; }
.conversation-tabs button.active { color: var(--accent); border-bottom: 2px solid var(--accent); background: var(--soft); }
.conversation-tabs span { font-size: 11px; margin-left: 4px; }
.status-note { padding: 9px 16px; color: var(--muted); font-size: 10px; }
.conversation-list { flex: 1; overflow-y: auto; min-height: 0; }
.conversation { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 15px 16px; border: 0; border-radius: 0; border-bottom: 1px solid var(--border); }
.conversation.selected { background: var(--soft); }
.conversation-info { min-width: 0; flex: 1; }
.conversation-info strong, .conversation-info small, .preview { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.conversation-info small { margin: 5px 0; font-size: 10px; }
.preview { color: var(--muted); font-size: 12px; }
.trial { color: var(--accent); font-size: 10px; font-weight: normal; }
.group-chip { display: inline-block; margin-left: 4px; padding: 1px 5px; border-radius: 8px; background: var(--soft); color: var(--accent); font-style: normal; font-size: 9px; }
.region-chip { display: inline-block; margin-left: 4px; padding: 1px 5px; border-radius: 8px; background: #fff4e2; color: #b16b45; font-style: normal; font-size: 9px; white-space: nowrap; }
.conversation-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 10px; color: var(--muted); }
.waiting { background: #ffecdf; color: #b16b45; padding: 3px 6px; border-radius: 4px; }
.sidebar-footer { display: flex; justify-content: space-between; padding: 14px 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }
.chat-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.profile-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--border); }
.profile-heading { padding: 18px 16px; border-bottom: 1px solid var(--border); }
.profile-heading h2 { font-size: 16px; }
.profile-heading small { display: block; margin-top: 6px; font-size: 10px; }
.profile-back, .profile-mobile-toggle { display: none; }
.profile-identity { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--border); }
.profile-identity strong, .profile-identity small { display: block; overflow-wrap: anywhere; }
.profile-identity small { margin-top: 6px; }
.profile-details { margin: 0; padding: 8px 16px 14px; border-bottom: 1px solid var(--border); }
.profile-details > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; padding: 8px 0; font-size: 11px; }
.profile-details dt { color: var(--muted); }
.profile-details dd { margin: 0; overflow-wrap: anywhere; }
.profile-edit { padding: 16px; }
.profile-edit label { display: block; margin-bottom: 14px; font-size: 12px; }
.profile-edit label > button { margin-left: 8px; padding: 3px 8px; font-size: 10px; }
.profile-edit input, .profile-edit select, .profile-edit textarea { display: block; width: 100%; margin-top: 6px; }
.profile-edit textarea { resize: vertical; line-height: 1.6; }
.profile-edit small { display: block; text-align: right; margin-top: 4px; font-size: 10px; }
.profile-edit > button { width: 100%; }
.welcome { margin: auto; padding: 25px; text-align: center; }
.welcome-icon { display: grid; place-items: center; width: 90px; height: 90px; border-radius: 24px; background: var(--soft); color: var(--accent); font-size: 24px; margin: 0 auto 25px; }
.welcome h2 { font-size: 24px; }
.welcome p { color: var(--muted); margin: 14px 0; }
.chat-heading { display: flex; align-items: center; gap: 14px; padding: 18px 24px; background: var(--panel); border-bottom: 1px solid var(--border); }
.chat-heading > div:first-of-type { flex: 1; min-width: 0; }
.chat-heading h2 { font-size: 17px; overflow-wrap: anywhere; }
.chat-heading small { display: block; margin-top: 6px; font-size: 11px; overflow-wrap: anywhere; }
.back { display: none; }
.message-area { flex: 1; min-height: 0; overflow-y: auto; padding: 24px; }
.older { display: block; margin: 0 auto 20px; font-size: 12px; }
.message { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 22px; }
.message.outgoing { flex-direction: row-reverse; }
.message-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: var(--panel); color: var(--muted); font-size: 10px; border-radius: 50%; }
.message-content { max-width: min(76%, 620px); min-width: 0; }
.message-meta { color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.outgoing .message-meta { text-align: right; }
.bubble { padding: 12px 16px; background: var(--panel); border-radius: 0 12px 12px; line-height: 1.8; overflow-wrap: anywhere; }
.outgoing .bubble { background: var(--soft); border-radius: 12px 0 12px 12px; }
.bubble img { display: block; max-width: 100%; max-height: 300px; border-radius: 6px; }
.bubble video { display: block; width: 300px; max-width: 100%; max-height: 260px; }
.bubble small { display: block; font-size: 11px; }
.order-actions { display: flex; gap: 8px; margin-top: 8px; }
.order-actions button { min-width: 72px; padding: 5px 14px; }
.order-actions .approve { color: #fff; border-color: #22966c; background: #22966c; }
.order-actions .reject { color: #fff; border-color: #d34d4d; background: #d34d4d; }
.text { white-space: pre-wrap; }
.composer { background: var(--panel); border-top: 1px solid var(--border); padding: 12px 22px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar button, .toolbar label { padding: 5px 8px; font-size: 12px; color: var(--muted); border: 0; cursor: pointer; }
.toolbar input { display: none; }
.toolbar .disabled { opacity: .5; pointer-events: none; }
.toolbar .grant-bonus { border: 1px solid #b6d9b4; border-radius: 6px; color: #338b58; font-weight: 600; }
.composer > textarea { width: 100%; min-height: 80px; max-height: 160px; resize: vertical; }
.send-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; }
.send-row small { font-size: 10px; }
.send-row button { flex-shrink: 0; min-width: 86px; }
.quick-replies, .emoji-picker { display: flex; gap: 8px; flex-wrap: wrap; max-height: 140px; overflow-y: auto; padding: 10px 0; }
.quick-replies button { font-size: 12px; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.attachment-draft { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; padding: 8px; background: var(--soft); overflow-wrap: anywhere; }
.attachment-draft span { min-width: 0; flex: 1; }
.empty { color: var(--muted); text-align: center; padding: 30px 15px; font-size: 12px; }
.error { padding: 10px 14px; color: #b55040; background: #fff0ed; line-height: 1.6; overflow-wrap: anywhere; }
.error button { font-size: 11px; margin-left: 8px; }
.new-messages { position: absolute; right: 24px; bottom: 210px; color: var(--accent); box-shadow: 0 4px 15px #0001; }
.modal-mask { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: #0005; z-index: 10; }
.settings-card { padding: 25px; background: var(--panel); width: 480px; max-width: 100%; border-radius: 12px; max-height: 90dvh; overflow-y: auto; }
.settings-card h2 { margin-bottom: 20px; }
.settings-card p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.settings-card .check { display: flex; gap: 8px; align-items: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.bonus-message { min-width: 190px; text-align: center; }
.bonus-message strong, .bonus-message b { display: block; }
.bonus-message strong { color: #377d73; font-size: 13px; }
.bonus-message b { margin: 8px 0; color: #29966d; font-size: 25px; }
.bonus-message p, .bonus-message small { display: block; margin: 4px 0; color: #79938e; font-size: 11px; }
.bonus-dialog > label { display: block; margin-bottom: 8px; font-size: 13px; }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #263246; color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 20; max-width: calc(100% - 30px); overflow-wrap: anywhere; box-shadow: 0 4px 20px #0002; }
@media (max-width: 900px) and (min-width: 701px) {
  .workbench { grid-template-columns: 290px minmax(0, 1fr); }
  .identity { padding: 14px; }
  .workbench.chat-open { grid-template-columns: 290px minmax(0, 1fr); }
  .profile-panel { position: fixed; z-index: 5; top: 0; right: 0; bottom: 0; width: 300px; box-shadow: -8px 0 25px #172b4d25; }
  .workbench.chat-open:not(.mobile-profile-open) .profile-panel { display: none; }
  .workbench.mobile-profile-open .profile-panel { display: flex; }
  .profile-back { display: inline-block; margin-bottom: 12px; }
  .profile-mobile-toggle { display: inline-block; }
}
@media (max-width: 700px) {
  .workbench { display: block; }
  .workbench.chat-open { display: block; }
  .sidebar { height: 100dvh; border: 0; }
  .chat-panel { display: none; height: 100dvh; }
  .chat-open .sidebar { display: none; }
  .chat-open .chat-panel { display: flex; }
  .profile-panel { display: none; }
  .mobile-profile-open .chat-panel { display: none; }
  .mobile-profile-open .profile-panel { position: fixed; inset: 0; z-index: 5; display: flex; border: 0; }
  .workbench.mobile-profile-open .profile-panel { width: auto; }
  .profile-back { display: inline-block; margin-bottom: 12px; }
  .profile-mobile-toggle { display: inline-block; }
  .back { display: block; padding: 5px 6px; font-size: 12px; }
  .chat-heading { padding: 12px; gap: 8px; flex-wrap: wrap; }
  .chat-heading .header-actions { margin-left: auto; }
  .chat-heading h2 { font-size: 15px; }
  .message-area { padding: 16px 10px; }
  .message { gap: 6px; }
  .message-content { max-width: 80%; }
  .bubble { padding: 9px 12px; }
  .composer { padding: 10px; }
  .toolbar { gap: 3px; }
  .toolbar label, .toolbar button { padding: 5px; font-size: 11px; }
  .send-row small { max-width: 200px; }
  .new-messages { right: 12px; bottom: 200px; }
}
