/* ==========================================================================
   大语言模型基准评测榜 · 柔光工作台
   淡暖纸白 + 单一鼠尾草绿点缀，索引卡式排名卡片（与个人工具站主页统一）
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeede7;
  --ink: #24231f;
  --ink-2: #56544c;
  --muted: #6b685d;
  --line: #e7e5dc;
  --line-strong: #d9d6ca;
  --accent: #5f7c61;
  --accent-deep: #42584a;
  --accent-soft: #e6ece1;
  --ok: #4f9d6b;
  --warn: #c9a27b;

  --gold: #b98a3f;
  --silver: #8b9198;
  --bronze: #a5764f;

  --shadow-sm: 0 1px 2px rgba(36, 35, 31, 0.05), 0 4px 12px rgba(36, 35, 31, 0.05);
  --shadow-md: 0 2px 6px rgba(36, 35, 31, 0.05), 0 16px 40px rgba(36, 35, 31, 0.1);

  --radius: 18px;
  --font-display: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 细腻的纸面颗粒 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   花园背景
   -------------------------------------------------------------------------- */
.garden {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 640px at 82% -8%, rgba(95, 124, 97, 0.1), transparent 62%),
    radial-gradient(820px 560px at 2% 16%, rgba(95, 124, 97, 0.07), transparent 60%),
    radial-gradient(960px 720px at 92% 104%, rgba(95, 124, 97, 0.09), transparent 66%);
}

.garden__defs {
  position: absolute;
  width: 0;
  height: 0;
}

.garden__vine {
  position: absolute;
}

.g-stem {
  stroke: #6b8a6e;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  opacity: 0.55;
}

.garden__vine--left {
  left: clamp(-90px, -4vw, -20px);
  top: 40px;
  width: 300px;
  opacity: 0.8;
}

.garden__vine--br {
  right: -30px;
  bottom: -50px;
  width: 360px;
  opacity: 0.75;
}

.garden__float {
  position: absolute;
  width: 56px;
  opacity: 0.5;
  animation: garden-float 7s ease-in-out infinite;
}

.garden__float--1 {
  left: 12%;
  top: 22%;
}

.garden__float--2 {
  right: 16%;
  top: 34%;
  animation-delay: -2.3s;
}

.garden__float--3 {
  left: 24%;
  top: 58%;
  animation-delay: -4.1s;
}

@keyframes garden-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(6deg);
  }
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand__mark svg {
  width: 36px;
  height: 36px;
  display: block;
}

.brand__word {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__word strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__word small {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 22px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(79, 157, 107, 0.14);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status.is-offline .status__dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(201, 162, 123, 0.16);
}

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  font-family: var(--font-mono);
}

.clock strong {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.clock span {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   主体
   -------------------------------------------------------------------------- */
.main {
  flex: 1;
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  padding: 40px 0 36px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent-deep);
  text-transform: uppercase;
}

.eyebrow__rule {
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(25px, 5vw, 40px);
  line-height: 1.04;
  letter-spacing: 0;
  font-weight: 700;
}

.hero__title-accent {
  position: relative;
  z-index: 0;
  color: var(--accent-deep);
}

.hero__title-accent::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 0.05em;
  height: 0.34em;
  z-index: -1;
  border-radius: 6px;
  background: var(--accent-soft);
}

.hero__lead {
  max-width: 640px;
  margin: 26px 0 0;
  font-size: 16px;
  line-height: 1.9;
  color: var(--muted);
}

.hero__lead strong {
  color: var(--accent-deep);
  font-weight: 600;
}

/* --- 实时信息栏 --- */
.livebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  max-width: 760px;
  margin-top: 30px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.livebar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.livebar__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.livebar__source {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.18s ease;
}

.livebar__source:hover {
  border-color: var(--accent);
}

.livebar__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.livebar__updated {
  color: var(--muted);
}

.refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.refresh:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.refresh svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh.is-loading svg {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   维度分榜 tabs
   -------------------------------------------------------------------------- */
.dims {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 0 4px;
}

.dim-tab {
  --i: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  animation: rise-in 0.5s calc(var(--i) * 50ms) cubic-bezier(0.22, 0.8, 0.32, 1) backwards;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.dim-tab:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.dim-tab.is-active {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.dim-tab__label {
  font-weight: 600;
}

.dim-tab__code {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   排名
   -------------------------------------------------------------------------- */
.ranking {
  padding: 12px 0 64px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent-deep);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.section-head p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* --- 维度口径提示（如数学榜上游停更） --- */
.dim-notice {
  margin: 14px 0 0;
  max-width: 640px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--warn) 9%, var(--surface));
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.8;
}

.dim-notice strong {
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--warn) 22%, transparent);
  color: #8a6a44;
  font-weight: 600;
}

.dim-notice a {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.18s ease;
}

.dim-notice a:hover {
  border-color: var(--accent);
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 签名元素：带折角的索引卡 */
.rank-card {
  --i: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: rise-in 0.5s calc(var(--i) * 55ms) cubic-bezier(0.22, 0.8, 0.32, 1) backwards;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.rank-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.rank-card__fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 22px solid var(--accent);
  border-right: 22px solid transparent;
  filter: drop-shadow(-2px 3px 3px rgba(36, 35, 31, 0.12));
  pointer-events: none;
  z-index: 1;
}

/* --- 模型族（可折叠） --- */
.family {
  display: block;
}

.family__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 20px 22px;
  cursor: default;
  list-style: none;
}

details.family > summary.family__head {
  cursor: pointer;
}

details.family > summary.family__head::-webkit-details-marker {
  display: none;
}

.family__rank {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0;
}

.rank-card--1 .family__rank {
  color: var(--gold);
  border-color: rgba(185, 138, 63, 0.4);
  background: rgba(185, 138, 63, 0.08);
}

.rank-card--2 .family__rank {
  color: var(--silver);
  border-color: rgba(139, 145, 152, 0.4);
  background: rgba(139, 145, 152, 0.08);
}

.rank-card--3 .family__rank {
  color: var(--bronze);
  border-color: rgba(165, 118, 79, 0.4);
  background: rgba(165, 118, 79, 0.08);
}

.family__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.family__org {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
  text-transform: uppercase;
}

.family__name {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.family__badge {
  flex: none;
  min-width: 88px;
  text-align: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.family__score {
  flex: none;
  min-width: 96px;
  justify-content: flex-end;
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding-right: 10px;
}

.family__score-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

.family__score-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.family__chevron {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  transition: transform 0.25s ease;
}

.family__chevron svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

details.family[open] > .family__head .family__chevron {
  transform: rotate(180deg);
}

.family__body {
  padding: 0 22px 18px 92px;
}

.family__bar {
  flex: none;
  flex-basis: 100%;
  width: 660px;
  height: 6px;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.family__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #7fa083);
  width: 0;
  transition: width 0.8s cubic-bezier(0.22, 0.8, 0.32, 1);
}

.rank-card--1 .family__bar span,
.rank-card--1 .variant__bar span {
  background: linear-gradient(90deg, #c9a861, var(--gold));
}

.family__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  color: var(--muted);
}

.family__meta strong {
  color: var(--ink-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --- 变体列表（思考深度） --- */
.variants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variant {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

.variant__depth {
  flex: none;
  min-width: 84px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

.variant__bar {
  flex: none;
  flex-basis: 100%;
  width: 660px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.variant__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #7fa083);
  width: 0;
  transition: width 0.8s cubic-bezier(0.22, 0.8, 0.32, 1);
}

.variant__score {
  flex: none;
  margin-left: auto;
  min-width: 48px;
  text-align: right;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

/* --- 空状态 --- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
}

.empty__title {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.empty__text {
  max-width: 420px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

/* --- 脚注 --- */
.footnote {
  margin: 26px 0 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.footnote code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-deep);
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   动画
   -------------------------------------------------------------------------- */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .topbar {
    padding: 14px 18px;
  }

  .status {
    display: none;
  }

  .clock strong {
    font-size: 13px;
  }

  .main {
    width: min(100% - 30px, 900px);
  }

  .hero {
    padding: 40px 0 30px;
  }

  .hero__title {
    font-size: clamp(25px, 5vw, 40px);
  }

  .livebar {
    flex-direction: column;
    align-items: stretch;
  }

  .livebar__right {
    display: flex;
  }

  .refresh {
    flex: 1;
    justify-content: center;
  }

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

  .dim-tab__code {
    display: none;
  }

  .family__head {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }

  .family__rank {
    width: 44px;
    height: 44px;
    font-size: 19px;
  }

  .family__info {
    order: 1;
    width: calc(100% - 60px);
  }

  .family__badge {
    order: 3;
  }

  .family__score {
    order: 2;
    margin-left: auto;
  }

  .family__chevron {
    order: 4;
  }

  .family__body {
    padding: 0 16px 16px;
  }

  .variant {
    flex-wrap: wrap;
    gap: 8px;
  }

  .variant__depth {
    min-width: 70px;
  }

  .family__bar {
    width: 100%;
  }

  .variant__bar {
    flex: none;
    width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .garden__float {
    animation: none;
  }

  .rank-card,
  .dim-tab {
    animation: none;
  }

  .rank-card,
  .rank-card__fold,
  .refresh,
  .refresh svg,
  .family__chevron,
  .dim-tab {
    transition: none;
  }
}
