@import url("/assets/site-font-faces.css?v=20261129-reference-type");

:root {
  --font-ui: "Xunshu Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-title: "Xunshu Serif", "Songti SC", "Noto Serif SC", SimSun, Georgia, serif;
  --font-brand: "Xunshu Brand", var(--font-title);
  --font-feature: "Xunshu Serif", "Xunshu Reading Serif", "Songti SC", "Noto Serif CJK SC", SimSun, var(--font-ui);
  --font-body: var(--font-ui);
  --type-page-size: clamp(30px, calc(22px + 3.1vw), 40px);
  --type-feature-size: clamp(24px, calc(18px + 2.75vw), 45px);
  --type-section-size: clamp(20px, calc(18px + 0.65vw), 23px);
  --type-card-size: clamp(14px, calc(13px + 0.25vw), 16px);
  --type-title-weight: 700;
  --type-section-weight: 650;
  --type-control-weight: 600;
  --type-label-weight: 550;
  --form-control-radius: 15px;
  --browse-control-height: 44px;
}

body {
  --sans: var(--font-ui);
  --drama-sans: var(--font-ui);
  font-family: var(--font-ui);
}

body.drama-app {
  --drama-sans: var(--font-ui);
  font-family: var(--font-ui);
}

h2 {
  font-family: var(--font-ui);
}

button, input, select, textarea {
  font-family: var(--font-ui);
}

h1,
body .brand,
body .drawer-heading {
  font-family: var(--font-title);
}

body.app-shell[data-mode] #site-header.site-header > a.brand > span:last-child {
  font-family: var(--font-brand);
  font-weight: 660;
  font-synthesis-weight: none;
  letter-spacing: .025em;
}

body.app-shell .page-heading h1,
body.app-shell .anime-heading h1,
body.app-shell :is(#anime-heading, #movie-heading, #comic-heading),
body.app-shell #drama-main .page-heading h1,
body.app-shell[data-content="novel"] #page-title,
body.app-shell[data-content="novel"] .page-heading h1 {
  font: var(--type-title-weight) var(--type-page-size)/1.22 var(--font-title);
  letter-spacing: normal;
}

body.app-shell .desktop-nav a,
body.app-shell .mobile-menu nav a {
  font-weight: 500;
}

body .description,
body .hero-copy,
body .overview-record-copy,
body .watch-context h2 {
  font-family: var(--font-ui);
}

body.app-shell .discovery-feature .discovery-feature-title {
  font: 500 var(--type-feature-size)/1.22 var(--font-feature);
  font-synthesis-weight: none;
  letter-spacing: .015em;
}

body.app-shell .discovery-feature :is(.discovery-feature-label, .discovery-feature-meta) {
  font: 500 13px/1.5 var(--font-ui);
}

body.app-shell .discovery-feature .discovery-feature-action {
  font: var(--type-control-weight) 14px/1.4 var(--font-ui);
}

#novel-discovery #novel-discovery-title,
.results-section #drama-results-heading,
.anime-view :is(#anime-results-title, [data-catalog-part="results-title"]),
.audio-view .audio-results-heading h2 {
  font: var(--type-title-weight) var(--type-section-size)/1.35 var(--font-ui);
  letter-spacing: normal;
}

body.app-shell .source-switch-heading h2,
body[data-mode="admin"]:has(#console-content:not([hidden])) .source-switch-heading h2 {
  font: var(--type-title-weight) 22px/1.35 var(--font-ui);
}

.catalog-source-section-heading h3 {
  font: var(--type-section-weight) 14px/1.4 var(--font-ui);
}

button.catalog-source-trigger,
.catalog-source-dialog button.catalog-source-option {
  font-family: var(--font-ui);
  font-weight: var(--type-label-weight);
}

.novel-discovery-card .discovery-card-title,
.anime-view .anime-card-title,
.drama-app .drama-card__title,
.audio-card h3 {
  font-family: var(--font-ui);
  font-size: var(--type-card-size);
  font-weight: var(--type-section-weight);
  line-height: 1.45;
  letter-spacing: normal;
}

.catalog-source-dialog button.catalog-source-option:is([aria-current], [aria-pressed="true"]) {
  font-weight: var(--type-section-weight);
}

body.app-shell :is(.discovery-search-bar, .discovery-section-links) :is(button, select, a),
body.app-shell :is(.movie-category-quick-list, #drama-categories .category-quick, .audio-category-quick, .novel-category-quick) > button {
  font-family: var(--font-ui);
  font-weight: var(--type-control-weight);
}

body.app-shell .discovery-search-bar .discovery-search-field > input[type="search"] {
  font-family: var(--font-ui);
  font-weight: 500;
}

.watch-page #comic-detail #comic-detail-title {
  font-family: var(--font-ui);
  font-weight: var(--type-title-weight);
  letter-spacing: normal;
}

.audio-detail-heading h1 {
  font-family: var(--font-ui);
  font-weight: var(--type-title-weight);
  letter-spacing: normal;
}

/* Reading content keeps the reader's own font family and weight settings. */

/* Animate the artwork within its frame so adjacent cards stay in place. */
@media (hover: hover) and (pointer: fine) {
  body.app-shell :is(.discovery-card-open .novel-cover, .anime-card-open .anime-cover, .drama-card__open .poster, .audio-card .audio-artwork) img {
    transition: scale var(--motion-normal) var(--motion-ease),
      opacity var(--motion-fast) var(--motion-ease), filter var(--motion-fast) var(--motion-ease);
  }
  body.app-shell :is(.discovery-card-open, .anime-card-open, .drama-card__open, .audio-card):hover
    :is(.novel-cover, .anime-cover, .poster, .audio-artwork) img {
    scale: 1.025;
  }
}

/* Source and search controls use the same surface in each palette. */
html[data-palette] body.app-shell :is(
  #novel-header-source > select,
  .page-heading > .source-field:not(:has(> select[hidden])),
  .audio-browse .audio-source,
  #drama-search > .search-field:not(.discovery-search-field),
  :is(#anime-search, [data-catalog-part="search"]) > .anime-search-field:not(.discovery-search-field),
  input[type="search"]:not(.search-field input, .anime-search-field input, .source-panel-search input, .discovery-search-field input)
) {
  background-color: var(--manga-surface, var(--raised));
  border: 1px solid var(--manga-line, var(--line));
  border-radius: var(--form-control-radius);
  box-shadow: none;
}
/* Rounded form controls share their silhouette with the discovery fields. */
html[data-palette] body.app-shell :is(
  .field > :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"]), select, textarea),
  .toolbar-field > select,
  form :is(button, a):is(.primary, .secondary, .danger-button)
) {
  border-radius: var(--form-control-radius);
}

/* Keep discovery search fields at the standard control height. */
html[data-palette] body.app-shell :is(
  #search-form.novel-discovery-search #search-key,
  #drama-search > .search-field,
  :is(#anime-search, [data-catalog-part="search"]) > .anime-search-field,
  .audio-search > .audio-query
) {
  min-height: var(--browse-control-height);
}

html[data-palette] body.app-shell :is(#drama-search > .search-field,
  :is(#anime-search, [data-catalog-part="search"]) > .anime-search-field) > input {
  min-height: calc(var(--browse-control-height) - 2px);
  padding-block: 7px;
}

html[data-palette] body.app-shell :is(#search-form.novel-discovery-search #search-key, .audio-search > .audio-query,
  .audio-browse .audio-source) {
  padding-block: 7px;
}
