* {
  box-sizing: border-box;
  font-family: "Blueaka", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  margin: 0;
  padding: 0;
}

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

body {
  background: #f4f6f1;
  color: #18201c;
  font-family: "Blueaka", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-weight: 400;
}

b, strong, h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
}

.rank-page {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.rank-table-wrap {
  display: none;
}

.rank-list {
  display: block;
  padding: 0 10px;
}

@media (min-width: 561px) {
  .rank-page {
    max-width: 960px;
  }

  .nav-inner {
    max-width: 960px;
  }

  .rank-table-wrap {
    display: block;
  }

  .rank-list {
    display: none;
  }
}

.rank-nav {
  background: #fff;
  border-bottom: 2px solid #28342d;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.nav-inner {
  margin: 0 auto;
  max-width: 640px;
}

.nav-inner::after {
  content: "";
  display: table;
  clear: both;
}

.nav-brand {
  float: left;
  font-size: 18px;
  font-weight: 700;
  line-height: 50px;
  padding: 0 20px;
}

.nav-toggle {
  display: none;
  float: right;
  background: none;
  border: none;
  cursor: pointer;
  padding: 15px 20px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #18201c;
  margin: 5px 0;
  transition: all 0.3s;
}

.nav-menu {
  float: right;
}

.nav-item {
  display: inline-block;
  font-size: 14px;
  line-height: 50px;
  padding: 0 15px;
  text-decoration: none;
  color: #18201c;
}

.nav-item:hover,
.nav-item.active {
  background: #eef1eb;
  color: #1f6f4a;
}

.nav-back {
  background: #1f6f4a;
  color: #fff !important;
}

.nav-back:hover {
  background: #268a5c !important;
}

.rank-header {
  padding: 20px 20px 0;
  text-align: center;
}

.rank-header h1 {
  font-size: 24px;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto 14px;
}

.search-box input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #28342d;
  border-radius: 6px;
  font-family: "Blueaka", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
}

.search-box button {
  padding: 10px 20px;
  background: #1f6f4a;
  border: 2px solid #163826;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.search-box button:hover {
  background: #268a5c;
}

.rank-notice {
  max-width: 480px;
  margin: 0 auto 14px;
  padding: 10px 14px;
  background: #fff8e1;
  border: 2px solid #e6c34a;
  border-radius: 6px;
  text-align: left;
}

.notice-title {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}


.rank-notice p {
  font-size: 13px;
  color: #8b6914;
  line-height: 1.6;
}

.rank-notice a {
  font-size: 12px;
  color: #1e90ff;
  text-decoration: none;
}

.rank-notice a:hover {
  text-decoration: underline;
}

.rank-controls {
  font-family: "Blueaka", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  padding: 0 20px 14px;
  text-align: right;
}

.page-size-label {
  font-size: 13px;
  color: #5e665d;
}

.page-size-label select {
  padding: 4px 8px;
  border: 2px solid #28342d;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

.rank-item {
  background: #fff;
  border: 2px solid #28342d;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.rank-item.loading {
  text-align: center;
  padding: 40px;
}

.loading-text {
  color: #8c9890;
}

.rank-item.no-data {
  text-align: center;
  padding: 40px;
}

.rank-item-header {
  display: flex;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid #dde7e1;
}

.rank-name {
  font-size: 16px;
  font-weight: 700;
}

.rank-time {
  font-size: 12px;
  color: #8c9890;
}

.rank-item-body {
  padding: 10px 15px;
}

.rank-score {
  font-size: 14px;
  margin-bottom: 8px;
}

.rank-score strong {
  color: #1f6f4a;
}

.rank-info {
  font-size: 12px;
  color: #5e665d;
  margin-bottom: 8px;
}

.rank-message {
  font-size: 13px;
  color: #3d4743;
  padding-top: 8px;
  border-top: 1px dashed #dde7e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.rank-message.expanded {
  white-space: normal;
  word-break: break-word;
  overflow-y: auto;
  max-height: 120px;
}

.rank-pagination {
  padding: 20px;
  text-align: center;
}

.pagination {
  display: inline-flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination li {
  display: inline;
}

.pagination a {
  display: inline-block;
  min-width: 36px;
  height: 36px;
  line-height: 32px;
  padding: 0 8px;
  border: 2px solid #28342d;
  border-radius: 6px;
  text-decoration: none;
  color: #18201c;
  font-size: 14px;
  text-align: center;
}

.pagination a:hover {
  background: #eef1eb;
}

.pagination li.active a {
  background: #1f6f4a;
  color: #fff;
  border-color: #163826;
}

.pagination li.disabled a {
  opacity: 0.5;
  pointer-events: none;
}

.rank-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #28342d;
  padding: 12px 20px;
  text-align: center;
  font-size: 13px;
  color: #5e665d;
}

.rank-table-wrap {
  background: #fffdf6;
  border: 2px solid #28342d;
  margin: 0 10px;
  overflow-x: auto;
}

.server-error-modal {
  align-items: center;
  background: rgba(0, 0, 0, 0);
  display: none;
  inset: 0;
  justify-content: center;
  opacity: 0;
  position: fixed;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 30;
}

.server-error-modal:not(.hidden) {
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.server-error-dialog {
  background: #fffdf6;
  border: 2px solid #28342d;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  max-width: 90vw;
  width: 800px;
}

.server-error-header {
  align-items: center;
  border-bottom: 2px solid #dde7e1;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  flex-shrink: 0;
}

.server-error-header h2 {
  font-size: 18px;
  margin: 0;
}

.server-error-close-btn {
  background: #c0392b;
  border: 2px solid #8b1a1a;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  min-height: 28px;
  min-width: 36px;
  padding: 0 10px;
}

.server-error-frame {
  border: none;
  flex: 1;
  min-height: 400px;
  width: 100%;
}

.rank-table {
  border-collapse: collapse;
  font-size: 15px;
  width: 100%;
}

.rank-table thead {
  background: #eef1eb;
}

.rank-table th {
  border-bottom: 2px solid #28342d;
  font-size: 14px;
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

.rank-table th.sortable {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.rank-table th.sortable:hover {
  background: #dde7e1;
}

.rank-table th.sort-active {
  color: #1f6f4a;
}

.sort-arrow {
  font-size: 12px;
}

.rank-table td {
  border-bottom: 1px solid #dde7e1;
  padding: 10px 8px;
  vertical-align: middle;
}

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

.col-rank {
  text-align: center;
  width: 56px;
}

.col-score {
  text-align: right;
  width: 90px;
}

.col-dev {
  width: 90px;
}

.col-loc {
  width: 120px;
}

.col-msg {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.col-msg.expanded {
  white-space: normal;
  word-break: break-word;
  overflow: visible;
}

.col-nick {
  width: 110px;
}

.col-time {
  white-space: nowrap;
  width: 130px;
}

.rank-loading {
  color: #8c9890;
  padding: 40px;
  text-align: center;
}

@media (max-width: 560px) {
  .nav-brand {
    font-size: 16px;
    padding: 0 15px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 2px solid #28342d;
  }

  .nav-menu.active {
    display: block;
  }

  .nav-item {
    display: block;
    text-align: center;
    border-bottom: 1px solid #eef1eb;
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
  }

  .rank-header h1 {
    font-size: 20px;
  }

  .rank-item-header {
    padding: 10px 12px;
  }

  .rank-name {
    font-size: 14px;
  }

  .rank-time {
    font-size: 11px;
  }

  .rank-item-body {
    padding: 8px 12px;
  }

  .rank-score {
    font-size: 13px;
  }

  .rank-info {
    font-size: 11px;
  }

  .rank-message {
    font-size: 12px;
  }

  .pagination a {
    min-width: 32px;
    height: 32px;
    line-height: 28px;
    font-size: 13px;
  }
}

.footer-links {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 12px;
  color: #5e665d;
  text-decoration: none;
}

.footer-links a:hover {
  color: #1f6f4a;
  text-decoration: underline;
}