:root { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #203238; background: #f3f6f7; font-size: 14px; letter-spacing: 0; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { min-height: 36px; min-width: 36px; border: 1px solid #cbd6d9; border-radius: 5px; background: white; color: #25434b; padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover { background: #edf5f5; }
button:disabled { opacity: .45; cursor: default; }
button svg { width: 18px; height: 18px; }
button.primary { background: #087e82; color: white; border-color: #087e82; }
button.primary:hover { background: #05666a; }
input, select, textarea { border: 1px solid #bdcdd2; border-radius: 5px; padding: 10px; background: white; color: #203238; width: 100%; }
:focus-visible { outline: 2px solid #087e82; outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: 20px; font-weight: 650; }
h1 span { font-size: 14px; font-weight: 400; color: #62787d; margin-left: 14px; }
h2 { font-size: 17px; }
.topbar { height: 72px; padding: 0 28px; background: white; border-bottom: 1px solid #d7e0e3; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand, .account { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; background: #087e82; color: white; border-radius: 6px; font-size: 24px; font-weight: 650; }
.account { color: #62787d; }
main { max-width: 1600px; margin: auto; }
.connecting { padding: 48px; text-align: center; color: #62787d; }
.login-form { width: min(360px, calc(100% - 40px)); margin: 90px auto; display: grid; gap: 22px; }
.login-form label { display: grid; gap: 8px; }
.login-form h2 { font-size: 22px; }
#login-error, .notice { color: #aa3434; min-height: 22px; }
.notice { padding: 8px 24px; }
.workbench { height: calc(100dvh - 112px); min-height: 480px; display: grid; grid-template-columns: 330px minmax(0, 1fr); background: white; }
.tickets { border-right: 1px solid #d7e0e3; display: flex; flex-direction: column; min-height: 0; }
.list-tools { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.filter-label { display: flex; align-items: center; gap: 12px; padding: 8px 20px 16px; white-space: nowrap; color: #62787d; }
.ticket-list { overflow-y: auto; flex: 1; }
.ticket { display: block; width: 100%; padding: 16px 20px; text-align: left; border: 0; border-top: 1px solid #e4eaec; border-radius: 0; }
.ticket.selected { background: #e8f4f2; border-left: 3px solid #087e82; padding-left: 17px; }
.ticket strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.ticket small { display: block; margin-top: 8px; color: #62787d; overflow-wrap: anywhere; }
.badge { display: inline-block; margin-top: 8px; font-size: 12px; color: #9a650d; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid #e4eaec; }
.conversation, .ticket-detail { min-height: 0; height: 100%; }
.ticket-detail { display: flex; flex-direction: column; }
.detail-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 28px; border-bottom: 1px solid #e4eaec; }
.detail-header h2 { overflow-wrap: anywhere; font-size: 15px; }
.detail-header > div:first-child { min-width: 0; flex: 1 1 240px; }
.detail-header p { font-size: 12px; margin-top: 8px; color: #62787d; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.messages { flex: 1; overflow-y: auto; padding: 24px 28px; background: #f9fbfb; }
.message { margin-bottom: 22px; }
.message small { display: block; color: #6b7d82; font-size: 12px; margin-bottom: 6px; }
.message p { display: inline-block; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; padding: 11px 14px; background: #eaf0f2; border-radius: 6px; line-height: 1.7; }
.message.agent { text-align: right; }
.message.agent p { text-align: left; background: #dff2ec; }
.message.system p { background: #f5eddc; }
.reply-form { padding: 16px 28px; border-top: 1px solid #e4eaec; }
.reply-form label { display: block; font-size: 12px; margin-bottom: 8px; color: #62787d; }
.reply-form textarea { resize: vertical; min-height: 75px; max-height: 180px; }
.reply-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: #62787d; font-size: 12px; }
.empty { padding: 60px 20px; color: #75868a; text-align: center; }
@media (max-width: 700px) {
  .topbar { height: 64px; padding: 0 14px; }
  h1 { font-size: 16px; } h1 span { display: block; margin: 3px 0 0; font-size: 12px; }
  .brand-mark { width: 30px; height: 30px; font-size: 20px; } .account { font-size: 12px; gap: 6px; overflow-wrap: anywhere; }
  .workbench { height: auto; min-height: 0; display: block; }
  .tickets { border-right: 0; max-height: 300px; border-bottom: 1px solid #d7e0e3; }
  .ticket-list { max-height: 150px; } .ticket { padding: 10px 16px; }
  .conversation { height: 660px; max-height: 85dvh; }
  .detail-header, .messages, .reply-form { padding: 14px 16px; }
  .detail-actions button { font-size: 12px; } .login-form { margin: 60px auto; }
}
