/* SC Make Boards — 视觉规范自 Supercell Make 原站实测提取后重新实现 */

/* ---- Supercell 官方字体（CDN 已验证可用；font-display:swap 避免白屏） ---- */
/* 标题 / 数字大字：SupercellHeadline Heavy（仅 900 一个字重） */
@font-face {
  font-family: 'SupercellHeadline';
  src: url('https://cdn.supercell.com/fonts/supercell/supercellheadline/supercellheadline-heavy.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* 正文：SupercellText 三个字重（Bold 700 / Medium 500 / Regular 400） */
@font-face {
  font-family: 'SupercellText';
  src: url('https://cdn.supercell.com/fonts/supercell/supercelltext/full/supercelltext_w_bd.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SupercellText';
  src: url('https://cdn.supercell.com/fonts/supercell/supercelltext/full/supercelltext_w_md.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SupercellText';
  src: url('https://cdn.supercell.com/fonts/supercell/supercelltext/full/supercelltext_w_rg.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #1c1c1c;
  --ink-soft: #808080;
  --ink-faint: #c0c0c0;
  --ink-ghost: #dddddd;
  --surface: #f9f9f9;
  --accent: #ff5190;
  --gold: #f5b301;
  --silver: #9aa2ad;
  --bronze: #c47f3e;
  --thumb-bg: #1c1c1c; /* 缩略图占位深色，contain 模式下露出的留边底色 */
  --card-shadow: 0 4px 16px rgba(71, 69, 156, 0.1);
  --card-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.1);
  --nav-shadow: 0 0 15px rgba(0, 0, 0, 0.075);
  --pop-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  --radius-card: 8px;
  --radius-control: 4px;
  --font-head: 'SupercellHeadline', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-body: 'SupercellText', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --olinehub: #0099ff;
  --ease-hover: cubic-bezier(0.455, 0.03, 0.515, 0.955);
  --ease-in: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --page-max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

/* ---- 顶部导航 ---- */
.topbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg);
  box-shadow: var(--nav-shadow);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* 顶部品牌：官方 Make logo 图 + 浅色 BOARDS 后缀小字标 */
.topbar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.2s var(--ease-in);
}

.topbar__logo:hover { transform: scale(1.05); }

.topbar__logo-img {
  height: 26px;
  width: auto;
  display: block;
}

.topbar__logo-suffix {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 2.5px;
  color: var(--ink-faint);
}

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

/* 语言切换器：单按钮 + 下拉菜单（当前语言按钮，点击展开三项） */
.lang-switch {
  position: relative;
}

.lang-switch__btn {
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.lang-switch__btn:hover { color: var(--ink); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 104px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink-ghost);
  border-radius: var(--radius-control);
  background: var(--bg);
  box-shadow: var(--card-shadow-hover);
}

/* hidden 属性默认 display:none 会被上面的 display:flex 覆盖，需显式恢复 */
.lang-menu[hidden] { display: none; }

.lang-menu__item {
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-menu__item:hover { background: var(--surface); color: var(--ink); }

.lang-menu__item.is-active { background: var(--surface); color: var(--olinehub); font-weight: 700; }

/* ---- 页面骨架 ---- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 88px 24px 48px;
}

/* ---- 活动头部 ---- */
.hero {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.57) 92%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 24px;
  width: 100%;
  color: #ffffff;
}

.hero__kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  align-items: center;
}

.hero__phase {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero__phase--pre { background: var(--ink-soft); }
.hero__phase--closed { background: var(--ink-faint); color: var(--ink); }

.hero__countdown {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---- 统计条 ---- */
.statsbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-card);
}

.statsbar__item { display: flex; flex-direction: column; gap: 2px; }

.statsbar__label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.statsbar__value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.statsbar__value--small { font-size: 16px; }

.statsbar__value--muted { color: var(--ink-faint); }

/* ---- 工具行 ---- */
/* 排序 Tab：列表上方、左对齐 */
.tabs {
  display: flex;
  gap: 4px;
  margin: 24px 0 12px;
}

.tabs__tab {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tabs__tab:hover { color: var(--ink); }

.tabs__tab.is-active {
  background: var(--ink);
  color: #ffffff;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.filters__search {
  width: 220px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
}

.filters__search:focus { outline: 2px solid var(--accent); }

.filters__search::placeholder { color: var(--ink-faint); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.chip:hover { color: var(--ink); }

.chip.is-active {
  background: var(--accent);
  color: #ffffff;
}

/* ---- 刷新提示 ---- */
.notice {
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

/* ---- 作品列表与卡片 ---- */
.board { min-height: 320px; }

/* 最新提交：网格视图（桌面 4 列，断点见 responsive.css） */
.board__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
}

/* 票数排行：单列列表视图，每行一个作品 */
.board__list { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-card);
  background: var(--bg);
  box-shadow: var(--card-shadow);
  opacity: 0;
  transform: translateY(8px);
  animation: card-in 0.3s var(--ease-in) forwards;
  transition: transform 0.2s var(--ease-hover), box-shadow 0.2s var(--ease-hover);
}

.row:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }

/* 行内缩略图：72px 正方形 + object-fit:contain 完整显示作品，左上角排名徽章 */
.row__thumb {
  position: relative;
  flex: none;
  width: 72px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--thumb-bg);
}

.row__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.row__img--error { object-fit: contain; width: 30%; height: 30%; top: 35%; left: 35%; }

/* 行内排名徽章复用 .card__rank，需更高优先级覆盖其定位与尺寸 */
.row__rank.card__rank {
  top: 4px;
  left: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 900;
}

/* 行内中部：作品名 + 作者 · 提交时间，均截断省略 */
.row__text {
  flex: 1;
  min-width: 0;
}

.row__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.row__meta {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 行内右侧：票数大号数字 + 查看原作小按钮 */
.row__right {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.row__likes {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.row__likes--muted { color: var(--ink-faint); font-weight: 600; font-size: 13px; }

.row__heart { width: 16px; height: 16px; fill: var(--accent); flex: none; }

.row__view {
  padding: 4px 12px;
  border: none;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.2s;
}

.row__view:hover { filter: brightness(0.9); }

.card {
  position: relative;
  border-radius: var(--radius-card);
  background: var(--bg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  animation: card-in 0.3s var(--ease-in) forwards;
  transition: transform 0.2s var(--ease-hover), box-shadow 0.2s var(--ease-hover);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

.card__rank {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control);
  background: rgba(28, 28, 28, 0.82);
  color: #ffffff;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.card__rank--1 { background: var(--gold); color: #1c1c1c; }
.card__rank--2 { background: var(--silver); }
.card__rank--3 { background: var(--bronze); }

.card__media {
  position: relative;
  padding-top: 100%;
  background: var(--thumb-bg);
}

.card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card__img--error { object-fit: contain; width: 30%; height: 30%; top: 35%; left: 35%; }

.card__status {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: var(--radius-control);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
}

.card__status--non-finalist { background: var(--ink-soft); }
.card__status--finalist { background: #3a7bd5; }
.card__status--winner { background: var(--gold); color: #1c1c1c; }

.card__info {
  padding: 6px 10px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.card__title:hover { white-space: normal; }

.card__author {
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__likes {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.card__likes--muted { color: var(--ink-faint); font-weight: 600; font-size: 12px; }

/* 卡片点赞/票数行 */
.card__heart { width: 15px; height: 15px; fill: var(--accent); flex: none; }

.card__view {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.2s var(--ease-hover), opacity 0.2s var(--ease-hover);
  text-decoration: none;
  text-align: center;
}

.card:hover .card__view { opacity: 1; transform: translateY(0); }

/* ---- 状态视图（骨架/空态/错误） ---- */
.board__state {
  padding: 64px 24px;
  text-align: center;
}

.board__state-text { color: var(--ink-soft); font-size: 15px; margin: 0 0 16px; }

.btn {
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s var(--ease-in);
}

.btn:hover { transform: scale(1.03); }

.btn--primary { background: var(--accent); color: #ffffff; }

.board__skeleton {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 8px;
}

.skeleton-card {
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
}

.skeleton-card::before {
  content: '';
  display: block;
  padding-top: 40%;
}

.skeleton-card::after {
  content: '';
  display: block;
  height: 96px;
}

.skeleton-card,
.skeleton-card::before {
  background: linear-gradient(100deg, var(--surface) 40%, #f1f1f1 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* 票数排行的单列骨架行 */
.board__list-skeleton {
  display: flex;
  flex-direction: column;
}

/* 同上：display 规则会覆盖 hidden 属性，需显式恢复 */
.board__skeleton[hidden],
.board__list-skeleton[hidden] { display: none; }

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--ink-ghost);
}

.skeleton-row > span {
  border-radius: var(--radius-card);
  background: linear-gradient(100deg, var(--surface) 40%, #f1f1f1 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.skeleton-thumb {
  flex: none;
  width: 72px;
  height: 72px;
}

.skeleton-line { flex: 1; height: 18px; }

/* ---- 分页：固定两行居中（第一行上/下一页，第二行页码信息 + 输入跳转） ---- */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
}

.pagination__row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pagination button:hover:not(:disabled) { color: var(--ink); }

.pagination button:disabled { opacity: 0.4; cursor: default; }

/* 页码信息：第 X / Y 页 */
.pagination__info {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 页码输入框：数字输入，宽约 72px */
.pagination__input {
  width: 72px;
  height: 36px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pagination__input:focus { outline: 2px solid var(--accent); }

/* ---- 页脚 ---- */
.footer {
  border-top: 1px solid var(--surface);
  padding: 20px 24px 28px;
  text-align: center;
}

/* Powered By OlineHub：前缀用正文字体灰色，站名用 SupercellHeadline，仅 Hub 为品牌蓝 */
.footer__power-wrap { margin: 0 0 10px; }

.footer__power {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer__power-brand { font-family: var(--font-head); font-weight: 900; }

.footer__power-brand-accent { color: var(--olinehub); }

.footer__power:hover { opacity: 0.75; text-decoration: underline; }

.footer__disclaimer {
  max-width: 720px;
  margin: 0 auto 6px;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.7;
}

.footer__disclaimer a { color: var(--ink-soft); }

.footer__utc {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
