:root {
  --cream: #f7efe4;
  --cream-soft: #fff9f0;
  --cream-deep: #eadbc8;
  --surface: #fffdf8;
  --plum: #481238;
  --plum-2: #351027;
  --wine: #7a203b;
  --gold: #d39a4a;
  --green: #2f7a20;
  --text: #2d2025;
  --muted: #75636a;
  --line: rgba(72, 18, 56, 0.14);
  --shadow: 0 18px 40px rgba(47, 21, 28, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 820px;
  background: var(--cream);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 24px;
  background: linear-gradient(180deg, var(--plum-2), var(--plum));
  color: #fff8ed;
  overflow-y: auto;
}

.logo-card {
  display: grid;
  place-items: center;
  min-height: 142px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 248, 237, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 14px 30px rgba(24, 4, 17, 0.2);
}

.logo-card img {
  display: block;
  width: 100%;
  max-width: 210px;
  height: auto;
}

.category-list {
  display: grid;
  gap: 9px;
}

.category-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 70px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 248, 237, 0.82);
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.category-button.is-active {
  background: linear-gradient(135deg, var(--wine), #5a153e);
  border-color: rgba(255, 248, 237, 0.25);
  color: #fff8ed;
  box-shadow: 0 12px 24px rgba(18, 2, 14, 0.23);
}

.category-button:active {
  transform: scale(0.99);
}

.menu-thumb {
  width: 38px;
  height: 44px;
  border-radius: 6px;
  background: var(--cream-soft);
  object-fit: cover;
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.2);
}

.menu-label {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.28;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.menu-count {
  color: rgba(255, 248, 237, 0.65);
  font-size: 13px;
  font-weight: 700;
}

.gallery {
  height: 100vh;
  overflow-y: auto;
  padding: 34px 36px 44px;
}

.hero,
.category-title,
.cake-grid,
.pwa-panel {
  max-width: 1180px;
  margin-right: auto;
  margin-left: auto;
}

.pwa-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(122, 32, 59, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.84);
  box-shadow: 0 8px 18px rgba(47, 21, 28, 0.06);
}

.pwa-status {
  min-width: 0;
  color: var(--wine);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.pwa-status.is-offline {
  color: var(--green);
}

.update-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--radius);
  background: var(--plum);
  color: #fff8ed;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.update-button:hover,
.update-button:focus-visible {
  outline: none;
  background: var(--wine);
}

.update-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0;
  color: var(--plum-2);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.12;
}

.hero p {
  margin: 10px 0 0;
  color: #735d64;
  font-size: 19px;
  line-height: 1.5;
}

.total-badge {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.76);
  color: var(--wine);
  font-size: 15px;
  font-weight: 800;
}

.category-title {
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid rgba(122, 32, 59, 0.15);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.92), rgba(242, 226, 207, 0.8));
}

.category-title p {
  margin: 0 0 8px;
  color: var(--wine);
  font-size: 13px;
  font-weight: 800;
}

.category-title h2 {
  margin: 0;
  color: var(--plum-2);
  font-size: 27px;
  line-height: 1.2;
}

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

@media (min-width: 1240px) {
  .cake-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cake-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(72, 18, 56, 0.12);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(47, 21, 28, 0.08);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.cake-card:hover,
.cake-card:focus-visible {
  outline: none;
  border-color: rgba(122, 32, 59, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.image-frame {
  display: grid;
  place-items: center;
  height: 350px;
  padding: 10px;
  background: #f2e5d3;
}

.image-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 4px 16px rgba(45, 20, 26, 0.1);
}

.cake-copy {
  display: grid;
  gap: 8px;
  padding: 16px 16px 18px;
}

.cake-copy h3 {
  margin: 0;
  color: var(--plum-2);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.28;
}

.cake-copy p {
  margin: 0;
  color: #69565d;
  font-size: 15px;
  line-height: 1.55;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 34px;
  place-items: center;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(31, 11, 22, 0.58);
  cursor: pointer;
}

.detail-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(340px, 0.8fr);
  width: min(1040px, calc(100vw - 68px));
  max-height: calc(100vh - 68px);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 30px 86px rgba(22, 7, 16, 0.32);
}

.detail-image-wrap {
  display: grid;
  place-items: center;
  min-height: 620px;
  padding: 18px;
  background: #f2e5d3;
}

.detail-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 8px 26px rgba(45, 20, 26, 0.14);
}

.detail-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 34px;
}

.detail-text > p {
  margin: 0 0 10px;
  color: var(--wine);
  font-size: 13px;
  font-weight: 800;
}

.detail-text h2 {
  margin: 0 0 20px;
  color: var(--plum-2);
  font-size: 31px;
  line-height: 1.22;
}

.recommend-block {
  padding: 18px 18px 20px;
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #faf0e3;
  color: #5f4d53;
  font-size: 20px;
  line-height: 1.7;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  min-width: 76px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: var(--plum);
  color: #fff8ed;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

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

@media (max-width: 1050px) {
  body {
    min-width: 760px;
  }

  .album-app {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 12px;
  }

  .gallery {
    padding: 28px 24px 38px;
  }

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

  .pwa-panel {
    align-items: stretch;
  }

  .menu-label {
    font-size: 14px;
  }

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

  .image-frame {
    height: 318px;
  }

  .detail-dialog {
    grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.8fr);
  }
}
