body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
}

.reading-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top left, #ffe9d5 0, #f5f5f7 40%, #eef3ff 100%);
}

.app-header {
  padding: 32px 24px 24px;
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(135deg, #ffcc80 0%, #ff8a65 35%, #7e57c2 100%);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.app-title {
  font-size: 32px;
  font-weight: 500;
  margin: 0 0 8px;
  color: #ffffff;
}

.app-subtitle {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #fceade;
}

.app-subtitle-secondary {
  font-size: 14px;
  color: #ffecb3;
}

.app-year-target {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.year-select,
.target-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.year-select label,
.target-input label {
  font-size: 13px;
  color: #fff3e0;
}

.year-select select,
.target-input input {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.year-select select:focus,
.target-input input:focus {
  outline: none;
  border-color: #ffecb3;
  box-shadow: 0 0 0 1px rgba(255, 236, 179, 0.5);
}

.target-input {
  min-width: 260px;
  flex: 1;
}

.target-progress {
  margin-top: 8px;
}

.target-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #ffecb3;
}

.target-progress-tip {
  color: #ffe8c2;
}

.target-progress-bar {
  margin-top: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  overflow: hidden;
}

.target-progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #ffb74d, #ff8a65);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.app-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 0 24px 32px;
}

.section {
  margin-top: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  padding: 20px 20px 24px;
}

.section-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.section-description {
  margin: 0;
  font-size: 13px;
  color: #777;
}

.add-book-grid {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.add-book-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.add-book-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #555;
}

.add-book-form input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d2d2d7;
  font-size: 14px;
}

.add-book-form input:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.2);
}

.primary-button,
.secondary-button {
  border-radius: 999px;
  border: none;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.primary-button {
  background: #ff8a65;
  color: #fff;
  margin-top: auto;
  height: 32px;
}

.primary-button:hover {
  background: #ff7043;
  box-shadow: 0 4px 12px rgba(255, 138, 101, 0.4);
}

.secondary-button {
  background: #f2f2f7;
  color: #111;
  border: 1px solid #d2d2d7;
}

.secondary-button:hover {
  background: #e5e5ea;
}

.primary-button.small,
.secondary-button.small {
  padding: 4px 10px;
  font-size: 12px;
  height: auto;
}

.tiny-hint {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #999;
}

.books-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}

.books-section-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.status-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  border: 1px solid #d2d2d7;
  padding: 4px 10px;
  font-size: 12px;
  background: #f5f5f7;
  cursor: pointer;
  color: #555;
}

.chip-active {
  background: #ffb74d;
  color: #fff;
  border-color: #ffb74d;
}

.empty-hint {
  font-size: 13px;
  color: #777;
  margin-top: 8px;
}

.books-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 12px;
}

.book-item {
  cursor: pointer;
}

.book-cover-wrapper {
  position: relative;
}

.book-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.09);
}

.book-cover.placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: linear-gradient(135deg, #f2f2f7, #e5e5ea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #555;
  text-align: center;
  padding: 4px;
}

.book-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #34c759;
  color: #fff;
}

.book-badge.reading {
  background: #ff9f0a;
}

.book-meta {
  margin-top: 4px;
}

.book-title {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-author {
  font-size: 11px;
  color: #777;
}

.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.detail-panel {
  width: min(960px, 96vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
}

.detail-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #777;
}

.detail-layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr);
  gap: 16px;
  overflow: auto;
}

.detail-book-info {
  display: flex;
  gap: 16px;
}

.detail-cover-block {
  width: 140px;
  flex-shrink: 0;
}

.detail-cover {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.detail-cover.placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: linear-gradient(135deg, #f2f2f7, #e5e5ea);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  color: #555;
}

.detail-meta {
  flex: 1;
}

.detail-title {
  margin: 0 0 4px;
  font-size: 20px;
}

.detail-author {
  margin: 0 0 8px;
  font-size: 13px;
  color: #777;
}

.detail-link a {
  font-size: 13px;
  color: #007aff;
  text-decoration: none;
}

.detail-link a:hover {
  text-decoration: underline;
}

.detail-status-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.detail-status-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #f2f2f7;
  color: #111;
}

.detail-logs {
  margin-top: 12px;
  font-size: 13px;
}

.detail-logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-logs-hint {
  margin: 4px 0 6px;
  color: #777;
}

.detail-logs-months {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.month-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f2f7;
  color: #555;
}

.detail-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-review textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 8px;
  border: 1px solid #d2d2d7;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.detail-review textarea:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.2);
}

.detail-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-ai-hint {
  font-size: 11px;
  color: #999;
  margin: 4px 0 6px;
}

.detail-ai-output {
  margin: 0;
  border-radius: 8px;
  background: #f5f5f7;
  border: 1px solid #e5e5ea;
  padding: 8px 10px;
  font-size: 12px;
  white-space: pre-wrap;
}

/* Landing（展示页） */

.landing-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.landing-cta-text h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.landing-cta-text p {
  margin: 0;
  font-size: 13px;
  color: #777;
}

.landing-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button.large {
  padding: 10px 22px;
  font-size: 15px;
  height: auto;
}

.landing-books-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.landing-book-item {
  cursor: default;
}

.landing-book-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: #f5f5f7;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* 让不同位置的卡片带有不同的渐变色调，增强整体色彩感 */
.landing-book-item:nth-child(6n + 1) .landing-book-cover-fallback,
.landing-book-item:nth-child(6n + 1) .landing-book-cover {
  background: linear-gradient(135deg, #ffe0b2, #ffcc80);
}

.landing-book-item:nth-child(6n + 2) .landing-book-cover-fallback,
.landing-book-item:nth-child(6n + 2) .landing-book-cover {
  background: linear-gradient(135deg, #e1bee7, #ba68c8);
}

.landing-book-item:nth-child(6n + 3) .landing-book-cover-fallback,
.landing-book-item:nth-child(6n + 3) .landing-book-cover {
  background: linear-gradient(135deg, #bbdefb, #64b5f6);
}

.landing-book-item:nth-child(6n + 4) .landing-book-cover-fallback,
.landing-book-item:nth-child(6n + 4) .landing-book-cover {
  background: linear-gradient(135deg, #c8e6c9, #81c784);
}

.landing-book-item:nth-child(6n + 5) .landing-book-cover-fallback,
.landing-book-item:nth-child(6n + 5) .landing-book-cover {
  background: linear-gradient(135deg, #ffe0e0, #ffb3b3);
}

.landing-book-item:nth-child(6n) .landing-book-cover-fallback,
.landing-book-item:nth-child(6n) .landing-book-cover {
  background: linear-gradient(135deg, #fff9c4, #fff59d);
}

.landing-book-cover-fallback {
  background: linear-gradient(135deg, #e8f0ff, #f5f5f7);
}

.landing-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-book-no {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
}

.landing-book-meta {
  margin-top: 4px;
}

.landing-book-title {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-book-author {
  font-size: 10px;
  color: #777;
}

@media (max-width: 960px) {
  .books-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .landing-books-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header {
    padding: 20px 16px 12px;
  }

  .app-main {
    padding: 0 16px 24px;
  }

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

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

  .detail-panel {
    width: 96vw;
    max-height: 96vh;
  }

  .detail-book-info {
    flex-direction: column;
  }

  .detail-cover-block {
    width: 120px;
  }
}


