/* TTAI API · 模型广场 */

:root {
  --mk-bg: #f6f7f9;
  --mk-surface: #ffffff;
  --mk-surface-2: #fafbfc;
  --mk-fg: #15171c;
  --mk-muted: #6b7280;
  --mk-faint: #9aa1ae;
  --mk-border: #e5e7ec;
  --mk-border-strong: #d6d9e0;
  --mk-accent: #3b6ef5;
  --mk-accent-soft: #eef2ff;
  --mk-chip: #f1f3f6;
  --mk-chip-hover: #e8ebf1;
  --mk-shadow: 0 1px 2px rgba(16, 20, 30, 0.04);
  --mk-radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mk-bg: #0d0f14;
    --mk-surface: #14171d;
    --mk-surface-2: #181b22;
    --mk-fg: #e8ebf2;
    --mk-muted: #98a0b0;
    --mk-faint: #6f7787;
    --mk-border: #242a35;
    --mk-border-strong: #333a48;
    --mk-accent: #6f95ff;
    --mk-accent-soft: #1b2440;
    --mk-chip: #1b1f27;
    --mk-chip-hover: #232833;
    --mk-shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --mk-bg: #0d0f14;
  --mk-surface: #14171d;
  --mk-surface-2: #181b22;
  --mk-fg: #e8ebf2;
  --mk-muted: #98a0b0;
  --mk-faint: #6f7787;
  --mk-border: #242a35;
  --mk-border-strong: #333a48;
  --mk-accent: #6f95ff;
  --mk-accent-soft: #1b2440;
  --mk-chip: #1b1f27;
  --mk-chip-hover: #232833;
  --mk-shadow: none;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--mk-bg);
  color: var(--mk-fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Inter, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

.mk-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 顶栏 ---------- */

.mk-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--mk-surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--mk-border);
}

.mk-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.mk-brand img {
  border-radius: 6px;
}

.mk-navlinks {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--mk-chip);
}

.mk-navlinks a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--mk-muted);
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease;
}

.mk-navlinks a:hover {
  color: var(--mk-fg);
}

.mk-navlinks a.is-active {
  background: var(--mk-surface);
  color: var(--mk-fg);
  font-weight: 600;
  box-shadow: var(--mk-shadow);
}

.mk-navactions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mk-iconbtn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--mk-muted);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.mk-iconbtn svg {
  width: 17px;
  height: 17px;
}

.mk-iconbtn:hover {
  background: var(--mk-chip);
  color: var(--mk-fg);
}

.mk-link {
  font-size: 13px;
  color: var(--mk-muted);
  padding: 6px 4px;
  transition: color 0.16s ease;
}

.mk-link:hover {
  color: var(--mk-fg);
}

.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--mk-border-strong);
  border-radius: 9px;
  background: var(--mk-surface);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.mk-btn:hover {
  border-color: var(--mk-faint);
}

.mk-btn--primary {
  border-color: transparent;
  background: var(--mk-accent);
  color: #fff;
}

.mk-btn--primary:hover {
  background: color-mix(in srgb, var(--mk-accent) 88%, #000);
}

/* ---------- 容器 ---------- */

.mk-main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 24px 64px;
}

/* ---------- 英雄区 ---------- */

.mk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 396px;
  gap: 40px;
  align-items: end;
  padding-bottom: 26px;
}

.mk-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--mk-border);
  border-radius: 999px;
  background: var(--mk-surface);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--mk-muted);
}

.mk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mk-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mk-accent) 16%, transparent);
}

.mk-hero h1 {
  margin: 18px 0 0;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.mk-hero h1 span {
  color: var(--mk-accent);
}

.mk-lede {
  margin: 14px 0 0;
  max-width: 520px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--mk-muted);
}

.mk-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  padding: 1px;
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  background: var(--mk-border);
  overflow: hidden;
}

.mk-kpi {
  padding: 14px 16px;
  background: var(--mk-surface);
}

.mk-kpi dt {
  font-size: 12px;
  color: var(--mk-muted);
}

.mk-kpi dd {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 0;
}

.mk-kpi strong {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mk-kpi em {
  font-style: normal;
  font-size: 12px;
  color: var(--mk-faint);
}

/* ---------- 筛选面板 ---------- */

.mk-panel {
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  background: var(--mk-surface);
  overflow: hidden;
}

.mk-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--mk-border);
}

.mk-row--head {
  align-items: center;
  padding: 10px 16px;
}

.mk-rowlabel {
  flex: none;
  width: 52px;
  padding-top: 7px;
  font-size: 12.5px;
  color: var(--mk-faint);
  letter-spacing: 0.01em;
}

.mk-row--head .mk-rowlabel {
  padding-top: 0;
  width: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--mk-muted);
  letter-spacing: 0.02em;
}

.mk-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--mk-chip);
}

.mk-tab {
  height: 26px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mk-muted);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.mk-tab:hover {
  color: var(--mk-fg);
}

.mk-tab.is-active {
  background: var(--mk-surface);
  color: var(--mk-fg);
  font-weight: 600;
  box-shadow: var(--mk-shadow);
}

.mk-tab em {
  font-style: normal;
  margin-left: 5px;
  font-size: 11.5px;
  color: var(--mk-faint);
  font-variant-numeric: tabular-nums;
}

.mk-reset {
  margin-left: auto;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mk-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.mk-reset:hover {
  background: var(--mk-chip);
  color: var(--mk-fg);
}

.mk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.mk-chips--models {
  max-height: 34px;
  overflow: hidden;
}

.mk-chips--models.is-open {
  max-height: none;
}

.mk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--mk-chip);
  color: var(--mk-fg);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.mk-chip:hover {
  background: var(--mk-chip-hover);
}

.mk-chip.is-active {
  border-color: color-mix(in srgb, var(--mk-accent) 45%, transparent);
  background: var(--mk-accent-soft);
  color: var(--mk-accent);
  font-weight: 600;
}

.mk-chip em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--mk-faint);
  font-variant-numeric: tabular-nums;
}

.mk-chip.is-active em {
  color: color-mix(in srgb, var(--mk-accent) 72%, transparent);
}

.mk-vdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}

.mk-chip.is-active .mk-vdot {
  opacity: 1;
}

.mk-more {
  flex: none;
  height: 30px;
  padding: 0 11px;
  border: 1px dashed var(--mk-border-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--mk-muted);
  font-size: 12.5px;
  cursor: pointer;
}

.mk-more:hover {
  color: var(--mk-fg);
  border-color: var(--mk-faint);
}

.mk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
}

.mk-result {
  margin: 0;
  font-size: 12.5px;
  color: var(--mk-muted);
}

.mk-result b {
  color: var(--mk-fg);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mk-result span {
  margin-left: 6px;
  color: var(--mk-faint);
}

.mk-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--mk-border-strong);
  border-radius: 9px;
  background: var(--mk-surface);
  color: var(--mk-faint);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.mk-search:focus-within {
  border-color: var(--mk-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mk-accent) 14%, transparent);
}

.mk-search svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.mk-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--mk-fg);
}

.mk-search input::placeholder {
  color: var(--mk-faint);
}

/* ---------- 表格 ---------- */

.mk-tablewrap {
  position: relative;
  margin-top: 16px;
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  background: var(--mk-surface);
  overflow: hidden;
}

.mk-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mk-col-pick { width: 4%; }
.mk-col-name { width: 26%; }
.mk-col-vendor { width: 9%; }
.mk-col-billing { width: 8%; }
.mk-col-price { width: 10%; }
.mk-col-endpoint { width: 10%; }
.mk-col-group { width: 8%; }
.mk-col-action { width: 5%; }

.mk-table th.mk-col-pick,
.mk-table td.mk-cell-pick {
  padding-left: 12px;
  padding-right: 0;
}

.mk-thbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.mk-thbtn:hover {
  color: var(--mk-fg);
}

.mk-thind {
  font-size: 9px;
  line-height: 1;
  color: var(--mk-faint);
}

.mk-thbtn.is-sorted {
  color: var(--mk-accent);
}

.mk-thbtn.is-sorted .mk-thind::after {
  content: "▲";
}

.mk-table th[aria-sort="descending"] .mk-thind::after {
  content: "▼";
}

.mk-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.mk-check input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.mk-check span {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--mk-border-strong);
  border-radius: 4px;
  background: var(--mk-surface);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.mk-check input:checked + span {
  border-color: var(--mk-accent);
  background: var(--mk-accent);
  box-shadow: inset 0 0 0 2px var(--mk-surface);
}

.mk-check input:focus-visible + span {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mk-accent) 20%, transparent);
}

.mk-check input:disabled + span {
  opacity: 0.4;
  cursor: not-allowed;
}

.mk-table th {
  padding: 10px 14px;
  background: var(--mk-surface-2);
  border-bottom: 1px solid var(--mk-border);
  font-size: 12px;
  font-weight: 550;
  color: var(--mk-muted);
  text-align: left;
  white-space: nowrap;
}

.mk-table th.mk-num {
  text-align: right;
}

.mk-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--mk-border);
  vertical-align: middle;
}

.mk-table tbody tr:last-child td {
  border-bottom: 0;
}

.mk-table tbody tr {
  transition: background 0.14s ease;
}

.mk-table tbody tr:hover {
  background: var(--mk-surface-2);
}

.mk-table tbody tr:hover .mk-name {
  color: var(--mk-accent);
}

.mk-model {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mk-model-text {
  min-width: 0;
}

.mk-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.mk-logo img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.mk-logo--mono {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: #6b7280;
  box-shadow: none;
}

.mk-logo--mono[data-tone="智谱"] {
  background: #3859ff;
}

.mk-logo--mono[data-tone="Midjourney"] {
  background: #1a222d;
}

.mk-logo--lg {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.mk-logo--lg img {
  width: 22px;
  height: 22px;
}

.mk-logo--lg.mk-logo--mono {
  font-size: 13px;
}

.mk-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  word-break: break-word;
  transition: color 0.14s ease;
}

.mk-desc {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: 12px;
  color: var(--mk-muted);
}

.mk-vendor {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--mk-muted);
  white-space: nowrap;
}

.mk-vendor i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mk-accent);
  opacity: 0.55;
}

.mk-billing {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--mk-chip);
  font-size: 11.5px;
  color: var(--mk-muted);
  white-space: nowrap;
}

.mk-price {
  display: block;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mk-price b {
  font-weight: 600;
}

.mk-price span {
  margin-left: 3px;
  font-size: 11px;
  color: var(--mk-faint);
}

.mk-price.is-empty {
  color: var(--mk-faint);
}

.mk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mk-tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--mk-border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--mk-muted);
  white-space: nowrap;
}

.mk-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--mk-faint);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.mk-detail-label {
  display: none;
  font-size: 12.5px;
}

.mk-detail:hover {
  background: var(--mk-chip);
  color: var(--mk-fg);
}

.mk-detail svg {
  width: 15px;
  height: 15px;
}

.mk-state {
  padding: 56px 24px;
  text-align: center;
}

.mk-state-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.mk-state-desc {
  margin: 6px 0 16px;
  font-size: 13px;
  color: var(--mk-muted);
}

.mk-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--mk-faint);
}

.mk-foot p {
  margin: 0;
}

.mk-foot a {
  color: var(--mk-muted);
  transition: color 0.16s ease;
}

.mk-foot a:hover {
  color: var(--mk-accent);
}

.mk-foot span {
  margin: 0 7px;
  opacity: 0.5;
}

/* ---------- 弹层 ---------- */

.mk-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.mk-modal[hidden] {
  display: none;
}

.mk-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(9, 12, 20, 0.5);
  backdrop-filter: blur(2px);
}

.mk-modal-panel {
  position: relative;
  width: min(100%, 620px);
  max-height: calc(100svh - 48px);
  overflow: auto;
  border: 1px solid var(--mk-border);
  border-radius: 16px;
  background: var(--mk-surface);
  box-shadow: 0 24px 64px -24px rgba(10, 15, 30, 0.45);
  animation: mkModalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.mk-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--mk-border);
}

.mk-modal-titlewrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mk-modal-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.mk-modal-head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--mk-muted);
}

.mk-modal-body {
  padding: 18px 22px 22px;
}

.mk-modal-body h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--mk-faint);
}

.mk-modal-body p {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--mk-muted);
}

.mk-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 18px;
  padding: 1px;
  border: 1px solid var(--mk-border);
  border-radius: 10px;
  background: var(--mk-border);
  overflow: hidden;
}

.mk-grid3 div {
  padding: 11px 13px;
  background: var(--mk-surface);
}

.mk-grid3 span {
  display: block;
  font-size: 11.5px;
  color: var(--mk-faint);
}

.mk-grid3 b {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mk-formula {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--mk-border);
  border-radius: 10px;
  background: var(--mk-surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--mk-muted);
  word-break: break-all;
}

.mk-modal-body .mk-tags {
  margin-bottom: 18px;
}

.mk-modal-actions {
  display: flex;
  gap: 10px;
}

.mk-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--mk-muted);
}

.mk-btn--ghost:hover {
  background: var(--mk-chip);
  border-color: transparent;
  color: var(--mk-fg);
}

.mk-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- 加载更多 ---------- */

.mk-morewrap {
  display: flex;
  justify-content: center;
  padding: 0 16px 14px;
}

.mk-morewrap:has([hidden]) {
  display: none;
}

/* ---------- 对比 ---------- */

.mk-comparebar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 80;
  width: min(100% - 32px, 760px);
  transform: translateX(-50%);
}

.mk-comparebar[hidden] {
  display: none;
}

.mk-comparebar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--mk-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--mk-surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 18px 40px -16px rgba(10, 15, 30, 0.4);
}

.mk-comparebar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.mk-pickchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 220px;
  height: 26px;
  padding: 0 3px 0 9px;
  border-radius: 7px;
  background: var(--mk-accent-soft);
  color: var(--mk-accent);
  font-size: 12px;
  font-weight: 550;
  overflow: hidden;
  white-space: nowrap;
}

.mk-pickchip > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mk-pickchip button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-size: 10px;
  cursor: pointer;
}

.mk-pickchip button:hover {
  background: color-mix(in srgb, var(--mk-accent) 16%, transparent);
}

.mk-comparebar-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.mk-modal-panel--wide {
  width: min(100%, 900px);
}

.mk-cmp-scroll {
  overflow-x: auto;
  margin-bottom: 4px;
}

.mk-cmp {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.mk-cmp th,
.mk-cmp td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--mk-border);
  text-align: left;
  vertical-align: top;
}

.mk-cmp thead th {
  border-bottom: 1px solid var(--mk-border-strong);
  font-weight: 600;
}

.mk-cmp tbody th {
  width: 88px;
  font-weight: 500;
  color: var(--mk-faint);
  white-space: nowrap;
}

.mk-cmp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mk-cmp-head > span {
  font-weight: 600;
  word-break: break-word;
}

.mk-cmp .mk-logo {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.mk-cmp .mk-logo img {
  width: 15px;
  height: 15px;
}

.mk-cmp .mk-logo--mono {
  font-size: 10px;
}

.mk-cmp .mk-price {
  text-align: left;
}

.mk-cmp tfoot td {
  padding-top: 14px;
  border-bottom: 0;
}

/* ---------- 调用示例 ---------- */

.mk-code {
  margin: 0 0 18px;
  border: 1px solid var(--mk-border);
  border-radius: 10px;
  background: var(--mk-surface-2);
  overflow: hidden;
}

.mk-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--mk-border);
  background: var(--mk-surface);
}

.mk-code-tabs {
  display: flex;
  gap: 2px;
}

.mk-code-tab {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mk-muted);
  font-size: 12px;
  cursor: pointer;
}

.mk-code-tab:hover {
  color: var(--mk-fg);
}

.mk-code-tab.is-active {
  background: var(--mk-chip);
  color: var(--mk-fg);
  font-weight: 600;
}

.mk-code-copy {
  flex: none;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--mk-border-strong);
  border-radius: 6px;
  background: var(--mk-surface);
  color: var(--mk-muted);
  font-size: 12px;
  cursor: pointer;
}

.mk-code-copy:hover {
  color: var(--mk-fg);
}

.mk-code-pane {
  display: none;
  margin: 0;
  padding: 12px 14px;
  max-height: 280px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--mk-fg);
  tab-size: 2;
}

.mk-code-pane.is-active {
  display: block;
}

.mk-code-pane code {
  font: inherit;
  white-space: pre;
}

.mk-modal-body .mk-code-note {
  margin: -8px 0 18px;
  font-size: 11.5px;
  color: var(--mk-faint);
}

/* ---------- 动效 ---------- */

@keyframes mkRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mkModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mk-hero-copy,
.mk-kpis,
.mk-panel,
.mk-tablewrap {
  animation: mkRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mk-kpis {
  animation-delay: 0.06s;
}

.mk-panel {
  animation-delay: 0.12s;
}

.mk-tablewrap {
  animation-delay: 0.18s;
}

.mk-table tbody.is-filtered {
  animation: mkRise 0.18s ease both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 平板 ---------- */

@media (max-width: 1080px) {
  .mk-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .mk-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- 移动端 ---------- */

@media (max-width: 900px) {
  .mk-nav {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }

  .mk-navlinks {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mk-navlinks::-webkit-scrollbar {
    display: none;
  }

  .mk-navactions .mk-link {
    display: none;
  }

  .mk-main {
    padding: 22px 16px 48px;
  }

  .mk-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mk-kpi strong {
    font-size: 22px;
  }

  .mk-row {
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
  }

  .mk-row--head {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }

  .mk-row--head .mk-rowlabel {
    display: none;
  }

  .mk-tabs {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
  }

  .mk-reset {
    flex: none;
    min-height: 40px;
    margin-left: 0;
  }

  .mk-rowlabel {
    width: auto;
    padding-top: 0;
    font-size: 12px;
  }

  .mk-chips--models {
    max-height: 40px;
  }

  .mk-chips--models.is-open {
    max-height: none;
  }

  .mk-more {
    align-self: flex-start;
  }

  .mk-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mk-iconbtn {
    width: 40px;
    height: 40px;
  }

  .mk-tab {
    height: 40px;
    padding: 0 15px;
  }

  .mk-chip {
    height: 40px;
    padding: 0 13px;
  }

  .mk-more {
    height: 40px;
  }

  .mk-reset {
    padding: 10px 12px;
  }

  .mk-search {
    width: 100%;
    height: 40px;
  }

  .mk-detail {
    width: 100%;
    height: 40px;
  }

  .mk-detail-label {
    display: inline;
  }

  /* 表格转卡片 */
  .mk-table,
  .mk-table tbody,
  .mk-table tr,
  .mk-table td {
    display: block;
    width: 100%;
  }

  .mk-table thead {
    display: none;
  }

  .mk-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 14px;
    padding: 14px;
    border-bottom: 1px solid var(--mk-border);
    position: relative;
  }

  .mk-table tbody tr:last-child {
    border-bottom: 0;
  }

  .mk-table td {
    padding: 0;
    border: 0;
  }

  .mk-table td::before {
    content: attr(data-l);
    display: block;
    margin-bottom: 1px;
    font-size: 11px;
    color: var(--mk-faint);
  }

  .mk-table td.mk-cell-name {
    grid-column: 1 / -1;
    padding-right: 44px;
  }

  .mk-table td.mk-cell-pick {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
    padding: 0;
  }

  .mk-table td.mk-cell-pick::before {
    display: none;
  }

  .mk-check {
    width: 22px;
    height: 22px;
  }

  .mk-table td.mk-cell-name::before {
    display: none;
  }

  .mk-table td.mk-cell-action {
    grid-column: 1 / -1;
  }

  .mk-table td.mk-cell-action::before {
    display: none;
  }

  .mk-price {
    text-align: left;
  }

  .mk-detail {
    width: 100%;
    height: 40px;
    border: 1px solid var(--mk-border-strong);
  }

  .mk-grid3 {
    grid-template-columns: 1fr;
  }

  .mk-modal {
    padding: 12px;
    align-items: end;
  }

  .mk-modal-panel {
    max-height: calc(100svh - 24px);
  }

  .mk-comparebar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    transform: none;
  }

  .mk-comparebar-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .mk-comparebar-actions {
    justify-content: flex-end;
  }

  .mk-code-pane {
    max-height: 220px;
  }

  .mk-cmp {
    min-width: 460px;
  }

  .mk-cmp tbody th {
    width: 72px;
  }
}
