/* iOS 风格课本专区覆盖样式 */

.ios-book {
  --ios-bg: #F2F2F7;
  --ios-card: #FFFFFF;
  --ios-label: #8E8E93;
  --ios-text: #000000;
  --ios-blue: #007AFF;
  --ios-blue-soft: rgba(0, 122, 255, 0.12);
  --ios-separator: rgba(60, 60, 67, 0.12);
  --ios-radius-xl: 22px;
  --ios-radius: 14px;
  --ios-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  --ios-shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.1);
  background: var(--ios-bg);
  min-height: 100vh;
  padding-bottom: 40px;
}

/* 顶部大标题区 */
.ios-hero {
  padding: 24px 20px 16px;
}
.ios-hero h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--ios-text);
  line-height: 1.15;
}
.ios-hero p {
  font-size: 16px;
  color: var(--ios-label);
  margin-top: 8px;
  line-height: 1.4;
}

/* 筛选区 */
.ios-filter-group {
  margin: 0 0 18px;
  padding: 0 20px;
}
.ios-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ios-label);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}
.ios-filter-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.ios-filter-scroll::-webkit-scrollbar { display: none; }

.ios-pill {
  flex: 0 0 auto;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ios-card);
  color: var(--ios-text);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--ios-separator);
  transition: transform 0.12s, background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.ios-pill:active { transform: scale(0.96); }
.ios-pill.active {
  background: var(--ios-blue);
  color: #fff;
  border-color: var(--ios-blue);
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.28);
}
.ios-pill-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-flex;
  margin-right: 7px;
  vertical-align: -4px;
}
.ios-pill-icon svg { display: block; }

/* 统计小条 */
.ios-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 6px;
  font-size: 14px;
  color: var(--ios-label);
  font-weight: 500;
}
.ios-summary b { color: var(--ios-text); font-weight: 700; }

/* 卡片网格 */
.ios-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 10px 20px 30px;
}
@media (max-width: 1100px) { .ios-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .ios-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 420px)  { .ios-grid { grid-template-columns: 1fr; } }

.ios-card {
  background: var(--ios-card);
  border-radius: var(--ios-radius-xl);
  overflow: hidden;
  box-shadow: var(--ios-shadow);
  transition: transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.18s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ios-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ios-shadow-hover);
}
.ios-card:active { transform: scale(0.98); }

.ios-card-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #E5E5EA 0%, #D1D1D6 100%);
  overflow: hidden;
}
.ios-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.ios-card:hover .ios-card-cover img { transform: scale(1.04); }

.ios-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(8px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
}
.ios-card-subject {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.ios-card-subject svg {
  width: 14px;
  height: 14px;
  display: block;
}

.ios-card-body {
  padding: 15px 16px 18px;
}
.ios-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ios-text);
  line-height: 1.35;
  letter-spacing: -0.2px;
}
.ios-card-desc {
  font-size: 14px;
  color: var(--ios-label);
  margin-top: 7px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 空状态 */
.ios-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ios-label);
}
.ios-empty svg {
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  opacity: 0.55;
}
.ios-empty p {
  font-size: 16px;
  font-weight: 600;
}

/* 底部说明 */
.ios-footer-note {
  text-align: center;
  font-size: 13px;
  color: var(--ios-label);
  padding: 10px 20px 30px;
}

/* 适配通用 topbar 在 iOS 背景下的显示 */
.ios-book .topbar {
  background: rgba(242, 242, 247, 0.88);
  border-bottom: 1px solid var(--ios-separator);
}
.ios-book .container { max-width: 1200px; }

/* 移动端字距微调 */
@media (max-width: 480px) {
  .ios-hero { padding: 18px 16px 12px; }
  .ios-hero h1 { font-size: 30px; }
  .ios-filter-group { padding: 0 16px; }
  .ios-grid { padding: 8px 16px 24px; }
  .ios-card-subject { bottom: 10px; left: 10px; }
}
