:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #17242b;
  background: #f7f9fa;
  --blue: #00668d;
  --cyan: #00aff0;
  --tint: #e6f8ff;
  --line: #dbe6eb;
  --muted: #48616c;
}
* { box-sizing: border-box; }
body { margin: 0; }
header { background: white; border-bottom: 1px solid var(--line); }
.bar, .intro, .directory { width: min(1080px, calc(100% - 36px)); margin: auto; }
.bar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-size: 1.45rem; font-weight: 800; letter-spacing: -.06em; color: inherit; text-decoration: none; }
.brand span { color: var(--cyan); }
.intro { padding: clamp(32px, 8vw, 72px) 0 30px; }
h1 { margin: 0; font-size: clamp(2.5rem, 7vw, 4.25rem); letter-spacing: -.055em; }
.intro p { color: var(--muted); margin: 12px 0 25px; }
label { display: block; font-size: .9rem; font-weight: 650; margin-bottom: 8px; }
input { width: min(100%, 500px); background: white; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: inherit; font: inherit; }
.directory { padding-bottom: 48px; }
.filters, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, .primary { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 8px 13px; color: var(--blue); cursor: pointer; font: inherit; text-decoration: none; }
button[aria-pressed=true] { background: var(--tint); border-color: var(--cyan); }
.primary { background: var(--cyan); color: #092a37; border-color: var(--cyan); font-weight: 650; }
button:hover, .primary:hover { filter: brightness(.95); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
#results { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
article { display: flex; flex-direction: column; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.initials { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; background: var(--tint); color: var(--blue); font-weight: 800; }
.tag { color: var(--muted); font-size: .9rem; }
h2 { margin: 13px 0 0; font-size: 1.25rem; }
article p { flex: 1; margin: 7px 0 17px; color: var(--muted); line-height: 1.6; }
.nav-link { align-self: center; color: var(--blue); text-decoration: none; padding: 8px 4px; }
.nav-link:hover { text-decoration: underline; }
.initials { position: relative; overflow: hidden; }
.initials img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ranking { border-top: 1px solid var(--line); padding-top: 24px; }
.ranking p { color: var(--muted); }
.ranking-list { padding: 0 0 0 2rem; max-width: 560px; }
.ranking-list li { padding: 12px 5px; border-bottom: 1px solid var(--line); }
.ranking-list a { color: var(--blue); }


/* Directory layout */
:root { background: #f4f8fa; }
.bar, .intro, .content { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.bar { min-height: 72px; }
.brand { letter-spacing: -.055em; font-size: 1.55rem; }
.brand span { color: var(--blue); }
.bar button { border-radius: 999px; padding-inline: 16px; }
.intro {
  margin-block: 28px 32px;
  padding: clamp(24px, 5vw, 58px);
  border: 1px solid #c4e8f5;
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 98% 4%, #9de4fb 0%, transparent 55%),
    linear-gradient(120deg, #fff 16%, #e3f7fd 100%);
}
h1 { font-size: clamp(2.35rem, 6vw, 4.5rem); line-height: 1.12; }
.intro p { font-size: clamp(1rem, 2vw, 1.15rem); margin: 14px 0 27px; }
input { min-height: 52px; border-color: #b0d5e4; border-radius: 12px; box-shadow: 0 3px 10px #164c6110; }
.content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 285px); align-items: start; gap: 24px; padding-bottom: 56px; }
.directory { width: 100%; padding-bottom: 0; }
.filters button { border-radius: 999px; padding-inline: 15px; }
.filters button[aria-pressed=true] { background: #d4f4ff; color: #075575; font-weight: 650; }
#results { margin-block: 15px; font-size: .9rem; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr)); gap: 14px; }
article {
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 3px 10px #164c6108;
  transition: border-color .2s, box-shadow .2s;
}
article:hover { border-color: #9dd8ea; box-shadow: 0 8px 24px #164c6114; }
.initials { width: 54px; height: 54px; border-radius: 16px; font-size: 1.1rem; }
.tag { border-radius: 999px; padding: 4px 10px; background: #f0f6f8; color: #3e5966; }
article h2 { margin-top: 15px; letter-spacing: -.025em; }
article .actions { border-top: 1px solid #ecf1f3; padding-top: 13px; }
article .actions > * { font-size: .9rem; }
.ranking {
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--cyan);
  border-radius: 16px;
  background: white;
  scroll-margin-top: 16px;
}
.ranking h2 { margin: 0; font-size: 1.18rem; }
.ranking p { margin: 8px 0 0; line-height: 1.55; font-size: .9rem; }
#ranking-empty { background: #f2f8fa; border-radius: 10px; padding: 12px; margin-top: 15px; }
.ranking-list { margin-bottom: 0; padding-left: 21px; }
.ranking-list li { padding: 10px 0 10px 4px; }
.ranking-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.ranking-list li::marker { color: var(--blue); font-weight: 700; }
.ranking-list a { text-underline-offset: 3px; }

@media (max-width: 780px) {
  .content { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .bar, .intro, .content { width: calc(100% - 28px); }
  .brand { font-size: 1.25rem; }
  .bar .actions { gap: 2px; font-size: .875rem; }
  .bar button { padding-inline: 10px; }
  .intro { margin-block: 16px 22px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  article { transition: none; }
}
.handle { margin-top: 3px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.source { align-self: center; padding: 7px 4px; color: var(--blue); }
#creator-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 24px;
  color: inherit;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 50px #102d4040;
}
#creator-dialog::backdrop { background: #102c405c; }
.profile-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.profile-header h2 { margin: 0; font-size: 1.5rem; }
.profile-header .handle { margin-bottom: 0; }
#profile-description { color: var(--muted); line-height: 1.6; margin: 16px 0 20px; }
.profile-header > div { flex: 1; min-width: 0; }
#profile-background { padding: 14px; margin-bottom: 18px; background: #f2f8fa; border-radius: 12px; }
#profile-background h3 { margin: 0 0 6px; font-size: 1rem; }
#profile-background p { margin: 0 0 8px; color: var(--muted); line-height: 1.55; }

/* Large creator portraits */
.card-top {
  position: relative;
  display: block;
}
.card-top .initials {
  width: 100%;
  height: clamp(158px, 16vw, 215px);
  border-radius: 13px;
  background: linear-gradient(135deg, #dcf5ff, #effaff);
  font-size: 2.25rem;
}
.card-top .tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fffffff2;
  box-shadow: 0 1px 6px #164c6115;
}
.initials img { object-position: center 24%; }
#creator-dialog #profile-avatar {
  width: 100%;
  height: clamp(180px, 35vh, 285px);
  margin-bottom: 18px;
  border-radius: 13px;
  font-size: 3rem;
  background: linear-gradient(135deg, #dcf5ff, #effaff);
}
#creator-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.creator-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.creator-stats:empty, .stats-caption:empty { display: none; }
.creator-stats > div { padding: 6px 9px; border-radius: 8px; background: #e6f8ff; }
.creator-stats dt { color: var(--muted); font-size: .8125rem; }
.creator-stats dd { margin: 2px 0 0; color: #17242b; font-weight: 650; font-variant-numeric: tabular-nums; }
#profile-stats { margin: 0 0 18px; }
#profile-stats h3 { margin: 0 0 8px; font-size: 1rem; }
.stats-empty, .stats-caption, .stats-source { color: var(--muted); font-size: .875rem; }
.stats-empty, .stats-caption { margin: 0; }
#ranking-mode { margin-top: 12px; font-size: .875rem; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { flex: 0 0 auto; }
.brand .wordmark { color: inherit; }
.wordmark b { color: var(--blue); }
.ranking-entry, .ranking-entry a { display: flex; align-items: center; gap: 8px; }
.ranking-entry { justify-content: space-between; }
.ranking-entry a { min-width: 0; }
.ranking-entry .ranking-avatar { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; font-size: .75rem; }
.ranking-name { overflow-wrap: anywhere; }
.ranking-count { flex: 0 0 auto; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: white;
}
.loading-screen[hidden] { display: none; }
.loading-content {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}
.loading-content p { margin: 0; color: var(--muted); font-size: .9375rem; }
.loading-track { width: 80px; height: 3px; overflow: hidden; border-radius: 999px; background: var(--tint); }
.loading-track::after {
  content: '';
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
  animation: loading-slide .9s ease-in-out infinite alternate;
}
@keyframes loading-slide { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .loading-track::after { animation: none; }
}
.logo-lockup {
  display: inline-flex;
  align-items: baseline;
  color: #008cc3;
  font-weight: 800;
  letter-spacing: -.055em;
  white-space: nowrap;
}
.logo-lockup img {
  display: block;
  width: var(--logo-width);
  height: calc(var(--logo-width) * .181);
  object-fit: cover;
  object-position: center 53.5%;
  align-self: center;
}
.logo-lockup span { color: inherit; margin-inline-start: calc(var(--logo-width) * -.038); }
.brand .logo-lockup { --logo-width: clamp(96px, 29vw, 152px); color: #008cc3; font-size: clamp(.9rem, 3vw, 1.3rem); }
.loading-content .logo-lockup { --logo-width: clamp(168px, 48vw, 450px); font-size: clamp(1.45rem, 4.6vw, 3.55rem); }
#age-dialog, #safari-dialog {
  width: min(460px, calc(100% - 32px));
  padding: clamp(20px, 5vw, 32px);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: inherit;
  background: white;
  box-shadow: 0 16px 50px #102d4040;
}
#age-dialog::backdrop, #safari-dialog::backdrop { background: #102c40b3; backdrop-filter: blur(6px); }
#age-dialog h2, #safari-dialog h2 { margin: 12px 0 0; font-size: 1.5rem; }
.age-label {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 14px;
  background: var(--tint);
  color: var(--blue);
  font-weight: 800;
}
#age-description, #safari-description { color: var(--muted); line-height: 1.6; margin: 12px 0 20px; }
#age-actions[hidden] { display: none; }
header[inert], main[inert] { visibility: hidden; }
[data-language] {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--blue);
  background: white;
  font: inherit;
  font-size: .875rem;
}
.age-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar .actions { justify-content: flex-end; align-items: center; }
@media (max-width: 460px) {
  .bar { flex-wrap: wrap; padding-block: 10px; }
  .bar .actions { justify-content: flex-start; }
}
#open-safari[hidden], #safari-url[hidden] { display: none; }
#safari-status { color: var(--muted); margin-bottom: 8px; }
#safari-status:empty { display: none; }
#safari-url { margin-top: 4px; }
