:root {
  --bg: #eaf2f8;
  --surface: #ffffff;
  --text: #14233a;
  --muted: #66778b;
  --line: #d7e4ee;
  --green: #0b8f64;
  --green-deep: #066647;
  --blue: #245fba;
  --gold: #b98a22;
  --shadow: 0 22px 54px rgba(30, 52, 80, 0.13);
  --shadow-soft: 0 10px 28px rgba(30, 52, 80, 0.08);
  --ring: 0 0 0 4px rgba(11, 143, 100, 0.12);
  --font: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0) 220px),
    radial-gradient(circle at 12% 12%, rgba(11, 143, 100, 0.16), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(36, 95, 186, 0.13), transparent 32%),
    linear-gradient(135deg, #eef7f4 0%, #e7f1fb 47%, #f4f7fa 100%);
}

button, input { font: inherit; }

/* ===== 顶部导航（与资源中心一致） ===== */
.bs-top {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(18px, 4vw, 52px);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.70);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px rgba(25, 45, 70, 0.08);
}

.bs-top .brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 21px;
  font-weight: 900;
}

.bs-top .brand img {
  width: 48px;
  height: 48px;
  padding: 2px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 28px rgba(11, 143, 100, 0.20);
}

.bs-top .top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bs-top .top-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(215, 228, 238, 0.84);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #344960;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.bs-top .top-nav a:hover {
  border-color: rgba(11, 143, 100, 0.32);
  background: #ffffff;
  color: var(--green-deep);
  box-shadow: 0 14px 28px rgba(30, 52, 80, 0.10);
  transform: translateY(-1px);
}

.bs-top .top-nav i { color: var(--green); }

/* ===== 主体容器 ===== */
.bs-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 30px auto 64px;
}

/* ===== Hero ===== */
.bs-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 28px;
  min-height: 200px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.88) 46%, rgba(229, 245, 239, 0.74) 100%);
  box-shadow: var(--shadow);
}

.bs-hero::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 7px; height: 100%;
  background: linear-gradient(180deg, var(--green), var(--blue));
}

.bs-hero > * { position: relative; z-index: 1; }

.bs-hero h1 {
  margin: 0 0 14px;
  color: #0f2036;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  font-weight: 950;
}

.bs-hero p {
  max-width: 760px;
  margin: 0;
  color: #52677e;
  font-size: 15.5px;
  line-height: 1.95;
}

.bs-hero .hero-stats {
  align-self: center;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.bs-hero .hero-stats div {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  column-gap: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(30, 52, 80, 0.08);
  backdrop-filter: blur(18px);
}

.bs-hero .hero-stats strong {
  grid-row: span 2;
  min-width: 84px;
  color: var(--green-deep);
  font-size: 30px;
  line-height: 1;
}

.bs-hero .hero-stats span {
  align-self: center;
  color: #43576e;
  font-size: 13px;
  font-weight: 800;
}

/* ===== 控制条（搜索 + 学科跳转） ===== */
.bs-controls {
  position: sticky;
  top: 86px;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 22px 0 26px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.bs-controls .search-box {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(215, 228, 238, 0.92);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.bs-controls .search-box:focus-within {
  border-color: rgba(11, 143, 100, 0.38);
  box-shadow: var(--ring);
}

.bs-controls .search-box i { color: var(--green); font-size: 17px; }

.bs-controls .search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.bs-controls #bs-search-clear {
  width: 32px; height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: #98a7b8;
  cursor: pointer;
}

.bs-controls #bs-search-clear.visible { display: inline-flex; }

.bs-controls .subject-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bs-controls .subject-chips button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f5f9fc;
  color: #34506a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.bs-controls .subject-chips button:hover {
  border-color: rgba(11, 143, 100, 0.3);
  background: #fff;
  transform: translateY(-1px);
}

.bs-controls .subject-chips button.active {
  background: linear-gradient(135deg, var(--green), var(--blue));
  border-color: transparent;
  color: #fff;
}

/* ===== 书架 ===== */
.bs-shelves { display: grid; gap: 40px; }

.shelf { scroll-margin-top: 150px; }

.shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.shelf-head h2 {
  margin: 0;
  color: #13243b;
  font-size: 22px;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.shelf-head h2::before {
  content: "";
  width: 6px; height: 22px;
  border-radius: 3px;
  background: var(--shelf-c, var(--green));
}

.shelf-head .shelf-count {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(11, 143, 100, 0.10);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 900;
}

.shelf-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 28px 18px 0;
  overflow-x: auto;
  perspective: 1100px;
  scrollbar-width: thin;
}

.shelf-board {
  height: 22px;
  margin: 0 6px;
  border-radius: 0 0 8px 8px;
  position: relative;
  background: linear-gradient(180deg, #4a5b71 0%, #36465a 42%, #2a3848 100%);
  box-shadow: 0 18px 32px rgba(20, 32, 52, 0.30);
}

.shelf-board::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05));
}

.shelf-board::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 6px;
  background: rgba(0, 0, 0, 0.18);
}

/* ===== 书 ===== */
.book {
  --bw: 116px;
  position: relative;
  flex: 0 0 auto;
  width: var(--bw);
  height: calc(var(--bw) / var(--ar, 0.71));
  border-radius: 3px 6px 6px 3px;
  background: linear-gradient(135deg, var(--c1, #0b8f64), var(--c2, #2ba882));
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transform-origin: bottom center;
  box-shadow:
    3px 0 0 rgba(0, 0, 0, 0.10),
    6px 5px 0 rgba(0, 0, 0, 0.12),
    8px 16px 24px rgba(20, 32, 52, 0.22);
  transition: transform 0.26s cubic-bezier(.2,.75,.25,1), box-shadow 0.26s ease;
  animation: bookRise 0.7s cubic-bezier(.2,.75,.25,1) both;
  animation-delay: calc(var(--i, 0) * 42ms);
}

/* 书脊 */
.book::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 10px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.28));
}

/* 书口高光 */
.book::after {
  content: "";
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.42);
}

.book .face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 11px 13px 19px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.book .face::after {
  /* 书封斜向高光，增加纸质光泽 */
  content: "";
  position: absolute;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 160%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.22), transparent 60%);
  transform: rotate(8deg);
  pointer-events: none;
}

.book .subject {
  font-size: 23px;
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 1px;
}

.book .sub-name {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 800;
  opacity: 0.95;
}

.book .gt {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 900;
  opacity: 0.96;
  white-space: nowrap;
}

.book .pages {
  align-self: flex-end;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 11px;
  font-weight: 900;
}

.book:hover {
  transform: translateY(-18px) rotate(-1.6deg) scale(1.05);
  box-shadow:
    4px 0 0 rgba(0, 0, 0, 0.10),
    10px 10px 0 rgba(0, 0, 0, 0.12),
    14px 30px 40px rgba(20, 32, 52, 0.34);
  z-index: 6;
}

.book:active { transform: translateY(-8px) scale(1.0); }

.book.opening { animation: pullOut 0.5s ease forwards; pointer-events: none; z-index: 50; }

@keyframes bookRise {
  from {
    opacity: 0;
    transform: translateY(54px) rotateX(-26deg) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pullOut {
  to {
    opacity: 0;
    transform: translateY(-70px) scale(1.2) rotate(-6deg);
    filter: blur(1.5px);
  }
}

/* ===== 空状态 / 脚注 ===== */
.bs-empty {
  display: none;
  min-height: 240px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.bs-empty.visible { display: grid; }
.bs-empty i { color: var(--green); font-size: 26px; }
.bs-empty h2, .bs-empty p { margin: 0; }
.bs-empty p { color: var(--muted); }

.bs-foot {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 40px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  color: #506177;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.7;
}

.bs-foot i {
  margin-top: 2px;
  color: var(--gold);
  font-size: 16px;
  flex: 0 0 auto;
}

/* ===== 响应式 ===== */
@media (max-width: 1160px) {
  .bs-controls { grid-template-columns: 1fr; }
  .bs-controls .subject-chips { justify-content: flex-start; }
}

@media (max-width: 860px) {
  .bs-shell { width: calc(100% - 28px); margin-top: 16px; }
  .bs-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 28px 22px;
  }
  .bs-hero .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bs-hero .hero-stats div { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .bs-hero .hero-stats strong { min-width: 0; grid-row: auto; font-size: 24px; }
  .bs-controls { padding: 12px; }
}

@media (max-width: 760px) {
  .bs-top { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .bs-top .top-nav { width: 100%; }
  .bs-top .top-nav a { flex: 1; justify-content: center; padding: 0 10px; }
  .book { --bw: 96px; }
  .shelf-row { gap: 12px; padding: 22px 12px 0; }
  .bs-hero h1 { font-size: 28px; }
  .bs-hero .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .bs-hero .hero-stats div { min-height: 84px; padding: 10px 8px; }
  .bs-hero .hero-stats strong { font-size: 22px; }
}
