:root {
  --blue: #2388df;
  --blue-dark: #1d78c6;
  --line: #d9e0e8;
  --text: #001a3a;
  --muted: #5c6b7a;
  --bg: #f2f2f2;
  --panel: #ffffff;
  --red: #ff0000;
  --orange: #ff9900;
  --soft: #f8fafc;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Hiragino Sans GB",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  display: grid;
  place-items: start center;
  margin: 0;
  padding: 38px 10px;
  background: var(--bg);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.service-window {
  width: min(1000px, 100%);
  min-height: 830px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.service-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 10px 20px;
  background: var(--blue);
  color: #ffffff;
}

.service-logo {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  background: #ffffff;
  color: var(--blue);
  border-radius: 2px;
}

.service-logo svg {
  width: 38px;
  height: 38px;
  fill: currentColor;
  stroke: none;
}

.service-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

.service-title h1 span {
  color: #00ff00;
  font-size: 16px;
  font-weight: 700;
}

.service-title p {
  margin: 4px 0 0;
  font-size: 14px;
}

.service-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 754px;
}

.chat-side {
  display: grid;
  grid-template-rows: auto minmax(380px, 1fr) 50px 214px;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.notice {
  min-height: 40px;
  padding: 12px 8px 8px;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
}

.message-list {
  overflow: auto;
  padding: 8px 16px 20px;
  background: #ffffff;
}

.message {
  display: flex;
  margin: 10px 0;
}

.message.customer {
  justify-content: flex-end;
}

.bubble {
  max-width: min(72%, 520px);
  padding: 9px 12px;
  border: 1px solid #d3e0ed;
  border-radius: 4px;
  background: #f7fbff;
  color: #001a3a;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.message.customer .bubble {
  border-color: #b8daf7;
  background: #e7f3ff;
}

.bubble small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.tool-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  color: #8aa1b8;
}

.tool-button:hover {
  color: var(--blue-dark);
}

.image-tool {
  color: #a26f2a;
}

.input-area {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 52px;
  background: #ffffff;
}

.input-area textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 16px;
  border: 0;
  resize: none;
  outline: 0;
  color: var(--text);
  font-size: 15px;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px 16px 16px;
}

.input-footer a {
  overflow: hidden;
  color: #2688ff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  min-height: 38px;
  padding: 0 22px;
  background: var(--blue);
  color: #ffffff;
  border-radius: 3px;
  font-size: 18px;
}

.send-button:hover {
  background: var(--blue-dark);
}

.help-side {
  background: #ffffff;
}

.help-side h2 {
  display: grid;
  place-items: center;
  min-height: 50px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  font-weight: 400;
}

.help-content {
  padding: 22px 14px;
}

.help-content p {
  margin: 0 0 24px;
  color: #001a3a;
  font-size: 15px;
  line-height: 1.5;
}

.apply-link {
  display: inline;
  padding: 0;
  background: transparent;
  color: #5f6368;
  font-size: 20px;
  text-decoration: underline;
}

.orange-tip {
  margin-top: 18px;
  color: var(--orange) !important;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 340px;
  padding: 12px 14px;
  background: #1f2937;
  color: #ffffff;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  body {
    padding: 0;
  }

  .service-window {
    min-height: 100vh;
    box-shadow: none;
  }

  .service-body {
    grid-template-columns: 1fr;
  }

  .chat-side {
    min-height: 680px;
    border-right: 0;
  }

  .help-side {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .service-header {
    padding: 10px 12px;
  }

  .service-title h1 {
    font-size: 17px;
  }

  .service-title p,
  .notice,
  .help-content p {
    font-size: 13px;
  }

  .input-footer {
    align-items: stretch;
    flex-direction: column;
    padding-right: 16px;
  }

  .send-button {
    width: 100%;
  }
}
