:root {
  --cream: #f7efe3;
  --cream-deep: #eadcc9;
  --paper: #fffaf2;
  --ink: #342027;
  --muted: #7c6761;
  --wine: #5c1436;
  --wine-deep: #3d0d26;
  --wine-soft: #7b244d;
  --gold: #c49a62;
  --line: rgba(92, 20, 54, 0.14);
  --shadow: 0 18px 45px rgba(61, 13, 38, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 8%, rgba(196, 154, 98, 0.18), transparent 34%),
    linear-gradient(135deg, #fbf4e8 0%, var(--cream) 48%, #f2e5d3 100%);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.album-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  color: #fff8ee;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(160deg, var(--wine-deep), var(--wine) 58%, #6b173e);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 14px 0 30px rgba(61, 13, 38, 0.18);
  z-index: 3;
}

.brand-panel {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-logo {
  width: 78px;
  height: 78px;
  border-radius: 8px;
  object-fit: contain;
  padding: 5px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.brand-name {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-subtitle {
  margin: 0;
  color: rgba(255, 248, 238, 0.72);
  font-size: 14px;
  line-height: 1.45;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 3px;
}

.search-panel {
  display: grid;
  gap: 8px;
}

.search-panel label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-row input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 11px 12px;
  color: var(--wine-deep);
  font: inherit;
}

.search-row button {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: transparent;
  padding: 0 11px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.search-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.category-button {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: rgba(255, 248, 238, 0.82);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.category-button:hover,
.category-button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.category-button.is-active {
  color: #35101f;
  background: #fff3df;
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.content {
  height: 100vh;
  overflow-y: auto;
  padding: 36px clamp(26px, 4vw, 54px) 64px;
  scroll-padding-top: 28px;
}

.hero {
  margin: 0 0 30px;
  padding: 4px 0 24px;
  border-bottom: 1px solid var(--line);
}

.hero-kicker {
  margin: 0 0 8px;
  color: var(--wine-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  color: var(--wine-deep);
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero p:last-child {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.5;
}

.offline-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.92);
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(61, 13, 38, 0.06);
}

.offline-panel[hidden] {
  display: none;
}

.offline-copy {
  display: grid;
  gap: 4px;
}

.offline-copy strong {
  color: var(--wine-deep);
}

.offline-copy span {
  color: var(--muted);
  font-size: 14px;
}

.offline-panel button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: var(--wine);
  padding: 12px 16px;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.offline-panel button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.album-section[hidden],
.cake-card[hidden] {
  display: none;
}

.album-section {
  scroll-margin-top: 26px;
  margin-bottom: 46px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  color: var(--wine);
  font-size: 27px;
  line-height: 1.25;
}

.section-count {
  flex: none;
  color: var(--muted);
  font-size: 15px;
}

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

.cake-card {
  overflow: hidden;
  min-width: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  background: var(--paper);
  border: 1px solid rgba(92, 20, 54, 0.11);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(61, 13, 38, 0.08);
  cursor: pointer;
}

.cake-card:hover,
.cake-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(92, 20, 54, 0.25);
  box-shadow: var(--shadow);
  outline: none;
}

.image-frame {
  display: grid;
  place-items: center;
  height: 340px;
  padding: 10px;
  background: linear-gradient(180deg, #fff9ef, #f0e3cf);
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.image-fallback {
  display: none;
  width: 100%;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  background:
    linear-gradient(135deg, rgba(92, 20, 54, 0.08), transparent),
    #fff6e7;
  border: 1px dashed rgba(92, 20, 54, 0.2);
  border-radius: 6px;
}

.image-frame.is-missing img {
  display: none;
}

.image-frame.is-missing .image-fallback {
  display: flex;
}

.cake-copy {
  min-height: 148px;
  padding: 16px 18px 18px;
  background: #fff1dc;
  border-top: 1px solid rgba(92, 20, 54, 0.12);
}

.cake-number {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 9px;
  padding: 4px 9px;
  color: #fff8ee;
  background: var(--wine);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.cake-copy h3 {
  margin: 0 0 8px;
  color: var(--wine-deep);
  font-size: 21px;
  line-height: 1.35;
}

.cake-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.cake-price {
  display: inline-flex;
  margin-top: 12px;
  color: var(--wine);
  font-size: 18px;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 10;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 12, 24, 0.62);
}

.modal-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 58%) minmax(280px, 1fr);
  gap: 28px;
  width: min(1040px, 94vw);
  max-height: 88vh;
  padding: 24px;
  overflow: auto;
  background: #fffaf2;
  border-radius: 8px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 86px;
  min-height: 44px;
  color: #fff8ee;
  background: var(--wine);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  z-index: 2;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--wine-deep);
  outline: none;
}

.modal-image-wrap {
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 12px;
  background: linear-gradient(180deg, #fff5e6, #eadcc9);
  border-radius: 8px;
}

.modal-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 6px;
}

.modal-image-fallback {
  display: none;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.modal-image-wrap.is-missing img {
  display: none;
}

.modal-image-wrap.is-missing .modal-image-fallback {
  display: block;
}

.modal-copy {
  align-self: center;
  padding: 36px 12px 12px 0;
}

.modal-copy h2 {
  margin: 0 0 18px;
  color: var(--wine-deep);
  font-size: 42px;
  line-height: 1.16;
}

.modal-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.65;
}

@media (max-width: 980px) {
  .album-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 13px;
  }

  .brand-panel {
    grid-template-columns: 62px 1fr;
  }

  .brand-logo {
    width: 62px;
    height: 62px;
  }

  .brand-name {
    font-size: 18px;
  }

  .category-button {
    min-height: 48px;
    padding: 11px 12px;
  }

  .content {
    padding: 28px 24px 52px;
  }

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

  .image-frame {
    height: 310px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero p:last-child {
    font-size: 20px;
  }

  .modal-copy h2 {
    font-size: 34px;
  }
}

@media (max-width: 760px) {
  .album-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    max-height: 46vh;
    overflow: auto;
  }

  .content {
    height: auto;
    overflow: visible;
  }

  .offline-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .offline-panel button {
    width: 100%;
  }

  .cake-grid {
    grid-template-columns: 1fr;
  }

  .image-frame {
    height: 330px;
  }

  .modal-card {
    grid-template-columns: 1fr;
    width: min(620px, 94vw);
  }

  .modal-image-wrap {
    min-height: 300px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p:last-child {
    font-size: 18px;
  }

  .modal-copy h2 {
    font-size: 30px;
  }
}
