:root {
  --paper: #f7f5ef;
  --ink: #1e1e1c;
  --muted: #74716b;
  --line: #d9d3c6;
  --accent: #b01224;
  --panel: #fffdf8;
  --side: #ebe4d6;
}

.theme-orange-1485c {
  --paper: #fff7ef;
  --ink: #191713;
  --muted: #77685c;
  --line: #e6cbb7;
  --accent: #ff6a13;
  --panel: #fffaf4;
  --side: #f3dfc8;
}

.theme-clean {
  --paper: #f7f8f8;
  --ink: #15171a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --panel: #ffffff;
  --side: #f0f2f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  line-height: 1.65;
}

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

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
}

body.side-collapsed .shell {
  grid-template-columns: 44px minmax(0, 1fr);
}

.site-head {
  display: none;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 38px 20px 28px;
  border-right: 1px solid var(--line);
  background: var(--side);
}

.side-toggle {
  position: static;
  width: 30px;
  height: 30px;
  margin-top: 18px;
  border: 1px solid rgba(30, 30, 28, .35);
  border-radius: 999px;
  background: rgba(255, 253, 248, .55);
  color: var(--ink);
  cursor: pointer;
}

.side-toggle::before {
  content: "←";
  display: block;
  font-size: 15px;
  line-height: 1;
}

.brand {
  display: grid;
  gap: 2px;
  margin-bottom: 36px;
}

.brand-main {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.brand-sub,
.eyebrow,
.muted,
small,
time {
  color: var(--muted);
}

.brand-sub,
.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .08em;
}

.nav {
  display: grid;
  gap: 4px;
  margin-top: 34px;
}

.nav a {
  padding: 9px 0;
  border-bottom: 1px solid rgba(30, 30, 28, .13);
  font-weight: 650;
}

.nav a.active,
.nav a:hover {
  color: var(--accent);
}

.account {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

body.side-collapsed .side {
  padding: 16px 7px;
}

body.side-collapsed .side-toggle {
  margin: 0 auto;
}

body.side-collapsed .side-toggle::before {
  content: "→";
}

body.side-collapsed .side-brand,
body.side-collapsed .nav,
body.side-collapsed .account {
  display: none;
}

.account button,
.login-panel button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
}

.content {
  max-width: 980px;
  width: 100%;
  padding: 54px 46px 80px;
}

.wide-page .content {
  max-width: none;
  padding-right: 18px;
}

.page-title {
  margin-bottom: 30px;
  border-bottom: 3px solid var(--ink);
}

h1 {
  margin: 0 0 16px;
  font-size: 42px;
  line-height: 1.15;
}

h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.35;
}

.current-strip,
.news-row,
.notice-list article,
.timeline article,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

.current-strip {
  margin-bottom: 28px;
  padding: 20px;
}

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

.current-list article {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: baseline;
}

.news-list,
.notice-list,
.timeline {
  display: grid;
  gap: 12px;
}

.news-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 20px;
}

.news-row p {
  margin: 0;
  color: var(--muted);
}

.article {
  max-width: 760px;
}

.article h1 {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 14px;
}

.lead {
  font-size: 18px;
  color: #4f4b45;
}

.hero-image {
  width: 100%;
  margin: 22px 0;
  border: 1px solid var(--line);
}

.rich-text {
  overflow-wrap: anywhere;
}

.rich-text a {
  color: var(--accent);
  text-decoration: underline;
}

.wiki-profile {
  max-width: 900px;
}

.source-note {
  color: var(--muted);
  font-size: 14px;
}

.profile-infobox,
.work-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 26px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.profile-infobox th,
.profile-infobox td,
.work-table th,
.work-table td {
  border: 1px solid var(--line);
  padding: 9px 11px;
  vertical-align: top;
}

.profile-infobox th,
.work-table th {
  width: 150px;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  text-align: left;
}

.work-table th {
  width: auto;
}

.wiki-profile h2 {
  margin-top: 30px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}

.wiki-profile h3 {
  margin: 22px 0 8px;
}

.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ff6a13;
  vertical-align: -3px;
}

.timeline article {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 20px;
}

.timeline article.current {
  border-color: var(--accent);
}

.work-grid,
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.work-section {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.work-section:first-of-type {
  margin-top: 0;
}

.work-section h2 {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 500;
}

.work-card,
.archive-card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .15s ease, transform .15s ease;
}

.work-card:hover,
.archive-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}

.work-card img,
.poster-empty {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #ded7c9;
}

.poster-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.work-card span {
  display: grid;
  gap: 2px;
  padding: 12px;
}

.archive-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
}

.mark {
  width: 42px;
  height: 5px;
  background: var(--accent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.gallery figure {
  margin: 0;
}

.gallery figcaption {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.notice-list article,
.login-panel {
  padding: 20px;
}

@media (min-width: 1180px) {
  .wide-page .content {
    padding-left: 18px;
  }
}

.timeline-host {
  margin: -54px 0 -80px 0;
}

.wide-page .timeline-host .schedule-shell {
  display: block;
  min-height: auto;
}

.wide-page .timeline-host .content {
  max-width: none;
  padding: 0;
}

.timeline-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 168px);
  min-height: 760px;
  border: 1px solid var(--line);
  background: #fff;
}

.archive-frame-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  margin: -54px -18px -80px -18px;
  background: #fff;
  border-left: 1px solid var(--line);
}

.archive-frame-shell header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.archive-frame-shell nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.archive-frame-shell h1 {
  margin: 0;
  font-size: 18px;
}

.archive-frame-shell a {
  color: var(--accent);
  font-size: 14px;
}

.archive-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.archive-page .content {
  padding: 54px 18px 80px;
}

.login-panel {
  max-width: 420px;
}

.login-panel form,
.login-panel label {
  display: grid;
  gap: 8px;
}

.login-panel form {
  gap: 16px;
}

.login-panel input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  font: inherit;
}

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

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  body.side-collapsed .shell {
    display: block;
  }

  .site-head {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--side);
  }

  .site-head .brand {
    margin: 0;
  }

  .menu-toggle {
    border: 1px solid var(--ink);
    background: transparent;
    min-width: 58px;
    min-height: 38px;
    padding: 8px 12px;
    font: inherit;
    font-weight: 700;
  }

  .side {
    display: none;
    position: sticky;
    top: 62px;
    z-index: 19;
    height: auto;
    padding: 10px 18px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 28px rgba(30, 30, 28, .12);
  }

  body.nav-open .side {
    display: block;
  }

  .side > .brand {
    display: none;
  }

  .side-toggle {
    display: none;
  }

  .nav {
    margin: 0;
    gap: 0;
  }

  .nav a {
    padding: 12px 0;
    font-size: 16px;
  }

  .account {
    position: static;
    margin-top: 18px;
  }

  .content {
    padding: 24px 14px 54px;
    max-width: none;
  }

  .wide-page .content,
  .archive-page .content {
    padding: 18px 10px 48px;
  }

  .page-title {
    margin-bottom: 20px;
  }

  h1 {
    font-size: 30px;
  }

  .current-list article,
  .news-row,
  .timeline article {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .current-strip,
  .news-row,
  .notice-list article,
  .login-panel {
    padding: 15px;
  }

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

  .archive-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .work-card span {
    padding: 10px;
  }

  .work-card strong,
  .archive-card strong {
    line-height: 1.35;
  }

  .profile-infobox,
  .work-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .profile-infobox th,
  .profile-infobox td,
  .work-table th,
  .work-table td {
    white-space: normal;
    min-width: 112px;
  }

  .timeline-frame {
    height: calc(100vh - 118px);
    min-height: 680px;
  }

  .archive-frame-shell {
    height: calc(100vh - 18px);
    margin: -18px -10px -48px;
    border-left: 0;
  }

  .archive-frame-shell header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .archive-frame-shell nav {
    justify-content: space-between;
  }
}

@media (max-width: 430px) {
  .site-head .brand-main {
    font-size: 18px;
  }

  .site-head .brand-sub {
    display: none;
  }

  h1 {
    font-size: 27px;
  }

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

  .work-card small {
    font-size: 12px;
  }

  .timeline-frame {
    min-height: 720px;
  }
}
