: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); }

.location-recommendation {
  margin-top: 10px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.location-recommendation:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.location-recommendation:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

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

.object-summary-row {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  text-decoration: none;
}

.object-summary-row span,
.object-summary-row small {
  color: var(--muted);
}

.object-seo-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.object-correction-action {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 780;
  cursor: pointer;
}

.ranking-faq {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.ranking-faq h2 {
  margin: 0;
  font-size: 18px;
}

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

.ranking-faq-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.ranking-faq-item p {
  margin: 0;
  color: var(--muted);
}

.ranking-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.ranking-summary h2 {
  margin: 0;
  font-size: 18px;
}

.ranking-summary-list {
  display: grid;
  gap: 8px;
}

.ranking-summary-list p {
  margin: 0;
  color: var(--muted);
}

.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-tier.t6, .tier-label.t6, .tier-mini.t6 { background: #4b5563; }

.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;
  max-width: 100%;
  overflow-x: clip;
}

.ranking-hero {
  padding: 18px 52px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  min-width: 0;
  max-width: 100%;
}

.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;
  font-weight: 760;
  text-decoration: none;
}

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

.breadcrumb [aria-current="page"],
.category-breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 760;
}

.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;
  min-width: 0;
}

.ranking-head h1 {
  min-width: 0;
  margin: 0;
  font-size: 32px;
  overflow-wrap: anywhere;
}

.actions { display: flex; flex-wrap: wrap; 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 {
  min-width: 0;
  max-width: 100%;
  padding: 14px 52px 34px;
}

.mini-search-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

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

.mini-search-form button,
.mini-search-form a {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
}

.ranking-search-state {
  margin: 0 0 10px 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.ladder-compact {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.tier-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.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; text-align: center; }
.tier-label.t6 strong { font-size: 18px; line-height: 1.15; }

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

.object-label {
  min-width: 0;
  max-width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.object-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  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: visible;
}

.object-label:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 999px;
}

.score-inline {
  color: #8a4b12;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

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

.object-tag.search-hit {
  border-color: #c3861a;
  background: #fff4c8;
  box-shadow: 0 0 0 2px rgba(195, 134, 26, 0.16), 0 8px 18px rgba(49, 39, 24, 0.1);
}

.object-tag.current-search-hit {
  outline: 3px solid #111827;
  outline-offset: 3px;
  background: #fff0a6;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.14), 0 12px 24px rgba(49, 39, 24, 0.14);
  z-index: 4;
}

.object-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  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 {
  position: absolute;
  top: -20px;
  right: -12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  padding: 2px;
  border: 1px solid rgba(216, 208, 197, 0.88);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 8px 20px rgba(49, 39, 24, 0.14);
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.object-tag:hover .vote-actions,
.object-tag:focus-within .vote-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(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); }

.vote-dialog-open { overflow: hidden; }

.vote-reason-dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 51, 0.38);
  z-index: 90;
}

.vote-reason-dialog[hidden] { display: none; }

.vote-reason-panel {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.vote-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.vote-dialog-kicker,
.vote-reason-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.vote-reason-panel h2 {
  margin: 0;
  padding-right: 36px;
  font-size: 24px;
}

.vote-dialog-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.vote-reason-input {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.65;
}

.vote-reason-input:focus {
  outline: 2px solid rgba(36, 89, 214, 0.22);
  border-color: var(--blue);
}

.vote-dialog-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.vote-dialog-error { color: var(--coral); text-align: right; }

.vote-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.vote-dialog-actions button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.vote-dialog-submit {
  border-color: var(--blue) !important;
  background: var(--blue) !important;
  color: #fff !important;
}

.vote-dialog-cancel[hidden] { display: none; }

.vote-status-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 95;
  max-width: min(460px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.vote-status-toast[hidden] { display: none; }

.ranking-tags-bottom,
.related-rankings-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; min-width: 0; }
.ranking-tags-bottom > span,
.related-rankings-bottom > span { line-height: 30px; color: var(--muted); font-weight: 780; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }

.related-rankings-bottom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.related-ranking-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.related-ranking-links a {
  min-width: min(260px, 100%);
  max-width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 12px rgba(49, 39, 24, 0.05);
}

.related-ranking-links a:hover,
.related-ranking-links a:focus {
  border-color: #c3861a;
  background: #fff8dc;
}

.related-ranking-links strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.related-ranking-links small {
  color: var(--muted);
  line-height: 1.5;
}

.drawer-backdrop {
  position: fixed;
  top: 68px;
  right: 0;
  bottom: 0;
  width: 50vw;
  min-width: 0;
  background: transparent;
  z-index: 10;
  transform: translate3d(100%, 0, 0);
  opacity: 0;
  visibility: hidden;
  will-change: transform;
  transition:
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 160ms ease,
    visibility 0s linear 240ms;
}

.drawer-backdrop.is-open {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.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-loading {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
}

.drawer-loading::before {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: drawer-loading-spin 700ms linear infinite;
  content: "";
}

@keyframes drawer-loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .drawer-backdrop { transition: none; }
  .drawer-loading::before { animation: none; }
}

.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; }
.detail-item .metric-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.detail-item-wide { grid-column: 1 / -1; }
.object-metric-group + .object-metric-group { margin-top: 14px; }
.object-metric-group h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.key-metric-grid { margin-bottom: 10px; }
.key-metric-item {
  border-color: #c3861a;
  background: #fff4c8;
}
.key-metric-item strong { font-size: 18px; }
.teacher-metric-panel {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #c0ded8;
  border-radius: 7px;
  background: #f1faf7;
}
.teacher-metric-panel h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}
.teacher-metric-item {
  border-color: #b8d7d0;
  background: #fbfffd;
}
.metric-source-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #d8d0c5;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  line-height: 1.4;
  vertical-align: 1px;
}
.metric-source-official {
  border-color: #9eb7a6;
  color: #416f50;
}
.metric-source-unofficial {
  border-color: #d2a46b;
  color: #8a5c1a;
}
.metric-source-display {
  border-color: #b7c6d8;
  color: #50647a;
}
.pathway-key-rate {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}
.pathway-key-rate strong {
  color: var(--ink);
  font-size: 13px;
}

.quant-list {
  display: grid;
  gap: 8px;
}

.quant-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(90px, 0.8fr) minmax(90px, 0.8fr) minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 13px;
}

.quant-row span {
  color: var(--muted);
}

.pathway-relation-note {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.pathway-probability-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.pathway-target-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: -2px 0 12px;
}

.pathway-target-list a {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.pathway-target-list a:hover {
  border-color: var(--accent);
}

.pathway-target-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.quant-row .source-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #faf8f2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.quant-row a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.related-object-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #d8d0c5;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(49, 39, 24, 0.05);
}

.related-object-link:hover,
.related-object-link:focus {
  border-color: #c3861a;
  background: #fff4c8;
}

.related-object-link strong { font-size: 13px; }
.related-object-link span { color: var(--muted); font-size: 12px; }

.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 .related-rankings-bottom,
.drawer-state .disclaimer,
.drawer-state .ranking-search-state,
.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;
}

.share-dialog-open { overflow: hidden; }

.wechat-share-dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 51, 0.38);
  z-index: 80;
}

.wechat-share-dialog[hidden] { display: none; }

.wechat-share-panel {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.wechat-share-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.wechat-share-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #16a34a;
  color: #fff;
  font-weight: 900;
}

.wechat-share-panel h2 {
  margin: 0;
  font-size: 24px;
}

.wechat-share-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.wechat-share-qr {
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.wechat-share-qr[hidden] { display: none; }

.wechat-share-qr img {
  width: 210px;
  height: 210px;
  display: block;
  image-rendering: crisp-edges;
}

.wechat-share-link {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.wechat-share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wechat-share-actions button {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 820;
}

.wechat-open-btn {
  border-color: #16a34a !important;
  background: #16a34a !important;
  color: #fff !important;
}

.site-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 26px 18px 32px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

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

.html-sitemap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px 52px 58px;
}

.html-sitemap-header {
  max-width: 720px;
  margin-bottom: 30px;
}

.html-sitemap-header h1 {
  margin: 0 0 10px;
  font-size: 30px;
}

.html-sitemap-header p,
.html-sitemap-section p {
  margin: 0;
  color: var(--muted);
}

.html-sitemap-section + .html-sitemap-section {
  margin-top: 36px;
}

.html-sitemap-section h2 {
  margin: 0 0 14px;
  font-size: 21px;
}

.html-sitemap-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.html-sitemap-list a {
  color: var(--ink);
  text-decoration: none;
}

.html-sitemap-list a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.html-sitemap-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.html-sitemap-object-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .rank-grid { grid-template-columns: 1fr; }
  .html-sitemap { padding-left: 18px; padding-right: 18px; }
  .html-sitemap-list,
  .html-sitemap-object-list { grid-template-columns: repeat(2, minmax(0, 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; }
  .ranking-page {
    overflow-x: hidden;
  }
  .ranking-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .ranking-head h1 {
    font-size: 28px;
  }
  .actions {
    width: 100%;
    gap: 8px;
  }
  .actions button {
    flex: 1 1 88px;
    min-width: 0;
  }
  .mini-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    width: 100%;
  }
  .mini-search-form input {
    width: 100%;
  }
  .mini-search-form a {
    grid-column: 1 / -1;
  }
  .tier-line {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
  }
  .tier-label {
    min-height: 50px;
    padding: 8px 6px;
  }
  .tier-label strong {
    font-size: 25px;
  }
  .tier-label.t6 strong {
    font-size: 14px;
  }
  .object-tags {
    min-height: 50px;
    padding: 10px;
    gap: 7px;
  }
  .object-tag {
    max-width: 100%;
    padding: 0 9px;
  }
  .object-name {
    max-width: min(100%, calc(100vw - 116px));
  }
  .vote-actions {
    right: 2px;
  }
  .ranking-tags-bottom {
    flex-direction: column;
    gap: 8px;
  }
  .related-rankings-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .related-ranking-links a {
    width: 100%;
  }
  .ranking-tags-bottom > span,
  .related-rankings-bottom > span {
    line-height: 1.2;
  }
  .wechat-share-panel {
    padding: 20px;
  }
  .wechat-share-actions {
    grid-template-columns: 1fr;
  }
  .vote-reason-panel {
    padding: 20px;
  }
  .vote-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .object-drawer { width: 100%; min-width: 0; }
  .drawer-backdrop {
    left: 0;
    width: auto;
    min-width: 0;
    max-width: 100vw;
  }
  .object-drawer {
    max-width: 100vw;
    padding: 16px;
    overflow-x: hidden;
  }
  .drawer-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .drawer-head h2 {
    font-size: 22px;
    overflow-wrap: anywhere;
  }
  .drawer-head p,
  .drawer-section p,
  .detail-item strong,
  .quant-row,
  .related-object-link {
    overflow-wrap: anywhere;
  }
  .drawer-section {
    min-width: 0;
    padding: 12px;
  }
  .object-meta-grid,
  .quant-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .quant-row {
    align-items: start;
    padding: 10px;
  }
  .quant-row > * {
    min-width: 0;
  }
  .quant-row .source-chip {
    margin-left: 0;
    margin-top: 4px;
    white-space: normal;
  }
  .related-object-link {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
    border-radius: var(--radius);
  }
  .related-object-link strong,
  .related-object-link span {
    min-width: 0;
    max-width: 100%;
  }
  .drawer-state .ranking-hero,
  .drawer-state .ranking-content { padding-right: 18px; }
  .login-panel { grid-template-columns: 1fr; }
}
