:root {
  --page: #f6f3ee;
  --paper: #fffdf8;
  --ink: #172033;
  --muted: #667085;
  --line: #ded8cc;
  --blue: #2457d6;
  --blue-soft: #e8efff;
  --teal: #0f766e;
  --teal-soft: #e7f5f2;
  --amber: #b7791f;
  --amber-soft: #fff4d7;
  --coral: #c5543d;
  --coral-soft: #fff0eb;
  --shadow: 0 24px 60px rgba(49, 39, 24, 0.12);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

.site-nav {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 850;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
}

.site-nav nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-weight: 760;
  color: #4b5563;
}

.site-nav nav a:first-child { color: var(--ink); }

.nav-user {
  color: var(--ink);
  font-size: 13px;
}

.hero {
  padding: 74px 52px 42px;
  text-align: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid #cbdcd9;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 13px;
  font-weight: 800;
}

.badge.blue {
  border-color: #dce5ff;
  color: var(--blue);
  background: var(--blue-soft);
}

.hero h1 {
  margin: 18px auto 12px;
  font-size: 34px;
  line-height: 1.18;
}

.hero p,
.result-heading p {
  color: var(--muted);
  font-size: 15px;
}

.hero-search,
.compact-search {
  max-width: 720px;
  height: 58px;
  margin: 34px auto 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(49, 39, 24, 0.1);
}

.compact-search {
  margin: 0;
  max-width: 720px;
}

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

.hero-search input,
.compact-search input,
.mini-search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.hero-search button,
.compact-search button,
.drawer-actions button,
.actions button,
.vote-btn,
.drawer-close {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.hero-search button,
.compact-search button {
  height: 42px;
  min-width: 92px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
}

.quick-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-tags a,
.chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 760;
}

.section-wrap {
  padding: 32px 52px 46px;
}

.muted-section { background: #f1ece3; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-wrap h2,
.section-head h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.section-head p { margin: 0; color: var(--muted); }

.rank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.rank-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 14px 34px rgba(49, 39, 24, 0.08);
}

.rank-card-link {
  display: block;
  padding: 18px 20px 14px;
}

.rank-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.rank-card h3 { margin: 0 0 8px; font-size: 21px; }
.rank-card p { margin: 0; color: var(--muted); line-height: 1.55; }

.thumb {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf7ef;
}

.thumb-row { display: grid; grid-template-columns: 54px 1fr; gap: 8px; }

.thumb-tier,
.tier-mini {
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
}

.thumb-tier { height: 34px; }
.thumb-tier.t1, .tier-label.t1, .tier-mini.t1 { background: #2d5bd7; }
.thumb-tier.t2, .tier-label.t2, .tier-mini.t2 { background: #118477; }
.thumb-tier.t3, .tier-label.t3, .tier-mini.t3 { background: #c17a19; }
.thumb-tier.t4, .tier-label.t4, .tier-mini.t4 { background: #c9513d; }
.thumb-tier.t5, .tier-label.t5, .tier-mini.t5 { background: #707b8d; }

.thumb-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.thumb-tag {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 7px;
  background: #fffdf8;
  font-size: 13px;
  font-weight: 760;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.results-top {
  padding: 30px 52px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.result-heading h1 { margin: 22px 0 0; font-size: 30px; }

.ranking-page {
  min-height: calc(100vh - 68px);
  position: relative;
}

.ranking-hero {
  padding: 18px 52px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a,
.category-breadcrumb a {
  color: #3b5375;
  text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumb a:focus,
.category-breadcrumb a:hover,
.category-breadcrumb a:focus {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.category-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.ranking-head h1 { margin: 0; font-size: 32px; }

.actions { display: flex; gap: 10px; }

.actions button,
.drawer-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 780;
}

.actions button.active,
.drawer-actions button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.ranking-content { padding: 14px 52px 34px; }

.mini-search-form input {
  width: 360px;
  height: 38px;
  margin-bottom: 14px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.ladder-compact { display: grid; gap: 10px; }

.tier-line {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: stretch;
}

.tier-label {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 10px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--ink);
}

.tier-label strong { font-size: 30px; line-height: 1; }

.object-tags {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.78);
}

.object-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d8d0c5;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  box-shadow: 0 4px 12px rgba(49, 39, 24, 0.05);
  cursor: pointer;
  overflow: hidden;
}

.object-tag:hover,
.object-tag:focus-within {
  box-shadow: 0 8px 18px rgba(49, 39, 24, 0.09);
}

.object-tag.selected-object {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  background: #fff8dc;
}

.object-name { white-space: nowrap; }

.tag-warn { border-color: #e0a33a; }
.tag-data { border-color: #8d99a8; }
.tag-review { border-color: #16867a; }
.tag-risk { border-color: #cf523c; }
.tag-stale { border-color: #6b7280; }

.vote-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-4px);
  transition: max-width 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.object-tag:hover .vote-actions,
.object-tag:focus-within .vote-actions {
  max-width: 52px;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.vote-btn {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #d8d0c5;
  border-radius: 999px;
  background: var(--paper);
  color: #7a8494;
  line-height: 1;
}

.vote-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  stroke: currentColor;
  transform: translate(0, 0);
}
.vote-btn.up { color: var(--blue); }
.vote-btn.down { color: var(--coral); }
.vote-btn.active.up { color: #fff; background: var(--blue); border-color: var(--blue); }
.vote-btn.active.down { color: #fff; background: var(--coral); border-color: var(--coral); }

.ranking-tags-bottom,
.disclaimer {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: #5b6472;
}

.ranking-tags-bottom { display: flex; gap: 12px; align-items: flex-start; }
.ranking-tags-bottom > span { line-height: 30px; color: var(--muted); font-weight: 780; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.drawer-backdrop {
  position: fixed;
  top: 68px;
  right: 0;
  bottom: 0;
  width: 50%;
  min-width: 540px;
  background: transparent;
  z-index: 10;
}

.object-drawer {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: -24px 0 64px rgba(23, 32, 51, 0.18);
  overflow: auto;
}

.drawer-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 { margin: 0; font-size: 28px; }
.drawer-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }

.drawer-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 22px;
  font-weight: 900;
}

.drawer-body { display: grid; gap: 14px; padding-top: 16px; }

.drawer-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf4;
}

.drawer-section h3 { margin: 0 0 10px; font-size: 18px; }

.object-tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.status-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 760;
}

.status-chip.tag-warn { border-color: #f1d4a6; color: var(--amber); background: var(--amber-soft); }
.status-chip.tag-risk { border-color: #f0c8bc; color: var(--coral); background: var(--coral-soft); }
.status-chip.tag-review { border-color: #c0ded8; color: var(--teal); background: var(--teal-soft); }
.status-chip.tag-data,
.status-chip.tag-stale { border-color: #d3d7df; color: #596273; background: #f5f6f8; }

.object-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.detail-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #faf7ef;
}

.detail-item span { display: block; color: var(--muted); font-size: 12px; }
.detail-item strong { display: block; margin-top: 5px; font-size: 15px; }

.drawer-state .ranking-hero { padding-right: calc(50% + 28px); }
.drawer-state .ranking-content { padding-right: calc(50% + 28px); }
.drawer-state .ranking-tags-bottom,
.drawer-state .disclaimer,
.drawer-state .mini-search-form { display: none; }
.drawer-state .tier-line { grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
.drawer-state .tier-label { min-height: 56px; }
.drawer-state .tier-label strong { font-size: 28px; }
.drawer-state .ladder-compact { gap: 8px; }
.drawer-state .object-tags { min-height: 52px; gap: 7px; padding: 10px; }
.drawer-state .object-tag { height: 28px; padding: 0 9px; font-size: 12px; }

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--paper);
}

.login-page {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 52px;
}

.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 18px 0 12px;
  font-size: 32px;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.login-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.wechat-login-btn,
.wechat-login-disabled {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  background: #18a058;
  font-weight: 850;
}

.alipay-login-btn {
  background: #1677ff;
}

.wechat-login-disabled {
  background: #9aa4b2;
}

.login-secondary-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.login-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #f0c8bc;
  border-radius: var(--radius);
  color: var(--coral);
  background: var(--coral-soft);
}

.login-note {
  margin-top: 14px;
  font-size: 13px;
}

.qr-card {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf7ef;
  text-align: center;
}

.qr-grid {
  width: 180px;
  height: 180px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  border: 10px solid #111827;
  background: #fff;
}

.qr-grid span,
.qr-grid strong {
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
  font-weight: 900;
}

.qr-grid span:nth-child(3n) {
  background: #18a058;
}

@media (max-width: 900px) {
  .rank-grid { grid-template-columns: 1fr; }
  .site-nav { padding: 0 18px; }
  .site-nav nav { gap: 14px; }
  .section-wrap,
  .ranking-content,
  .ranking-hero,
  .results-top { padding-left: 18px; padding-right: 18px; }
  .object-drawer { width: 100%; min-width: 0; }
  .drawer-backdrop {
    left: 0;
    width: auto;
    min-width: 0;
  }
  .drawer-state .ranking-hero,
  .drawer-state .ranking-content { padding-right: 18px; }
  .login-panel { grid-template-columns: 1fr; }
}
