:root {
  --ink: #202b42;
  --muted: #7c879d;
  --line: #e7ebf2;
  --bg: #f6f8fc;
  --primary: #5264e4;
  --soft: #eef0ff;
  --green: #238166;
  --radius: 14px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: var(--primary);
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 26px;
  letter-spacing: -0.6px;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 15px;
}
small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
p {
  line-height: 1.7;
}
input,
select,
textarea {
  background: white;
  border: 1px solid #dce1ed;
  border-radius: 9px;
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
}
button {
  border: 0;
  background: transparent;
}
label {
  line-height: 1.6;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 17px;
  font-size: 13px;
  font-weight: 500;
}
.field small {
  font-weight: 400;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  padding: 10px 17px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.button.secondary {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}
.button.ghost {
  background: var(--soft);
  color: var(--primary);
}
.button.danger {
  background: #fff0f0;
  color: #bb4242;
}
.icon-button {
  font-size: 23px;
  color: var(--muted);
  padding: 0 5px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spread {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.muted {
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 20px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h2 {
  margin-bottom: 8px;
}
.card p {
  color: var(--muted);
  font-size: 13px;
}
.card footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  background: #eff2f7;
  color: #6a768e;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.badge.new {
  background: #eaf0ff;
  color: #4d68ca;
}
.badge.working {
  background: #fff4df;
  color: #a77b1e;
}
.badge.waiting {
  background: #f4edff;
  color: #8b61b5;
}
.badge.resolved {
  background: #e4f5ed;
  color: #35816a;
}
.badge.closed {
  background: #edf0f3;
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 600;
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 65px 25px;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  margin: 15px 0 8px;
}
.empty p {
  font-size: 13px;
}
.empty-mark {
  font-size: 40px;
  color: #aeb6cc;
}
.notice {
  padding: 13px 16px;
  border: 1px solid #dce3ff;
  background: #f4f6ff;
  border-radius: 10px;
  font-size: 12px;
  color: #6874a0;
  line-height: 1.8;
}
.notice.warn {
  background: #fff8ec;
  border-color: #f3e3c5;
  color: #9c804c;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}
.check input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #17203960;
  z-index: 10000;
}
dialog.dialog-fallback[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  z-index: 10001;
}
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.brand {
  font-weight: 700;
  letter-spacing: -0.7px;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.brandmark {
  width: 31px;
  height: 31px;
  border: 5px solid #8694ff;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.brandmark:after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #8694ff;
  border: 3px solid #263550;
  border-radius: 50%;
  right: -9px;
  top: -7px;
}
.login-form {
  display: flex;
  flex-direction: column;
  max-width: 420px;
  width: 100%;
  padding: 32px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.login-form .brand {
  margin-bottom: 24px;
}
.login-form h1 {
  font-size: 23px;
  margin-bottom: 28px;
}
.login-form .button {
  width: 100%;
  margin-top: 6px;
}
.login-form .error-text:empty {
  display: none;
}
.shell {
  display: grid;
  grid-template-columns: 224px 1fr;
  min-height: 100vh;
}
.sidebar {
  overflow-y: auto;
  background: white;
  border-right: 1px solid var(--line);
  position: fixed;
  width: 224px;
  inset: 0 auto 0 0;
  padding: 30px 18px 18px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar .brand {
  font-size: 23px;
  margin: 0 14px 30px;
}
.sidebar .brandmark:after {
  border-color: white;
}
.project-switch {
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 24px;
  background: #fbfcff;
}
.project-switch select {
  border: 0;
  background: transparent;
  padding: 6px 0 0;
  font-weight: 600;
  font-size: 13px;
}
.nav-group {
  margin-bottom: 24px;
}
.nav-group .eyebrow {
  padding: 0 12px;
  margin-bottom: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 11px 13px;
  margin: 3px 0;
  border-radius: 8px;
  color: #738098;
  text-align: left;
  font-size: 13px;
}
.nav-item.active {
  background: var(--soft);
  color: var(--primary);
  font-weight: 600;
}
.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 17px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #e8edfc;
  color: #6373b1;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex: none;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 74px;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.topbar .crumb {
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
}
.topbar > .row {
  flex-shrink: 0;
  gap: 14px;
  white-space: nowrap;
}
.topbar #ui-language {
  width: 108px;
  min-width: 108px;
  font-size: 12px;
}
.topbar .check {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12px;
}
.topbar .check input {
  flex-shrink: 0;
}
.connection:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58a98e;
  margin-right: 7px;
}
.page {
  padding: 30px 32px;
}
.page-heading {
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.page-heading p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}
.configuration-panel {
  margin-bottom: 24px;
  min-width: 0;
  scroll-margin-top: 16px;
}
#workspace > .configuration-panel {
  margin: 24px 32px;
}
.configuration-form > header {
  gap: 16px;
  margin-bottom: 20px;
}
.configuration-form > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 20px;
}
.configuration-fields {
  overflow-wrap: anywhere;
}
.template-tabs {
  margin-bottom: 16px;
}
.project-tools {
  align-items: end;
}
.project-tools .field {
  min-width: 180px;
}
.content-editor-with-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, 1fr);
  gap: 24px;
  align-items: start;
}
.live-content-preview {
  min-width: 0;
  background: #f5f7fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.live-content-preview > .inline-note {
  margin: 5px 0 14px;
}
.preview-sheet {
  max-width: 540px;
  margin: 12px auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.preview-sheet h3 {
  margin-bottom: 16px;
}
.rule-flow {
  max-width: 820px;
  margin: 16px auto 0;
  overflow-wrap: anywhere;
}
.flow-node {
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 9px;
}
.flow-node small {
  display: block;
}
.flow-node p {
  white-space: pre-wrap;
}
.flow-node ul {
  margin: 6px 0 0;
  padding-inline-start: 20px;
}
.flow-arrow {
  text-align: center;
  padding: 6px 0;
  color: var(--muted);
  font-size: 12px;
}
.flow-arrow span {
  color: var(--primary);
}
.flow-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-field-row [data-option-field][hidden] {
  display: none;
}
@media (max-width: 1050px) {
  .content-editor-with-preview {
    grid-template-columns: minmax(0, 1fr);
  }
}
.language-fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px 12px;
  margin: 0 0 18px;
}
.language-fieldset legend {
  font-size: 13px;
  font-weight: 600;
  padding-inline: 4px;
}
.language-fieldset small {
  display: block;
  margin-top: 8px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  padding: 20px 23px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.stat .number {
  font-size: 29px;
  font-weight: 650;
  margin: 10px 0 5px;
  letter-spacing: -1px;
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
}
.workbench {
  display: grid;
  grid-template-columns: 310px minmax(320px, 1fr) 255px;
  height: calc(100vh - 74px);
  background: white;
}
.ticket-list {
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.list-head {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--line);
}
.list-head h2 {
  font-size: 19px;
  margin-bottom: 15px;
}
.list-tools {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.list-tools select {
  font-size: 11px;
  padding: 7px 6px;
}
.ticket-item {
  width: 100%;
  padding: 19px 19px 17px;
  border-bottom: 1px solid #f0f2f7;
  text-align: left;
  border-left: 3px solid transparent;
}
.ticket-item:hover {
  background: #fafbff;
}
.ticket-item.active {
  background: #f5f6ff;
  border-left-color: var(--primary);
}
.ticket-item .subject {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  margin: 10px 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-item .meta {
  font-size: 10px;
  color: #9aa3b6;
}
.ticket-item .uid {
  font-size: 11px;
  color: #77829b;
}
.conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.conversation-head {
  padding: 21px 25px;
  border-bottom: 1px solid var(--line);
  min-height: 81px;
}
.conversation-head h3 {
  font-size: 14px;
  margin-bottom: 7px;
}
.messages {
  padding: 24px;
  overflow: auto;
  flex: 1;
  background: #fcfdff;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.message {
  max-width: 85%;
  align-self: flex-start;
  flex-shrink: 0;
}
.message.agent,
.message.bot {
  align-self: flex-end;
}
.message .message-label {
  font-size: 10px;
  color: #9aa4b7;
  margin-bottom: 7px;
}
.message.agent .message-label,
.message.bot .message-label {
  text-align: right;
}
.bubble {
  background: #f0f2f7;
  border-radius: 2px 12px 12px;
  padding: 12px 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}
.agent .bubble {
  background: #eef0ff;
  border-radius: 12px 2px 12px 12px;
  color: #4c5987;
}
.bot .bubble {
  background: #eaf5f1;
  color: #4c8070;
}
.message.private .bubble {
  background: #fff5da;
  color: #887448;
}
.message-tools {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  gap: 12px;
}
.message-tools button {
  font-size: 10px;
  color: var(--primary);
  padding: 0;
}
.message img {
  max-width: 100%;
  max-height: 250px;
  border-radius: 8px;
  display: block;
  margin-top: 6px;
}
.translation {
  margin-top: 8px;
  padding: 10px;
  border-top: 1px solid #dde2ee;
  font-size: 12px;
  color: #7a6a97;
  white-space: pre-wrap;
}
.composer {
  padding: 17px 22px;
  border-top: 1px solid var(--line);
  background: white;
}

.composer textarea {
  border: 0;
  padding: 4px;
  min-height: 80px;
  resize: none;
  outline: 0;
}
.composer .compose-tools {
  padding-top: 12px;
  border-top: 1px solid #f0f2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.composer select {
  width: auto;
  font-size: 11px;
  padding: 6px 8px;
  border: 0;
  background: #f4f5fa;
}
.context-panel {
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 24px 20px;
}
.context-section {
  padding-bottom: 23px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.context-section h3 {
  font-size: 12px;
  margin-bottom: 17px;
}
.context-section dl {
  margin: 0;
}
.context-section dt {
  font-size: 11px;
  color: #929cb0;
  margin-bottom: 5px;
}
.context-section dd {
  font-size: 12px;
  margin: 0 0 15px;
  word-break: break-word;
}
.context-section select {
  font-size: 12px;
  padding: 8px;
  margin-top: 6px;
}
.context-section .button {
  font-size: 11px;
  width: 100%;
  margin-top: 10px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
.table th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  background: #fafbfe;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 17px 15px;
  border-bottom: 1px solid #f0f2f7;
  vertical-align: middle;
}
.table td .button {
  font-size: 11px;
  padding: 6px 10px;
}
.table td small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
}
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.provider-header {
  height: 42px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-weight: 650;
  font-size: 17px;
}
.provider-icon {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--primary);
}
.code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  background: #f5f7fb;
  padding: 12px;
  border-radius: 8px;
}
.form-field-row {
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.form-field-row .two {
  gap: 10px;
}
.form-field-row .field {
  margin-bottom: 10px;
}
.field-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.content-preview {
  white-space: pre-wrap;
  line-height: 1.8;
  padding: 20px;
  background: #f8f9fd;
  border-radius: 10px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 25px 100px #22304a33;
  width: min(650px, calc(100vw - 30px));
  padding: 0;
  max-height: 90vh;
  color: var(--ink);
}
dialog::backdrop {
  background: #1b294762;
  backdrop-filter: blur(3px);
}
.dialog-form > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 25px;
  border-bottom: 1px solid var(--line);
}
.dialog-body {
  padding: 24px;
  max-height: 65vh;
  overflow: auto;
}
.dialog-form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 17px 24px;
  border-top: 1px solid var(--line);
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 15px);
  background: #263550;
  color: white;
  padding: 13px 23px;
  border-radius: 10px;
  box-shadow: 0 7px 30px #25334a30;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  max-width: 90vw;
  font-size: 13px;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
body.player {
  background: #eef1f7;
  min-height: 100vh;
  min-height: 100dvh;
}
.player-shell {
  max-width: 580px;
  margin: 0 auto;
  background: white;
  min-height: 100vh;
  min-height: 100dvh;
  box-shadow: 0 0 50px #23305009;
  display: flex;
  flex-direction: column;
}
.player-header {
  background: var(--primary);
  color: white;
  padding: 26px 25px 28px;
}
.player-header h1 {
  font-size: 25px;
}
.player-header p {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 10px;
}
.player-nav {
  display: flex;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  gap: 24px;
}
.player-nav button {
  padding: 18px 3px 14px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.player-nav .active {
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.player-body {
  padding: 24px;
  flex: 1;
}
.player-search {
  background: #f6f8fc;
  border: 0;
  padding: 14px;
}
.faq-item {
  border-bottom: 1px solid var(--line);
  width: 100%;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  text-align: left;
  font-size: 13px;
  gap: 15px;
  line-height: 1.6;
}
.faq-item span:last-child {
  color: #a0a8bb;
}
.faq-category {
  display: inline-block;
  padding: 5px 10px;
  background: #f4f5fb;
  color: #8290aa;
  border-radius: 6px;
  font-size: 10px;
  margin-bottom: 8px;
}
.contact-actions {
  margin-top: 24px;
}
.player-foot {
  text-align: center;
  font-size: 10px;
  letter-spacing: 1px;
  color: #b3bbcd;
  padding: 23px;
}
body.player .messages {
  min-height: 250px;
  max-height: calc(100dvh - 290px);
  padding: 20px;
}
body.player .conversation-head {
  padding: 15px 22px;
  min-height: 0;
}
body.player .composer {
  padding: 14px 18px;
}
body.player .composer textarea {
  min-height: 65px;
}
body.player .message {
  max-width: 90%;
}
body.player .message.player {
  align-self: flex-end;
}
body.player .message.player .bubble {
  background: var(--soft);
  color: #55628a;
  border-radius: 12px 2px 12px 12px;
}
body.player .message.agent,
body.player .message.bot {
  align-self: flex-start;
}
body.player .message.agent .bubble {
  background: #f1f3f7;
  color: var(--ink);
  border-radius: 2px 12px 12px;
}
body.player .message.agent .message-label,
body.player .message.bot .message-label {
  text-align: left;
}
body.player .bubble {
  font-size: 13px;
}
.player-ticket {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  width: 100%;
  margin-bottom: 13px;
}
.player-ticket h3 {
  font-size: 13px;
  margin: 12px 0;
}
.file-label {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.file-label input {
  display: none;
}
.mobile-back {
  display: none;
}
.error-text {
  color: #c35e5e;
  font-size: 12px;
  padding-top: 10px;
}
.feedback {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}
.feedback button {
  font-size: 12px;
}
.unread {
  background: var(--primary);
  color: white;
  border-radius: 20px;
  padding: 2px 6px;
  font-size: 9px;
}
.inline-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
@media (min-width: 1600px) {
  .workbench {
    grid-template-columns: 350px minmax(400px, 1fr) 290px;
  }
  .page {
    max-width: 1500px;
    margin: auto;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 185px 1fr;
  }
  .sidebar {
    width: 185px;
    padding-inline: 12px;
  }
  .sidebar .brand {
    margin-inline: 8px;
  }
  .workbench {
    grid-template-columns: 270px 1fr;
  }
  .context-panel {
    display: none;
  }
  .page {
    padding: 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .provider-grid {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 780px) {
  .shell {
    display: block;
  }
  .sidebar {
    overflow: visible;
    position: relative;
    width: auto;
    inset: auto;
    display: block;
    padding: 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .brand {
    margin: 0;
    font-size: 20px;
  }
  .sidebar .project-switch {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 160px;
    padding: 6px 10px;
    margin: 0;
  }
  .sidebar .project-switch .eyebrow {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    margin-top: 15px;
    gap: 8px;
  }
  .nav-group {
    display: contents;
  }
  .nav-group .eyebrow,
  .sidebar-bottom {
    display: none;
  }
  .nav-item {
    width: auto;
    white-space: nowrap;
    padding: 9px 12px;
  }
  .nav-icon {
    display: none;
  }
  .main {
    grid-column: 1;
  }
  .topbar {
    height: 55px;
    padding: 0 20px;
  }
  .topbar .connection {
    display: none;
  }
  .workbench {
    height: calc(100dvh - 180px);
    grid-template-columns: 230px 1fr;
  }
  .page {
    padding: 24px 18px;
  }
  #workspace > .configuration-panel {
    margin-inline: 18px;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .provider-grid {
    grid-template-columns: 1fr;
  }
  .login-form {
    padding: 24px;
  }
  .stat {
    padding: 17px;
  }
  .table {
    min-width: 550px;
  }
  .table-container {
    overflow: auto;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: 23px;
  }
  .page-heading .button {
    font-size: 11px;
    padding: 9px 12px;
  }
  .messages {
    padding: 17px;
  }
  .composer {
    padding: 15px;
  }
  .message {
    max-width: 95%;
  }
}
@media (max-width: 550px) {
  .workbench {
    display: block;
  }
  .ticket-list {
    height: 100%;
    border: 0;
  }
  .conversation {
    display: none;
    height: 100%;
  }
  .workbench.open .ticket-list {
    display: none;
  }
  .workbench.open .conversation {
    display: flex;
  }
  .mobile-back {
    display: inline-block;
    color: var(--primary);
    padding: 0 12px 0 0;
  }
  .player-body {
    padding: 20px;
  }
  .player-header {
    padding: 23px 22px;
  }
  .player-shell {
    min-height: 100vh;
    min-height: 100dvh;
  }
  .stat-grid {
    gap: 10px;
  }
  .context-panel {
    display: none;
  }
  .topbar .crumb {
    font-size: 11px;
  }
  .topbar a {
    font-size: 11px;
  }
}

body.player .composer {
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.context-toggle,
.context-close {
  display: none;
}
.workbench.details-open .context-panel {
  display: block;
  position: fixed;
  inset: 0 0 0 auto;
  width: min(360px, 100vw);
  z-index: 90;
  padding-top: 65px;
  background: white;
  box-shadow: -16px 0 80px #20304a33;
}
.workbench.details-open .context-close {
  display: block;
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 91;
}
@media (max-width: 1150px) {
  .context-toggle {
    display: inline-flex;
  }
}

.csat-star {
  font-size: 26px;
  line-height: 1;
  color: #d5d9e2;
  padding: 2px 4px;
}
.csat-star.on,
.csat-star.hover {
  color: #e8a33d;
}

/* ---------- 项目外观（外观装饰） ---------- */
body.player.has-brand-bg {
  background: #1b1f2a var(--brand-bg) center / cover fixed no-repeat;
}
body.player.has-brand-bg .player-shell {
  background:
    linear-gradient(var(--brand-veil), var(--brand-veil)),
    var(--brand-bg) center / cover fixed no-repeat;
}
body.player.has-brand-bg .player-body,
body.player.has-brand-bg .messages {
  background: transparent;
}
body.player.has-brand-bg .player-nav {
  background: #fff;
}
.player-header.has-banner {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.55)),
    var(--brand-banner) center / cover no-repeat;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.player-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.player-title img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  flex: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.message.with-avatar {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
body.player .message.player.with-avatar {
  flex-direction: row-reverse;
}
.message-main {
  min-width: 0;
}
.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  margin-top: 2px;
}
body.player .message.player .message-label {
  text-align: right;
}

/* ---------- 玩家端聊天页：铺满整屏，消息区内部滚动 ---------- */
.player-shell:has(#player-messages) {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}
.player-shell:has(#player-messages) #player-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.player-shell:has(#player-messages) .player-foot {
  display: none;
}
body.player #player-messages {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.player-shell:has(#player-messages) .player-header.has-banner {
  min-height: 120px;
}
/* 输入区：一行图标按钮 + 发送 */
body.player .composer .compose-tools {
  flex-wrap: nowrap;
  padding-top: 10px;
}
body.player .compose-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
body.player .compose-icon {
  position: relative;
  min-width: 52px;
  height: 48px;
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6f7a92;
  cursor: pointer;
  padding: 0 6px;
}
body.player .compose-icon svg {
  width: 21px;
  height: 21px;
}
body.player .compose-icon span {
  font-size: 10.5px;
  line-height: 1.1;
  white-space: nowrap;
}
body.player .compose-icon:hover {
  background: #f1f3f9;
  color: var(--primary);
}
body.player .compose-icon.on {
  color: var(--primary);
  background: var(--soft);
  font-weight: 600;
}
body.player .compose-icon.on::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--green, #238166)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E")
    center / 8px no-repeat;
}
body.player .compose-icon input {
  display: none;
}
body.player .composer #player-send {
  flex: none;
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
  white-space: nowrap;
}
body.player .composer #upload-name:empty {
  display: none;
}
/* 顶部：标题可换行，退出按钮不折行 */
.player-header .row.spread {
  align-items: flex-start;
  gap: 12px;
}
.player-header h1 {
  font-size: clamp(20px, 6vw, 25px);
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}
.player-nav button {
  white-space: nowrap;
}

/* ---------- 玩家端常见问题：搜索 + 分类标签 + 卡片 ---------- */
.faq-top {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}
.faq-search {
  position: relative;
  flex: 1;
  min-width: 0;
}
.faq-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: #9aa3b5;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.faq-search .player-search {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 14px;
}
.faq-search .player-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.faq-chips-wrap {
  position: relative;
  margin: 0 0 16px;
}
.faq-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 2px 0;
  transition: opacity 0.15s;
}
.faq-chips::-webkit-scrollbar {
  display: none;
}
.faq-chips button {
  flex: none;
}
/* 左右可滚动提示：渐隐遮罩 + 圆形箭头，只在该方向还有内容时出现 */
.faq-chips {
  --fade-left: 0px;
  --fade-right: 0px;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 var(--fade-left),
    #000 calc(100% - var(--fade-right)),
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 var(--fade-left),
    #000 calc(100% - var(--fade-right)),
    transparent 100%
  );
}
.faq-chips-wrap.can-left .faq-chips {
  --fade-left: 48px;
}
.faq-chips-wrap.can-right .faq-chips {
  --fade-right: 48px;
}
.chips-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #4b556b;
  box-shadow: 0 2px 8px rgba(35, 48, 80, 0.15);
  transform: translateY(-50%) scale(0.8);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.chips-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chips-arrow.left {
  left: -4px;
}
.chips-arrow.right {
  right: -4px;
}
.faq-chips-wrap.can-left .chips-arrow.left,
.faq-chips-wrap.can-right .chips-arrow.right {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
.faq-chips::-webkit-scrollbar {
  display: none;
}
.faq-chips.is-muted {
  opacity: 0.45;
}
.faq-chips button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #4b556b;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.faq-chips button span {
  font-size: 11px;
  color: #9aa3b5;
}
.faq-chips button[aria-selected="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.faq-chips button[aria-selected="true"] span {
  color: rgba(255, 255, 255, 0.8);
}
.faq-group {
  margin-bottom: 18px;
}
.faq-group h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 2px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7489;
}
.faq-group h3 span {
  font-size: 11px;
  font-weight: 500;
  color: #a0a8bb;
}
.faq-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.faq-card:hover,
.faq-card:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  box-shadow: 0 4px 14px rgba(35, 48, 80, 0.07);
  outline: none;
}
.faq-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.faq-card-main strong {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}
.faq-card-main small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.55;
  color: #8a93a6;
}
.faq-card .faq-category {
  align-self: flex-start;
  margin: 0 0 2px;
  padding: 3px 8px;
  font-size: 10.5px;
}
.faq-lang {
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f3f8;
  color: #8a93a6;
  font-size: 10.5px;
}
.faq-arrow {
  flex: none;
  font-size: 20px;
  line-height: 1;
  color: #b3bbcd;
}
.faq-result-count {
  margin: 2px 2px 10px;
  font-size: 12px;
  color: #8a93a6;
}
.faq-contact {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, #fff);
}
.faq-contact > div {
  flex: 1;
  min-width: 0;
}
.faq-contact strong {
  font-size: 14px;
}
.faq-contact p {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: #7c879d;
}
.faq-contact .button {
  flex: none;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .faq-contact {
    flex-direction: column;
    align-items: stretch;
  }
}

/* 常见问题：卡片原地展开回答（不再弹窗） */
.faq-card {
  display: block;
  padding: 0;
  overflow: hidden;
}
.faq-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px 14px 16px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.faq-card .faq-arrow {
  transition: transform 0.18s;
}
.faq-card.open {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  box-shadow: 0 6px 18px rgba(35, 48, 80, 0.08);
}
.faq-card.open .faq-arrow {
  transform: rotate(90deg);
  color: var(--primary);
}
.faq-card.open .faq-card-main small {
  display: none;
}
.faq-answer {
  padding: 0 16px 16px;
  animation: faq-open 0.18s ease-out;
}
@keyframes faq-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.faq-fallback {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: #9aa3b5;
}
.faq-answer-text {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f6f8fc;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}
.faq-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 12px;
  font-size: 12.5px;
  color: #7c879d;
}
.faq-feedback-actions {
  display: flex;
  gap: 8px;
}
.faq-feedback-actions .button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}
.faq-thanks {
  color: var(--green, #238166);
  font-weight: 600;
}

/* 页面上方的联系客服按钮（常见问题与咨询记录共用） */
.contact-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 28%, transparent);
}
.contact-cta svg,
.web-contact-done svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.content-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.content-top h3 {
  margin: 0;
  font-size: 16px;
  min-width: 0;
}
@media (max-width: 360px) {
  .contact-cta span {
    display: none;
  }
}
/* 网页表单 */
.web-contact-intro {
  margin: 0 0 14px;
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.web-contact-done {
  text-align: center;
  padding: 18px 6px 8px;
}
.web-contact-done svg {
  width: 40px;
  height: 40px;
  color: var(--primary);
}
.web-contact-done h3 {
  margin: 10px 0 8px;
  font-size: 17px;
}
.web-contact-done p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #5b6478;
}

/* ---------- 顶部横幅：高度缩为 2/3；标题单行，15 个字内不换行 ---------- */
.player-header {
  position: relative;
}
.player-header .row.spread {
  display: block;
}
/* 可用宽度 = 页面宽度 - 左右留白 - 图标；按 15.5 个字分配字号 */
.player-header h1.player-title {
  font-size: clamp(16px, calc((min(100vw, 580px) - 96px) / 15.5), 26px);
  line-height: 1.25;
  white-space: nowrap;
  overflow-wrap: normal;
}
.player-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-header.has-banner {
  min-height: 112px;
  padding-top: 16px;
  padding-bottom: 14px;
}
.player-header.has-banner p {
  margin-top: 6px;
}
.player-shell:has(#player-messages) .player-header.has-banner {
  min-height: 80px;
}

/* 公告：搜索栏上方的标题条 + 公告页 */
.notice-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.notice-strip[hidden] {
  display: none;
}
.notice-unread {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #d23b3b;
}
.notice-more {
  padding: 2px 0;
}
.notice-more summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--primary);
  padding: 6px 4px;
}
.notice-more-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.notice-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 7%, #fff);
  color: var(--ink, #1f2430);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.notice-item:hover {
  border-color: var(--primary);
}
.notice-item svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notice-label {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.notice-item strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}
.notice-go {
  flex: none;
  font-size: 20px;
  line-height: 1;
  color: #9aa1b0;
}
.notice-item.urgent {
  border-color: #f3b9bb;
  background: #fff3f3;
}
.notice-item.urgent svg {
  stroke: #d23b3b;
}
.notice-item.urgent .notice-label {
  color: #c2282e;
}
.notice-item.urgent:hover {
  border-color: #d23b3b;
}
.notice-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.notice-back {
  align-self: flex-start;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
}
.notice-detail {
  padding: 18px 18px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e6e9f0;
}
.notice-detail.urgent {
  border-color: #f3b9bb;
  box-shadow: inset 4px 0 0 #d23b3b;
}
.notice-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, #fff);
}
.notice-tag svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notice-detail.urgent .notice-tag {
  color: #c2282e;
  background: #fff0f0;
}
.notice-detail h2 {
  margin: 10px 0 4px;
  font-size: 18px;
  line-height: 1.4;
}
.notice-meta {
  margin: 0 0 12px;
  font-size: 12px;
  color: #8a91a1;
}
.notice-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.75;
  color: #2b3140;
}
.notice-form-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e6e9f0;
}
.notice-form-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.notice-form-card > .inline-note {
  margin: 0 0 12px;
}
.notice-form-card.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notice-form-card.compact p {
  margin: 2px 0 0;
}
.notice-submit {
  width: 100%;
  margin-top: 4px;
}

/* ---------- 玩家端自适应排版：手机 / 平板 / PC ----------
 * 游戏内（body.game-mode）与网页客服（body.player）共用；
 * 区别：网页客服 PC 版横幅更高，游戏内保留「常见问题 / 我的咨询」标签和聊天页。 */
.faq-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.faq-hours {
  display: none;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e6e9f0;
}
.faq-hours span {
  font-size: 12px;
  font-weight: 700;
  color: #7c879d;
}
.faq-hours p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #2b3140;
  white-space: pre-wrap;
}
.player-ticket {
  background: #fff;
}

@media (min-width: 720px) {
  body.player:not(.force-mobile) .player-shell {
    max-width: 760px;
  }
}
@media (min-width: 960px) {
  body.player:not(.force-mobile) {
    padding: 32px 24px;
  }
  body.player:not(.force-mobile) .player-shell {
    max-width: 1160px;
    min-height: calc(100dvh - 64px);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 60px #1d2a4a1f;
  }
  body.player:not(.force-mobile) .player-header {
    padding: 34px 48px 36px;
  }
  body.player .player-title {
    font-size: 30px;
  }
  body.player:not(.force-mobile) .player-title img {
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }
  body.player:not(.force-mobile) .player-header p {
    font-size: 14px;
  }
  body.player:not(.force-mobile) .player-body {
    padding: 32px 48px 40px;
  }
  body.player:not(.force-mobile) .player-foot {
    padding: 20px 48px 26px;
  }

  body.player:not(.force-mobile) .faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
  }
  body.player:not(.force-mobile) .faq-side {
    position: sticky;
    top: 24px;
  }
  body.player:not(.force-mobile) .faq-side .faq-contact {
    margin-top: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }
  body.player:not(.force-mobile) .faq-side .faq-contact strong {
    font-size: 16px;
  }
  body.player:not(.force-mobile) .faq-side .faq-contact p {
    font-size: 12.5px;
  }
  body.player:not(.force-mobile) .faq-hours {
    display: block;
  }
  /* 右侧已有联系卡和服务时间，搜索栏旁的按钮和页脚不再重复 */
  body.player:not(.force-mobile) .faq-top .contact-cta {
    display: none;
  }
  body.player:not(.force-mobile) .player-shell:has(.faq-hours) .player-foot {
    display: none;
  }
  body.player:not(.force-mobile) .notice-page {
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
  }
}
@media (min-width: 1600px) {
  body.player:not(.force-mobile) .player-shell {
    max-width: 1280px;
  }
  body.player:not(.force-mobile) .faq-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (min-width: 960px) {
  /* 网页客服 PC 版内容区很宽，横幅限制高度，避免占满首屏 */
  body.web-mode:not(.force-mobile) .player-header.has-banner {
    aspect-ratio: auto;
    min-height: 0;
    height: clamp(220px, 22vw, 300px);
  }
}

/* 游戏内：标签栏、咨询记录、聊天在平板 / PC 上的排版 */
@media (min-width: 720px) {
  body.player:not(.force-mobile) .ticket-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  body.player:not(.force-mobile) .ticket-grid .player-ticket {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
  }
  body.player:not(.force-mobile) .ticket-grid .player-ticket small {
    margin-top: auto;
  }
  body.player:not(.force-mobile) .message {
    max-width: 78%;
  }
}
@media (min-width: 960px) {
  body.player:not(.force-mobile) .player-nav {
    padding: 0 48px;
  }
  body.player:not(.force-mobile) .player-nav button {
    font-size: 14px;
  }
  body.player:not(.force-mobile) .ticket-grid {
    gap: 16px;
  }
  /* 聊天：整屏卡片内居中，消息区不过宽 */
  body.player:not(.force-mobile) .player-shell:has(#player-messages) {
    height: calc(100dvh - 64px);
    min-height: 0;
  }
  body.player:not(.force-mobile)
    .player-shell:has(#player-messages)
    #player-content {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
  }
  body.player:not(.force-mobile) .message {
    max-width: 68%;
  }
}
@media (min-width: 1200px) {
  body.player:not(.force-mobile) .ticket-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* 顶部横幅：与「外观装饰」预览同一规则——按 5:2 显示，高度最多 170px；
 * 窗口更宽时只裁掉下半部分，保留人物头部（裁切焦点偏上）。聊天页仍用紧凑高度。 */
.player-header.has-banner {
  aspect-ratio: 5 / 2;
  min-height: 0;
  max-height: 170px;
  height: auto;
  background-position: var(--banner-pos, 50% 22%);
}
.player-shell:has(#player-messages) .player-header.has-banner {
  aspect-ratio: auto;
  max-height: none;
  min-height: 80px;
}

@media (min-width: 960px) {
  body.web-mode:not(.force-mobile) .player-header.has-banner {
    background-position: var(--banner-pos, 50% 22%);
  }
}

/* 顶部横幅：所有页面统一用聊天页的扁平比例（约 4:1），与外观装饰预览一致。 */
.player-header.has-banner,
.player-shell:has(#player-messages) .player-header.has-banner {
  aspect-ratio: 4 / 1;
  min-height: 84px;
  max-height: 120px;
  height: auto;
  padding-top: 14px;
  padding-bottom: 12px;
}

/* LLM 客服回复：参考资料 */
.msg-cite {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(120, 130, 160, 0.3);
  font-size: 11.5px;
  color: #7c879d;
}
.llm-intro {
  margin: 0 0 10px;
}

/* PC / 平板宽屏：背景铺满整页（不再是浮在背景上的卡片），横幅贴顶通栏，内容居中限宽 */
@media (min-width: 960px) {
  body.player:not(.force-mobile) {
    padding: 0;
  }
  body.player:not(.force-mobile) .player-shell {
    max-width: none;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  body.player.has-brand-bg:not(.force-mobile) {
    background:
      linear-gradient(var(--brand-veil), var(--brand-veil)),
      var(--brand-bg) center / cover fixed no-repeat;
  }
  body.player.has-brand-bg:not(.force-mobile) .player-shell {
    background: transparent;
  }
  body.player:not(.force-mobile) .player-nav,
  body.player:not(.force-mobile) .player-body,
  body.player:not(.force-mobile) .player-foot {
    padding-left: max(48px, calc((100% - 1160px) / 2));
    padding-right: max(48px, calc((100% - 1160px) / 2));
  }
  body.player:not(.force-mobile) .player-header {
    padding-left: max(48px, calc((100% - 1160px) / 2));
    padding-right: max(48px, calc((100% - 1160px) / 2));
  }
  body.player.has-brand-bg:not(.force-mobile) .player-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
  }
  /* 聊天页：整屏高度，消息区居中 */
  body.player:not(.force-mobile) .player-shell:has(#player-messages) {
    height: 100dvh;
  }
}
@media (min-width: 1600px) {
  body.player:not(.force-mobile) .player-nav,
  body.player:not(.force-mobile) .player-body,
  body.player:not(.force-mobile) .player-foot,
  body.player:not(.force-mobile) .player-header {
    padding-left: max(48px, calc((100% - 1280px) / 2));
    padding-right: max(48px, calc((100% - 1280px) / 2));
  }
}
@media (min-width: 720px) and (max-width: 959px) {
  body.player:not(.force-mobile) .player-shell {
    max-width: none;
  }
  body.player.has-brand-bg:not(.force-mobile) {
    background:
      linear-gradient(var(--brand-veil), var(--brand-veil)),
      var(--brand-bg) center / cover fixed no-repeat;
  }
  body.player.has-brand-bg:not(.force-mobile) .player-shell {
    background: transparent;
  }
  body.player:not(.force-mobile) .player-nav,
  body.player:not(.force-mobile) .player-body,
  body.player:not(.force-mobile) .player-foot,
  body.player:not(.force-mobile) .player-header {
    padding-left: max(24px, calc((100% - 760px) / 2));
    padding-right: max(24px, calc((100% - 760px) / 2));
  }
}

/* 笔记本与桌面横幅增加高度；手机和平板沿用原有尺寸。 */
@media (min-width: 1100px) {
  body.player:not(.force-mobile) .player-header.has-banner,
  body.player:not(.force-mobile)
    .player-shell:has(#player-messages)
    .player-header.has-banner {
    aspect-ratio: auto;
    height: clamp(180px, 15vw, 240px);
    min-height: 180px;
    max-height: 240px;
  }
}
/* 仅后台打开横幅调整时添加这些类，正常玩家界面不进入编辑状态。 */
.player-header.banner-position-editing {
  outline: 2px dashed var(--primary);
  outline-offset: -3px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.player-header.banner-position-editing::after {
  content: attr(data-banner-edit-label);
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}
.player-header.banner-position-dragging {
  cursor: grabbing;
}

/* LLM 回复的参考资料：资料图标 */
.msg-cite .cite-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.msg-cite .cite-item img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
}
.player-nav .unread[hidden] {
  display: none;
}

/* 转人工分隔提示：居中细线 + 文字 */
.message-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: stretch;
  flex-shrink: 0;
  color: #7b8597;
  font-size: 12px;
}
.message-divider::before,
.message-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}
.message-divider span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(123, 133, 151, 0.25);
  white-space: nowrap;
}
.message-divider svg {
  width: 14px;
  height: 14px;
}

/* 消息里的链接：长链接允许换行，颜色跟随气泡文字并加下划线 */
.bubble a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.bubble a:hover {
  opacity: 0.8;
}
