:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #1f2d2a;
  background: #f2f5f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
}

button,
input,
textarea {
  font: inherit;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef4f2;
}

.login-box {
  width: 380px;
  padding: 32px;
  border: 1px solid #dce6e2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(35, 54, 49, 0.08);
}

.brand {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #0f8b6f;
  color: #ffffff;
  font-weight: 800;
}

.login-box h1,
.page-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-box p,
.page-head p {
  margin: 8px 0 0;
  color: #667a73;
}

.full-btn {
  width: 100%;
}

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

.sidebar {
  padding: 20px 14px;
  border-right: 1px solid #dfe8e5;
  background: #ffffff;
}

.sidebar-title {
  padding: 0 10px 18px;
  color: #0f735d;
  font-weight: 800;
}

.sidebar button {
  width: 100%;
  height: 40px;
  margin-bottom: 4px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #40524b;
  text-align: left;
  cursor: pointer;
}

.sidebar button.active {
  background: #e9f5f1;
  color: #0f735d;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid #dfe8e5;
  background: #ffffff;
}

.topbar div {
  display: grid;
  gap: 2px;
}

.topbar span {
  color: #70837c;
  font-size: 12px;
}

.content {
  min-width: 0;
  padding: 24px;
  overflow: auto;
}

.page-head {
  margin-bottom: 18px;
}

.page-head.inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-head.inline .el-input {
  width: 260px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  padding: 18px;
  border: 1px solid #dfe8e5;
  border-radius: 8px;
  background: #ffffff;
}

.stat span {
  display: block;
  color: #667a73;
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.inline-form,
.model-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.model-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.model-config-panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #dfe8e5;
  border-radius: 8px;
  background: #ffffff;
}

.model-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px 14px;
}

.model-config-panel .el-form-item {
  margin-bottom: 12px;
}

.model-config-panel .el-select,
.model-config-panel .el-input-number,
.model-config-panel .el-input {
  width: 100%;
}

.actions {
  margin-top: 12px;
}

.record-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) 140px 150px 360px 72px 72px 72px;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.chat-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.chat-summary div {
  padding: 12px;
  border: 1px solid #dfe8e5;
  border-radius: 8px;
  background: #f8fbfa;
}

.chat-summary span {
  display: block;
  color: #6b7d77;
  font-size: 12px;
}

.chat-summary strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #1f2d2a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-title {
  margin: 18px 0 10px;
  font-size: 16px;
}

.conversation-list {
  display: grid;
  gap: 12px;
}

.conversation-message {
  padding: 12px;
  border: 1px solid #dfe8e5;
  border-radius: 8px;
  background: #ffffff;
}

.conversation-message.user {
  border-color: #cde7df;
  background: #f2faf7;
}

.message-meta,
.message-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: #6b7d77;
  font-size: 12px;
}

.message-meta strong {
  color: #0f735d;
}

.conversation-message pre,
.prompt-preview {
  margin: 10px 0;
  padding: 10px;
  overflow-x: auto;
  border-radius: 6px;
  background: #f4f7f6;
  color: #223631;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "PingFang SC", monospace;
  line-height: 1.65;
}

.ai-log-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
  color: #40524b;
  font-size: 13px;
}

.error-text {
  color: #b42318;
}
