:root {
  color: #1f2937;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button {
  font: inherit;
}

.home-page {
  min-height: 100vh;
  padding: 42px 20px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 247, 251, 0.94)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1600&q=78") center/cover;
}

.title-button {
  min-width: min(420px, calc(100vw - 40px));
  min-height: 72px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #2563eb;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
  font-size: 34px;
  font-weight: 800;
  cursor: default;
}

.plan-grid {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr repeat(4, 1fr);
  gap: 14px;
}

.plan-button {
  min-height: 70px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #172554;
  box-shadow: 0 12px 26px rgba(31, 41, 55, 0.12);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.plan-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(31, 41, 55, 0.18);
}

.date-button {
  color: #fff;
  background: #0f766e;
}

.completed {
  color: #fff;
  background: #16a34a;
}

.photo-input {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.viewer-mask,
.grading-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  z-index: 20;
}

.viewer-mask[hidden],
.grading-mask[hidden],
.toast[hidden] {
  display: none;
}

.viewer-panel {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 42px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.34);
}

.day-viewer-panel {
  width: min(1120px, calc(100vw - 32px));
}

.viewer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  font-size: 22px;
}

.viewer-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #ef4444;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.review-summary,
.day-subject-section {
  padding: 22px;
  border-bottom: 1px solid #e5e7eb;
}

.review-summary h2,
.day-subject-section h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.review-text-card,
.review-box {
  border-radius: 8px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0c4a6e;
}

.review-text-card {
  padding: 14px;
  margin-bottom: 12px;
}

.review-text-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 16px;
  line-height: 1.6;
}

.photo-list,
.day-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 22px;
}

.photo-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-card,
.day-photo-card {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  text-decoration: none;
}

.photo-card img,
.day-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.review-box {
  padding: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.review-box p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.day-review-box {
  margin: 10px;
}

.delete-photo-button,
.add-photo-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.delete-photo-button {
  background: #dc2626;
}

.add-photo-button {
  display: block;
  width: calc(100% - 44px);
  margin: 0 22px 22px;
  background: #2563eb;
}

.empty-text,
.empty-review-text {
  margin: 0;
  color: #64748b;
  font-size: 16px;
}

.grading-panel {
  min-width: 260px;
  padding: 24px 30px;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 30;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 16px;
}

@media (max-width: 760px) {
  .home-page {
    padding: 24px 12px 36px;
  }

  .title-button {
    min-height: 58px;
    font-size: 26px;
  }

  .plan-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .date-button {
    grid-column: 1 / -1;
  }

  .plan-button {
    min-height: 58px;
    font-size: 19px;
  }

  .viewer-header {
    padding: 14px 16px;
    font-size: 19px;
  }

  .photo-list,
  .day-photo-list {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .review-summary,
  .day-subject-section {
    padding: 16px;
  }

  .add-photo-button {
    width: calc(100% - 32px);
    margin: 0 16px 16px;
  }
}
