@font-face {
  font-family: "Love Serif";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../Font/noto-serif-sc-home.woff2") format("woff2");
}

:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #49464d;
  background: #f8fafb;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #f8fafb;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: #fbfcfc;
  background-image:
    linear-gradient(rgba(190, 211, 218, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 211, 218, 0.34) 1px, transparent 1px);
  background-size: 28px 28px;
}

body.modal-open {
  overflow: hidden;
}

html.viewer-open,
html.viewer-open body {
  overflow: hidden;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.legacy-header {
  position: relative;
  z-index: 10;
  min-height: 80px;
  border-bottom: 1px solid rgba(219, 221, 223, 0.84);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 20px rgba(62, 58, 65, 0.05);
}

.legacy-header-inner {
  width: min(1540px, calc(100% - 72px));
  min-height: 80px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 42px;
}

.legacy-brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #403d44;
  font-family: "Love Serif", "Songti SC", serif;
  text-decoration: none;
}

.legacy-brand strong {
  font-size: 30px;
  line-height: 1;
}

.legacy-brand span {
  padding: 7px 11px;
  border-radius: 7px;
  background: #ef7160;
  color: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.legacy-header p {
  margin: 0;
  overflow: hidden;
  color: #69656c;
  font-family: "Love Serif", "Songti SC", serif;
  font-size: 18px;
  line-height: 1.5;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-back {
  display: none;
}

.content-main {
  width: min(1540px, calc(100% - 72px));
  margin: 0 auto;
  padding: 22px 0 54px;
}

.content-main.list-main {
  width: min(1080px, calc(100% - 72px));
}

.content-notice {
  position: fixed;
  z-index: 150;
  top: 94px;
  left: 50%;
  min-width: min(360px, calc(100% - 32px));
  padding: 11px 15px;
  transform: translateX(-50%);
  border: 1px solid #9ecfc2;
  border-radius: 7px;
  background: #f1faf7;
  color: #246e61;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(39, 57, 53, 0.13);
}

.content-notice.error {
  border-color: #efacb8;
  background: #fff3f5;
  color: #a82c4b;
}

.collection-bar {
  min-height: 48px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.collection-bar p {
  margin: 0;
  color: #827e85;
  font-family: "Love Serif", "Songti SC", serif;
  font-size: 15px;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 7px;
  font-weight: 700;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #ed6b5a;
  background: #ef7160;
  color: #fff;
  box-shadow: 0 5px 13px rgba(218, 91, 73, 0.18);
}

.primary-button:hover:not(:disabled) {
  border-color: #d95d4d;
  background: #d95d4d;
}

.secondary-button {
  border: 1px solid #d4d2d5;
  background: #fff;
  color: #57535a;
}

.secondary-button:hover:not(:disabled) {
  background: #f5f4f5;
}

.primary-button svg,
.secondary-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.photo-card {
  min-width: 0;
  padding: 20px 20px 24px;
  border: 1px solid rgba(208, 206, 206, 0.72);
  border-radius: 24px;
  background: #f9f9f9;
  box-shadow: 0 8px 20px rgba(118, 124, 130, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(90, 96, 103, 0.24);
}

.photo-frame {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #ececed;
  box-shadow: 0 8px 25px rgba(91, 87, 91, 0.28);
}

.photo-view-trigger {
  width: 100%;
  padding: 0;
  display: block;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
}

.photo-view-trigger:focus-visible {
  outline: 3px solid rgba(239, 113, 96, 0.72);
  outline-offset: -3px;
}

.photo-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.photo-card:hover .photo-image {
  transform: scale(1.015);
}

.photo-edit-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 7px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.photo-card:hover .photo-edit-actions,
.photo-card:focus-within .photo-edit-actions {
  opacity: 1;
  transform: translateY(0);
}

.photo-info {
  padding: 23px 12px 0;
  text-align: center;
}

.photo-info time {
  display: block;
  color: #a19da2;
  font-family: "Love Serif", Georgia, serif;
  font-size: 17px;
  line-height: 1.35;
}

.photo-info strong {
  margin-top: 9px;
  display: block;
  overflow: hidden;
  color: #625e64;
  font-family: "Love Serif", "Songti SC", serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  padding: 58px 86px 34px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 28px;
  background: rgba(25, 24, 28, 0.94);
}

.photo-viewer-content {
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  max-width: min(1180px, 100%);
  max-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.viewer-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  display: block;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.38);
}

.viewer-caption {
  width: min(720px, 100%);
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #fff;
  text-align: center;
}

.viewer-caption time {
  color: rgba(255, 255, 255, 0.68);
  font-family: "Love Serif", Georgia, serif;
  font-size: 14px;
}

.viewer-caption strong {
  max-width: 100%;
  color: #fff;
  font-family: "Love Serif", "Songti SC", serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.viewer-button {
  width: 52px;
  height: 52px;
  padding: 13px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.viewer-button:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.22);
}

.viewer-button:active {
  transform: scale(0.94);
}

.viewer-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viewer-close {
  position: absolute;
  top: 22px;
  right: 24px;
}

.viewer-previous,
.viewer-next {
  justify-self: center;
}

.viewer-previous {
  grid-column: 1;
}

.viewer-next {
  grid-column: 3;
}

.list-panel {
  overflow: hidden;
  border: 1px solid rgba(208, 206, 206, 0.75);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 26px rgba(118, 124, 130, 0.18);
}

.list-row {
  min-height: 68px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: 44px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px dashed #dedbdd;
  transition: background 150ms ease;
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row:hover {
  background: #fcf8f7;
}

.list-number {
  color: #b2adb1;
  font-family: "Love Serif", Georgia, serif;
  font-size: 14px;
  text-align: center;
}

.list-check {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 2px solid #d0ccd0;
  border-radius: 50%;
  background: #fff;
  color: transparent;
}

.list-check:hover {
  border-color: #ef7160;
}

.list-check.done {
  border-color: #64ad8f;
  background: #64ad8f;
  color: #fff;
}

.list-check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.list-title {
  min-width: 0;
  color: #565259;
  font-family: "Love Serif", "Songti SC", serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.list-row.completed .list-title {
  color: #aaa5aa;
  text-decoration: line-through;
  text-decoration-color: #c2bdc1;
}

.list-edit-actions {
  display: flex;
  gap: 7px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.list-row:hover .list-edit-actions,
.list-row:focus-within .list-edit-actions {
  opacity: 1;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(211, 208, 211, 0.94);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #6b676d;
  box-shadow: 0 3px 10px rgba(51, 48, 52, 0.1);
}

.icon-button:hover {
  border-color: #ef8a7d;
  color: #db6253;
}

.empty-state {
  min-height: 220px;
  padding: 30px;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px dashed #cfcbce;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #99949a;
  font-family: "Love Serif", "Songti SC", serif;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 18px;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(31, 29, 33, 0.5);
}

.dialog {
  width: min(500px, 100%);
  padding: 23px;
  border: 1px solid #dfdcdf;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 22, 28, 0.26);
}

.dialog-header {
  margin-bottom: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header h2 {
  margin: 0;
  color: #454148;
  font-family: "Love Serif", "Songti SC", serif;
  font-size: 21px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  margin-bottom: 7px;
  display: block;
  color: #5b565d;
  font-size: 13px;
  font-weight: 700;
}

.form-group input {
  width: 100%;
  height: 43px;
  padding: 0 11px;
  border: 1px solid #d2cfd2;
  border-radius: 8px;
  background: #fff;
  color: #373339;
  outline: none;
}

.form-group input:focus {
  border-color: #ef8a7d;
  box-shadow: 0 0 0 3px rgba(239, 113, 96, 0.12);
}

.form-group input[type="file"] {
  height: auto;
  min-height: 46px;
  padding: 7px;
  background: #faf9fa;
}

.form-group input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  padding: 4px 11px;
  border: 1px solid #d2d0d2;
  border-radius: 6px;
  background: #fff;
  color: #555158;
  font-weight: 700;
}

.complete-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #57535a;
  font-weight: 700;
  cursor: pointer;
}

.complete-field input {
  width: 18px;
  height: 18px;
  accent-color: #64ad8f;
}

.dialog-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1050px) {
  .legacy-header-inner,
  .content-main {
    width: calc(100% - 44px);
  }

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

@media (max-width: 680px) {
  body {
    background-size: 22px 22px;
  }

  .legacy-header,
  .legacy-header-inner {
    min-height: 58px;
  }

  .legacy-header-inner {
    width: 100%;
    padding: 0 14px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 4px;
  }

  .mobile-back {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #5c585e;
  }

  .mobile-back svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .legacy-brand {
    justify-self: center;
  }

  .legacy-brand strong {
    font-size: 21px;
  }

  .legacy-brand span,
  .legacy-header p {
    display: none;
  }

  .photo-page .legacy-brand strong {
    font-size: 0;
  }

  .photo-page .legacy-brand strong::after {
    content: "恋爱相册";
    font-size: 21px;
  }

  .list-page .legacy-brand strong {
    font-size: 0;
  }

  .list-page .legacy-brand strong::after {
    content: "恋爱清单";
    font-size: 21px;
  }

  .content-main,
  .content-main.list-main {
    width: calc(100% - 24px);
    padding: 13px 0 28px;
  }

  .collection-bar {
    min-height: 42px;
    margin-bottom: 12px;
  }

  .collection-bar p {
    font-size: 13px;
  }

  .primary-button,
  .secondary-button {
    min-height: 39px;
    padding: 7px 12px;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .photo-card {
    padding: 14px 14px 18px;
    border-radius: 18px;
  }

  .photo-frame {
    border-radius: 12px;
  }

  .photo-edit-actions {
    top: 9px;
    right: 9px;
    opacity: 1;
    transform: none;
  }

  .photo-info {
    padding-top: 17px;
  }

  .photo-info time {
    font-size: 15px;
  }

  .photo-info strong {
    margin-top: 7px;
    font-size: 15px;
  }

  .photo-viewer {
    padding: 64px 12px 24px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: end;
    gap: 8px;
  }

  .photo-viewer-content {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: center;
  }

  .viewer-image {
    max-height: calc(100dvh - 188px);
    border-radius: 6px;
  }

  .viewer-caption {
    min-height: 49px;
    margin-top: 13px;
    gap: 3px;
  }

  .viewer-caption time {
    font-size: 13px;
  }

  .viewer-caption strong {
    font-size: 15px;
  }

  .viewer-button {
    width: 42px;
    height: 42px;
    padding: 9px;
  }

  .viewer-previous {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    justify-self: start;
  }

  .viewer-next {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }

  .viewer-close {
    top: 12px;
    right: 12px;
  }

  .list-panel {
    border-radius: 18px;
  }

  .list-row {
    min-height: 68px;
    padding: 10px 11px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .list-number {
    display: none;
  }

  .list-title {
    font-size: 15px;
  }

  .list-edit-actions {
    opacity: 1;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    padding: 7px;
  }

  .content-notice {
    top: 70px;
  }

  .dialog-backdrop {
    padding: 10px;
    align-items: end;
  }

  .dialog {
    max-height: calc(100dvh - 20px);
    padding: 19px 15px;
    overflow-y: auto;
    border-radius: 15px;
  }
}

@media (max-width: 380px) {
  .collection-bar .primary-button span {
    display: none;
  }

  .collection-bar .primary-button {
    width: 40px;
    padding: 0;
  }

  .list-row {
    grid-template-columns: 27px minmax(0, 1fr);
  }

  .list-edit-actions {
    grid-column: 2;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
