:root {
  --blue: #2f80ff;
  --blue-strong: #2471f3;
  --sidebar: #1b1d1f;
  --sidebar-active: #34373b;
  --text: #1f2937;
  --muted: #8b95a1;
  --line: #e5e8ef;
  --line-dark: #d8dde6;
  --panel: #ffffff;
  --page: #f4f6fa;
  --soft: #f7f8fb;
  --green: #22c55e;
  --orange: #f59e0b;
  --gray: #9ca3af;
  --shadow: 0 1px 6px rgba(31, 41, 55, 0.08);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Hiragino Sans GB",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration: none;
}

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

.qy-shell {
  display: grid;
  grid-template-columns: 162px minmax(0, 1fr);
  min-height: 100vh;
}

.qy-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--sidebar);
  color: #cfd3d8;
}

.qy-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 70px;
  padding: 0 22px;
  background: var(--blue);
  color: #ffffff;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #ffffff;
  font-size: 24px;
  font-style: italic;
  font-weight: 800;
  transform: skew(-10deg);
}

.qy-logo strong,
.qy-logo span {
  display: block;
}

.qy-logo strong {
  font-size: 21px;
  line-height: 1.05;
}

.qy-logo span {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 3px;
}

.qy-nav {
  padding: 16px 8px;
}

.qy-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 42px;
  margin-bottom: 2px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: #c5c8cc;
  font-size: 15px;
  text-align: left;
}

.qy-nav-item:hover,
.qy-nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

.qy-nav-item.active::after {
  position: absolute;
  top: 11px;
  right: 0;
  width: 4px;
  height: 20px;
  border-radius: 4px 0 0 4px;
  background: var(--blue);
  content: "";
}

.qy-nav-item svg {
  color: #aeb4bc;
}

.sidebar-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 0 20px 16px;
}

.sidebar-bottom button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: transparent;
  color: #9aa0a8;
}

.qy-main {
  display: grid;
  grid-template-rows: 70px minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
}

.qy-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  margin: 6px 6px 0;
  padding: 0 20px;
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.trial-note {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  color: #5f6b7a;
  font-size: 15px;
  white-space: nowrap;
}

.trial-note span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
}

.trial-note svg {
  flex: 0 0 auto;
  color: #8a93a2;
}

.top-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  color: #343b45;
}

.plain-action,
.status-button,
.icon-action,
.avatar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 6px;
  border-radius: 6px;
  background: transparent;
  color: #343b45;
  font-size: 14px;
}

.plain-action:hover,
.status-button:hover,
.icon-action:hover {
  background: #f0f2f5;
}

.status-wrap {
  position: relative;
}

.status-button {
  padding: 0 10px;
  background: #f0f2f5;
}

.status-menu {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 20;
  display: none;
  width: 82px;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(31, 41, 55, 0.16);
}

.status-menu.open {
  display: block;
}

.status-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 34px;
  padding: 0 12px;
  background: transparent;
  color: #4b5563;
  text-align: left;
}

.status-menu button:hover {
  background: #f6f7f9;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.green {
  background: var(--green);
}

.dot.orange {
  background: var(--orange);
}

.dot.gray {
  background: var(--gray);
}

.avatar-action {
  width: 34px;
  padding: 0;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  font-weight: 700;
}

.qy-view {
  display: none;
  min-width: 0;
  min-height: 0;
  margin: 6px;
}

.qy-view.active {
  display: block;
}

.chat-workbench {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  height: calc(100vh - 82px);
  min-height: 650px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.session-column {
  display: grid;
  grid-template-rows: 64px 58px minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: #f8f9fb;
}

.session-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 42px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.session-tabs button {
  height: 40px;
  background: transparent;
  color: #374151;
  font-size: 15px;
  text-align: left;
}

.session-tabs button span {
  color: var(--blue);
}

.session-tabs button:not(.active) span {
  color: #111827;
}

.session-tabs .active {
  color: var(--blue);
}

.more-button {
  display: grid;
  place-items: center;
  color: #737b87 !important;
}

.session-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.session-tools button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: transparent;
  color: #747d8c;
}

.empty-box,
.center-empty,
.wide-empty {
  display: grid;
  place-items: center;
  color: #9aa2ad;
}

.empty-box {
  align-content: center;
  gap: 10px;
}

.empty-box svg {
  width: 38px;
  height: 48px;
  color: #d2d7df;
}

.conversation-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  background: #ffffff;
}

.center-empty {
  gap: 8px;
  margin-top: -30px;
}

.center-empty svg {
  width: 92px;
  height: 82px;
  color: #d9dee6;
}

.center-empty p {
  margin: 0;
  color: #9ca3af;
  font-size: 15px;
}

.float-tools {
  position: absolute;
  right: 0;
  top: 57%;
  overflow: hidden;
  border-radius: 4px 0 0 4px;
}

.float-tools button {
  display: block;
  width: 38px;
  min-height: 46px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--blue);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.25;
}

.page-panel {
  min-height: calc(100vh - 82px);
  padding: 28px 26px;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  font-weight: 500;
}

h2 {
  font-size: 24px;
  font-weight: 500;
}

.info-dot {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #7a8da8;
  border-radius: 50%;
  color: #63758f;
  font-size: 12px;
}

.filter-card {
  position: relative;
  margin-top: 24px;
  padding: 16px 12px 54px;
  background: #f5f7fb;
}

.filter-row {
  display: grid;
  grid-template-columns: 360px repeat(8, minmax(135px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.filter-row.short {
  grid-template-columns: repeat(3, 215px);
}

select,
input {
  height: 32px;
  min-width: 0;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #ffffff;
  color: #374151;
  outline: none;
}

select {
  padding: 0 12px;
}

input {
  padding: 0 10px;
}

.date-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #ffffff;
  color: #111827;
  white-space: nowrap;
}

.date-filter em {
  color: #111827;
  font-style: normal;
}

.filter-actions {
  position: absolute;
  right: 12px;
  bottom: 18px;
  display: flex;
  gap: 14px;
}

.filter-actions button {
  background: transparent;
  color: var(--blue);
  font-size: 15px;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
}

.search-combo {
  display: flex;
  align-items: center;
}

.search-combo select {
  width: 122px;
  border-radius: 5px 0 0 5px;
  background: #f4f5f8;
}

.search-combo label,
.module-search,
.monitor-filters label {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-combo input {
  width: 208px;
  border-left: 0;
  border-radius: 0 5px 5px 0;
}

.search-combo svg,
.module-search svg,
.monitor-filters label svg {
  position: absolute;
  right: 10px;
  color: #8b95a1;
}

.disabled-button {
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #f4f5f8;
  color: #a1a8b3;
}

.data-table {
  margin-top: 14px;
  border: 1px solid var(--line-dark);
  background: #ffffff;
}

.total-line {
  height: 52px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  color: #4b5563;
}

.total-line strong {
  color: var(--blue);
}

.leave-head {
  display: grid;
  grid-template-columns: 44px 120px 260px 150px 120px 120px 120px 150px 120px 150px 140px 140px 48px;
  min-width: 1500px;
  height: 46px;
  align-items: center;
  overflow: auto;
  background: #f4f5f8;
  color: #111827;
  font-weight: 700;
}

.leave-head span {
  padding: 0 10px;
}

.gear {
  display: grid;
  place-items: center;
  font-size: 22px;
}

.table-empty {
  display: grid;
  place-items: center;
  height: 46px;
  color: #6b7280;
}

.page-title-row,
.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-title-row h1 span,
.monitor-panel h2 span {
  color: #9aa2ad;
}

.refresh-note {
  color: #111827;
  font-size: 13px;
}

.refresh-note span {
  color: #c2c8d1;
  margin-left: 8px;
  font-size: 20px;
}

.alarm-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  margin: 34px 8px 54px;
}

.alarm-card {
  min-height: 182px;
  border: 1px solid #d5dbe5;
  background: #ffffff;
}

.alarm-card p {
  padding: 24px 18px 0;
  color: #111827;
  text-align: center;
}

.alarm-card p a {
  margin-left: 10px;
  font-size: 14px;
}

.alarm-card strong {
  display: block;
  margin-top: 22px;
  color: var(--blue);
  font-size: 34px;
  text-align: center;
}

.alarm-card strong span {
  margin-left: 2px;
  font-size: 15px;
  font-weight: 400;
}

.alarm-card div {
  display: flex;
  justify-content: center;
  gap: 32px;
  height: 32px;
  padding-top: 9px;
  background: #f6f6f6;
  color: #6b7280;
  font-size: 13px;
}

.alarm-card div:first-of-type {
  margin-top: 26px;
}

.alarm-card em {
  color: #111827;
  font-style: normal;
}

.monitor-panel h2 {
  margin-left: 2px;
  margin-bottom: 28px;
}

.monitor-filters {
  display: grid;
  grid-template-columns: 182px 182px 182px 132px 200px 182px 100px 200px 88px;
  gap: 12px;
  align-items: center;
}

.monitor-filters select,
.monitor-filters input {
  width: 100%;
}

.monitor-filters label input {
  padding-right: 34px;
}

.tag-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #ffffff;
}

.tag-filter span {
  padding: 4px 8px;
  background: #f2f4f7;
  color: #374151;
}

.wide-empty {
  margin-top: 44px;
  gap: 8px;
  color: #9aa2ad;
}

.wide-empty svg {
  color: #9aa2ad;
}

.blue-button {
  height: 34px;
  padding: 0 14px;
  border-radius: 5px;
  background: var(--blue);
  color: #ffffff;
}

.ticket-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.ticket-column {
  min-height: 420px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7f8fb;
}

.ticket-column h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 12px;
  font-size: 15px;
}

.ticket-card,
.knowledge-card,
.generic-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.ticket-card {
  margin-bottom: 10px;
  padding: 12px;
}

.ticket-card strong,
.knowledge-card strong {
  display: block;
  margin-bottom: 8px;
}

.ticket-card p,
.knowledge-card p,
.generic-card p {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.ticket-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #8b95a1;
  font-size: 12px;
}

.module-search input {
  width: 300px;
  padding-right: 34px;
}

.knowledge-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.knowledge-card {
  min-height: 140px;
  padding: 16px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  font-size: 12px;
}

.generic-view.active {
  display: block;
}

.generic-card {
  max-width: 980px;
  min-height: 420px;
  padding: 22px;
}

.generic-card h1 {
  margin-bottom: 20px;
}

.generic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.generic-item {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.generic-item strong,
.generic-item span {
  display: block;
}

.generic-item span {
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
}

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

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

@media (max-width: 1280px) {
  .filter-row {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .filter-row.short {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .alarm-grid,
  .knowledge-list {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .monitor-filters {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 920px) {
  .qy-shell {
    grid-template-columns: 1fr;
  }

  .qy-sidebar {
    min-height: auto;
  }

  .qy-logo {
    height: 58px;
  }

  .qy-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
  }

  .sidebar-bottom {
    display: none;
  }

  .qy-main {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .qy-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .chat-workbench {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 760px;
  }

  .session-column {
    min-height: 320px;
  }

  .conversation-stage {
    min-height: 360px;
  }

  .ticket-board,
  .knowledge-list,
  .generic-grid {
    grid-template-columns: 1fr;
  }
}
