:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #17191c;
  background: #f5f6f7;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f5f6f7; }
button, input { font: inherit; }
[hidden] { display: none !important; }

.subscribe-header {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid #e4e6e8;
}
.subscribe-header img { border-radius: 8px; }
.subscribe-header div { display: grid; gap: 1px; }
.subscribe-header strong { font-size: 17px; }
.subscribe-header span { color: #757b82; font-size: 12px; }

main { width: min(880px, 100%); margin: 0 auto; padding: 34px 18px 128px; }
.subscribe-title p { margin: 0 0 6px; color: #b4232c; font-size: 13px; font-weight: 700; }
.subscribe-title h1 { margin: 0; font-size: 30px; line-height: 1.25; letter-spacing: 0; }
.book-group { margin-top: 34px; }
.book-group > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.book-group h2 { margin: 0; font-size: 19px; letter-spacing: 0; }
.book-group header span { color: #777d83; font-size: 13px; }
.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.book-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e5e7;
  border-radius: 8px;
}
.book-card img { width: 92px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 5px; background: #e9ebed; }
.book-card div { min-width: 0; align-self: center; }
.book-card h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.35; letter-spacing: 0; overflow-wrap: anywhere; }
.book-card p { margin: 0; color: #6a7077; font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.payment-state { margin-top: 24px; padding: 13px 14px; border-left: 4px solid #cf8b18; background: #fff; font-size: 14px; }
.payment-state[data-kind="success"] { border-color: #22875b; color: #176b48; }
.payment-state[data-kind="error"] { border-color: #c9353e; color: #9a2029; }
.account-completion { margin-top: 24px; padding: 20px; background: #fff; border: 1px solid #dfe2e5; border-radius: 8px; }
.completion-heading p { margin: 0 0 4px; color: #22875b; font-size: 13px; font-weight: 700; }
.completion-heading h2 { margin: 0 0 18px; font-size: 20px; }
.account-completion form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.account-completion label { display: grid; gap: 6px; color: #4f555b; font-size: 13px; }
.account-completion input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid #cbd0d4; border-radius: 6px; }
.account-completion button { height: 42px; align-self: end; border: 0; border-radius: 6px; color: #fff; background: #1d6046; font-weight: 700; cursor: pointer; }

.subscribe-bar {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 84px;
  padding: 12px max(18px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: #fff;
  border-top: 1px solid #dfe2e5;
  box-shadow: 0 -8px 24px rgba(20, 24, 28, .08);
}
.subscribe-bar div { min-width: 160px; display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 8px; }
.subscribe-bar span { font-size: 14px; font-weight: 700; }
.subscribe-bar strong { color: #b4232c; font-size: 25px; }
.subscribe-bar small { grid-column: 1 / -1; color: #747a80; font-size: 12px; }
.subscribe-bar button { width: min(320px, 45vw); height: 50px; border: 0; border-radius: 7px; color: #fff; background: #b4232c; font-size: 17px; font-weight: 700; cursor: pointer; }
.subscribe-bar button:disabled { background: #92979c; cursor: default; }

@media (max-width: 640px) {
  main { padding-top: 26px; }
  .subscribe-title h1 { font-size: 26px; }
  .book-grid { grid-template-columns: 1fr; }
  .book-card { grid-template-columns: 82px minmax(0, 1fr); }
  .book-card img { width: 82px; }
  .account-completion form { grid-template-columns: 1fr; }
  .subscribe-bar { justify-content: space-between; gap: 12px; }
  .subscribe-bar div { min-width: 120px; }
  .subscribe-bar button { width: min(210px, 50vw); }
}
