:root {
  --lib-card: #ffffff;
  --lib-card-soft: #f7fbff;
  --lib-line: rgba(26, 43, 60, 0.08);
  --lib-muted: #5a7088;
  --lib-accent: #ff8c42;
  --lib-accent-dark: #e86a20;
  --lib-shadow: 0 8px 28px rgba(26, 43, 60, 0.08);
}

.lib-page-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 18px 40px;
}

.lib-subnav {
  margin: 0 0 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid var(--lib-line);
  border-radius: 16px;
  box-shadow: var(--lib-shadow);
}

.lib-subnav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
}

.lib-subnav-title {
  font: 800 18px/1.1 "Segoe UI", system-ui, sans-serif;
  color: #1a2b3c;
  white-space: nowrap;
}

.lib-subnav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.lib-subnav-link {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--lib-muted);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
}

.lib-subnav-link:hover,
.lib-subnav-link.is-active {
  color: #1a2b3c;
  background: rgba(255, 140, 66, 0.12);
  text-decoration: none;
}

.lib-subnav-search {
  display: flex;
  gap: 8px;
  min-width: 240px;
}

.lib-subnav-search input {
  flex: 1;
  border: 1px solid var(--lib-line);
  background: #fff;
  color: #1a2b3c;
  border-radius: 10px;
  padding: 9px 12px;
}

.lib-subnav-search button {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  background: linear-gradient(135deg, var(--lib-accent), var(--lib-accent-dark));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.lib-content {
  min-height: 320px;
}

.lib-hero {
  margin-bottom: 22px;
}

.lib-hero-card {
  background: linear-gradient(135deg, #fff8ee 0%, #ffffff 55%, #eef8ff 100%);
  border: 1px solid var(--lib-line);
  border-radius: 20px;
  box-shadow: var(--lib-shadow);
  padding: 28px 24px;
  text-align: center;
}

.lib-hero-logo {
  margin-bottom: 16px;
}

.lib-logo-text {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  font: 800 clamp(1.8rem, 4vw, 2.6rem)/1 "Segoe UI", system-ui, sans-serif;
}

.lib-logo-classic { color: #1a2b3c; }
.lib-logo-plus { color: var(--lib-accent); }
.lib-logo-library { color: #5bb8e8; width: 100%; font-size: 0.72em; }

.lib-hero-search {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto 12px;
}

.lib-hero-search input {
  flex: 1;
  border: 1px solid var(--lib-line);
  border-radius: 12px;
  padding: 12px 14px;
}

.lib-hero-search button,
.lib-inline-search button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--lib-accent), var(--lib-accent-dark));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.lib-hero-copy,
.lib-muted,
.lib-desc {
  color: var(--lib-muted);
}

.lib-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.lib-stat-card {
  background: var(--lib-card);
  border: 1px solid var(--lib-line);
  border-radius: 16px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--lib-shadow);
}

.lib-stat-card:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.lib-stat-icon { font-size: 1.6rem; }
.lib-stat-label { font-weight: 800; margin-top: 8px; color: #1a2b3c; }
.lib-stat-count { color: var(--lib-muted); font-size: 0.92rem; margin-top: 4px; }

.lib-feature-grid,
.lib-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.lib-panel {
  background: var(--lib-card);
  border: 1px solid var(--lib-line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--lib-shadow);
}

.lib-panel-accent {
  background: linear-gradient(180deg, #fff8ee 0%, #ffffff 100%);
  border-color: rgba(255, 140, 66, 0.18);
}

.lib-panel h2,
.lib-section-title,
.lib-page-head h1 {
  margin: 0 0 12px;
  color: #1a2b3c;
}

.lib-page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.lib-inline-search {
  display: flex;
  gap: 8px;
}

.lib-inline-search input {
  min-width: 220px;
  border: 1px solid var(--lib-line);
  border-radius: 10px;
  padding: 10px 12px;
}

.lib-breadcrumb {
  color: var(--lib-muted);
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.lib-id-line { color: var(--lib-muted); }

.lib-table-wrap {
  overflow: auto;
  background: var(--lib-card);
  border: 1px solid var(--lib-line);
  border-radius: 16px;
  box-shadow: var(--lib-shadow);
}

.lib-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.lib-table th,
.lib-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--lib-line);
  text-align: left;
  vertical-align: top;
}

.lib-table th {
  background: #f7fbff;
  color: var(--lib-muted);
  font-size: 0.88rem;
  text-transform: uppercase;
}

.lib-meta-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 14px;
  margin: 18px 0 0;
}

.lib-meta-list dt { color: var(--lib-muted); font-weight: 700; }
.lib-meta-list dd { margin: 0; }

.lib-result-list { display: grid; gap: 10px; }

.lib-result-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--lib-card);
  border: 1px solid var(--lib-line);
  border-radius: 14px;
  color: inherit;
  box-shadow: var(--lib-shadow);
}

.lib-result-type {
  color: var(--lib-accent-dark);
  font-weight: 800;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.lib-result-name { font-weight: 800; color: #1a2b3c; }
.lib-result-meta { color: var(--lib-muted); font-size: 0.92rem; }

.lib-empty {
  background: var(--lib-card-soft);
  border: 1px dashed var(--lib-line);
  border-radius: 16px;
  padding: 28px;
}

.lib-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.lib-pagination a,
.lib-pagination span {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--lib-line);
  color: #1a2b3c;
}

.lib-pagination .is-active {
  background: linear-gradient(135deg, var(--lib-accent), var(--lib-accent-dark));
  color: #fff;
  font-weight: 800;
}

@media (max-width: 920px) {
  .lib-subnav-inner {
    grid-template-columns: 1fr;
  }
  .lib-subnav-search {
    min-width: 0;
    width: 100%;
  }
  .lib-result-item {
    grid-template-columns: 1fr;
  }
}
