:root {
  --ink: #121212;
  --muted: #626262;
  --line: #151515;
  --paper: #f8f8f5;
  --panel: #ffffff;
  --panel-soft: #ecefed;
  --accent: #e72a23;
  --accent-dark: #b81716;
  --teal: #0c7c73;
  --gold: #f2c849;
  --rank-bg: #cfcfcf;
  --shadow: 0 18px 42px rgba(18, 18, 18, 0.11);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(18, 18, 18, 0.04) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(rgba(18, 18, 18, 0.035) 1px, transparent 1px) 0 0 / 34px 34px,
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 3px solid var(--line);
  background: rgba(248, 248, 245, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.brand small,
.eyebrow,
.counter,
.dialog-note {
  color: var(--muted);
}

.brand small {
  margin-top: 4px;
  font-size: 12px;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.top-actions,
.toolbar-buttons,
.section-heading,
.visibility-group,
.object-form {
  display: flex;
  align-items: center;
}

.top-actions,
.toolbar-buttons {
  gap: 10px;
  min-width: 0;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.text-button {
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.text-button:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 var(--line);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  font-size: 23px;
  line-height: 1;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  max-width: 100%;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.primary-button {
  color: #050505;
  background: var(--gold);
}

.secondary-button {
  background: #e8f2ef;
}

.danger-button {
  background: #ffd6d2;
}

.text-button {
  min-height: 38px;
  background: transparent;
}

.nav-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

main {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.home-view,
.board-view,
.admin-view {
  padding: clamp(18px, 4vw, 44px);
}

.home-view {
  display: grid;
  gap: clamp(18px, 3vw, 30px);
}

.home-hero {
  display: grid;
  align-items: end;
  min-height: 170px;
  padding: clamp(20px, 4vw, 40px) 0 0;
}

.home-title-block h1 {
  max-width: none;
  margin: 10px 0 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.94;
  white-space: nowrap;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}

.create-panel,
.topic-list-panel,
.object-dock,
.comparison-panel {
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.create-panel {
  padding: clamp(20px, 4vw, 36px);
}

.home-create-panel {
  position: sticky;
  top: 94px;
}

.board-toolbar h1 {
  margin: 8px 0 0;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 1.02;
}

.topic-list-panel {
  min-height: 420px;
  padding: clamp(16px, 3vw, 24px);
}

.home-topic-panel {
  min-height: 520px;
}

.home-topic-panel .topic-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.home-topic-panel .topic-card {
  grid-template-columns: 1fr;
  align-content: space-between;
  min-height: 170px;
  padding: 16px;
}

.home-topic-panel .topic-card h3 {
  font-size: 22px;
  line-height: 1.12;
}

.home-topic-panel .topic-card .toolbar-buttons {
  justify-content: space-between;
}

.section-heading {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  min-width: 0;
  font-size: clamp(20px, 3vw, 30px);
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.create-form,
.join-form,
.share-dialog form {
  display: grid;
  gap: 18px;
}

.join-form {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 2px solid var(--line);
}

.join-form .section-heading {
  margin-bottom: 0;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

label span,
legend {
  font-size: 14px;
}

input[type="text"],
input[type="file"],
select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

input[type="text"] {
  padding: 0 12px;
}

input[type="file"] {
  padding: 10px;
}

select {
  padding: 0 10px;
}

.visibility-group {
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.visibility-group legend {
  width: 100%;
  margin-bottom: 4px;
  font-weight: 800;
}

.visibility-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.compact-option {
  align-self: end;
}

.compact-option label {
  min-height: 46px;
}

.topic-list {
  display: grid;
  gap: 12px;
}

.topic-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.topic-card > div {
  min-width: 0;
}

.topic-card .toolbar-buttons {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topic-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.topic-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #e8f2ef;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  border: 2px dashed #8a8a8a;
  color: var(--muted);
  font-weight: 800;
}

.board-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.rank-shell {
  overflow-x: auto;
  border: 3px solid var(--line);
  background: var(--line);
  box-shadow: var(--shadow);
}

.ranking-board {
  min-width: 760px;
}

.rank-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 148px;
  background: var(--rank-bg);
}

.rank-row + .rank-row {
  border-top: 3px solid var(--line);
}

.rank-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  overflow: hidden;
  border-right: 3px solid var(--line);
  color: #050505;
  font-size: clamp(28px, 3.7vw, 54px);
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.rank-label[data-rank="bang"] {
  background: #ef261e;
}

.rank-label[data-rank="top"] {
  background: #f3cc4b;
}

.rank-label[data-rank="elite"] {
  background: #ffff00;
}

.rank-label[data-rank="npc"] {
  background: #fff7dc;
}

.rank-label[data-rank="trash"] {
  background: #fff;
}

.rank-drop {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  min-height: 148px;
  padding: 14px;
  background: var(--rank-bg);
}

.rank-drop.is-over,
.item-pool.is-over {
  outline: 4px solid var(--teal);
  outline-offset: -8px;
}

.object-dock {
  margin-top: 24px;
  padding: clamp(16px, 3vw, 24px);
}

.comparison-panel {
  margin-top: 24px;
  padding: clamp(16px, 3vw, 24px);
}

.comparison-summary {
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 800;
}

.comparison-list {
  display: grid;
  gap: 10px;
}

.comparison-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.comparison-row strong,
.comparison-row p {
  margin: 0;
}

.comparison-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.comparison-thumb {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 6px;
}

.comparison-thumb img,
.comparison-thumb .image-placeholder {
  width: 100%;
  height: 100%;
}

.admin-hero {
  margin-bottom: 22px;
}

.admin-hero h1 {
  margin: 8px 0 0;
  font-size: clamp(38px, 7vw, 82px);
  line-height: 0.98;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card,
.admin-detail-panel,
.admin-card-panel {
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.stat-card strong {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 28px);
  align-items: start;
}

.admin-topic-panel {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.admin-topic-card {
  cursor: pointer;
}

.admin-topic-card.is-selected {
  background: #fff7dc;
  box-shadow: 4px 4px 0 var(--line);
}

.admin-detail-panel {
  min-height: 520px;
  padding: clamp(16px, 3vw, 24px);
}

.admin-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-detail-header > div:first-child {
  min-width: min(100%, 260px);
  flex: 1 1 280px;
}

.admin-detail-header .toolbar-buttons {
  flex: 1 1 260px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-detail-header h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.admin-edit-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fbfbfb;
}

.admin-tier-form {
  margin-bottom: 18px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fbfbfb;
}

.admin-data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.admin-card-panel {
  padding: 16px;
}

.admin-add-item-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fbfbfb;
}

.admin-item-editor-list {
  display: grid;
  gap: 10px;
}

.admin-item-editor {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(96px, 150px) minmax(72px, auto) minmax(72px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-item-editor input,
.admin-item-editor select {
  min-width: 0;
}

.admin-rank-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 2px solid #d0d0d0;
}

.admin-rank-row > strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.admin-mini-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
}

.admin-mini-item {
  display: grid;
  width: 78px;
  grid-template-rows: 56px minmax(26px, auto);
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.admin-mini-item img,
.admin-mini-item .image-placeholder {
  width: 100%;
  height: 56px;
  object-fit: cover;
}

.admin-mini-item span {
  display: grid;
  place-items: center;
  padding: 4px;
  overflow-wrap: anywhere;
  border-top: 2px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.admin-muted {
  color: var(--muted);
  font-weight: 800;
}

.admin-response-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-response-card > div {
  min-width: 0;
}

.admin-response-card + .admin-response-card {
  margin-top: 10px;
}

.admin-response-card strong,
.admin-response-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-response-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-empty {
  min-height: 160px;
}

.counter {
  display: inline-grid;
  min-width: 38px;
  min-height: 32px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  font-weight: 900;
}

.object-form {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.object-form label {
  flex: 1 1 210px;
}

.object-form .primary-button {
  align-self: end;
}

.dock-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 16px;
}

.tier-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tier-editor-field {
  padding: 12px;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fbfbfb;
}

@media (max-width: 1120px) {
  .admin-data-grid {
    grid-template-columns: 1fr;
  }
}

.item-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 142px;
  padding: 14px;
  border: 2px dashed #777;
  background: #fbfbfb;
}

.rank-item {
  position: relative;
  display: grid;
  width: 108px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 3px 3px 0 rgba(18, 18, 18, 0.22);
  user-select: none;
}

.rank-item.name-hidden {
  aspect-ratio: 1;
}

.rank-item.settling-item {
  opacity: 0;
}

.rank-item[draggable="true"] {
  cursor: grab;
}

.rank-item:active {
  cursor: grabbing;
}

.rank-item img,
.rank-item .image-placeholder {
  width: 100%;
  height: 100%;
}

.rank-item img {
  display: block;
  object-fit: cover;
}

.image-placeholder {
  display: grid;
  place-items: center;
  background: #dfe7e4;
  font-size: 34px;
  font-weight: 900;
}

.rank-item strong {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  min-height: 32px;
  place-items: center;
  padding: 6px 7px;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  backdrop-filter: blur(4px);
}

.remove-item {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.review-stage {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  pointer-events: none;
}

.review-card {
  align-self: center;
  display: grid;
  width: min(280px, 56vw);
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border: 4px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 10px 10px 0 rgba(18, 18, 18, 0.3);
  transition: opacity 120ms ease;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform, opacity;
}

.review-card.name-hidden {
  aspect-ratio: 1;
}

.review-card img,
.review-card .image-placeholder {
  width: 100%;
  height: 100%;
}

.review-card img {
  display: block;
  object-fit: cover;
}

.review-card strong {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 8px 12px;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.72);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  backdrop-filter: blur(5px);
}

.review-card.is-switching {
  opacity: 0;
  transition: none;
}

.review-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 10px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 5px 5px 0 rgba(18, 18, 18, 0.22);
  pointer-events: auto;
}

.review-actions span {
  min-width: 70px;
  font-weight: 900;
  text-align: center;
}

.flying-card {
  position: fixed;
  z-index: 60;
  margin: 0;
  opacity: 1;
  pointer-events: none;
  contain: layout paint style;
  transform-origin: top left;
  will-change: transform, opacity;
}

.review-mode {
  background: #f3f3ef;
}

.review-mode .app-header,
.review-mode .board-toolbar,
.review-mode .object-dock,
.review-mode .site-footer {
  display: none;
}

.review-mode main {
  width: 100%;
}

.review-mode .board-view {
  padding: 14px;
}

.review-mode .rank-shell {
  box-shadow: none;
}

.review-mode .rank-row {
  cursor: pointer;
}

.review-mode .rank-row:hover .rank-drop {
  background: #bfc9c6;
}

.review-mode .rank-item {
  opacity: 0.72;
}

.share-dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 22px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

.share-dialog::backdrop {
  background: rgba(10, 10, 10, 0.48);
}

.dialog-note {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.site-footer {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 44px) clamp(18px, 4vw, 34px);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  padding: 18px 0 0;
  border-top: 2px solid rgba(18, 18, 18, 0.18);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.site-footer .beian-link img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (max-width: 820px) {
  .board-toolbar {
    align-items: flex-start;
  }

  .board-toolbar,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .board-toolbar {
    flex-direction: column;
  }

  .app-header {
    align-items: center;
    gap: 10px;
  }

  .app-header .brand {
    flex: 1 1 auto;
  }

  .app-header .top-actions {
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-end;
  }

  .top-actions,
  .toolbar-buttons {
    width: 100%;
    justify-content: flex-end;
  }

  .home-grid {
    display: grid;
  }

  .home-hero {
    min-height: 0;
    padding-top: 6px;
  }

  .home-create-panel {
    position: static;
  }

  .admin-stats,
  .admin-layout,
  .admin-data-grid,
  .admin-edit-form,
  .admin-add-item-form,
  .admin-item-editor {
    grid-template-columns: 1fr;
  }

  .admin-topic-panel {
    position: static;
    max-height: none;
  }

  .admin-detail-header {
    flex-direction: column;
  }

  .admin-detail-header .toolbar-buttons {
    justify-content: flex-start;
  }

  .rank-row {
    grid-template-columns: 128px minmax(0, 1fr);
    min-height: 126px;
  }

  .rank-label {
    font-size: 28px;
    padding: 14px;
  }

  .rank-drop {
    min-height: 126px;
  }

  .rank-item {
    width: 96px;
    aspect-ratio: 1;
  }

  .rank-item.name-hidden {
    aspect-ratio: 1;
  }

  .rank-item img,
  .rank-item .image-placeholder {
    height: 100%;
  }
}

@media (max-width: 520px) {
  .brand strong {
    font-size: 16px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .home-view,
  .board-view {
    padding: 14px;
  }

  .home-title-block h1 {
    font-size: 38px;
    line-height: 0.98;
    white-space: normal;
  }

  .toolbar-buttons {
    flex-wrap: wrap;
  }

  .toolbar-buttons button {
    flex: 1 1 140px;
  }

  .app-header .top-actions {
    flex-wrap: nowrap;
    width: auto;
  }

  .app-header .toolbar-buttons button,
  .app-header .top-actions button {
    flex: 0 0 auto;
  }

  .site-footer a[href*="beian"] {
    flex: 1 0 100%;
  }

  .topic-card {
    grid-template-columns: 1fr;
  }

  .comparison-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .comparison-row .topic-badge {
    grid-column: 2;
    justify-self: start;
  }

  .comparison-thumb {
    width: 48px;
    height: 48px;
  }

  .tier-editor-grid {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .rank-label {
    padding: 10px 12px;
    font-size: 23px;
  }
}
