:root {
  --brand: #e5352b;
  --brand-2: #ff6b4a;
  --text: #222222;
  --muted: #555555;
  --line: #eeeeee;
  --bg: #f7f7f7;
  --card: #ffffff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}
a { color: var(--brand); }

/* top navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  flex-wrap: wrap;
}
.logo { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.logo span { color: var(--brand); }
.nav-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); }

/* hero */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #ffffff;
  padding: 56px 16px 64px;
  text-align: center;
}
.hero h1 { margin: 0 0 10px; font-size: 32px; letter-spacing: 1px; }
.hero p { margin: 0 auto; max-width: 620px; font-size: 16px; color: #ffffff; opacity: 0.95; }
.hero .cta { margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .cta a {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #ffffff;
  color: var(--brand);
}
.hero .cta a.ghost { background: transparent; color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.8); }

/* layout */
.wrap { max-width: 1040px; margin: -28px auto 40px; padding: 0 16px; }
.wrap.plain { margin-top: 24px; }
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
h2 {
  margin: 0 0 14px;
  font-size: 19px;
  border-left: 3px solid var(--brand);
  padding-left: 10px;
}
h3 { margin: 0 0 6px; font-size: 16px; }
p { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
ul, ol { margin: 0 0 10px; padding-left: 22px; color: var(--muted); font-size: 15px; }
li { margin-bottom: 6px; }
.lead { font-size: 15px; color: var(--muted); }

/* feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { background: #fff7f5; border-radius: 10px; padding: 16px; }
.feature h3 { color: var(--brand); }
.feature p { margin: 0; font-size: 14px; }

/* books */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head p { margin: 0 0 14px; font-size: 13px; }
.books { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.book {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}
a.book { color: inherit; text-decoration: none; transition: box-shadow 0.15s, transform 0.15s; }
a.book:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); transform: translateY(-2px); }
.book img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #f2f2f2; }
.book-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.book h3 { font-size: 14px; line-height: 1.5; margin: 4px 0 2px; }
.book .meta { font-size: 12px; color: #888888; margin: 0; }
.book .price { margin: auto 0 0; padding-top: 6px; font-size: 16px; font-weight: 700; color: var(--brand); }
.tag {
  align-self: flex-start;
  font-size: 11px;
  line-height: 1.6;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff1ee;
  color: var(--brand);
}

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: step; }
.step { border: 1px dashed #f3c2bc; border-radius: 10px; padding: 14px; position: relative; }
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.step p { margin: 0; font-size: 14px; }

/* definition lists */
dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dt { color: #888888; }
dd { margin: 0; color: var(--text); }

a.btn {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.note { font-size: 13px; color: #888888; }

/* book detail page */
.crumbs { font-size: 13px; color: #888888; margin: 0 0 12px; }
.crumbs a { color: #888888; text-decoration: none; }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.hero-img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 10px; background: #f6f6f6; display: block; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #f6f6f6; cursor: pointer; }
.thumb.on { border-color: var(--brand); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info h1 { margin: 0 0 10px; font-size: 22px; line-height: 1.5; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tags .tag { font-size: 12px; background: #f2f2f2; color: #666666; }
.tags .tag.ok { background: #eaf7ef; color: #1f8a4c; }
.big-price { font-size: 28px; font-weight: 700; color: var(--brand); margin: 0 0 12px; }
.original { font-size: 13px; font-weight: 400; color: #999999; text-decoration: line-through; margin-left: 8px; }
.intro { font-size: 15px; color: var(--text); }
.buy { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: #fff7f5; }
.buy p { margin: 0 0 6px; font-size: 14px; }
.buy p:last-child { margin: 0; }
.detail-imgs img { width: 100%; max-width: 750px; height: auto; display: block; margin: 0 auto; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; margin: 8px 0 0; }
.pager a { color: var(--muted); text-decoration: none; }
.pager a:hover { color: var(--brand); }

footer { text-align: center; font-size: 13px; color: #888888; padding: 12px 16px 32px; }
footer p { margin: 0 0 4px; font-size: 13px; color: #888888; }
footer a { color: #666666; text-decoration: none; }

@media (max-width: 860px) {
  .books { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .product { grid-template-columns: 1fr; gap: 16px; }
  .info h1 { font-size: 19px; }
  .hero h1 { font-size: 26px; }
  .features { grid-template-columns: 1fr; }
  .books { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .steps { grid-template-columns: 1fr; }
  dl { grid-template-columns: 1fr; gap: 4px; }
  dd { margin-bottom: 10px; }
  .card { padding: 18px; }
}
