:root {
  --paper: #fffefa;
  --card: #fff;
  --ink: #1d2225;
  --muted: #596269;
  --accent: #c74632;
  --accent-hover: #a93426;
  --selected: #abd4ee;
  --selected-hover: #93c7e6;
  --controls: #f4f7f8;
  --fine: #b9c4c9;
  --soft-blue: #e1edf3;
  --body-font: 'Libre Franklin', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --title-font: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --year-font: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body-font);
  font-size: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: .48; }
button, input, select { border-radius: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.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; }
.skip-link { position: fixed; left: 20px; top: -100px; padding: 12px; background: var(--ink); color: #fff; z-index: 99; }
.skip-link:focus { top: 20px; }

.shell { max-width: 1580px; margin: auto; padding: 0 30px; }
.masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 22px;
  min-height: 225px;
  padding: 34px 42px 28px;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.masthead::before {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: 42%;
  background: radial-gradient(circle, #446983 1px, transparent 1.4px) 0 0 / 8px 8px;
  opacity: .28;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  pointer-events: none;
  z-index: -1;
}
.masthead::after {
  content: '';
  position: absolute;
  top: -62px;
  right: 16%;
  width: 74px;
  height: 340px;
  transform: rotate(27deg);
  background: #da6d5b;
  opacity: .12;
  pointer-events: none;
  z-index: -1;
}
h1 {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 20px;
  color: var(--ink);
  font-family: var(--title-font);
  font-size: clamp(58px, 6.9vw, 105px);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -.075em;
  text-align: center;
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 5px 5px 0 #e69b8e, 7px 7px 0 var(--ink);
  transform: skew(-4deg);
}
.editing-guide { display: flex; align-items: center; justify-content: center; min-height: 25px; color: var(--ink); font-size: 14px; font-weight: 600; text-align: center; }
.editing-guide p { margin: 0; }
.return-button { position: absolute; top: 30px; right: 32px; padding: 10px 15px; border: 2px solid var(--ink); background: var(--card); font-weight: 600; }
.return-button:hover { background: var(--soft-blue); }

.catalog-nav { display: flex; border: 2px solid var(--ink); border-top: 0; background: var(--card); }
.catalog-nav button { min-width: 170px; min-height: 51px; padding: 10px 25px; border-right: 2px solid var(--ink); font-size: 16px; font-weight: 600; }
.catalog-nav button:hover { background: var(--soft-blue); }
.catalog-nav button.is-active { color: #fff; background: var(--accent); }
.catalog-nav button.is-active:hover { background: var(--accent-hover); }

.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 16px; padding: 22px 0 18px; }
.search-field { display: flex; align-items: center; gap: 13px; width: min(100%, 460px); min-width: 0; height: 50px; padding: 0 15px; border: 2px solid var(--ink); background: var(--card); }
.search-field:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.search-field svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.view-switch { display: flex; height: 50px; border: 2px solid var(--ink); background: var(--card); }
.view-switch button { min-width: 90px; padding: 0 17px; font-size: 15px; font-weight: 600; }
.view-switch button + button { border-left: 2px solid var(--ink); }
.view-switch button.is-active { background: var(--selected); }
.view-switch button:hover:not(.is-active) { background: var(--controls); }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 50px; padding: 0 20px; border: 2px solid var(--ink); background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; box-shadow: 3px 3px 0 var(--ink); transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.primary:hover:not(:disabled) { background: var(--accent-hover); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.primary span { font-size: 24px; line-height: 1; }
.export-button { min-width: 220px; justify-self: end; }
.mobile-decade, .mobile-export-bar { display: none; }

.navigation-row { display: flex; justify-content: space-between; align-items: center; gap: 22px; min-height: 54px; margin-bottom: 13px; border-top: 2px solid var(--ink); }
.decade-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.decade-nav button { padding: 8px 11px; color: var(--muted); font-family: var(--year-font); font-size: 16px; font-weight: 700; white-space: nowrap; }
.decade-nav button:first-child { font-family: var(--body-font); font-size: 13px; }
.decade-nav button.is-active { color: var(--ink); background: var(--selected); }
.decade-nav button:hover:not(.is-active) { color: var(--ink); background: var(--controls); }
.draft-actions { display: flex; gap: 12px; flex: none; }
.draft-actions button { padding: 8px 5px; color: var(--ink); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.album-list { min-height: 100px; }
.year-group { display: grid; grid-template-columns: 174px minmax(0, 1fr); min-height: 232px; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); background: var(--card); }
.year-group:last-child { border-bottom: 2px solid var(--ink); }
.year-label { align-self: stretch; margin: 0; padding: 23px 12px 16px 16px; border-right: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-family: var(--year-font); font-size: 62px; font-weight: 900; line-height: 1; letter-spacing: -.085em; font-variant-numeric: lining-nums tabular-nums; text-shadow: 2px 2px 0 #cbdde7; }
.year-label::after { content: ''; display: block; width: 70px; height: 5px; margin-top: 16px; background: var(--accent); transform: skew(-17deg); }
.album-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-content: start; }
.album { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 230px; padding: 17px 13px 15px; border-right: 1px solid var(--fine); border-bottom: 1px solid var(--fine); background: var(--card); text-align: left; transition: background-color .15s ease; }
.album:hover { background: var(--controls); }
.album[aria-pressed=true] { background: var(--selected); }
.album[aria-pressed=true]:hover { background: var(--selected-hover); }
.album:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 1; }
.cover-wrap { display: grid; place-items: center; width: min(100%, 116px); aspect-ratio: 1; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--ink); background: var(--controls); flex: none; }
.cover-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { color: var(--muted); font-family: var(--year-font); font-size: 26px; font-weight: 700; }
.album-title { max-width: 100%; font-family: Georgia, 'Noto Serif SC', serif; font-size: 15px; font-weight: 700; line-height: 1.22; overflow-wrap: anywhere; }
.album-artist { display: block; max-width: 100%; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.text-layout .album-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.text-layout .album { min-height: 114px; padding: 15px 11px; }
.text-layout .cover-wrap { display: none; }
.text-layout .album-title { font-size: 14px; }
.loading-message, .empty-message { margin: 60px 0; text-align: center; color: var(--muted); }
.empty-message button { color: var(--accent); text-decoration: underline; }

footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px 28px; margin-top: 30px; padding: 19px 0 34px; border-top: 2px solid var(--ink); color: var(--muted); font-size: 12px; }
.toast { position: fixed; bottom: 28px; left: 50%; z-index: 100; max-width: min(90vw, 520px); padding: 12px 18px; transform: translateX(-50%); border: 2px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); font-size: 14px; }

.export-view { display: grid; grid-template-columns: 294px minmax(0, 1fr); gap: 36px; padding: 32px 0 50px; border-top: 2px solid var(--ink); }
.export-controls { padding-right: 28px; border-right: 2px solid var(--ink); }
.export-controls fieldset { min-width: 0; margin: 0 0 32px; padding: 0; border: 0; }
.export-controls legend { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.export-controls .view-switch button { flex: 1; min-width: 0; }
.export-formats { display: grid; gap: 8px; }
.export-formats button { min-height: 46px; padding: 0 14px; border: 2px solid var(--ink); background: var(--card); text-align: left; font-size: 15px; }
.export-formats button.is-active { background: var(--selected); font-weight: 700; }
.export-formats button:hover:not(.is-active) { background: var(--controls); }
.export-controls .primary { width: 100%; margin-top: 32px; font-size: 15px; }
.export-controls p { margin: 25px 0 0; }
.export-status { color: var(--muted); font-size: 13px; line-height: 1.6; }
.export-decade-field { display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
select { min-height: 45px; padding: 8px 12px; border: 2px solid var(--ink); background: var(--card); color: var(--ink); }
.export-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 25px; min-width: 0; }
.export-previews:has(.preview-sheet:only-child) { grid-template-columns: 1fr; }
.preview-sheet { min-width: 0; }
.preview-scroll { height: 616px; overflow: auto; border: 2px solid var(--ink); background: #fff; scrollbar-color: var(--muted) var(--controls); scrollbar-width: thin; }
.preview-scroll img { display: block; width: 100%; height: auto; }
.preview-actions { display: flex; flex-direction: column; gap: 8px; }
.preview-actions button { min-height: 42px; padding: 0 14px; border: 1px solid var(--ink); background: var(--card); text-align: left; font-size: 14px; }
.preview-actions button:hover { background: var(--soft-blue); }
.preview-actions .full-image { display: flex; justify-content: space-between; align-items: center; border: 0; border-bottom: 2px solid var(--ink); }
.preview-actions .full-image span { color: var(--accent); font-size: 22px; }
.preview-caption { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0 2px; font-family: var(--year-font); font-size: 18px; font-weight: 700; }
.preview-caption small { color: var(--muted); font-family: var(--body-font); font-size: 12px; font-weight: 400; }
.image-dialog { max-width: 96vw; max-height: 94vh; padding: 0; border: 2px solid var(--ink); background: #fff; box-shadow: 8px 8px 0 var(--ink); }
.image-dialog::backdrop { background: #1d2225aa; }
.image-dialog img { display: block; width: min(1500px, 90vw); height: auto; margin-top: 46px; }
.close-image { position: sticky; top: 0; z-index: 1; width: 100%; height: 46px; margin-bottom: -46px; padding: 0 20px; background: var(--paper); text-align: right; }
.about-content { max-width: 780px; margin: 36px auto; font-size: 15px; line-height: 1.9; }
.about-content h2 { margin-top: 32px; color: var(--ink); font-family: var(--year-font); font-size: 28px; }
.about-content a { color: var(--accent); text-decoration: underline; }
.chinese-catalog { --body-font: 'Libre Franklin', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; font-family: var(--body-font); }

@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.masthead h1 { animation: arrive .4s ease both; }
.year-group:nth-child(-n+3) { animation: arrive .35s ease both; }
.year-group:nth-child(2) { animation-delay: .07s; }
.year-group:nth-child(3) { animation-delay: .14s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 1200px) {
  .shell { padding: 0 24px; }
  .year-group { grid-template-columns: 150px minmax(0, 1fr); }
  .year-label { font-size: 53px; }
  .album-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .text-layout .album-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .album { min-height: 213px; }
  .cover-wrap { width: min(100%, 108px); }
}

@media (max-width: 900px) {
  .masthead { min-height: 195px; padding: 30px 30px 25px; }
  h1 { font-size: 72px; }
  .toolbar { grid-template-columns: minmax(200px, 1fr) auto; }
  .export-button { grid-column: 2; }
  .view-switch { grid-column: 2; grid-row: 1; }
  .search-field { grid-row: 1; }
  .year-group { grid-template-columns: 118px minmax(0, 1fr); }
  .year-label { padding-left: 10px; font-size: 42px; }
  .year-label::after { width: 55px; }
  .album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .text-layout .album-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .export-view { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
  .export-controls { padding-right: 18px; }
  .export-previews { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .shell { padding: 0 14px; }
  .masthead { min-height: 0; margin-top: 14px; padding: 25px 20px 23px; }
  .masthead::before { width: 53%; opacity: .2; }
  .masthead::after { right: 5%; width: 45px; }
  h1 { margin-bottom: 18px; font-size: clamp(43px, 12vw, 64px); line-height: 1.24; text-shadow: 3px 3px 0 #e69b8e, 5px 5px 0 var(--ink); }
  .editing-guide { font-size: 13px; }
  .return-button { top: 10px; right: 10px; padding: 7px 10px; font-size: 12px; }
  .catalog-nav button { flex: 1; min-width: 0; min-height: 45px; padding: 7px 12px; font-size: 15px; }
  .catalog-nav button:last-child { border-right: 0; }
  .toolbar { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0 13px; }
  .search-field { grid-column: 1 / -1; grid-row: 1; width: 100%; height: 44px; }
  .search-field input { font-size: 16px; }
  .view-switch { grid-column: 1; grid-row: 2; width: fit-content; height: 44px; }
  .view-switch button { min-width: 76px; padding: 0 10px; font-size: 14px; }
  .mobile-decade { display: block; grid-column: 2; grid-row: 2; }
  .mobile-decade select { max-width: 135px; height: 44px; padding: 0 8px; font-size: 14px; }
  .export-button, .decade-nav { display: none; }
  .navigation-row { justify-content: flex-end; min-height: 44px; margin-bottom: 7px; }
  .draft-actions { gap: 16px; }
  .draft-actions button { font-size: 12px; }
  .year-group { display: block; min-height: 0; }
  .year-label { padding: 10px 14px 12px; border-right: 0; border-bottom: 2px solid var(--ink); font-size: 47px; }
  .year-label::after { display: inline-block; width: 42px; height: 4px; margin: 0 0 10px 17px; }
  .album-grid, .text-layout .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album { min-height: 210px; padding: 13px 11px 14px; }
  .cover-wrap { width: min(100%, 124px); margin-bottom: 10px; }
  .album-title { font-size: 14px; }
  .album-artist { font-size: 12px; }
  .text-layout .album { min-height: 116px; }
  .mobile-export-bar { display: block; position: sticky; bottom: 0; z-index: 5; padding: 12px 0 15px; border-top: 2px solid var(--ink); background: var(--paper); }
  .mobile-export-bar .primary { width: 100%; min-height: 50px; }
  footer { margin-top: 22px; padding: 18px 0 25px; font-size: 11px; }
  .toast { bottom: 83px; font-size: 13px; }
  .export-view { display: block; padding: 22px 0 40px; }
  .export-controls { padding: 0; border: 0; }
  .export-controls fieldset { margin-bottom: 22px; }
  .export-formats { display: flex; }
  .export-formats button { flex: 1; min-width: 0; padding: 0 6px; text-align: center; font-size: 13px; }
  .export-controls .primary { margin-top: 20px; }
  .export-controls p { margin: 16px 0; }
  .export-previews { margin-top: 28px; gap: 30px; }
  .preview-scroll { height: 500px; }
  .image-dialog img { width: 90vw; }
  .about-content { margin: 25px auto; font-size: 14px; }
}
