:root {
  --bg: #f7f6ff;
  --panel: rgba(255, 255, 255, 0.92);
  --ink: #1c2142;
  --muted: #666d94;
  --line: rgba(41, 54, 124, 0.12);
  --accent: #ff6f8f;
  --accent-2: #53d7ff;
  --accent-3: #bfff6d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 0 0, rgba(255, 111, 143, 0.18), transparent 32%),
    radial-gradient(circle at 100% 10%, rgba(83, 215, 255, 0.18), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(191, 255, 109, 0.2), transparent 24%),
    var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
}

.brand-mark {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
}

.nav {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-link {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-link--active,
.nav-link:hover {
  border-color: rgba(83, 215, 255, 0.35);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(86, 107, 214, 0.08);
}

.content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-view {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.admin-view--active {
  display: flex;
}

.hero,
.panel,
.metric-card,
.word-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  box-shadow:
    0 18px 36px rgba(75, 93, 196, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.hero {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.hero h1,
.panel h2,
.word-card h3 {
  margin: 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero p {
  max-width: 680px;
  line-height: 1.7;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.metric-group {
  display: grid;
  gap: 12px;
}

.metric-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

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

.metric-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-card span,
.metric-card small,
.filters,
table {
  color: var(--muted);
}

.metric-card strong {
  font-size: 30px;
}

.panel {
  padding: 24px;
}

.panel-note {
  margin: -4px 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.user-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.user-workbench {
  width: 100%;
}

.user-tab-panel {
  display: none;
}

.user-tab-panel--active {
  display: block;
}

.user-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.user-search-field {
  width: min(420px, 100%);
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters span,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(83, 215, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--ink);
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.word-deck {
  padding: 16px;
  border-radius: 20px;
  background: rgba(247, 250, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(83, 215, 255, 0.18);
}

.word-deck--active-pool {
  background: linear-gradient(135deg, rgba(255, 247, 252, 0.96), rgba(239, 248, 255, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 111, 143, 0.22), 0 14px 34px rgba(41, 54, 124, 0.08);
}

.word-deck__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.word-deck__head h3 {
  margin: 0;
  font-size: 17px;
}

.word-deck__flag {
  margin-left: 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.word-deck__head span {
  color: var(--muted);
  font-size: 13px;
}

.word-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.09);
}

.word-chip strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.word-chip em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.word-delete {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 95, 120, 0.12);
  color: #d93655;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.danger-button {
  color: #d93655;
}

.prompt-layout {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
  gap: 18px;
}

.prompt-subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.prompt-tab-button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.1);
}

.prompt-tab-button--active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 28px rgba(41, 54, 124, 0.18);
}

.prompt-workbench {
  width: 100%;
}

.prompt-tab-panel {
  display: none;
}

.quote-tab-panel,
.eval-tab-panel,
.model-tab-panel {
  display: none;
}

.prompt-tab-panel--active,
.quote-tab-panel--active,
.eval-tab-panel--active,
.model-tab-panel--active {
  display: block;
}

.prompt-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(247, 250, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(83, 215, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.prompt-card--wide {
  width: 100%;
}

.admin-error {
  margin: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 111, 143, 0.12);
  color: #7b2140;
  font-weight: 700;
}

.prompt-card__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.prompt-card__head h3,
.prompt-card__eyebrow {
  margin: 0;
}

.prompt-card__eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.prompt-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.prompt-meta span {
  overflow-wrap: anywhere;
}

.prompt-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.prompt-actions--sticky {
  position: sticky;
  top: 12px;
  z-index: 3;
  padding: 12px;
  border-radius: 18px;
  background: rgba(247, 250, 255, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.08), 0 14px 36px rgba(41, 54, 124, 0.08);
}

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

.prompt-editor-grid--runtime {
  max-width: 920px;
}

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

.prompt-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-field label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.prompt-field--full {
  grid-column: 1 / -1;
}

.fake-input,
.fake-textarea,
.real-input,
.real-textarea {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.1);
  color: var(--ink);
}

.fake-input {
  min-height: 44px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
}

.fake-textarea {
  min-height: 108px;
  padding: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.fake-textarea--code {
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.real-input,
.real-textarea {
  width: 100%;
  border: 0;
  font: inherit;
  outline: none;
}

.real-input {
  min-height: 44px;
  padding: 12px 14px;
}

.real-textarea {
  min-height: 140px;
  padding: 14px;
  line-height: 1.7;
  resize: vertical;
}

.real-textarea--lg {
  min-height: 220px;
}

.real-textarea--xl {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.prompt-result {
  min-height: 320px;
}

.prompt-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(41, 54, 124, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prompt-status[data-state="running"] {
  background: rgba(255, 190, 82, 0.2);
  color: #a26100;
}

.prompt-status[data-state="success"] {
  background: rgba(73, 202, 139, 0.2);
  color: #1f7a4d;
}

.prompt-status[data-state="error"] {
  background: rgba(255, 111, 143, 0.18);
  color: #a8284f;
}

.published-prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.prompt-readonly {
  max-height: 520px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.1);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
}

.prompt-version-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
}

.prompt-eval-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  align-items: start;
}

.prompt-version-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-version-item {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.1);
}

.prompt-version-item strong,
.prompt-version-item span,
.prompt-version-item em {
  display: block;
}

.prompt-version-item span,
.prompt-version-item em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.prompt-version-item--active {
  background: #182044;
  color: #fff;
}

.prompt-version-item--active span,
.prompt-version-item--active em {
  color: rgba(255, 255, 255, 0.72);
}

.record-detail summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.record-detail__body {
  min-width: 520px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.09);
}

.record-detail__body h4 {
  margin: 12px 0 6px;
}

.record-detail__body h4:first-child {
  margin-top: 0;
}

.record-detail__body pre {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  padding: 12px;
  border-radius: 12px;
  background: #f7f9ff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.7;
}

.pair-chips {
  display: inline-flex;
  gap: 6px;
  margin-right: 8px;
  vertical-align: middle;
}

.pair-chips em,
.record-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 105, 145, 0.14);
  color: var(--hot);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.record-meta span {
  background: rgba(83, 215, 255, 0.14);
  color: var(--muted);
}

.attempt-list {
  display: grid;
  gap: 14px;
}

.attempt-card,
.model-output-card {
  padding: 14px;
  border-radius: 16px;
  background: #fbfcff;
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.08);
}

.attempt-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.attempt-card__head span {
  color: var(--muted);
  font-weight: 900;
}

.attempt-card__head strong {
  color: var(--ink);
  font-size: 20px;
}

.attempt-card h5,
.model-output-card h5 {
  margin: 12px 0 6px;
  color: var(--ink);
}

.attempt-card h5:first-of-type {
  margin-top: 0;
}

.attempt-card__text,
.empty-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  white-space: pre-wrap;
}

.score-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.score-detail-card {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.08);
}

.score-detail-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.score-detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.model-output-card {
  margin-top: 10px;
}

.model-output-card summary {
  cursor: pointer;
  font-weight: 900;
}

.model-output-card__body {
  margin-top: 10px;
}

.primary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9855 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(255, 111, 143, 0.22);
}

.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-2) 0%, #5a7bff 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(90, 123, 255, 0.18);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(41, 54, 124, 0.1);
}

.phone-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .metrics,
  .metric-group__grid,
  .word-grid,
  .user-management-grid,
  .prompt-layout,
  .prompt-editor-grid,
  .prompt-lab-grid,
  .published-prompt-grid,
  .prompt-version-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }
}
