/* Color system
   Change these variables first when you want to retune the whole site. */
:root {
  --color-bg: #ffffff;
  --color-bg-soft: #fafafa;
  --color-surface: #ffffff;
  --color-surface-soft: #f5f5f3;
  --color-surface-muted: #eeeeeb;
  --color-surface-strong: #e7e6e2;
  --color-text: #2f2f2c;
  --color-muted: #6f6f69;
  --color-subtle: #96968f;
  --color-accent: #8a775b;
  --color-accent-strong: #77654c;
  --color-accent-soft: #eee9e1;
  --color-line: rgba(45, 45, 42, 0.12);
  --color-line-strong: rgba(45, 45, 42, 0.18);
  --color-shadow: rgba(30, 30, 28, 0.06);
  --color-success: #5f7561;
  --color-success-soft: #eef3ef;
  --color-danger: #8b635d;
  --color-danger-soft: #f6efee;
  --radius-card: 18px;
  --radius-soft: 12px;
  --content-width: 1080px;
  --reading-width: 760px;
  --font-heading: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --shadow-soft: 0 10px 28px rgba(30, 30, 28, 0.04);
  --shadow-lift: 0 12px 28px rgba(30, 30, 28, 0.07);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.9;
  letter-spacing: 0.02em;
  text-rendering: optimizeLegibility;
}

body.home-page {
  position: relative;
  background-color: var(--color-bg);
  background-image: none;
}

body.home-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/static/images/top-background.webp");
  background-size: 92% auto;
  background-position: center bottom;
  background-repeat: no-repeat;
}

body.detail-page-bg {
  min-height: 100vh;
  background-color: var(--color-bg);
  background-image: url("/static/images/detail-background.webp");
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

::selection {
  background: rgba(138, 119, 91, 0.18);
  color: var(--color-text);
}

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

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

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 2px 12px;
  border-bottom: 1px solid var(--color-line);
  background-color: rgba(255, 255, 255, 0.92);
}

body.home-page .site-header {
  background-color: rgba(255, 255, 255, 0.4);
}

.brand-group {
  min-width: 0;
}

.brand {
  display: inline-block;
  color: var(--color-text);
}

.brand-logo {
  display: block;
  width: clamp(110px, 12vw, 160px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.brand-note,
.eyebrow,
.meta-line,
.support-note,
.tag,
.metric-label,
.preview-title {
  color: var(--color-muted);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-note {
  margin: 6px 0 0;
  text-transform: lowercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a,
.ghost-button {
  color: var(--color-muted);
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

.site-nav a {
  padding: 5px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a.is-active,
.ghost-button:hover {
  color: var(--color-text);
}

.site-nav a:hover,
.site-nav a.is-active {
  border-color: rgba(138, 119, 91, 0.28);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 10px 14px;
  background-color: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 2px 8px var(--color-shadow);
}

.site-main {
  padding: 34px 0 72px;
}

body.home-page .site-main {
  padding-top: 12px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 4px 42px;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  background-color: transparent;
  font-size: 0.92rem;
}

body.home-page .site-footer {
  background-color: rgba(255, 255, 255, 0.72);
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.flash-message {
  padding: 14px 16px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-soft);
  background-color: var(--color-surface);
  box-shadow: 0 4px 12px var(--color-shadow);
}

.flash-message--success {
  border-color: rgba(96, 121, 86, 0.22);
  color: var(--color-success);
  background-color: var(--color-success-soft);
}

.flash-message--error {
  border-color: rgba(143, 97, 88, 0.22);
  color: var(--color-danger);
  background-color: var(--color-danger-soft);
}

.page-intro,
.reading-grid,
.auth-card,
.metric-card,
.admin-shortcut,
.admin-table-wrap,
.admin-form,
.archive-card,
.reading-card,
.compact-card {
  position: relative;
  border: 1px solid var(--color-line);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.page-intro,
.auth-card,
.admin-table-wrap,
.admin-form {
  border-radius: 28px;
}

.page-intro h1,
.detail-hero h1,
.auth-card h1,
.admin-page-head h1,
.home-hero h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-text);
}

.page-intro p,
.detail-summary,
.reading-card p,
.auth-card p,
.admin-page-head p,
.metric-card p {
  max-width: 42rem;
  color: rgba(47, 47, 44, 0.84);
}

.page-intro .music-ai-note {
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.hero-links,
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.home-hero {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(56px, 8vh, 90px) 24px clamp(64px, 8vh, 96px);
}

.home-kicker {
  margin: 0 0 18px;
  color: var(--color-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.home-logo {
  display: block;
  width: min(70%, 602px);
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
}

.home-copy {
  margin: 28px 0 0;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.8vw, 2.1rem);
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.home-lead {
  max-width: 620px;
  margin: 28px 0 0;
  color: rgba(47, 47, 44, 0.78);
  font-size: 1rem;
  line-height: 2;
}

.home-hero h1,
.home-copy,
.home-lead {
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.3);
}

.home-links {
  margin-top: 28px;
}

.home-section {
  padding: 28px;
  border-radius: 26px;
  border: 1px solid rgba(45, 45, 42, 0.08);
  background-color: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.home-section .section-heading {
  margin-bottom: 24px;
  padding: 0 4px 14px;
  border-bottom-color: var(--color-line);
}

.home-ai-notice {
  margin-top: 38px;
  padding: 20px 22px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background-color: var(--color-bg-soft);
  color: var(--color-muted);
  font-size: 0.86rem;
  line-height: 1.9;
}

.home-ai-notice h2 {
  margin-bottom: 10px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.home-ai-notice p + p {
  margin-top: 8px;
}

.music-shelf {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 119, 91, 0.32) transparent;
}

.music-shelf-item {
  flex: 0 0 148px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-text);
  padding: 0;
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
}

.music-shelf-item:focus-visible {
  outline: 2px solid rgba(138, 119, 91, 0.36);
  outline-offset: 6px;
  border-radius: 10px;
}

.music-shelf-cover {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background-color: var(--color-surface-soft);
}

.music-shelf-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-shelf-cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.music-shelf-title {
  display: block;
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--color-text);
}

.music-shelf-item.is-active .music-shelf-cover {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(138, 119, 91, 0.16);
}

.music-feature-player {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
  padding: 20px;
  border-radius: 14px;
  background-color: #1f2328;
  color: #f5f5f3;
}

.music-feature-cover {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.music-feature-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-feature-cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(245, 245, 243, 0.72);
  font-size: 0.88rem;
}

.music-feature-body {
  display: grid;
  gap: 10px;
  align-content: start;
}

.music-feature-meta {
  margin: 0;
  color: #b9b9b3;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.music-feature-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.95rem);
  font-weight: 500;
  line-height: 1.25;
}

.music-feature-title a,
.music-feature-detail {
  color: #f5f5f3;
}

.music-feature-description {
  margin: 0;
  color: #d5d4cf;
  line-height: 1.8;
}

.music-feature-audio-wrap {
  display: grid;
  gap: 10px;
}

.music-feature-audio {
  width: 100%;
}

.music-feature-audio-note {
  margin: 0;
  color: #b9b9b3;
}

.music-feature-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 4px;
}

.music-archive-grid,
.notes-grid {
  display: grid;
  gap: 22px;
}

.music-archive-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.music-archive-tile {
  min-width: 0;
}

.music-archive-cover {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background-color: var(--color-surface-soft);
  box-shadow: 0 8px 20px var(--color-shadow);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.music-archive-cover:hover,
.music-archive-cover:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(138, 119, 91, 0.28);
  box-shadow: 0 10px 24px rgba(30, 30, 28, 0.08);
}

.music-archive-cover:focus-visible {
  outline: none;
}

.music-archive-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-archive-meta {
  padding: 14px 2px 0;
}

.music-archive-meta time {
  display: block;
  color: var(--color-subtle);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.music-archive-meta h2 {
  margin: 8px 0 0;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.45;
}

.music-archive-meta h2 a {
  color: var(--color-text);
}

.music-archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.music-archive-tags .tag {
  padding: 4px 8px;
  font-size: 0.72rem;
}

.music-archive-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--color-accent);
  font-size: 0.86rem;
}

.notes-grid--home {
  grid-template-columns: repeat(auto-fill, minmax(180px, 180px));
  justify-content: start;
}

.notes-grid--archive {
  grid-template-columns: repeat(auto-fill, minmax(190px, 230px));
  justify-content: start;
}

.note-tile {
  display: block;
  color: var(--color-text);
  text-decoration: none;
}

.note-tile-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background-color: var(--color-surface-soft);
  box-shadow: 0 8px 20px var(--color-shadow);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.note-tile:hover .note-tile-media,
.note-tile:focus-visible .note-tile-media {
  transform: translateY(-2px);
  border-color: rgba(138, 119, 91, 0.28);
  box-shadow: 0 10px 24px rgba(30, 30, 28, 0.08);
}

.note-tile:focus-visible {
  outline: none;
}

.note-tile-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-tile-label {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 13px 14px 12px;
  border: 1px solid rgba(45, 45, 42, 0.1);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.92);
}

.note-tile-category {
  display: block;
  margin-bottom: 5px;
  color: var(--color-muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.note-tile h3 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
}

.note-tile time {
  display: block;
  margin-top: 7px;
  color: var(--color-subtle);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.note-tile-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  background-color: var(--color-surface-soft);
  color: var(--color-muted);
  text-align: center;
  line-height: 1.8;
}

body.home-page .archive-card {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: rgba(45, 45, 42, 0.1);
  box-shadow: var(--shadow-soft);
}

body.home-page .archive-card--note::before {
  background-color: rgba(138, 119, 91, 0.14);
}

body.home-page .empty-state {
  padding: 10px 0 4px;
}

.section-block {
  margin-top: 68px;
}

body.home-page .section-block {
  margin-top: 38px;
}

.section-heading,
.admin-page-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--color-line);
}

.section-heading h2,
.detail-section h2,
.reading-card h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--color-text);
}

.page-intro,
.auth-card,
.admin-form,
.admin-table-wrap {
  padding: 28px;
}

.page-intro {
  margin-bottom: 28px;
}

.page-intro--music,
.page-intro--notes,
.page-intro--tale {
  overflow: hidden;
}

.page-intro--music::after,
.page-intro--notes::after,
.page-intro--tale::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  height: 1px;
  background-color: rgba(138, 119, 91, 0.14);
}

.archive-grid {
  display: grid;
  gap: 22px;
}

.archive-grid--music,
.archive-grid--notes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.archive-card,
.reading-card,
.compact-card,
.admin-shortcut,
.metric-card {
  border-radius: var(--radius-card);
}

.archive-card {
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.archive-card:hover,
.compact-card:hover,
.admin-shortcut:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 119, 91, 0.28);
  box-shadow: var(--shadow-lift);
}

.archive-card--music {
  background-color: var(--color-surface);
}

.archive-card--note {
  background-color: var(--color-surface);
}

.archive-card--note::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background-color: rgba(138, 119, 91, 0.12);
}

.preview-image {
  display: block;
  width: 100%;
  height: auto;
}

.card-body {
  position: relative;
  z-index: 1;
  padding: 22px;
}

.list-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.list-card-image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--color-line);
  background-color: var(--color-surface-soft);
}

.list-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.list-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.list-card-link {
  margin-top: auto;
  align-self: flex-start;
}

.archive-card--note .card-body {
  padding-left: 28px;
}

.card-body h2,
.card-body h3 {
  margin: 6px 0 10px;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--color-text);
}

.card-body p {
  margin: 0 0 14px;
  color: rgba(47, 47, 44, 0.78);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(138, 119, 91, 0.16);
  background-color: var(--color-accent-soft);
  color: #5f5448;
  text-transform: none;
}

.text-link,
.soft-link {
  color: var(--color-accent);
}

.text-link:hover,
.soft-link:hover {
  color: var(--color-accent-strong);
}

.detail-page {
  display: block;
  max-width: 1180px;
  margin: 0 auto;
  padding:
    clamp(48px, 7vw, 96px)
    clamp(16px, 4vw, 40px)
    clamp(72px, 10vw, 140px);
  background: transparent;
}

.detail-panel {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 18px;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.detail-hero {
  display: grid;
  gap: 14px;
  padding: clamp(32px, 5vw, 58px);
  background-color: var(--color-surface-soft);
  border-bottom: 1px solid var(--color-line);
}

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

.detail-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.16;
}

.detail-summary,
.detail-lead {
  margin: 0;
  max-width: 46rem;
  color: rgba(47, 47, 44, 0.78);
  line-height: 1.9;
}

.detail-body {
  padding: clamp(24px, 4vw, 36px);
  background-color: var(--color-surface);
}

.detail-body-inner,
.detail-stack {
  display: grid;
  gap: 24px;
}

.detail-body-inner {
  max-width: var(--reading-width);
  margin: 0 auto;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.3fr);
  gap: 28px;
  align-items: start;
}

.detail-layout--note {
  grid-template-columns: 1fr;
}

.detail-image-frame {
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background-color: var(--color-surface-soft);
}

.detail-image-frame--wide {
  margin-bottom: 24px;
}

.detail-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 720px;
  margin: 0 auto;
  border-radius: 12px;
}

.detail-media,
.detail-content {
  display: grid;
  gap: 28px;
}

.detail-section,
.audio-panel,
.reading-card,
.compact-card,
.preview-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--color-line);
  background-color: var(--color-bg-soft);
}

.audio-panel h2,
.detail-section h2 {
  margin-bottom: 0;
}

.detail-page--tale .detail-body-inner {
  max-width: 920px;
}

.detail-panel .detail-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
}

.detail-panel .detail-section + .detail-section {
  padding-top: 28px;
  border-top: 1px solid var(--color-line);
}

.detail-panel .audio-panel {
  padding: 20px;
  border-radius: 14px;
  background-color: var(--color-surface-soft);
}

.detail-panel .compact-card {
  border-radius: 14px;
  background-color: var(--color-bg-soft);
}

.audio-player {
  width: 100%;
  accent-color: var(--color-accent);
}

.prose-block {
  color: rgba(47, 47, 44, 0.9);
  line-height: 2;
}

.creator-name {
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 1.18rem;
  letter-spacing: 0.04em;
}

.preline {
  white-space: pre-line;
}

.compact-list {
  display: grid;
  gap: 14px;
}

.compact-card {
  display: grid;
  gap: 8px;
}

.reading-grid {
  display: grid;
  gap: 22px;
  padding: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reading-card {
  min-height: 100%;
}

.empty-state,
.empty-cell {
  color: var(--color-muted);
}

.media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  color: var(--color-muted);
}

.auth-section {
  display: grid;
  place-items: center;
  min-height: 62vh;
}

.auth-card {
  width: min(100%, 540px);
}

.admin-page-head {
  margin-bottom: 24px;
}

.metric-grid,
.admin-shortcuts {
  display: grid;
  gap: 20px;
}

.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2rem, 1.6rem + 1vw, 3rem);
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--color-text);
}

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

.admin-shortcut {
  display: grid;
  gap: 6px;
  padding: 22px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

.admin-table tbody tr:hover {
  background-color: var(--color-bg-soft);
}

.admin-table th {
  color: var(--color-muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-line);
  color: var(--color-muted);
  background-color: var(--color-bg-soft);
}

.status-badge--live {
  border-color: rgba(96, 121, 86, 0.22);
  color: var(--color-success);
  background-color: var(--color-success-soft);
}

.admin-form {
  display: grid;
  gap: 24px;
}

.admin-form--wide {
  width: 100%;
}

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

.form-field {
  display: grid;
  gap: 8px;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field--checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
}

.form-field span {
  color: rgba(47, 47, 44, 0.92);
}

.form-field input[type="text"],
.form-field input[type="password"],
.form-field input[type="datetime-local"],
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid rgba(45, 45, 42, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  background-color: rgba(255, 255, 255, 0.96);
  color: var(--color-text);
}

.form-field input[type="text"]:focus,
.form-field input[type="password"]:focus,
.form-field input[type="datetime-local"]:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: rgba(138, 119, 91, 0.36);
  box-shadow: 0 0 0 3px rgba(138, 119, 91, 0.1);
}

.form-field input[type="file"] {
  color: var(--color-muted);
}

.form-field small {
  color: var(--color-muted);
}

.primary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.primary-button {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 30, 28, 0.05);
}

.primary-button:hover {
  background-color: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
}

.danger-button {
  background-color: transparent;
  border-color: rgba(143, 97, 88, 0.24);
  color: var(--color-danger);
}

.danger-button:hover {
  background-color: rgba(143, 97, 88, 0.08);
}

.ghost-button {
  background-color: transparent;
  border-color: var(--color-line);
  color: var(--color-muted);
}

.ghost-button:hover {
  background-color: rgba(245, 245, 243, 0.9);
}

.inline-form {
  display: inline-flex;
}

.preview-panel {
  display: grid;
  gap: 12px;
}

.preview-image {
  max-width: 360px;
  max-height: 260px;
  border-radius: 16px;
  border: 1px solid var(--color-line);
}

.admin-theme .site-main {
  padding-top: 28px;
}

body.detail-page-bg .site-main,
body.detail-page-bg .detail-page,
body.detail-page-bg .detail-layout,
body.detail-page-bg .detail-body-inner,
body.detail-page-bg .detail-stack {
  background: transparent;
}

@media (max-width: 900px) {
  .archive-grid--music,
  .reading-grid,
  .metric-grid,
  .admin-shortcuts,
  .form-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .music-archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .notes-grid--archive {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .detail-layout--note {
    grid-template-columns: 1fr;
  }

  .site-footer,
  .section-heading,
  .admin-page-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  body.home-page::before {
    background-image: url("/static/images/top-background-mobile.webp");
    background-size: 100% auto;
    background-position: center 5rem;
  }

  body.detail-page-bg {
    background-image: url("/static/images/detail-background-mobile.webp");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: scroll;
  }

  .detail-page {
    padding:
      28px
      0
      72px;
  }

  .site-shell {
    width: min(calc(100% - 24px), var(--content-width));
  }

  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0 4px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .page-intro,
  .auth-card,
  .admin-form,
  .admin-table-wrap {
    padding: 22px;
    border-radius: 22px;
  }

  .detail-hero,
  .detail-body {
    padding: 22px;
  }

  .detail-panel {
    border-radius: 16px;
  }

  .home-hero {
    min-height: 64vh;
    padding: 48px 6px 56px;
  }

  .home-copy {
    margin-top: 22px;
    font-size: clamp(1.12rem, 5.8vw, 1.65rem);
  }

  .home-lead {
    margin-top: 22px;
    font-size: 0.95rem;
    line-height: 1.95;
  }

  .home-section {
    padding: 22px;
    border-radius: 22px;
  }

  .home-ai-notice {
    padding: 18px;
    font-size: 0.82rem;
    line-height: 1.85;
  }

  .music-shelf {
    gap: 14px;
    padding-bottom: 14px;
  }

  .music-shelf-item {
    flex-basis: 120px;
  }

  .music-feature-player {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .music-feature-cover {
    width: 112px;
    height: 112px;
  }

  .music-archive-grid,
  .notes-grid--archive,
  .notes-grid--home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .music-archive-meta h2 {
    font-size: 1rem;
  }

  .music-archive-link {
    font-size: 0.8rem;
  }

  .note-tile-label {
    left: 9px;
    right: 9px;
    bottom: 9px;
    padding: 10px;
  }

  .note-tile h3 {
    font-size: 0.88rem;
  }

  .note-tile time {
    font-size: 0.7rem;
  }

  .brand-logo {
    width: min(120px, 34vw);
  }

  .home-logo {
    width: min(70%, 364px);
  }

  .card-body,
  .archive-card--note .card-body {
    padding: 20px;
  }

  .archive-card--note::before {
    left: 14px;
  }

  .site-main {
    padding-bottom: 56px;
  }
}
