* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef2f7;
  color: #1f2937;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 50%, #fff7ed 100%);
}

.login-panel {
  width: min(440px, 100%);
  padding: 30px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.13);
}

.brand,
.side-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 26px;
}

.brand p,
.topbar p,
.side-brand span,
.hint {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.2);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 28px 0 18px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
}

.tabs button {
  height: 36px;
  background: transparent;
  border-radius: 8px;
  color: #475569;
}

.tabs button.active {
  background: #ffffff;
  color: #0f766e;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

label {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

label span {
  font-size: 13px;
  color: #475569;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
  align-items: center;
}

.captcha-image {
  min-height: 40px;
  padding: 0;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  overflow: hidden;
}

.captcha-image img {
  display: block;
  width: 100%;
  height: 40px;
  object-fit: cover;
}

.primary {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font-weight: 700;
}

.primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.wide {
  width: 100%;
  margin-top: 12px;
}

.ghost {
  background: #eef2f7;
  color: #334155;
}

.small {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  background: #e0f2fe;
  color: #0369a1;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.error,
.toast {
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 8px;
  padding: 10px 12px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  padding: 22px;
  background: #111827;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
}

.side-brand {
  margin-bottom: 28px;
}

.side-brand strong,
.side-brand span {
  display: block;
}

nav {
  display: grid;
  gap: 8px;
}

nav button,
.logout {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
}

nav button span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
}

nav button.active,
nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

nav button.active span,
nav button:hover span {
  background: #2563eb;
  color: #ffffff;
}

.logout {
  margin-top: auto;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.content {
  padding: 24px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h2 {
  margin: 0;
  font-size: 24px;
}

.grid {
  display: grid;
  gap: 16px;
}

.cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards article,
.panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.cards article {
  padding: 20px;
}

.cards span {
  display: block;
  color: #64748b;
  font-size: 13px;
}

.cards strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.dashboard {
  gap: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 18px;
  align-items: stretch;
  padding: 24px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(37, 99, 235, 0.9)),
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.3), transparent 28%);
  color: #ffffff;
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.18);
}

.dashboard-hero h3 {
  margin: 10px 0 8px;
  font-size: 28px;
}

.dashboard-hero p,
.hero-score em {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
}

.hero-score {
  display: grid;
  align-content: center;
  justify-items: end;
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-score span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.hero-score strong {
  margin: 6px 0;
  font-size: 44px;
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  min-height: 118px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -24px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.1);
}

.metric-card span,
.metric-card em {
  display: block;
  color: #64748b;
  font-size: 13px;
  font-style: normal;
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
}

.accent-green::after {
  background: rgba(16, 185, 129, 0.14);
}

.accent-blue::after {
  background: rgba(37, 99, 235, 0.14);
}

.accent-red::after {
  background: rgba(239, 68, 68, 0.12);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.dashboard-layout:last-child {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.block-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.block-title h3 {
  margin: 0;
  font-size: 16px;
}

.block-title p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.dashboard-chart .trend-row {
  grid-template-columns: 96px 1fr 150px;
}

.trend-list.large {
  gap: 12px;
}

.trend-bars.triple {
  gap: 5px;
}

.trend-bars .failed {
  background: linear-gradient(90deg, #fb7185, #ef4444);
}

.ai-funnel {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.funnel {
  display: grid;
  gap: 10px;
}

.funnel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 10px;
  background: #eef6ff;
  color: #1e3a8a;
}

.funnel div:nth-child(2) {
  margin-left: 18px;
  background: #ecfdf5;
  color: #047857;
}

.funnel div:nth-child(3) {
  margin-left: 36px;
  background: #f0fdf4;
  color: #15803d;
}

.funnel div.danger {
  margin-left: 54px;
  background: #fef2f2;
  color: #b91c1c;
}

.funnel span {
  font-size: 13px;
}

.funnel strong {
  font-size: 24px;
}

.platform-list,
.rank-list {
  display: grid;
  gap: 10px;
}

.platform-row,
.rank-row {
  display: grid;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fbfdff;
}

.platform-row {
  grid-template-columns: 92px 1fr;
}

.platform-row div,
.rank-row div {
  display: grid;
  gap: 3px;
}

.platform-row strong,
.rank-row strong {
  color: #0f172a;
}

.platform-row em,
.rank-row span {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.rank-row {
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
}

.rank-row b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 13px;
}

.rank-row em {
  color: #0f766e;
  font-style: normal;
  font-weight: 800;
}

.panel {
  padding: 18px;
}

.stack {
  display: grid;
  gap: 16px;
}

.form {
  max-width: 760px;
}

.form-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
}

.form-hint {
  margin: -6px 0 6px;
  color: #667085;
  font-size: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 140px auto;
  gap: 10px;
}

.user-create-row {
  grid-template-columns: 1fr 1fr 1fr 130px auto;
}

.ip-row {
  grid-template-columns: 1fr 1fr auto;
}

.version-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.version-form label {
  margin: 0;
}

.version-form .check {
  min-height: 40px;
}

.version-notes {
  grid-column: span 2;
}

.version-notes textarea {
  min-height: 80px;
}

.version-upload-button {
  align-self: end;
}

a {
  color: #0369a1;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

th,
td {
  height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

.mono-cell {
  max-width: 180px;
  font-family: Consolas, "Microsoft YaHei", monospace;
  white-space: nowrap;
}

th {
  color: #64748b;
  font-weight: 700;
  background: #f8fafc;
}

tbody tr:hover {
  background: #f8fafc;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.tag.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.tag.success {
  background: #dcfce7;
  color: #15803d;
}

.danger-button {
  background: #fee2e2;
  color: #b91c1c;
}

.danger-button:hover {
  background: #fecaca;
  color: #991b1b;
}

.admin-block {
  display: grid;
  gap: 12px;
}

.admin-block h3 {
  margin: 0;
  font-size: 16px;
}

.trend-list {
  display: grid;
  gap: 10px;
}

.trend-row {
  display: grid;
  grid-template-columns: 96px 1fr 120px;
  gap: 12px;
  align-items: center;
  color: #475569;
  font-size: 13px;
}

.trend-bars {
  display: grid;
  gap: 4px;
}

.trend-bars i {
  display: block;
  height: 8px;
  border-radius: 999px;
}

.trend-bars .received {
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.trend-bars .replied {
  background: linear-gradient(90deg, #34d399, #059669);
}

.trend-row em {
  color: #64748b;
  font-style: normal;
  text-align: right;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
  min-height: auto;
}

.sub-list {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.image-field {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.image-field label {
  margin: 0;
}

.image-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.image-preview {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 12px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.upload-button {
  width: auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  cursor: pointer;
}

.upload-button input {
  display: none;
}

.model-layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 22px;
  align-items: start;
}

.model-list {
  display: grid;
  gap: 12px;
}

.model-list h3 {
  margin: 0;
}

.model-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.model-card.active {
  border-color: #0f766e;
  background: #ecfdf5;
}

.model-card strong,
.model-card span,
.model-card em {
  display: block;
}

.model-card span,
.model-card em {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  font-style: normal;
}

.model-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ai-test-box {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
}

.ai-test-box h3 {
  margin: 0;
}

.ai-test-box label {
  margin: 0;
}

.ai-test-result {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.ai-test-result p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.ai-test-result span {
  color: #64748b;
  font-size: 12px;
}

.key-list {
  display: grid;
  gap: 8px;
}

.key-list p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  color: #64748b;
  font-size: 13px;
}

.pager div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager strong {
  color: #334155;
  min-width: 52px;
  text-align: center;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .cards,
  .metric-grid,
  .dashboard-hero,
  .dashboard-layout,
  .dashboard-layout:last-child,
  .form-row,
  .version-form,
  .model-layout {
    grid-template-columns: 1fr;
  }

  .hero-score {
    justify-items: start;
  }

  .dashboard-chart .trend-row,
  .trend-row {
    grid-template-columns: 1fr;
  }

  .trend-row em {
    text-align: left;
  }

  .version-notes {
    grid-column: auto;
  }

  .model-card,
  .image-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .pager {
    align-items: flex-start;
    flex-direction: column;
  }
}
