:root {
  --cream-bg: #fdfaf5;
  --wood-dark: #5c3a21;
  --wood-mid: #8b5a2b;
  --wood-light: #cdaa7d;
  --wood-shelf: #e8d5c4;
  --text-main: #332211;
  --text-muted: #776655;
  --accent-red: #b22222;
  --accent-gold: #d4af37;
  --card-bg: #fffdf9;
  --shadow-sm: 0 2px 8px rgba(92, 58, 33, 0.08);
  --shadow-md: 0 4px 16px rgba(92, 58, 33, 0.12);
  --radius-md: 8px;
  --radius-lg: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--cream-bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--cream-bg);
  border-bottom: 2px solid var(--wood-light);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 1.2rem; color: var(--wood-dark); }
.brand img { height: 32px; width: auto; }
.nav-links { display: none; gap: 20px; font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent-red); }
.search-bar { display: none; align-items: center; background: #fff; border: 1px solid var(--wood-light); border-radius: 20px; padding: 4px 12px; }
.search-bar input { border: none; outline: none; background: transparent; font-size: 0.9rem; }
.btn-header-dl { background: var(--wood-dark); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; font-weight: bold; }

/* Sections Common */
section { padding: 40px 0; border-bottom: 6px solid var(--wood-shelf); }
.section-title { font-size: 1.6rem; color: var(--wood-dark); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; display: block; width: 6px; height: 24px; background: var(--accent-red); border-radius: 2px; }
.wood-shelf-divider { height: 12px; background: repeating-linear-gradient(90deg, var(--wood-light), var(--wood-light) 10px, var(--wood-mid) 10px, var(--wood-mid) 12px); border-radius: 4px; margin: 20px 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

/* Data Tag (馆藏章) */
.data-tag {
  display: inline-block;
  font-size: 0.75rem;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  padding: 2px 6px;
  border-radius: 2px;
  transform: rotate(-2deg);
  font-family: monospace;
  letter-spacing: 1px;
}

/* Hero Section */
.hero { background: #f7f1e8; padding-bottom: 30px; }
.hero-content { display: flex; flex-direction: column; gap: 30px; }
.hero-text h1 { font-size: 2rem; line-height: 1.3; color: var(--wood-dark); margin-bottom: 12px; }
.hero-text p { color: var(--text-muted); font-size: 1rem; margin-bottom: 20px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 24px; }
.hero-stats span { font-size: 0.9rem; font-weight: bold; color: var(--wood-dark); }
.download-btns { display: flex; gap: 15px; }
.dl-btn {
  display: flex; align-items: center; justify-content: center;
  background: var(--wood-dark); color: #fff;
  padding: 12px 24px; border-radius: var(--radius-md); font-weight: bold; font-size: 1rem;
  min-height: 48px; transition: background 0.3s;
}
.dl-btn.ios { background: var(--wood-mid); }
.dl-btn:hover { background: var(--accent-red); }

/* 书脊墙 (Hero Visual) */
.bookshelf-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: var(--wood-shelf); padding: 15px; border-radius: var(--radius-lg); align-items: end; }
.book-spine { position: relative; height: 160px; border-radius: 3px; overflow: hidden; cursor: pointer; box-shadow: 2px 0 5px rgba(0,0,0,0.1); }
.book-spine img { width: 100%; height: 100%; object-fit: cover; }
.book-spine:hover img { transform: translateY(-10px); }
.hero-featured { grid-column: span 4; background: #fff; border-radius: var(--radius-md); border: 2px solid var(--accent-gold); overflow: hidden; display: flex; box-shadow: var(--shadow-md); }
.hero-featured img { width: 120px; height: 170px; object-fit: cover; }
.hero-featured-info { padding: 15px; display: flex; flex-direction: column; justify-content: center; }
.hero-featured-info h3 { font-size: 1.1rem; margin-bottom: 8px; }
.hero-featured-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }

/* Hot Borrow Section */
.hot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.hot-card { background: var(--card-bg); border: 1px solid var(--wood-light); border-radius: var(--radius-md); overflow: hidden; position: relative; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; }
.hot-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.hot-card img { width: 100%; height: 180px; object-fit: cover; }
.hot-card-info { padding: 10px; }
.hot-card-info h3 { font-size: 1rem; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--text-muted); }
.hot-badge { position: absolute; top: 8px; right: 8px; background: var(--accent-red); color: #fff; font-size: 0.65rem; padding: 2px 6px; border-radius: 2px; }

/* Update Schedule */
.update-batch { margin-bottom: 20px; background: #fff; padding: 15px; border-radius: var(--radius-md); border: 1px solid var(--wood-shelf); }
.update-batch-title { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed var(--wood-light); padding-bottom: 10px; margin-bottom: 15px; font-weight: bold; color: var(--wood-dark); }
.update-cart { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.update-item { flex: 0 0 100px; text-align: center; }
.update-item img { width: 100px; height: 140px; object-fit: cover; border-radius: 4px; border: 1px solid #eee; }
.update-item h3 { font-size: 0.8rem; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-tag { font-size: 0.65rem; background: #f0f0f0; color: #666; padding: 2px 4px; border-radius: 2px; margin-top: 4px; display: inline-block; }
.stamp-passed { border: 2px solid var(--accent-red); color: var(--accent-red); display: inline-block; padding: 2px 8px; font-weight: bold; transform: rotate(-5deg); font-size: 0.8rem; }

/* Ranking */
.ranking-list { display: flex; flex-direction: column; gap: 12px; }
.rank-card { display: flex; align-items: center; background: #fff; padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--wood-light); gap: 15px; }
.rank-card:nth-child(1) { background: #fffdf5; border-color: var(--accent-gold); box-shadow: var(--shadow-sm); }
.rank-num { font-size: 1.4rem; font-weight: bold; color: var(--text-muted); width: 30px; text-align: center; font-family: serif; }
.rank-card:nth-child(1) .rank-num { color: var(--accent-gold); }
.rank-card img { width: 60px; height: 80px; object-fit: cover; border-radius: 4px; }
.rank-info { flex: 1; }
.rank-info h3 { font-size: 1rem; margin-bottom: 4px; }
.rank-info p { font-size: 0.8rem; color: var(--text-muted); }
.rank-stats { text-align: right; font-size: 0.8rem; }
.rank-trend.up { color: #d9534f; }
.rank-trend.down { color: #5cb85c; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.cat-card { background: #fff; padding: 15px; border-radius: var(--radius-md); border-left: 4px solid var(--wood-mid); box-shadow: var(--shadow-sm); transition: transform 0.2s; }
.cat-card:hover { transform: translateY(-3px); }
.cat-code { font-family: monospace; font-size: 0.75rem; color: var(--wood-mid); margin-bottom: 8px; }
.cat-card h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--wood-dark); }
.cat-covers { display: flex; gap: 8px; margin-bottom: 10px; }
.cat-covers img { width: 45px; height: 60px; object-fit: cover; border-radius: 2px; }
.cat-count { font-size: 0.8rem; color: var(--text-muted); }

/* Exclusive */
.exclusive-wrap { display: flex; flex-direction: column; gap: 20px; }
.exclusive-main { background: #fff; border: 2px solid var(--wood-dark); border-radius: var(--radius-lg); padding: 20px; display: flex; gap: 20px; align-items: center; }
.exclusive-main img { width: 120px; height: 170px; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-md); }
.ex-main-info h3 { font-size: 1.3rem; margin-bottom: 10px; }
.ex-main-info p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; }
.ex-countdown { font-size: 1.2rem; font-weight: bold; color: var(--accent-red); margin-bottom: 15px; }
.btn-reserve { background: var(--wood-dark); color: #fff; display: inline-block; padding: 10px 20px; border-radius: 20px; font-size: 0.9rem; }
.exclusive-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ex-list-item { display: flex; gap: 10px; background: #fff; padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--wood-shelf); }
.ex-list-item img { width: 50px; height: 70px; object-fit: cover; border-radius: 2px; }
.ex-list-info h3 { font-size: 0.9rem; margin-bottom: 4px; }
.ex-list-info span { font-size: 0.75rem; color: var(--text-muted); }

/* Free Zone */
.free-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.free-card { background: #fff; border-radius: var(--radius-md); overflow: hidden; border: 1px solid #eee; position: relative; }
.free-card img { width: 100%; height: 160px; object-fit: cover; }
.free-badge { position: absolute; top: 0; left: 0; background: #e6f4ea; color: #1e8e3e; font-size: 0.7rem; padding: 4px 8px; border-bottom-right-radius: 8px; font-weight: bold; }
.free-info { padding: 10px; }
.free-info h3 { font-size: 0.95rem; margin-bottom: 4px; }
.free-info span { font-size: 0.8rem; color: var(--text-muted); }

/* Reviews */
.review-stats { display: flex; justify-content: space-around; text-align: center; margin-bottom: 30px; background: #fff; padding: 20px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.rev-stat-item span { display: block; font-size: 1.8rem; font-weight: bold; color: var(--wood-dark); }
.rev-stat-item small { font-size: 0.85rem; color: var(--text-muted); }
.review-list { display: grid; grid-template-columns: 1fr; gap: 15px; }
.review-card { background: #fff; padding: 15px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--wood-light); position: relative; }
.review-card::before { content: ""; position: absolute; top: 0; left: 20px; width: 40px; height: 4px; background: var(--wood-mid); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }
.rev-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rev-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: contain; background: #eee; padding: 4px; }
.rev-user strong { font-size: 0.95rem; }
.rev-stars { color: var(--accent-gold); font-size: 0.8rem; margin-bottom: 8px; display: flex; gap: 4px; }
.rev-stamp { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--accent-gold); border-radius: 50%; text-align: center; line-height: 12px; font-size: 10px; font-family: serif; }
.rev-text { font-size: 0.9rem; color: var(--text-main); line-height: 1.5; }
.rev-line { height: 1px; background: repeating-linear-gradient(90deg, #ccc, #ccc 4px, transparent 4px, transparent 8px); margin-top: 12px; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #fff; border-radius: var(--radius-md); border: 1px solid var(--wood-shelf); overflow: hidden; }
.faq-q { padding: 15px; font-weight: bold; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.faq-q::after { content: "+"; font-size: 1.2rem; color: var(--wood-mid); }
.faq-a { display: none; padding: 0 15px 15px; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; border-top: 1px dashed var(--wood-shelf); padding-top: 15px; }
.faq-item.active .faq-a { display: block; }
.faq-item.active .faq-q::after { content: "-"; }

/* Download / Card */
.dl-steps { display: flex; flex-direction: column; gap: 15px; margin-bottom: 30px; }
.step-card { background: #fff; padding: 20px; border-radius: var(--radius-md); border-left: 4px solid var(--wood-dark); box-shadow: var(--shadow-sm); }
.step-card h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--wood-dark); }
.step-card p { font-size: 0.9rem; color: var(--text-muted); }
.card-dl-wrap { display: flex; flex-direction: column; gap: 20px; }
.reader-card { background: linear-gradient(135deg, var(--cream-bg), #fff); border: 2px solid var(--wood-mid); border-radius: var(--radius-lg); padding: 24px; text-align: center; box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.reader-card::after { content: "入馆凭证"; position: absolute; bottom: 15px; right: 15px; border: 2px solid rgba(178, 34, 34, 0.3); color: rgba(178, 34, 34, 0.3); border-radius: 50%; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; transform: rotate(-15deg); pointer-events: none; }
.rc-title { font-size: 1.2rem; font-weight: bold; color: var(--wood-dark); margin-bottom: 8px; }
.rc-no { font-family: monospace; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; letter-spacing: 2px; }
.rc-btn { display: block; background: var(--wood-dark); color: #fff; padding: 15px; border-radius: var(--radius-md); font-size: 1.1rem; font-weight: bold; min-height: 48px; text-align: center; }
.rc-btn.ios { background: var(--wood-mid); }

/* Footer */
.site-footer { background: #eee8df; color: var(--text-muted); font-size: 0.8rem; padding: 40px 0 100px; }
.footer-top { display: flex; flex-direction: column; gap: 30px; margin-bottom: 30px; }
.footer-desc { max-width: 300px; }
.footer-desc strong { display: block; font-size: 1.1rem; color: var(--wood-dark); margin-bottom: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 40px; }
.fl-col h4 { font-size: 0.9rem; color: var(--wood-dark); margin-bottom: 15px; }
.fl-col ul { display: flex; flex-direction: column; gap: 10px; }
.fl-col a:hover { color: var(--accent-red); }
.footer-bottom { border-top: 1px solid #dcd5c9; padding-top: 20px; text-align: center; line-height: 1.8; }
.footer-bottom a { color: var(--text-muted); text-decoration: underline; }

/* Mobile Floating Bar */
.mobile-dl-bar { display: flex; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 200; padding: 10px; gap: 10px; align-items: center; }
.mobile-dl-bar .dl-btn { flex: 1; padding: 12px 0; font-size: 0.95rem; min-height: 48px; }
.btn-close { background: none; border: none; font-size: 24px; color: #999; padding: 0 10px; min-height: 48px; }

/* Media Queries */
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .search-bar { display: flex; }
  .hero-content { flex-direction: row; align-items: center; justify-content: space-between; }
  .hero-text { flex: 1; padding-right: 30px; }
  .hero-text h1 { font-size: 2.4rem; }
  .bookshelf-wall { flex: 1; grid-template-columns: repeat(6, 1fr); }
  .hero-featured { grid-column: span 6; }
  .hot-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .exclusive-wrap { flex-direction: row; }
  .exclusive-main { flex: 1; }
  .exclusive-list { flex: 1; grid-template-columns: 1fr; overflow-y: auto; max-height: 400px; }
  .free-grid { grid-template-columns: repeat(3, 1fr); }
  .review-list { grid-template-columns: repeat(2, 1fr); }
  .dl-steps { flex-direction: row; }
  .step-card { flex: 1; }
  .card-dl-wrap { flex-direction: row; justify-content: center; }
  .reader-card { flex: 1; max-width: 400px; }
  .footer-top { flex-direction: row; justify-content: space-between; }
  .mobile-dl-bar { display: none; }
  .site-footer { padding-bottom: 40px; }
}

@media (min-width: 1024px) {
  .hero-text h1 { font-size: 2.8rem; }
  .bookshelf-wall { grid-template-columns: repeat(8, 1fr); }
  .hot-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .free-grid { grid-template-columns: repeat(4, 1fr); }
  .review-list { grid-template-columns: repeat(3, 1fr); }
  .exclusive-list { grid-template-columns: repeat(2, 1fr); }
  .update-cart { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}