/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Noto+Serif+SC:wght@300;400;500&display=swap');

:root {
  --bg: #faf9f6;         /* 暖白 */
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --muted: #8a8a86;
  --line: #e6e3dc;
  --accent: #7a6a56;     /* 淡棕点缀 */
  --serif: "EB Garamond", "Noto Serif SC", Georgia, "Songti SC", serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 90px 7vw 60px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--ink); color: var(--bg); }

/* ---------- Header ---------- */
header {
  margin-bottom: 160px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 1s ease both;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.2;
}

h1 .cn {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: .78em;
  margin-left: 10px;
  color: var(--ink-soft);
}

header .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 520px;
}

header p {
  margin: 0;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .28em;
  text-transform: uppercase;
}

/* ---------- Sections ---------- */
section { margin-bottom: 160px; }

h2 {
  margin: 0 0 60px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .35em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 22px;
}

h2::before {
  content: attr(data-index);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: none;
}

h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Book Grid ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 44px;
  row-gap: 110px;
}

.book {
  min-width: 0;
  animation: fadeUp .9s ease both;
}

.book img,
.empty-cover {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #ecebe5;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .6s ease;
  filter: saturate(.95);
}

.book:hover img {
  transform: scale(1.03);
  filter: saturate(1.05);
}

/* Book text */
.book-info { margin-top: 20px; }

.title-cn {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: .01em;
}

.title-cn a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .35s ease;
}

.title-cn a:hover { background-size: 100% 1px; }

.title-en {
  margin-top: 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.author {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- Forthcoming ---------- */
#forthcoming { max-width: 760px; }

.future-book {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 30px;
  align-items: baseline;
}

.future-book:first-child { border-top: 1px solid var(--line); }

.future-book div:first-child {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}

.future-book div:last-child {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Contact ---------- */
.contact { max-width: 620px; }

.contact p {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.8;
  margin: 0;
}

.contact form {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact input,
.contact textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 2px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .3s ease;
}

.contact input::placeholder,
.contact textarea::placeholder {
  color: var(--muted);
  font-weight: 300;
}

.contact input:focus,
.contact textarea:focus { border-bottom-color: var(--ink); }

.contact textarea { min-height: 140px; resize: vertical; padding-top: 20px; }

.contact button {
  align-self: flex-start;
  margin-top: 40px;
  padding: 14px 34px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .3s ease, background .3s ease;
}

.contact button:hover {
  transform: translateY(-2px);
  background: var(--accent);
}

/* ---------- Footer ---------- */
footer {
  margin-top: 140px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.book:nth-child(1)  { animation-delay: .05s; }
.book:nth-child(2)  { animation-delay: .10s; }
.book:nth-child(3)  { animation-delay: .15s; }
.book:nth-child(4)  { animation-delay: .20s; }
.book:nth-child(5)  { animation-delay: .25s; }
.book:nth-child(n+6){ animation-delay: .30s; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body { padding: 60px 32px 40px; }
  header { margin-bottom: 110px; }
  h1 { font-size: 30px; }
  section { margin-bottom: 120px; }
  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 80px;
  }
  footer { margin-top: 90px; }
}

@media (max-width: 600px) {
  h1 { font-size: 26px; }
  h1 .cn { display: block; margin-left: 0; margin-top: 6px; }
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 60px;
  }
  .future-book { grid-template-columns: 1fr; }
  .future-book div:last-child { margin-top: 4px; }
  footer { flex-direction: column; gap: 8px; }
}

@media (max-width: 380px) {
  .book-grid { grid-template-columns: 1fr; }
}
