:root {
  --wood-dark: #5c3a21;
  --wood-mid: #8b5a2b;
  --wood-light: #c19a6b;
  --cream-bg: #fdfaf6;
  --cream-card: #fffbf5;
  --ink: #332211;
  --ink-light: #665544;
  --stamp-red: #c0392b;
  --shelf-line: linear-gradient(90deg, transparent, #d2b48c 10%, #d2b48c 90%, transparent);
  --radius: 8px;
  --shadow: 0 4px 12px rgba(92, 58, 33, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--cream-bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Header & Nav */
.top-nav {
  position: sticky;
  top: 0;
  background-color: var(--cream-card);
  border-bottom: 2px solid var(--wood-light);
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--wood-dark);
  white-space: nowrap;
}
.brand img { height: 32px; border-radius: 4px; }
.nav-links {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
  color: var(--ink-light);
}
.nav-links a:hover { color: var(--stamp-red); }
.search-box {
  flex: 1;
  max-width: 200px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--wood-light);
  border-radius: 20px;
  background: #fff;
  font-size: 0.9rem;
  outline: none;
}
.nav-btn {
  background: var(--wood-dark);
  color: #fff;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.3s;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.nav-btn:hover { background: var(--stamp-red); }

/* Sections Common */
section {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 40px;
}
.section-header h2 {
  font-size: 2rem;
  color: var(--wood-dark);
  margin-bottom: 10px;
  display: inline-block;
  border-bottom: 3px solid var(--wood-light);
  padding-bottom: 5px;
}
.section-header p {
  color: var(--ink-light);
  font-size: 1.1rem;
}
.shelf-divider {
  height: 8px;
  background: var(--shelf-line);
  margin: 40px 0;
  border-radius: 4px;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding-top: 40px;
}
.hero-text {
  flex: 1;
}
.hero-text h1 {
  font-size: 3rem;
  line-height: 1.2;
  color: var(--wood-dark);
  margin-bottom: 20px;
}
.hero-text .hook {
  font-size: 1.2rem;
  color: var(--ink-light);
  margin-bottom: 30px;
}
.stats-row {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}
.stat-item {
  background: var(--cream-card);
  border: 1px solid var(--wood-light);
  padding: 10px 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
}
/* 馆藏章装饰 */
.stat-item::after {
  content: "馆藏章";
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 0.6rem;
  color: var(--stamp-red);
  border: 1px solid var(--stamp-red);
  padding: 2px;
  border-radius: 50%;
  transform: rotate(15deg);
}
.stat-item strong {
  display: block;
  font-size: 1.5rem;
  color: var(--stamp-red);
}
.stat-item span { font-size: 0.85rem; color: var(--ink-light); }

.hero-buttons {
  display: flex;
  gap: 20px;
}
.download-btn {
  flex: 1;
  max-width: 200px;
  background: var(--wood-mid);
  color: #fff;
  text-align: center;
  padding: 15px;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: bold;
  box-shadow: 0 4px 0 var(--wood-dark);
  transition: transform 0.1s, box-shadow 0.1s;
  min-height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.download-btn:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--wood-dark);
}

/* Hero Visual (Book Spine Wall) */
.hero-visual {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  position: relative;
  padding: 20px;
  background: var(--cream-card);
  border: 10px solid var(--wood-mid);
  border-radius: var(--radius);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.1), var(--shadow);
}
/* 假装的书架层板 */
.hero-visual::before, .hero-visual::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 10px;
  background: var(--wood-dark);
  z-index: 2;
}
.hero-visual::before { top: 33%; }
.hero-visual::after { top: 66%; }

.spine-card {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}
.spine-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 抽出一半效果 */
.spine-card.pulled {
  transform: translateX(-20%);
  z-index: 10;
  box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
}
.spine-card.pulled .spine-title {
  opacity: 1;
}
.spine-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(92, 58, 33, 0.85);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 推荐位大卡 */
.hero-feature {
  grid-column: span 2;
  grid-row: span 2;
  background: #fff;
  padding: 10px;
  border: 2px solid var(--wood-light);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.hero-feature img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 10px;
}
.hero-feature h3 { font-size: 1.1rem; margin-bottom: 5px; color: var(--wood-dark); }
.hero-feature .tag-free {
  display: inline-block;
  background: var(--stamp-red);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 2px;
  margin-bottom: 5px;
  align-self: flex-start;
}

/* 热播推荐 */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.rec-card {
  background: #fff;
  border: 1px solid var(--wood-light);
  border-radius: var(--radius);
  padding: 10px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.rec-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(92, 58, 33, 0.15);
}
.rec-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}
.rec-card h3 { font-size: 0.95rem; margin-bottom: 5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.rec-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-light);
}
.badge {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 2px;
  color: #fff;
}
.badge.hot { background: var(--stamp-red); }
.badge.exclusive { background: var(--wood-dark); }
.badge.free { background: #27ae60; }

/* 更新日历 */
.schedule-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 20px;
  background: var(--cream-card);
  border: 1px solid var(--wood-light);
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink-light);
  min-height: 48px;
}
.tab-btn.active {
  background: var(--wood-mid);
  color: #fff;
  border-color: var(--wood-mid);
}
.cart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  background: repeating-linear-gradient(90deg, #f4ebd9, #f4ebd9 10px, #ece2cd 10px, #ece2cd 20px);
  padding: 20px;
  border-radius: var(--radius);
  border: 2px solid var(--wood-light);
  position: relative;
}
.cart-grid::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 0; right: 0;
  height: 10px;
  background: var(--wood-dark);
  border-radius: 0 0 4px 4px;
}
.cart-card {
  background: #fff;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  position: relative;
}
.cart-card img { width: 100%; border-radius: 4px; margin-bottom: 8px; aspect-ratio: 2/3; object-fit: cover;}
.cart-card h3 { font-size: 0.9rem; }
.cart-card .status {
  position: absolute;
  top: 20px; right: 20px;
  font-size: 0.75rem;
  padding: 2px 5px;
  border-radius: 2px;
}
.status.done {
  border: 1px solid var(--stamp-red);
  color: var(--stamp-red);
  transform: rotate(-15deg);
  font-weight: bold;
}
.status.future {
  background: #999;
  color: #fff;
}

/* 排行榜 */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.rank-item {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--wood-light);
  border-radius: var(--radius);
  padding: 15px;
  gap: 15px;
}
.rank-item.top1 {
  border-color: var(--stamp-red);
  background: #fff9f9;
}
.rank-num {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--wood-light);
  width: 40px;
  text-align: center;
}
.rank-item.top1 .rank-num { color: var(--stamp-red); }
.rank-item img {
  width: 50px;
  height: 70px;
  object-fit: cover;
  border-radius: 2px;
}
.rank-info { flex: 1; }
.rank-info h3 { font-size: 1.1rem; margin-bottom: 5px; }
.rank-info .genre { font-size: 0.8rem; color: var(--ink-light); }
.rank-stats {
  text-align: right;
  font-size: 0.9rem;
  color: var(--ink-light);
}
.rank-up { color: var(--stamp-red); font-weight: bold; }
.rank-down { color: #27ae60; font-weight: bold; }
.medal {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 10px;
  color: #fff;
  margin-left: 10px;
  vertical-align: middle;
}
.medal.gold { background: #f1c40f; }
.medal.silver { background: #bdc3c7; }
.medal.bronze { background: #d35400; }
.medal.book-of-month { background: var(--stamp-red); }

/* 题材分类 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.cat-card {
  background: #fff;
  border: 1px solid var(--wood-light);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow);
  min-height: 48px;
}
.cat-card:hover { transform: translateY(-5px); }
.cat-callnum {
  font-family: monospace;
  font-size: 0.8rem;
  background: var(--cream-bg);
  padding: 2px 6px;
  border: 1px dashed var(--wood-light);
  display: inline-block;
  margin-bottom: 10px;
  color: var(--wood-dark);
}
.cat-card h3 { font-size: 1.2rem; margin-bottom: 15px; color: var(--wood-dark); }
.cat-covers {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.cat-covers img { width: 40px; height: 55px; object-fit: cover; border-radius: 2px; }
.cat-count { font-size: 0.8rem; color: var(--ink-light); }

/* 独播首发 */
.exclusive-section {
  display: flex;
  gap: 40px;
}
.exclusive-main {
  flex: 1.2;
  background: #fff;
  border: 3px solid var(--wood-dark);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.exclusive-main::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 15px;
  background: linear-gradient(to right, #d4af37, #fceb9e, #d4af37);
  border-right: 1px solid #b8941e;
}
.exclusive-main img {
  width: 100%;
  max-width: 250px;
  border-radius: 4px;
  margin-bottom: 15px;
  margin-left: 15px;
}
.exclusive-main h3 { font-size: 1.6rem; color: var(--wood-dark); margin-left: 15px; margin-bottom: 10px;}
.exclusive-main p { font-size: 0.95rem; color: var(--ink-light); margin-left: 15px; margin-bottom: 20px;}
.borrow-btn {
  display: inline-block;
  background: var(--wood-dark);
  color: #fff;
  padding: 10px 25px;
  border-radius: 4px;
  font-size: 1rem;
  margin-left: 15px;
  min-height: 48px;
}
.exclusive-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.exclusive-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid #eee;
}
.exclusive-item img { width: 40px; height: 55px; object-fit: cover; border-radius: 2px; }
.exclusive-item h4 { font-size: 1rem; margin-bottom: 4px; }
.exclusive-item span { font-size: 0.8rem; color: var(--ink-light); }

/* 免费专区 */
.free-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.free-card {
  background: #fff;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid #e0e0e0;
  transition: transform 0.3s;
}
.free-card:hover { transform: rotate(-2deg); }
.free-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; margin-bottom: 8px;}
.free-card h3 { font-size: 0.9rem; margin-bottom: 5px;}
.free-card .tag {
  font-size: 0.75rem;
  color: var(--stamp-red);
  border: 1px solid var(--stamp-red);
  padding: 1px 4px;
  border-radius: 2px;
}

/* 用户评价 */
.reviews-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 40px;
  background: var(--cream-card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--wood-light);
}
.rev-stat h3 { font-size: 2rem; color: var(--stamp-red); text-align: center; }
.rev-stat p { font-size: 0.9rem; color: var(--ink-light); }
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.review-card {
  background: #fff;
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 2px 2px 8px rgba(0,0,0,0.05);
  position: relative;
}
/* 留言卡背面的纹理 */
.review-card::after {
  content: '';
  position: absolute;
  bottom: 10px; left: 20px; right: 20px;
  height: 1px;
  background: #eee;
}
.review-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.review-user img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #ddd; }
.review-user h4 { font-size: 0.95rem; }
.stars { display: flex; gap: 2px; margin-bottom: 10px; }
.star-stamp {
  width: 14px; height: 14px;
  border: 1px solid var(--stamp-red);
  color: var(--stamp-red);
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  border-radius: 2px;
}
.review-text { font-size: 0.9rem; color: var(--ink-light); }

/* 常见问题 */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: #fff;
  border: 1px solid var(--wood-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-q {
  padding: 15px 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}
.faq-q::before {
  content: '书签';
  font-size: 0.7rem;
  background: var(--wood-light);
  color: #fff;
  padding: 2px 5px;
  border-radius: 2px;
  margin-right: 10px;
}
.faq-a {
  padding: 0 20px 15px;
  font-size: 0.95rem;
  color: var(--ink-light);
  display: block;
}
/* 手机端折叠 */
@media (max-width: 768px) {
  .faq-a { display: none; padding-top: 10px; border-top: 1px dashed #eee; }
  .faq-item.open .faq-a { display: block; }
  .faq-q::after { content: '+'; font-size: 1.2rem; }
  .faq-item.open .faq-q::after { content: '-'; }
}

/* 下载安装区 */
.install-steps {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}
.step-card {
  flex: 1;
  background: var(--cream-card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--wood-light);
  text-align: center;
}
.step-num {
  display: inline-block;
  width: 30px; height: 30px;
  background: var(--wood-dark);
  color: #fff;
  border-radius: 50%;
  line-height: 30px;
  margin-bottom: 10px;
}
.step-card h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--wood-dark); }
.step-card p { font-size: 0.9rem; color: var(--ink-light); text-align: left; }

.reader-cards {
  display: flex;
  justify-content: center;
  gap: 40px;
}
.reader-card {
  flex: 1;
  max-width: 350px;
  background: #fff;
  border: 2px solid var(--wood-mid);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.reader-card::before {
  content: '读者证';
  position: absolute;
  top: 15px; right: 15px;
  font-size: 0.8rem;
  color: #999;
  letter-spacing: 2px;
}
.reader-card h3 { font-size: 1.4rem; margin-bottom: 10px; color: var(--wood-dark); }
.reader-card .cert-num {
  font-family: monospace;
  font-size: 1.2rem;
  letter-spacing: 3px;
  color: var(--stamp-red);
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  display: inline-block;
}
.reader-btn {
  display: block;
  background: var(--wood-mid);
  color: #fff;
  padding: 15px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  min-height: 48px;
}
.reader-stamp {
  position: absolute;
  bottom: 70px; right: 20px;
  width: 60px; height: 60px;
  border: 2px solid rgba(192, 57, 43, 0.3);
  border-radius: 50%;
  color: rgba(192, 57, 43, 0.3);
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-15deg);
  pointer-events: none;
}

/* Footer */
footer {
  background: var(--wood-dark);
  color: #d2b48c;
  padding: 40px 20px 20px;
  font-size: 0.85rem;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 30px;
}
.footer-brand { flex: 2; min-width: 250px; }
.footer-brand p { margin-top: 10px; color: #a88e72; }
.footer-links { flex: 3; display: flex; justify-content: space-around; gap: 20px; }
.footer-col h4 { color: #fff; margin-bottom: 15px; font-size: 1rem; }
.footer-col a { display: block; margin-bottom: 8px; color: #d2b48c; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #a88e72;
}
.footer-bottom a { color: #d2b48c; }
.update-time { font-size: 0.75rem; margin-top: 8px; color: #8c7055;}

/* Mobile Bottom Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  padding: 10px;
  z-index: 999;
  justify-content: space-between;
  gap: 10px;
}
.mobile-bottom-bar .download-btn { flex: 1; max-width: none; }

/* Media Queries */
@media (max-width: 1200px) {
  .rec-grid { grid-template-columns: repeat(4, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .free-grid { grid-template-columns: repeat(3, 1fr); }
  .reviews-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .hero { flex-direction: column; }
  .hero-visual { order: -1; width: 100%; max-width: 500px; margin: 0 auto; }
  .hero-text { text-align: center; }
  .stats-row { justify-content: center; }
  .hero-buttons { justify-content: center; }
  .exclusive-section { flex-direction: column; }
  .install-steps { flex-direction: column; }
  .reader-cards { flex-direction: column; align-items: center; }
  .reader-card { width: 100%; }
  .footer-links { flex-direction: column; gap: 30px; }
}

@media (max-width: 768px) {
  .nav-links, .search-box { display: none; }
  .hero-text h1 { font-size: 2rem; }
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-grid { grid-template-columns: repeat(2, 1fr); }
  .rank-item { flex-wrap: wrap; }
  .rank-stats { width: 100%; text-align: left; margin-top: 10px; padding-left: 55px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .free-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid { grid-template-columns: 1fr; }
  .reviews-stats { flex-direction: column; gap: 20px; align-items: center; }
  .mobile-bottom-bar { display: flex; }
  body { padding-bottom: 70px; /* space for bottom bar */ }
  .faq-a { display: none; }
  .faq-item.open .faq-a { display: block; }
}

@media (max-width: 480px) {
  .hero-visual { grid-template-columns: repeat(2, 1fr); }
  .hero-feature { grid-column: span 2; grid-row: auto; }
  .hero-visual::before { top: 50%; }
  .hero-visual::after { display: none; }
  .stats-row { flex-wrap: wrap; }
  .stat-item { flex: 1 1 40%; }
  .hero-buttons { flex-direction: column; }
  .download-btn { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}