/* Paperfolio-inspired skin for the yhcq8.cn drop-rate query pages. */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f7f7;
  --border-color: #0b0b0b;
  --border-light: #1f1f1f;
  --text-primary: #0b0b0b;
  --text-secondary: #393939;
  --text-muted: #737373;
  --accent-blue: #2f81f7;
  --accent-cyan: #20b486;
  --accent-orange: #ffc224;
  --accent-red: #ff6b7a;
  --accent-purple: #6366f1;
  --gradient-main: linear-gradient(90deg, #ff6b7a, #ffc224, #2f81f7, #20b486);
  --primary-color: #2f81f7;
  --secondary-color: #0b0b0b;
  --border-radius: 10px;
  --box-shadow: 6px 6px 0 #0b0b0b;
  --line: #0b0b0b;
  --muted: #737373;
  --success: #20b486;
  --warn: #ffc224;
  --error: #ff6b7a;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition-fast: 0.16s ease;
  --transition-normal: 0.24s ease;
  --transition-bounce: 0.24s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  overflow: hidden;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(11, 11, 11, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(11, 11, 11, 0.045) 1px, transparent 1px),
    #fff;
  background-size: 32px 32px;
  color: var(--text-primary);
  font-family: "Onest", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: pageFadeIn 0.28s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 10px;
  z-index: 10000;
  background: var(--gradient-main);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

a:hover {
  opacity: 0.78;
}

::selection {
  background: #ffc224;
  color: #0b0b0b;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #fff;
}

::-webkit-scrollbar-thumb {
  background: #0b0b0b;
  border: 3px solid #fff;
  border-radius: 999px;
}

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

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

.container {
  width: min(100%, 1600px);
  height: calc(100vh - 28px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 12px;
}

header {
  flex: 0 0 auto;
  padding: 12px;
  background: #fff;
  border: 4px solid #0b0b0b;
  border-radius: 16px;
  box-shadow: 6px 6px 0 #0b0b0b;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #0b0b0b;
}

.logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border: 3px solid #0b0b0b;
  border-radius: 50%;
  background: #ffc224;
}

.logo-text,
.home-title {
  color: #0b0b0b;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.15;
  white-space: nowrap;
}

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav-right,
.viewer-nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.search-mode {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mode-btn,
.home-link-card,
.search-btn,
.version-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 3px solid #0b0b0b;
  border-radius: 9px;
  background: #fff;
  color: #0b0b0b !important;
  box-shadow: 3px 3px 0 #0b0b0b;
  font-weight: 950;
  line-height: 1.1;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.mode-btn:hover,
.mode-btn.active,
.home-link-card:hover,
.search-btn:hover,
.version-enter:hover {
  opacity: 1;
  background: #ffc224;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #0b0b0b;
}

.mode-btn.active {
  background: #2f81f7;
  color: #fff !important;
}

.community-info {
  min-width: 150px;
  padding: 8px 12px;
  background: #eff6ff;
  border: 3px solid #0b0b0b;
  border-radius: 10px;
  text-align: center;
}

.nav-right .home-link-card,
.viewer-nav-right .home-link-card {
  min-height: 44px;
  min-width: 112px;
  padding: 8px 18px;
  background: #fff;
  font-size: 16px;
  font-weight: 950;
}

.nav-right .home-link-card .community-label,
.viewer-nav-right .home-link-card .community-label {
  margin: 0;
  color: #0b0b0b;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.1;
}

.community-label,
.version-switch-label {
  display: block;
  margin-bottom: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 850;
}

.community-number {
  color: #0b0b0b;
  font-size: 14px;
  font-weight: 950;
  word-break: break-word;
}

.version-switch-wrap {
  min-width: 230px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: #fff8d8;
  border: 3px solid #0b0b0b;
  border-radius: 10px;
}

.version-switch-wrap .version-switch-label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}

.version-switch-select {
  width: auto;
  min-width: 130px;
  flex: 1;
  height: 32px;
  padding: 2px 28px 2px 10px;
  border: 2px solid #0b0b0b;
  border-radius: 7px;
  background: #fff;
  color: #0b0b0b;
  font-weight: 900;
  line-height: 28px;
  outline: none;
}

.search-container,
.data-banner,
.list-box,
.home-panel {
  background: #fff;
  border: 4px solid #0b0b0b;
  border-radius: 16px;
  box-shadow: 5px 5px 0 #0b0b0b;
  animation: cardSlideIn 0.36s ease both;
}

.search-container {
  flex: 0 0 auto;
  padding: 14px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 12px;
  border: 3px solid #0b0b0b;
  border-radius: 10px;
  background: #fff8d8;
  color: #0b0b0b;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.filter-checkbox input[type=checkbox] {
  display: none;
}

.checkbox-custom {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 3px solid #0b0b0b;
  border-radius: 5px;
}

.checkbox-custom::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform var(--transition-fast);
}

.filter-checkbox input[type=checkbox]:checked + .checkbox-custom {
  background: #2f81f7;
}

.filter-checkbox input[type=checkbox]:checked + .checkbox-custom::after {
  transform: rotate(-45deg) scale(1);
}

.search-box {
  flex: 1;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 3px solid #0b0b0b;
  border-radius: 10px;
  background: #fff;
  color: #0b0b0b;
  font-weight: 850;
  outline: none;
}

.search-box input:focus {
  box-shadow: 0 0 0 4px rgba(47, 129, 247, 0.18);
}

.search-btn.primary {
  background: #0b0b0b;
  color: #fff !important;
}

.search-btn.primary:hover {
  background: #2f81f7;
}

.search-info {
  display: none;
}

.data-banner {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #eff6ff;
  font-weight: 900;
}

.data-status {
  color: #0b0b0b;
}

.data-counts {
  color: var(--text-secondary);
}

.lists-container {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  overflow: hidden;
}

.list-box {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-box:nth-child(1) { background: #eff6ff; }
.list-box:nth-child(2) { background: #fff8d8; }
.list-box:nth-child(3) { background: #f0fff8; }
.list-box:nth-child(4) { background: #fff0f3; }

.list-title {
  flex: 0 0 auto;
  padding: 13px 14px;
  border-bottom: 4px solid #0b0b0b;
  background: #0b0b0b;
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.list-item,
.related-item,
.text-block {
  width: 100%;
  margin-bottom: 8px;
  background: #fff;
  border: 3px solid #0b0b0b;
  border-radius: 10px;
  color: #0b0b0b;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.list-item:hover,
.related-item.clickable:hover {
  background: #ffc224;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #0b0b0b;
}

.list-item.active,
.related-item.active,
.related-item.active:hover {
  background: #2f81f7;
  color: #fff;
  box-shadow: 2px 2px 0 #0b0b0b;
}

.item-number,
.related-number,
.version-index {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0b0b0b;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 950;
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-name,
.related-name {
  color: inherit;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.35;
  word-break: break-word;
}

.list-sub,
.related-meta {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.list-item.active .list-sub,
.related-item.active .related-meta {
  color: rgba(255, 255, 255, 0.84);
}

.sub-label {
  font-weight: 950;
}

.sub-map,
.highlight-map-name {
  color: #b86d00;
  font-weight: 950;
}

.highlight-coord {
  color: #087f63;
  font-weight: 950;
}

.highlight-npc {
  color: #5156d8;
  font-weight: 950;
}

.related-item {
  padding: 10px;
}

.related-head,
.text-block-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 7px;
}

.text-block {
  padding: 12px;
}

.text-block-title,
.section-label {
  color: #0b0b0b;
  font-weight: 950;
}

.text-block pre {
  margin-top: 8px;
  padding: 10px;
  border: 2px solid #0b0b0b;
  border-radius: 8px;
  background: #fff8d8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.7 "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.path-rich-text {
  color: var(--text-secondary);
  font-weight: 700;
  line-height: 1.75;
  word-break: break-word;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: #fff8d8;
  border: 2px solid #0b0b0b;
  border-radius: 999px;
  color: #0b0b0b;
  font-size: 12px;
  font-weight: 950;
}

.section-label {
  margin: 8px 2px 10px;
  font-size: 14px;
}

.notice,
.empty-state,
.empty-home {
  width: 100%;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #fff;
  border: 3px dashed #0b0b0b;
  border-radius: 10px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 900;
}

.home-page {
  max-width: 1300px;
}

.home-title-wrap {
  text-align: center;
}

.home-main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.home-panel {
  flex: 1;
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.home-panel-title {
  margin-bottom: 18px;
  color: #0b0b0b;
  font-size: clamp(30px, 5vw, 58px);
  font-weight: 950;
  line-height: 1.05;
}

.home-panel-title::after {
  content: "";
  display: block;
  width: 120px;
  height: 16px;
  margin-top: 12px;
  background: #ff6b7a;
  border: 3px solid #0b0b0b;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.version-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 132px;
  padding: 18px;
  background: #fff8d8;
  border: 4px solid #0b0b0b;
  border-radius: 16px;
  box-shadow: 5px 5px 0 #0b0b0b;
  color: #0b0b0b;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.version-card:nth-child(3n + 2) { background: #eff6ff; }
.version-card:nth-child(3n + 3) { background: #fff0f3; }

.version-card:hover {
  opacity: 1;
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 #0b0b0b;
}

.version-name {
  min-width: 0;
  color: #0b0b0b;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.25;
  word-break: break-word;
}

.version-file {
  display: none;
}

.version-enter {
  grid-column: 1 / -1;
  width: 100%;
  background: #0b0b0b;
  color: #fff !important;
}

.current-version-card {
  display: none;
}

@media (max-width: 1350px) {
  .lists-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
    padding: 12px;
  }

  .container {
    height: auto;
    min-height: calc(100vh - 24px);
    overflow: visible;
  }

  .nav-container,
  .search-row,
  .data-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-center,
  .nav-right,
  .viewer-nav-right,
  .logo {
    justify-content: center;
  }

  .search-box {
    flex-direction: column;
  }

  .lists-container {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .list-box {
    min-height: 360px;
  }
}

@media (max-width: 520px) {
  body {
    padding: 8px;
  }

  .container {
    min-height: calc(100vh - 16px);
  }

  header,
  .search-container,
  .data-banner,
  .list-box,
  .home-panel,
  .version-card {
    border-width: 3px;
    box-shadow: 3px 3px 0 #0b0b0b;
  }

  .logo {
    flex-direction: column;
    text-align: center;
  }

  .logo-img {
    width: 44px;
    height: 44px;
  }

  .logo-text,
  .home-title {
    white-space: normal;
    font-size: 17px;
  }

  .mode-btn,
  .home-link-card,
  .search-btn {
    width: 100%;
  }

  .version-grid {
    grid-template-columns: 1fr;
  }
}
