:root {
  --ink: #0f172a;
  --muted: #7a8497;
  --blue: #2f66ff;
  --blue-soft: #eaf1ff;
  --line: #e8edf7;
  --paper: #fff;
  --bg: #f8fbff;
  --shadow: 0 18px 52px rgba(28, 43, 79, .1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }

.library-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 80px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 40px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.library-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #5868ff 0 35%, #27b7ee 36% 62%, #82e4cf 63%);
  clip-path: polygon(24% 0, 56% 0, 100% 100%, 68% 100%, 51% 59%, 36% 100%, 0 100%);
  box-shadow: 0 12px 24px rgba(47, 102, 255, .22);
}
.library-brand strong { display: block; font-size: 22px; line-height: 1; }
.library-brand em { display: block; margin-top: 4px; color: #4d5668; font-size: 13px; font-style: normal; }
.library-nav {
  display: flex;
  justify-content: center;
  flex: 1;
  gap: clamp(28px, 5vw, 76px);
  font-size: 17px;
  font-weight: 800;
}
.library-nav a { padding: 28px 4px; color: #10172b; }
.library-nav a.active, .library-nav a:hover { color: var(--blue); }
.library-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.case-link, .create-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 800;
}
.case-link {
  color: var(--blue);
  border: 1px solid var(--blue);
  background: #fff;
}
.create-link {
  color: #fff;
  background: #111b35;
  box-shadow: 0 12px 28px rgba(17, 27, 53, .2);
}
.library-account { position: relative; }
.account-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.account-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  background: linear-gradient(145deg, #f4d2c2, #6b88ff);
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid #607089;
  border-bottom: 2px solid #607089;
  transform: rotate(45deg) translateY(-2px);
}
.account-menu {
  position: absolute;
  top: 58px;
  right: 0;
  width: 230px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.account-menu strong, .account-menu span, .account-menu a { display: block; }
.account-menu span { margin: 6px 0 14px; color: var(--muted); font-size: 13px; }
.account-menu a { padding-top: 12px; border-top: 1px solid var(--line); color: var(--blue); font-weight: 800; }

.library-page {
  min-height: calc(100vh - 80px);
  background:
    radial-gradient(circle at 84% 8%, rgba(47, 102, 255, .12), transparent 26%),
    linear-gradient(180deg, #f9fbff 0%, #fff 46%, #f9fbff 100%);
}
.library-hero {
  position: relative;
  padding: 58px 24px 48px;
  overflow: hidden;
  text-align: center;
}
.hero-shape {
  position: absolute;
  top: 0;
  right: 0;
  width: 330px;
  height: 230px;
  border-bottom-left-radius: 100%;
  background: linear-gradient(145deg, rgba(47, 102, 255, .12), rgba(47, 102, 255, .03));
}
.library-hero h1 {
  position: relative;
  margin: 0;
  font-size: 58px;
  line-height: 1.1;
  letter-spacing: 0;
}
.library-hero p {
  position: relative;
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 19px;
}
.library-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(900px, calc(100vw - 48px));
  height: 82px;
  margin: 0 auto;
  padding: 0 38px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 24px 52px rgba(52, 73, 113, .12);
}
.library-search span {
  width: 25px;
  height: 25px;
  margin-right: 24px;
  border: 3px solid #73809a;
  border-radius: 50%;
}
.library-search span::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 3px;
  margin: 20px 0 0 -2px;
  border-radius: 999px;
  background: #73809a;
  transform: rotate(45deg);
}
.library-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 20px;
}
.library-search input::placeholder { color: #7e889d; }

.library-content {
  width: min(1500px, calc(100% - 72px));
  margin: 0 auto;
  padding: 16px 0 78px;
}
.category-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 18px;
  margin-bottom: 42px;
}
.category-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #788397;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 28px rgba(35, 52, 83, .04);
  cursor: pointer;
}
.category-tabs button span { color: #8a96aa; font-size: 22px; }
.category-tabs button.active {
  color: var(--blue);
  border-color: rgba(47, 102, 255, .48);
  background: #fff;
}
.category-tabs button.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 44px;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: var(--blue);
  transform: translateX(-50%);
}
.asset-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.asset-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 47, 81, .08);
}
.asset-thumb {
  aspect-ratio: 1 / 1.07;
  overflow: hidden;
  background: var(--blue-soft);
}
.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.asset-card:hover .asset-thumb img { transform: scale(1.04); }
.asset-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 16px;
}
.asset-meta strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}
.asset-meta button {
  width: 28px;
  height: 28px;
  border: 0;
  color: #8590a6;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.empty-assets {
  grid-column: 1 / -1;
  padding: 44px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

@media (max-width: 1180px) {
  .library-header { padding: 0 22px; gap: 18px; }
  .library-nav { gap: 22px; }
  .case-link, .create-link { padding: 0 16px; }
  .asset-cards { grid-template-columns: repeat(3, 1fr); }
  .category-tabs { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 760px) {
  .library-header { height: auto; flex-wrap: wrap; padding: 14px 16px; }
  .library-brand { min-width: 0; }
  .library-nav { order: 3; width: 100%; justify-content: space-between; gap: 8px; font-size: 14px; }
  .library-nav a { padding: 10px 0; }
  .library-actions { margin-left: auto; }
  .case-link, .create-link { display: none; }
  .library-hero { padding-top: 38px; }
  .library-hero h1 { font-size: 42px; }
  .library-search { height: 62px; padding: 0 22px; }
  .library-search input { font-size: 16px; }
  .library-content { width: min(100% - 28px, 1500px); }
  .category-tabs { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .asset-cards { grid-template-columns: 1fr; }
}
