:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --ink: #202326;
  --muted: #667078;
  --line: rgba(32, 35, 38, 0.13);
  --accent: #176b5d;
  --accent-strong: #0d4f45;
  --shadow: 0 18px 42px rgba(33, 37, 41, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
}

.library {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.library-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.library-header h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.library-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

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

.book-card {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 214px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.cover-link {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eee8dc;
}

.cover-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-info h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.book-info p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.read-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.read-link:hover {
  background: var(--accent-strong);
}

@media (max-width: 760px) {
  .library {
    width: min(100% - 24px, 520px);
    padding-top: 22px;
  }

  .library-header {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .library-header h1 {
    font-size: 25px;
  }

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

  .book-card {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 14px;
    min-height: 180px;
    padding: 14px;
  }

  .book-info h2 {
    font-size: 21px;
  }

  .book-info p {
    margin-bottom: 16px;
  }
}

@media (max-width: 420px) {
  .book-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .read-link {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
  }
}
