/* ==========================================================================
   大黑的 AI-Bench 核心视觉样式表
   符合：@大黑网页设计风格说明.md
   ========================================================================== */

:root {
  /* 调色板 */
  --bg-color: #FAF9F6;       /* 米白背景 */
  --text-color: #1A1A1A;     /* 主深黑字 */
  --accent-color: #FF6B00;   /* 经典橙高亮 */
  --sub-text: #666666;       /* 次级灰字 */
  --panel-bg: #F2F0EB;       /* 面板底色 */
  --card-bg: rgba(255, 255, 255, 0.75); /* 轻玻璃感卡片 */
  --border-color: rgba(26, 26, 26, 0.08); /* 极轻边框 */
  
  /* 评分状态配色 */
  --good-bg: rgba(56, 142, 60, 0.09);
  --good-text: #23723A;
  --risk-bg: rgba(255, 107, 0, 0.1);
  --risk-text: #FF6B00;
  --bad-bg: rgba(26, 26, 26, 0.07);
  --bad-text: #555555;

  /* 字体设置 */
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-sans: "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", sans-serif;
  --font-mono: "SF Mono", "Monaco", "Consolas", monospace;
  
  /* 布局参数 */
  --max-width: 1120px;
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* ==========================================================================
   极简品牌头部 (Header)
   ========================================================================== */
header {
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--sub-text);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-color);
  background: rgba(26, 26, 26, 0.04);
}

.nav-link.active {
  color: #FFF;
  background-color: var(--text-color);
}

.external-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ext-btn {
  font-size: 13px;
  font-weight: bold;
  color: var(--sub-text);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 999px;
  background: #FFF;
}

.ext-btn:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: var(--bg-color);
}

/* ==========================================================================
   页面主排版 (Hero 区域与内容层)
   ========================================================================== */
main {
  flex: 1;
  position: relative;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

main > :not(.model-name-cloud) {
  position: relative;
  z-index: 1;
}

.model-name-cloud {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 130vw;
  height: 1600px;
  pointer-events: none;
  user-select: none;
  overflow: visible;
  transform: translateX(-50%);
  z-index: 0;
}

.model-name-cloud[hidden] {
  display: none;
}

.model-name-chip {
  position: absolute;
  top: var(--cloud-top);
  left: var(--cloud-left);
  color: var(--text-color);
  font-family: var(--font-serif);
  font-size: var(--cloud-size);
  font-weight: 900;
  line-height: 1;
  opacity: var(--cloud-opacity);
  transform: translate(-50%, -50%) rotate(var(--cloud-rotate));
  filter: blur(0.7px);
  white-space: nowrap;
  text-shadow: 0 8px 26px rgba(26, 26, 26, 0.08);
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 56px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 54px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-color);
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 16px;
  color: var(--sub-text);
  line-height: 1.6;
  font-weight: 400;
}

/* Dashboard Overview Cards */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--sub-text);
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-color);
}

.question-carousel {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(255, 107, 0, 0.13), rgba(255, 255, 255, 0.74) 42%, rgba(35, 114, 58, 0.08)),
    var(--card-bg);
  box-shadow: 0 18px 48px rgba(26, 26, 26, 0.06);
}

.question-carousel::before {
  content: "";
  position: absolute;
  inset: -80% auto -80% -20%;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: rotate(18deg);
  animation: carouselSheen 6.5s ease-in-out infinite;
}

.question-carousel-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 96px;
  padding: 22px 28px;
}

.question-phase {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.question-text {
  color: var(--text-color);
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.35vw, 26px);
  font-weight: 850;
  line-height: 1.38;
}

.question-carousel.is-swapping .question-phase,
.question-carousel.is-swapping .question-text {
  animation: carouselTextSwap 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.question-progress {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.08);
}

.question-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-color), #23723A);
  animation: carouselProgress 5.2s linear infinite;
}

/* ==========================================================================
   榜单入口视图 (Phase Entry View)
   ========================================================================== */
.view-container {
  display: none;
}

.view-container.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

.phase-entry-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.phase-entry-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.phase-entry-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 0, 0.35);
  box-shadow: 0 14px 32px rgba(26, 26, 26, 0.08);
}

.phase-entry-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--panel-bg);
}

.phase-entry-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.phase-entry-kicker {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 8px;
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.phase-entry-info h2 {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.phase-entry-summary {
  flex: 1;
  color: var(--sub-text);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.phase-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phase-entry-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-color);
  font-size: 10px;
  font-weight: 700;
}

@keyframes carouselTextSwap {
  0% { opacity: 0; transform: translateY(12px) scale(0.985); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes carouselProgress {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

@keyframes carouselSheen {
  0%, 18% { transform: translateX(-80%) rotate(18deg); opacity: 0; }
  38% { opacity: 0.9; }
  64%, 100% { transform: translateX(360%) rotate(18deg); opacity: 0; }
}

.entry-error {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 107, 0, 0.25);
  border-radius: 18px;
  padding: 24px;
  color: var(--accent-color);
  background: rgba(255, 107, 0, 0.06);
  text-align: center;
  line-height: 1.7;
}

.card-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(26, 26, 26, 0.02);
  border-radius: 28px;
  padding: 32px;
  backdrop-filter: blur(8px);
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 2px solid rgba(26, 26, 26, 0.06);
  padding-bottom: 16px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
}

.card-meta {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--sub-text);
}

/* 优雅的数据表格 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  font-family: var(--font-sans);
  color: var(--sub-text);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid rgba(26, 26, 26, 0.06);
}

td {
  padding: 16px;
  font-size: 15px;
  border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
  border-bottom: none;
}

/* 表格列宽限制 */
.rank-col { width: 80px; }
.model-col { font-weight: 700; }
.score-col { width: 140px; text-align: right; }
.phase-col { width: 140px; text-align: right; }

.rank-num {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 16px;
}

.top-3-rank-1 { color: var(--accent-color); }
.top-3-rank-2 { color: #8F8171; }
.top-3-rank-3 { color: #C2824C; }

.score-num {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 18px;
}

.score-high { color: var(--accent-color); }

/* ==========================================================================
   分期排行榜视图 - 详细分榜 (Phase View)
   ========================================================================== */
.phase-header-block {
  margin-bottom: 32px;
}

.phase-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
}

.phase-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  color: var(--sub-text);
  font-size: 14px;
  margin-bottom: 20px;
}

.phase-date {
  font-family: var(--font-mono);
}

.divider {
  width: 1px;
  height: 12px;
  background-color: var(--border-color);
}

.bilibili-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #FFF;
  background: #FF6699; /* B站粉色 */
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}

.bilibili-link:hover {
  background: #ff4d88;
}

.phase-summary-card {
  background: var(--panel-bg);
  border-radius: 20px;
  padding: 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 32px;
  border-left: 4px solid var(--accent-color);
}

/* 控制详细分榜表格的高级样式 */
.interactive-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.sort-label {
  font-size: 13px;
  color: var(--sub-text);
  font-weight: bold;
}

.sort-options {
  display: flex;
  gap: 8px;
}

.sort-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  background: #FFF;
  border: 1px solid var(--border-color);
  color: var(--sub-text);
  transition: all 0.2s ease;
}

.sort-btn:hover {
  color: var(--text-color);
  border-color: var(--text-color);
}

.sort-btn.active {
  background: var(--text-color);
  color: #FFF;
  border-color: var(--text-color);
}

/* 评分及校验状态 */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

tr.good td { background-color: rgba(255,255,255,0.4); }
tr.risk td { background-color: rgba(255, 107, 0, 0.01); }
tr.bad td { background-color: rgba(26, 26, 26, 0.01); }

/* 列级别单元格样式 */
td.cell-model {
  font-weight: bold;
}

td.cell-checksum {
  font-family: var(--font-mono);
  font-size: 13px;
}

td.cell-speed {
  font-family: var(--font-mono);
  font-weight: 700;
}

td.cell-impression {
  min-width: 360px;
  max-width: 460px;
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
  white-space: normal;
  word-break: normal;
}

/* 针对不同分类的高亮 */
.state-good {
  color: var(--good-text);
}
.state-good .status-badge {
  background: var(--good-bg);
  color: var(--good-text);
}

.state-risk {
  color: var(--accent-color);
}
.state-risk .status-badge {
  background: var(--risk-bg);
  color: var(--risk-text);
}

.state-bad {
  color: var(--sub-text);
}
.state-bad .status-badge {
  background: var(--bad-bg);
  color: var(--bad-text);
}

/* ==========================================================================
   题目与数据集公开区
   ========================================================================= */
.challenge-section {
  margin-top: 48px;
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text-color);
  color: var(--bg-color);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  margin-bottom: 28px;
  transition: opacity 0.2s;
}
.github-btn:hover { opacity: 0.75; }

.steps-list {
  margin: 0 0 28px 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.steps-list li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
}
.steps-list code {
  display: inline;
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent-color);
}

.prompt-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: -1px;
}
.prompt-tab-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--sub-text);
  transition: all 0.15s;
}
.prompt-tab-btn.active {
  background: #1E1E1E;
  color: #FFF;
  border-color: #1E1E1E;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  position: relative;
  bottom: -1px;
}

.challenge-footnote {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--sub-text);
  line-height: 1.6;
}

.submit-block {
  margin-top: 24px;
  padding: 20px 24px;
  background: rgba(255, 107, 0, 0.05);
  border: 1px solid rgba(255, 107, 0, 0.2);
  border-radius: 14px;
}

.submit-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-color);
}

.submit-desc {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--sub-text);
}

.submit-items {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.submit-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.submit-item-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.submit-item strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.submit-item p {
  font-size: 13.5px;
  color: var(--sub-text);
  line-height: 1.65;
  margin: 0;
}

.submit-contact {
  background: rgba(255, 107, 0, 0.06);
  border: 1px solid rgba(255, 107, 0, 0.25);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13.5px;
  color: var(--text-color);
}

.challenge-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 32px;
}

.challenge-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.challenge-desc {
  font-size: 14px;
  color: var(--sub-text);
  line-height: 1.6;
  margin-bottom: 24px;
}

.code-container {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #1E1E1E; /* 经典深色代码背景 */
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2D2D2D;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #AAA;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 6px;
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--accent-color);
}

pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 320px;
}

code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: #D4D4D4; /* 现代代码颜色 */
  display: block;
}

/* ==========================================================================
   页脚 (Footer)
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--sub-text);
  line-height: 1.8;
}

footer .footer-brand {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 8px;
}

/* ==========================================================================
   响应式调整 (Responsive Design)
   ========================================================================== */
@media (max-width: 820px) {
  .stats-bar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .question-carousel {
    margin-bottom: 24px;
    border-radius: 16px;
  }

  .question-carousel-inner {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 144px;
    padding: 18px 18px 24px;
  }

  .question-phase {
    justify-self: start;
  }

  .question-text {
    font-size: 21px;
    line-height: 1.42;
  }

  .phase-entry-grid {
    display: flex;
    gap: 14px;
    margin-right: -16px;
    padding: 0 16px 8px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .phase-entry-card {
    flex: 0 0 min(74vw, 280px);
    scroll-snap-align: start;
  }

  .phase-entry-info {
    padding: 14px;
  }

  .phase-entry-info h2 {
    font-size: 18px;
  }
  
  .header-container {
    padding: 16px;
  }
  
  main {
    padding: 32px 16px 60px;
  }

  .card-container {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .interactive-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  th, td {
    padding: 12px 8px;
    font-size: 13px;
  }
  
  .ext-btn {
    display: none; /* 移动端隐藏外部大按钮，保持顶部简洁 */
  }
}
