:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #f4f7fb;
  color: #152238;
}

html,
body {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f7faff 0%, #eef3fb 100%);
  overflow: hidden;
}

.page {
  width: 100vw;
  height: 100vh;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
}

.panel {
  background: #ffffff;
  border: 1px solid #dbe4f2;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(27, 51, 97, 0.08);
}

.hero h1,
.panel h2 {
  margin: 0 0 12px;
}

.subtitle,
.status,
.empty-state {
  color: #53627d;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #315efb;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.9fr) minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
  height: 100%;
}

.model-column,
.review-column {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  overflow: hidden;
}

.column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.attachment-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

textarea {
  width: 100%;
  border: 1px solid #c9d5ea;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #f9fbff;
}

button {
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #315efb, #6c47ff);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
}

button:hover {
  opacity: 0.95;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  background: #eef3fb;
  color: #2446a8;
}

.stop-button {
  background: #eef1f7;
  color: #5d6b85;
}

.status {
  min-height: 22px;
  font-size: 14px;
}

.message-list,
.review-feed {
  display: grid;
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.attachment-list {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 54px;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.attachment-list,
.message-list,
.review-feed {
  scrollbar-width: thin;
  scrollbar-color: #bfd0f1 transparent;
}

.attachment-list::-webkit-scrollbar,
.message-list::-webkit-scrollbar,
.review-feed::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.attachment-list::-webkit-scrollbar-thumb,
.message-list::-webkit-scrollbar-thumb,
.review-feed::-webkit-scrollbar-thumb {
  background: #c8d7f1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.attachment-list::-webkit-scrollbar-track,
.message-list::-webkit-scrollbar-track,
.review-feed::-webkit-scrollbar-track {
  background: transparent;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dbe4f2;
  border-radius: 14px;
  background: #fbfdff;
}

.attachment-meta {
  display: grid;
  gap: 4px;
}

.attachment-name {
  font-weight: 600;
}

.attachment-preview {
  font-size: 13px;
  color: #53627d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.attachment-remove {
  padding: 8px 12px;
  background: #eef3fb;
  color: #2446a8;
}

.message-card,
.review-card {
  border: 1px solid #dbe4f2;
  border-radius: 16px;
  padding: 16px;
  background: #fbfdff;
}

.message-card.user {
  border-left: 6px solid #9aa9c7;
}

.message-card.assistant.left-model {
  border-left: 6px solid #7b4dff;
}

.message-card.assistant.right-model {
  border-left: 6px solid #315efb;
}

.review-card.selected {
  border-left: 6px solid #ff9f43;
}

.review-card.generated.left-model {
  border-left: 6px solid #7b4dff;
}

.review-card.generated.right-model {
  border-left: 6px solid #315efb;
}

.message-card header,
.review-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.message-card h3,
.review-card h3 {
  margin: 0;
  font-size: 16px;
}

.message-content,
.review-content {
  white-space: pre-wrap;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.message-actions,
.review-actions,
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.message-actions,
.review-actions {
  margin-top: 14px;
}

.message-actions button,
.review-actions button,
.action-row button {
  min-width: 92px;
}

.message-actions button,
.review-actions button {
  padding: 8px 12px;
  background: #eef3fb;
  color: #2446a8;
}

.streaming,
.interrupted {
  position: relative;
}

.streaming::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: middle;
  background: linear-gradient(180deg, #315efb, #6c47ff);
  border-radius: 999px;
  animation: blink 1s infinite ease-in-out;
}

.interrupted {
  border-color: #f0c6a8;
  background: #fff8f2;
}

.interrupted::after {
  content: "已中断";
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  margin-left: 8px;
  border-radius: 999px;
  background: #fff0e3;
  color: #b65d16;
  font-size: 12px;
  font-weight: 700;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf2ff;
  color: #315efb;
  font-size: 13px;
  font-weight: 700;
}

.tag.left-model {
  background: #f1ebff;
  color: #7b4dff;
}

.tag.right-model {
  background: #edf2ff;
  color: #315efb;
}

.tag.user {
  background: #eef1f7;
  color: #5d6b85;
}

.tag.review {
  background: #fff0e3;
  color: #b65d16;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.2;
  }

  50% {
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .page {
    height: auto;
    min-height: 100vh;
  }
}
