:root {
  --bg-top: #f6efe4;
  --bg-bottom: #eef5f8;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --ink: #18212a;
  --muted: #55616d;
  --line: rgba(24, 33, 42, 0.11);
  --shadow: 0 32px 70px rgba(24, 33, 42, 0.14);
  --accent: #0f766e;
  --accent-soft: #d4f0ea;
  --accent-alt: #b45309;
  --danger-soft: #fff1ef;
  --danger-ink: #b42318;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --content-width: 1180px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI Variable", "Yu Gothic UI", "Hiragino Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(180, 83, 9, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  opacity: 0.28;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  position: relative;
  width: min(100%, calc(var(--content-width) + 3rem));
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.site-header,
.site-footer,
.hero-panel,
.content-section,
.feature-strip,
.detail-hero,
.reader-shell,
.notice-card,
.empty-card {
  backdrop-filter: blur(18px);
  animation: rise-up 0.65s ease both;
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: max-content;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  color: white;
  font-family: "Bahnschrift", "Aptos Display", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: grid;
}

.brand-copy strong,
.section-header h2,
.notice-card h2,
.empty-card h3,
.chapter-card h3,
.hero-copy h1,
.detail-hero__body h1,
.reader-header h1 {
  font-family: "Bahnschrift", "Aptos Display", sans-serif;
}

.brand-copy strong {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.brand-kicker,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
}

.header-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  width: min(100%, 480px);
}

.search-form,
.toolbar {
  display: grid;
  gap: 0.8rem;
}

.search-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.search-form__full,
.search-form__actions {
  grid-column: 1 / -1;
}

.field,
.checkbox-row label {
  display: grid;
  gap: 0.35rem;
}

.field span {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.header-search input,
.field input,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.header-search input:focus,
.field input:focus,
.field select:focus {
  border-color: rgba(15, 118, 110, 0.45);
  transform: translateY(-1px);
}

.search-button,
.action-link,
.ghost-link,
.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.search-button,
.action-link {
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  color: white;
  box-shadow: 0 18px 35px rgba(15, 118, 110, 0.24);
}

.ghost-link,
.mini-link {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--line);
  color: var(--ink);
}

.mini-link {
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
}

.search-button:hover,
.action-link:hover,
.ghost-link:hover,
.mini-link:hover,
.reader-nav__link:hover,
.manga-card:hover,
.chapter-card:hover,
.spotlight-card:hover {
  transform: translateY(-3px);
}

.site-nav {
  display: inline-flex;
  gap: 1rem;
  align-items: center;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  padding-bottom: 0.12rem;
  border-bottom: 2px solid transparent;
}

.site-nav a.is-active {
  color: var(--ink);
  border-bottom-color: rgba(15, 118, 110, 0.35);
}

.main-shell {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.hero-panel,
.detail-hero,
.reader-shell,
.content-section,
.notice-card,
.empty-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
  padding: 1.5rem;
  overflow: hidden;
}

.hero-copy,
.detail-hero__body {
  display: grid;
  gap: 1rem;
}

.hero-copy h1,
.detail-hero__body h1,
.reader-header h1 {
  margin: 0.25rem 0 0.2rem;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: 0.02em;
}

.hero-copy p,
.lead-copy,
.spotlight-card__description,
.notice-card p,
.empty-card p,
.section-header p,
.feature-strip p,
.site-footer p,
.filter-note,
.chapter-card__title,
.reader-subtitle,
.card-description {
  color: var(--muted);
  line-height: 1.7;
}

.hero-note,
.pill-row,
.tag-cloud,
.card-meta,
.action-row,
.reader-nav,
.chapter-card__meta,
.checkbox-row,
.mode-switch,
.link-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-note span,
.pill,
.tag,
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(24, 33, 42, 0.09);
  color: var(--muted);
  font-size: 0.83rem;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.link-pill {
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.link-pill:hover {
  transform: translateY(-2px);
}

.link-pill--active {
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  color: white;
  border-color: transparent;
}

.spotlight-card,
.manga-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: var(--panel-strong);
  border: 1px solid rgba(24, 33, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 36px rgba(24, 33, 42, 0.08);
}

.spotlight-card {
  grid-template-columns: 0.9fr 1.1fr;
  min-height: 100%;
}

.spotlight-card__media,
.manga-card__media {
  position: relative;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(15, 118, 110, 0.22), transparent 52%),
    linear-gradient(180deg, #fff8ef, #edf9f4);
}

.spotlight-card__body,
.manga-card__body {
  display: grid;
  gap: 0.8rem;
  padding: 1.2rem;
}

.spotlight-card__subtitle,
.card-subtitle,
.reader-subtitle,
.chapter-card__title {
  margin: 0;
  color: var(--accent-alt);
  font-weight: 700;
}

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

.manga-card {
  grid-template-rows: 280px 1fr;
}

.media-shell,
.detail-hero__media {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}

.media-shell {
  width: 100%;
  height: 100%;
  min-height: 240px;
  aspect-ratio: 3 / 4.2;
}

.detail-hero__media {
  aspect-ratio: 3 / 4.2;
}

.media-shell img,
.detail-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 240px;
  color: var(--accent);
  font-family: "Bahnschrift", "Aptos Display", sans-serif;
  font-size: clamp(2rem, 4vw, 4rem);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.25), transparent 40%),
    radial-gradient(circle at bottom right, rgba(180, 83, 9, 0.16), transparent 44%),
    linear-gradient(135deg, #fff7ed, #effcf6);
}

.media-shell .cover-fallback {
  position: absolute;
  inset: 0;
}

.media-shell.is-broken img {
  opacity: 0;
}

.content-section {
  padding: 1.35rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.section-header h2,
.notice-card h2,
.empty-card h3 {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.feature-strip article,
.notice-card,
.empty-card {
  padding: 1.2rem;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.feature-strip h3 {
  margin: 0.35rem 0 0.5rem;
  font-family: "Bahnschrift", "Aptos Display", sans-serif;
}

.detail-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  padding: 1.4rem;
}

.detail-hero__media {
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 36px rgba(24, 33, 42, 0.12);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.meta-grid div {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(24, 33, 42, 0.08);
}

.meta-grid dt {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.meta-grid dd {
  margin: 0.35rem 0 0;
  font-weight: 700;
  line-height: 1.55;
}

.chapter-stack {
  display: grid;
  gap: 0.9rem;
}

.chapter-pager {
  margin: 0 0 1rem;
}

.chapter-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(24, 33, 42, 0.08);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 26px rgba(24, 33, 42, 0.05);
}

.chapter-card--current {
  border-color: rgba(15, 118, 110, 0.34);
  box-shadow: 0 18px 30px rgba(15, 118, 110, 0.12);
}

.chapter-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.reader-shell {
  padding: 1.3rem;
}

.reader-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.reader-nav {
  padding: 1rem 0 0.3rem;
}

.reader-nav__link {
  min-width: 190px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  border: 1px solid rgba(24, 33, 42, 0.08);
  box-shadow: 0 14px 24px rgba(24, 33, 42, 0.06);
}

.reader-nav__link strong {
  display: block;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.reader-canvas {
  display: grid;
  gap: 1rem;
  padding-top: 1rem;
}

.reader-page {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) + 4px);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(24, 33, 42, 0.08);
  box-shadow: 0 18px 34px rgba(24, 33, 42, 0.08);
}

.reader-page img {
  width: min(100%, 980px);
  margin: 0 auto;
}

.reader-page__error {
  display: none;
  padding: 4rem 1.2rem 3rem;
  text-align: center;
  color: var(--danger-ink);
  font-weight: 700;
  background:
    radial-gradient(circle at top, rgba(180, 35, 24, 0.08), transparent 42%),
    var(--danger-soft);
}

.reader-page.is-broken img {
  display: none;
}

.reader-page.is-broken .reader-page__error {
  display: block;
}

.reader-page figcaption {
  padding: 0.8rem 1rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-hero {
  grid-template-columns: 1.2fr 0.8fr;
}

.admin-summary {
  grid-template-columns: 1fr;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(24, 33, 42, 0.08);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 16px 30px rgba(24, 33, 42, 0.06);
}

.metric-card h3 {
  margin: 0.35rem 0 0.55rem;
  font-family: "Bahnschrift", "Aptos Display", sans-serif;
  font-size: 1.2rem;
  line-height: 1.35;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.metric-card--ok {
  background: linear-gradient(180deg, rgba(212, 240, 234, 0.65), rgba(255, 255, 255, 0.92));
}

.metric-card--pending,
.metric-card--custom {
  background: linear-gradient(180deg, rgba(255, 243, 228, 0.8), rgba(255, 255, 255, 0.92));
}

.metric-card--error {
  background: linear-gradient(180deg, rgba(255, 241, 239, 0.92), rgba(255, 255, 255, 0.92));
}

.site-footer {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 1100px) {
  .hero-panel,
  .detail-hero,
  .spotlight-card,
  .site-header {
    grid-template-columns: 1fr;
  }

  .site-header {
    border-radius: 1.5rem;
  }

  .card-grid,
  .feature-strip,
  .admin-grid,
  .meta-grid,
  .search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-form__full,
  .search-form__actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 1rem 0.9rem 2rem;
  }

  .card-grid,
  .feature-strip,
  .admin-grid,
  .meta-grid,
  .chapter-card,
  .search-form,
  .site-header {
    grid-template-columns: 1fr;
  }

  .section-header,
  .reader-header {
    flex-direction: column;
    align-items: start;
  }

  .header-search {
    width: 100%;
  }
}
