/* ══════════════════════════════════════════════════════════════
   模型竞技场 · 与主站同一套视觉语言
   块面 + 大圆角 + 克制回弹｜主色 樱红 #FF3B6B，强调 天蓝 #00A3FF，
   第三 柠檬 #FFE44D（只用于第二组数据与「示例」标记）
   所有选择器挂在 .arena 下；令牌也挂在 .arena，不碰 :root / body。
   ══════════════════════════════════════════════════════════════ */

.arena {
  /* 每种彩色只有一个值，填充与文字共用；深底配白字，浅底（柠檬）配墨字 */
  --sakura: #e11945;
  --sky: #0073c0;
  --lemon: #ffe44d;

  --paper: #fff7f8;
  --surface: #ffffff;
  --ink: #14161c;
  --ink-2: #565b66;
  --ink-3: #8a909c;
  --line: rgba(20, 22, 28, .08);
  --line-2: rgba(20, 22, 28, .16);
  --veil: #f4f5f8;

  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --pill: 999px;

  --sh-sm: 0 2px 10px -4px rgba(20, 22, 28, .10);
  --sh-md: 0 14px 32px -18px rgba(214, 25, 76, .30);

  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --out: cubic-bezier(.16, 1, .3, 1);

  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.arena *,
.arena *::before,
.arena *::after { box-sizing: border-box; }

.arena a { color: inherit; text-decoration: none; }

.arena ::selection { background: var(--sakura); color: #fff; }

.arena :focus-visible {
  outline: 3px solid var(--sakura);
  outline-offset: 3px;
  border-radius: 8px;
}

.arena .mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ── 布局 ─────────────────────────────────────────────────── */

.a-wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px) clamp(18px, 4.5vw, 32px) 48px;
  /* 贴底布局：内容不满一屏时把页脚推到底 */
  flex: 1;
  display: flex;
  flex-direction: column;
}

.a-wrap.wide { max-width: 1480px; }

.a-main { flex: 1; }

/* 首页放开版面：标题更大，留白更狠 */
.a-index .a-title {
  font-size: clamp(36px, 6.6vw, 62px);
  margin: 16px 0 12px;
}

.a-index .a-head { margin-bottom: clamp(32px, 5.5vw, 52px); }

.a-index .a-lede { max-width: 46ch; }

/* ── 顶栏 ─────────────────────────────────────────────────── */

.a-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: clamp(22px, 4vw, 38px);
}

.a-top a {
  color: var(--ink-2);
  transition: color .18s ease;
}

.a-top a:hover { color: var(--sakura); }

.a-here { color: var(--ink); font-weight: 600; }

.a-crumb { color: var(--ink-3); }

.a-sep { color: var(--line-2); }

/* ── 页头 ─────────────────────────────────────────────────── */

.a-head { margin-bottom: clamp(28px, 4vw, 40px); }

.a-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 13px 6px 11px;
  border-radius: var(--pill);
  background: var(--sakura);
  color: #fff;
  font-size: 12px;
  letter-spacing: .02em;
}

.kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  flex: none;
}

.a-title {
  margin: 14px 0 10px;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.035em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.a-lede {
  margin: 0;
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.78;
  color: var(--ink-2);
}

/* ── 分节标题 ─────────────────────────────────────────────── */

.a-sect { margin-top: clamp(26px, 4vw, 40px); }

.a-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.a-sec-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.a-sec-head h2::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--sky);
  flex: none;
}

.a-sec-head .mono { color: var(--ink-3); }

/* ── 维度卡片（首页） ─────────────────────────────────────── */

.a-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.a-cats > .a-empty { grid-column: 1 / -1; }

/* 选项不是主体：白卡承担版面，色只落在编号块这种小面积上 */
.a-cat {
  --cat: var(--sakura);
  --cat-fg: #fff;

  display: flex;
  flex-direction: column;
  padding: 22px 24px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition:
    transform .26s var(--bounce),
    box-shadow .26s var(--out),
    border-color .2s ease;
}

/* 三色轮转：樱红 → 天蓝 → 柠檬；深底白字，柠檬浅底墨字 */
.a-cat:nth-child(3n + 2) { --cat: var(--sky); }
.a-cat:nth-child(3n) { --cat: var(--lemon); --cat-fg: var(--ink); }

.a-cat:hover,
.a-cat:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -20px rgba(20, 22, 28, .3);
  border-color: var(--line-2);
}

.a-cat-no {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--cat);
  color: var(--cat-fg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: transform .26s var(--bounce);
}

.a-cat:hover .a-cat-no { transform: scale(1.07); }

.a-cat-main { flex: 1; min-width: 0; }

.a-cat-main h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 7px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.a-cat-main p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.a-cat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ── 徽标 / 药丸 ──────────────────────────────────────────── */

.a-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--pill);
  background: #e7e9ee;
  color: #464b56;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.6;
  white-space: nowrap;
}

.a-badge.live { background: #dcdfe6; color: #33383f; }
.a-badge.demo { background: var(--lemon); color: var(--ink); }

.a-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--pill);
  background: #e7e9ee;
  color: #464b56;
  font-size: 11px;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* ── 测试列表（维度页） ───────────────────────────────────── */

.a-list {
  display: grid;
  gap: 10px;
}

.a-item {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--sh-sm);
  transition:
    transform .26s var(--bounce),
    box-shadow .26s var(--out),
    border-color .2s ease;
}

.a-item:hover,
.a-item:focus-visible {
  transform: translateY(-3px) scale(1.008);
  box-shadow: var(--sh-md);
  border-color: rgba(225, 25, 69, .25);
}

/* 编号色同样轮转，深底白字 / 柠檬墨字 */
.a-item { --cat: var(--sakura); --cat-fg: #fff; }
.a-item:nth-child(2) { --cat: var(--sky); }
.a-item:nth-child(3) { --cat: var(--lemon); --cat-fg: var(--ink); }

.a-item-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--cat);
  color: var(--cat-fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.a-item-main { flex: 1; min-width: 0; }

.a-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.a-item-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.a-item-date {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.a-item-prompt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}

.a-item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── 空态 / 加载 / 错误 ───────────────────────────────────── */

.a-empty {
  padding: 30px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .62);
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-3);
}

.a-empty code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--veil);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
}

.a-empty a {
  color: var(--sakura);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 对比页 ───────────────────────────────────────────────── */

.a-test-head { margin-bottom: 20px; }

.a-prompt {
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

/* 标签用实心深色 + 白字，块本身走白卡，避免再出现「淡底深字」 */
.a-prompt .label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 9px;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--sakura);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.a-prompt p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #2a2d36;
}

.a-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.a-meta .a-sep { color: var(--line-2); }

.a-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.a-panels.single { grid-template-columns: 1fr; }
.a-panels > .a-empty { grid-column: 1 / -1; }

.a-panel {
  --cat: var(--sakura);
  --cat-fg: #fff;

  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  position: relative;
}

/* 顶部细色条 + 编号块同色：第一组樱红、第二组天蓝、第三组柠檬 —— 这是分组色 */
.a-panel:nth-child(2) { --cat: var(--sky); }
.a-panel:nth-child(3) { --cat: var(--lemon); --cat-fg: var(--ink); }

.a-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--cat);
}

.a-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.a-panel-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.a-panel-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--cat);
  color: var(--cat-fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.a-panel-vendor {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--pill);
  background: #e7e9ee;
  color: #464b56;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .04em;
}

.a-panel-actions { display: flex; gap: 6px; flex: none; }

.a-btn {
  padding: 5px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--pill);
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
  transition:
    transform .22s var(--bounce),
    background .18s ease,
    color .18s ease,
    border-color .18s ease;
}

.a-btn:hover,
.a-btn:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  transform: translateY(-2px);
}

.a-btn:active { transform: translateY(0); }

.a-panel-body { padding: 18px; }

/* 文本结果 */

.a-prose {
  font-size: 14.5px;
  line-height: 1.9;
  color: #23262e;
  word-break: break-word;
}

.a-prose > *:first-child { margin-top: 0; }
.a-prose > *:last-child { margin-bottom: 0; }

.a-prose h1,
.a-prose h2,
.a-prose h3,
.a-prose h4 {
  margin: 26px 0 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.015em;
  color: var(--ink);
}

.a-prose h1 { font-size: 22px; }
.a-prose h2 { font-size: 19px; }
.a-prose h3 { font-size: 16.5px; }
.a-prose h4 { font-size: 15px; }

.a-prose p { margin: 0 0 14px; }

.a-prose ul,
.a-prose ol { margin: 0 0 14px; padding-left: 1.3em; }

.a-prose li { margin-bottom: 6px; }
.a-prose li::marker { color: var(--sakura); }

.a-prose strong { font-weight: 600; color: var(--ink); }

.a-prose a {
  color: var(--sky);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.a-prose code {
  padding: .12em .4em;
  border-radius: 6px;
  background: #f1f2f5;
  font-family: var(--mono);
  font-size: .88em;
  color: var(--ink);
}

.a-prose pre {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: var(--r-md);
  background: #14161c;
  color: #edeff3;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.75;
}

.a-prose pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.a-prose blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--lemon);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: #fffdf2;
  color: var(--ink-2);
}

.a-prose blockquote p:last-child { margin-bottom: 0; }

.a-prose table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 13px;
}

.a-prose th,
.a-prose td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.a-prose th {
  background: #fafafb;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.a-prose hr {
  margin: 22px 0;
  border: none;
  border-top: 1px solid var(--line-2);
}

.a-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-sm);
}

/* 前端结果：沙箱 iframe */

.a-frame {
  display: block;
  width: 100%;
  height: clamp(420px, 60vh, 700px);
  border: 0;
  background: #fff;
}

/* 3D 结果：白面上的观察窗，故意挖成暗色 */

.a-view {
  position: relative;
  height: clamp(360px, 52vh, 560px);
  background: radial-gradient(80% 70% at 50% 36%, #1f222b 0%, #0d0f13 74%);
  cursor: grab;
  overflow: hidden;
}

.a-view:active { cursor: grabbing; }

.a-view canvas { display: block; width: 100%; height: 100%; }

.a-view-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8b93a3;
  pointer-events: none;
}

.a-view-state.err { color: #ff8098; }

.a-view-full {
  position: fixed;
  inset: 0;
  z-index: 50;
  height: 100vh;
  border-radius: 0;
  background: #0d0f13;
}

/* ── 页脚 ─────────────────────────────────────────────────── */

.a-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: clamp(32px, 4.4vw, 52px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.a-foot a { color: var(--ink-2); transition: color .18s ease; }
.a-foot a:hover { color: var(--sakura); }
.a-foot .a-sep { color: var(--line-2); }

/* ── 入场 ─────────────────────────────────────────────────── */

@keyframes a-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.a-top,
.a-kicker,
.a-title,
.a-lede,
.a-sec-head,
.a-cat,
.a-item,
.a-prompt,
.a-meta,
.a-panel,
.a-foot {
  animation: a-rise .56s var(--out) both;
}

.a-top { animation-delay: .02s; }
.a-kicker { animation-delay: .08s; }
.a-title { animation-delay: .13s; }
.a-lede { animation-delay: .18s; }
.a-sec-head { animation-delay: .24s; }
.a-cat:nth-child(1), .a-item:nth-child(1) { animation-delay: .28s; }
.a-cat:nth-child(2), .a-item:nth-child(2) { animation-delay: .34s; }
.a-cat:nth-child(3), .a-item:nth-child(3) { animation-delay: .40s; }
.a-cat:nth-child(4), .a-item:nth-child(4) { animation-delay: .46s; }
.a-prompt { animation-delay: .22s; }
.a-meta { animation-delay: .26s; }
.a-panel:nth-child(1) { animation-delay: .3s; }
.a-panel:nth-child(2) { animation-delay: .36s; }
.a-panel:nth-child(3) { animation-delay: .42s; }
.a-foot { animation-delay: .48s; }

/* ── 响应式 ───────────────────────────────────────────────── */

@media (max-width: 900px) {
  .a-panels { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .a-wrap { padding-left: 16px; padding-right: 16px; }
  .a-title { font-size: clamp(28px, 8vw, 36px); }
  .a-lede { font-size: 14.5px; }
  .a-cat { padding: 20px; }
  .a-cat-main h3 { font-size: 19px; }
  .a-item { padding: 16px; gap: 12px; }
  .a-item-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .a-item-head h3 { font-size: 15.5px; }
  .a-item-prompt { font-size: 12.5px; }
  .a-frame { height: 380px; }
  .a-view { height: 320px; }
  .a-panel-body { padding: 14px; }
  .a-prose { font-size: 14px; }
  .a-prompt { padding: 16px; }
}

/* ── 动效降级 ─────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .arena *,
  .arena *::before,
  .arena *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }

  .arena .a-top,
  .arena .a-kicker,
  .arena .a-title,
  .arena .a-lede,
  .arena .a-cat,
  .arena .a-item,
  .arena .a-panel { opacity: 1; transform: none; }
}
