:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-soft: #f7f8fc;
  --sidebar: #ffffff;
  --text: #263445;
  --muted: #7e8ba0;
  --line: #dde4ee;
  --blue: #7dd3fc;
  --theme: #38bdf8;
  --theme-strong: #0284c7;
  --theme-soft: rgba(56, 189, 248, 0.12);
  --theme-mist: #f4f6fb;
  --shadow: 0 16px 42px rgba(32, 48, 78, 0.08);
  --topbar-height: 0px;
  --sidebar-width: 198px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei UI", "HarmonyOS Sans SC", "Source Han Sans SC", sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
  padding-bottom: 24px;
  background:
    radial-gradient(circle at 78% 8%, rgba(56, 189, 248, 0.14), transparent 26%),
    radial-gradient(circle at 22% 0%, rgba(255, 205, 143, 0.12), transparent 24%),
    linear-gradient(180deg, #f7f9fc 0%, #edf1f7 100%);
}

.site-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 12px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(226, 233, 243, 0.84);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.72)),
    radial-gradient(circle at 14% 0%, rgba(56, 189, 248, 0.12), transparent 34%);
  box-shadow: 0 10px 24px rgba(31, 43, 66, 0.045);
  backdrop-filter: blur(14px);
}

.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.top-brand-name {
  overflow: hidden;
  color: #22324a;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-sidebar-toggle {
  display: none;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.drawer-backdrop {
  display: none;
}

.sidebar {
  grid-column: 1;
  grid-row: 2 / span 2;
  position: sticky;
  z-index: 10;
  top: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--sidebar-width);
  height: calc(100vh - 104px);
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(228, 234, 243, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(31, 43, 66, 0.07);
  backdrop-filter: blur(16px);
  padding: 12px 0;
}

.category-rail {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0 10px;
  overflow-y: auto;
  overflow-x: hidden;
}

.category-item {
  display: grid;
  gap: 4px;
}

.category-tab,
.side-admin {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 34px;
  padding: 0 18px 0 28px;
  background: transparent;
  color: #707b8f;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.category-tab:hover,
.category-tab.is-active {
  color: var(--category-accent, #30405e);
  background: linear-gradient(90deg, var(--category-soft, var(--theme-soft)), rgba(255, 255, 255, 0));
}

.category-tab.is-active {
  box-shadow: inset 3px 0 0 var(--category-accent, var(--theme));
}

.category-tab:hover {
  box-shadow: inset 2px 0 0 var(--category-accent, var(--theme));
}

.subcategory-rail {
  display: none;
  gap: 5px;
  padding: 4px 14px 2px 34px;
}

.category-item.is-expanded .subcategory-rail {
  display: grid;
}

.subcategory-tab {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #72819a;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  transition: all 0.18s ease;
}

.subcategory-tab::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.52;
  transform: translateY(-50%);
}

.subcategory-tab:hover,
.subcategory-tab.is-active {
  border-color: rgba(0, 0, 0, 0);
  background: linear-gradient(90deg, var(--category-soft, rgba(56, 189, 248, 0.12)), rgba(255, 255, 255, 0));
  color: var(--category-accent, #0284c7);
  box-shadow: inset 2px 0 0 var(--category-accent, var(--theme));
}

.subcategory-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #738196;
  font-size: 15px;
  font-weight: 700;
}

.side-icon-alpha {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--category-soft, #e0f2fe), #ffffff);
  color: var(--category-accent, var(--theme-strong));
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.side-icon img,
.section-dot img {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.has-image-icon .side-icon-alpha {
  border: 1px solid var(--category-soft, #e0f2fe);
  background: #ffffff;
}

.has-image-icon .section-dot {
  border: 1px solid var(--category-soft, rgba(56, 189, 248, 0.16));
  background: #ffffff;
  color: var(--category-accent, var(--theme));
}

.has-image-icon .category-tab:hover .side-icon,
.has-image-icon .category-tab.is-active .side-icon {
  background: #ffffff;
}

.side-admin {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  min-height: 0;
  margin: 6px 0 0 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8d97aa;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.2;
}

.side-admin__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: currentColor;
}

.side-admin__icon svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-tab:hover .side-icon,
.category-tab.is-active .side-icon {
  color: var(--category-accent, var(--theme-strong));
}

.side-admin:hover {
  color: var(--theme-strong);
  background: transparent;
  transform: none;
}

.main-area {
  display: contents;
}

.hero-poster {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: none;
  min-height: 136px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(231, 236, 244, 0.92);
  border-color: rgba(221, 229, 241, 0.82);
  border-radius: 22px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.04) 48%, rgba(255, 246, 233, 0.22)),
    url("/assets/poster-bg.svg") center / cover no-repeat,
    linear-gradient(120deg, #eef7ff 0%, #f8fbff 50%, #fff4e5 100%);
  box-shadow: 0 12px 28px rgba(33, 45, 68, 0.06);
}

.hero-poster::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.hero-poster::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -74px;
  width: 300px;
  height: 144px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.62), transparent 34%),
    linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(255, 191, 112, 0.16));
  filter: blur(2px);
  opacity: 0.78;
  pointer-events: none;
}

.hero-poster .search-hero {
  position: relative;
  z-index: 1;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.brand-mark i {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 4px 15px 4px 15px;
  opacity: 0.94;
}

.brand-mark i:nth-child(1) {
  top: 0;
  left: 8px;
  background: #f06a3d;
  transform: rotate(45deg);
}

.brand-mark i:nth-child(2) {
  top: 8px;
  right: 0;
  background: #f5b437;
  transform: rotate(135deg);
}

.brand-mark i:nth-child(3) {
  bottom: 0;
  left: 8px;
  background: #2fb8ba;
  transform: rotate(225deg);
}

.brand-mark i:nth-child(4) {
  top: 8px;
  left: 0;
  background: #38bdf8;
  transform: rotate(315deg);
}

.search-hero {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1420px;
  margin: 0;
}

.hero-poster .search-hero {
  position: absolute;
  right: auto;
  top: 50%;
  bottom: auto;
  left: 50%;
  width: min(760px, calc(100% - 44px));
  transform: translate(-50%, -50%);
  margin: 0;
  max-width: none;
  justify-content: center;
}

.search-wrap {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 42px;
  align-items: center;
  width: min(720px, 100%);
  height: 46px;
  padding: 0 8px 0 12px;
  border: 1px solid #e3e7ef;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(31, 43, 66, 0.04), inset 0 0 0 1px var(--theme-strong-soft);
}

.hero-poster .search-wrap {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 24px rgba(31, 43, 66, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px) saturate(145%);
}

.search-engine {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--theme), var(--theme-strong));
  box-shadow: 0 8px 18px var(--theme-glow);
  color: #ffffff;
  position: relative;
}

.search-engine::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 999px;
  transform: translate(-1px, -1px);
}

.search-engine::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(5px, 5px) rotate(45deg);
  transform-origin: left center;
}

.search-wrap input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  color: #536174;
  background: transparent;
  font-size: 14px;
}

.search-wrap input::placeholder {
  color: #c3c9d3;
}

.hero-poster .search-wrap input {
  color: #36475f;
}

.hero-poster .search-wrap input::placeholder {
  color: rgba(75, 93, 118, 0.58);
}

.search-wrap button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: transparent;
  color: #c4cad4;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.search-wrap:focus-within {
  border-color: var(--theme);
  box-shadow: 0 10px 30px var(--theme-glow), inset 0 0 0 1px var(--theme-strong-line);
}

.search-filters {
  position: absolute;
  right: 18px;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 36px);
  overflow-x: auto;
  scrollbar-width: none;
  transform: translateY(-50%);
}

.search-filters::-webkit-scrollbar {
  display: none;
}

.search-filters select {
  flex: 0 0 auto;
  height: 36px;
  max-width: 150px;
  border: 1px solid rgba(218, 227, 239, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #5d6b82;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  padding: 0 30px 0 14px;
  backdrop-filter: blur(10px);
}

.bulk-toolbar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: calc(var(--sidebar-width) + 32px);
  z-index: 75;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(218, 227, 239, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(31, 43, 66, 0.08);
  backdrop-filter: blur(14px);
}

.bulk-toolbar strong {
  color: #33435a;
  font-size: 13px;
  white-space: nowrap;
}

.bulk-toolbar select,
.bulk-toolbar button {
  height: 30px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
}

.bulk-toolbar select {
  min-width: 116px;
  border: 1px solid rgba(218, 227, 239, 0.96);
  background: #ffffff;
  color: #526178;
  padding: 0 8px;
}

.bulk-toolbar button {
  padding: 0 10px;
  background: var(--theme-soft);
  color: var(--theme-strong);
  cursor: pointer;
}

.content-panel {
  grid-column: 2;
  grid-row: 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

.link-section {
  min-width: 0;
  overflow-x: hidden;
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  animation: sectionIn 0.38s ease both;
  scroll-margin-top: 84px;
}

.link-section + .link-section {
  padding-top: 14px;
  border-top: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--theme-strong-soft);
}

.section-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-dot {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--category-accent, #38bdf8), var(--category-soft, #bae6fd));
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 6px 14px var(--category-soft, rgba(56, 189, 248, 0.16));
}

.sub-section {
  min-width: 0;
  margin-bottom: 12px;
  animation: sectionIn 0.22s ease both;
}

.sub-section:last-child {
  margin-bottom: 0;
}

.sub-section.is-collapsed {
  display: none;
}

.sub-tabs {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
  margin: 2px 0 10px;
  padding: 4px 5px;
  border: 1px solid var(--theme-strong-soft);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), var(--theme-soft));
  box-shadow: 0 10px 24px rgba(34, 48, 74, 0.04), inset 0 0 0 1px rgba(255, 255, 255, 0.94);
}

.sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #617284;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.18s ease;
}

.sub-tab b {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #eef2f5;
  color: #7f8b99;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.sub-tab:hover,
.sub-tab.is-active {
  border-color: var(--category-soft, rgba(56, 189, 248, 0.22));
  background: #ffffff;
  color: var(--category-accent, #0284c7);
  box-shadow: 0 10px 24px var(--category-soft, rgba(2, 132, 199, 0.08));
}

.sub-tab.is-active::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--category-accent, var(--theme));
  box-shadow: 0 0 0 4px var(--category-soft, rgba(56, 189, 248, 0.16));
}

.sub-tab.is-active {
  transform: translateY(-1px);
}

.sub-tab:hover b,
.sub-tab.is-active b {
  background: var(--category-soft, #e0f2fe);
  color: var(--category-accent, #0284c7);
}

.panel-stack {
  display: block;
  min-width: 0;
}

.subcategory-panel {
  min-width: 0;
  animation: sectionIn 0.24s ease both;
}

.section-head h2,
.section-head p {
  margin: 0;
}

.section-head h2 {
  color: #5f6b7d;
  font-size: 13px;
  font-weight: 700;
}

.section-head p {
  color: #a2adbd;
  font-size: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-width: 0;
  gap: 8px;
}

.bookmark-card-shell {
  position: relative;
  min-width: 0;
}

.bookmark-card-shell.is-dragging {
  opacity: 0.55;
}

.bookmark-select {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  display: inline-flex;
  width: 18px;
  height: 18px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.bookmark-card-shell:hover .bookmark-select,
.bookmark-select:has(input:checked) {
  opacity: 1;
}

.bookmark-select input {
  position: absolute;
  opacity: 0;
}

.bookmark-select span {
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(183, 196, 216, 0.9);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 14px rgba(32, 48, 78, 0.12);
}

.bookmark-select input:checked + span {
  border-color: var(--theme-strong);
  background: var(--theme-strong);
}

.bookmark-select input:checked + span::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  margin: 5px 0 0 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.bookmark-card {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 54px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(223, 230, 239, 0.96);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.bookmark-card::after {
  content: "";
  position: absolute;
  inset: auto -42px -46px auto;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: var(--card-hover-soft, rgba(56, 189, 248, 0.18));
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.bookmark-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-hover-border, rgba(56, 189, 248, 0.28));
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(35, 45, 62, 0.14);
}

.bookmark-card:hover::after {
  opacity: 1;
  transform: scale(1.22);
}

.card-qr-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--theme-strong);
  cursor: pointer;
  opacity: 0;
  transform: translateY(5px);
  box-shadow: 0 6px 18px rgba(32, 48, 78, 0.12);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.bookmark-card-shell:hover .card-qr-button,
.card-qr-button:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.card-qr-button:hover,
.card-qr-button:focus-visible {
  background: var(--theme-strong);
  color: #ffffff;
}

.qr-glyph {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
}

.qr-glyph i {
  position: absolute;
  display: block;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.qr-glyph i:nth-child(1) {
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
}

.qr-glyph i:nth-child(2) {
  top: 0;
  right: 0;
  width: 4px;
  height: 4px;
}

.qr-glyph i:nth-child(3) {
  right: 0;
  bottom: 0;
  width: 6px;
  height: 6px;
}

.qr-glyph i:nth-child(4) {
  left: 1px;
  bottom: 1px;
  width: 2px;
  height: 2px;
  border-width: 1px;
}

.qr-glyph i:nth-child(5) {
  top: 6px;
  left: 7px;
  width: 2px;
  height: 2px;
  border-width: 1px;
}

.card-icon {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  align-self: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--theme-strong);
  font-size: 13px;
  font-weight: 700;
}

.card-icon img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 7px;
}

.card-icon.is-default {
  background: transparent;
}

.card-icon.is-default img {
  width: 34px;
  height: 34px;
  border-radius: 0;
}

.card-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 28px;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.card-content strong,
.card-content em {
  display: block;
}

.card-content small {
  display: none;
}

.card-content mark {
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(255, 214, 102, 0.55);
  color: inherit;
}

.card-content strong {
  overflow: hidden;
  color: #22324b;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-content em {
  margin-top: 1px;
  color: #8a97ac;
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-style: normal;
  line-height: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.card-tag {
  display: none;
}

.empty-state {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  min-height: 180px;
  color: #95a0b2;
}

.empty-state strong {
  color: #4a5568;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 34, 52, 0.32);
  backdrop-filter: blur(10px);
}

.qr-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  border: 1px solid rgba(225, 232, 241, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 54px rgba(31, 44, 70, 0.18);
}

.qr-dialog strong {
  font-size: 18px;
  color: #21304a;
}

.qr-url {
  color: #748397;
  font-size: 12px;
  word-break: break-all;
}

.qr-image-wrap {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
}

.qr-image-wrap img {
  display: block;
  width: min(220px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: #ffffff;
  object-fit: contain;
}

.qr-dialog p {
  margin: 0;
  color: #7d8b9f;
  font-size: 12px;
}

.qr-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f2f5fa;
  color: #6b7a8f;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.bookmark-context-menu {
  position: fixed;
  z-index: 90;
  display: grid;
  min-width: 132px;
  padding: 6px;
  border: 1px solid rgba(218, 227, 239, 0.96);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(31, 44, 70, 0.18);
  backdrop-filter: blur(12px);
}

.bookmark-context-menu button {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: transparent;
  color: #4f6078;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.bookmark-context-menu button:hover {
  background: var(--theme-soft, rgba(56, 189, 248, 0.12));
  color: var(--theme-strong);
}

.bookmark-context-menu button[data-context-action="delete"]:hover {
  background: rgba(199, 76, 76, 0.1);
  color: #b93f4f;
}

.bookmark-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.bookmark-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 34, 52, 0.32);
  backdrop-filter: blur(10px);
}

.bookmark-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(224, 232, 243, 0.92);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 70px rgba(31, 44, 70, 0.2);
}

.bookmark-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bookmark-dialog__head div {
  display: grid;
  gap: 2px;
}

.bookmark-dialog__head span {
  color: #8794a7;
  font-size: 11px;
  font-weight: 800;
}

.bookmark-dialog__head strong {
  color: #22324b;
  font-size: 18px;
  line-height: 1.2;
}

.bookmark-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f2f5fa;
  color: #6b7a8f;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.front-bookmark-preview {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(225, 232, 241, 0.9);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcff 0%, #f7f9fc 100%);
}

.bookmark-preview-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
}

.bookmark-preview-icon img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.bookmark-preview-icon.is-default img {
  width: 40px;
  height: 40px;
  border-radius: 0;
}

.front-bookmark-preview div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.front-bookmark-preview strong,
.front-bookmark-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.front-bookmark-preview strong {
  color: #22324b;
  font-size: 14px;
}

.front-bookmark-preview span {
  color: #7d8b9f;
  font-size: 12px;
}

.bookmark-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bookmark-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.bookmark-field.is-wide {
  grid-column: 1 / -1;
}

.bookmark-field > span {
  color: #66758c;
  font-size: 12px;
  font-weight: 800;
}

.bookmark-field input,
.bookmark-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(218, 227, 239, 0.96);
  border-radius: 11px;
  outline: none;
  background: #ffffff;
  color: #263445;
  font-size: 13px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.bookmark-field input:focus,
.bookmark-field select:focus {
  border-color: var(--theme-strong-line, rgba(2, 132, 199, 0.28));
  box-shadow: 0 0 0 3px var(--theme-strong-soft, rgba(2, 132, 199, 0.16));
}

.bookmark-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bookmark-modal-actions [data-bookmark-status] {
  flex: 1 1 180px;
  overflow: hidden;
  color: #7d8b9f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-modal-actions [data-type="success"] {
  color: #2f8f6b;
}

.bookmark-modal-actions [data-type="error"] {
  color: #c74c4c;
}

.front-primary-button,
.front-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.front-primary-button {
  background: var(--theme-strong);
  color: #ffffff;
  box-shadow: 0 12px 24px var(--theme-strong-soft, rgba(2, 132, 199, 0.18));
}

.front-secondary-button {
  border: 1px solid rgba(218, 227, 239, 0.96);
  background: #ffffff;
  color: #4f6078;
}

.front-primary-button:hover,
.front-secondary-button:hover {
  transform: translateY(-1px);
}

.front-primary-button:disabled,
.front-secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.front-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(225, 232, 241, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #526178;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 18px 42px rgba(31, 44, 70, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.front-toast.is-info,
.front-toast.is-success,
.front-toast.is-error {
  opacity: 1;
  transform: translate(-50%, 0);
}

.front-toast.is-success {
  color: #2f8f6b;
}

.front-toast.is-error {
  color: #c74c4c;
}

[hidden] {
  display: none !important;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 210px;
  }

  .hero-poster {
    min-height: 128px;
  }

  .search-wrap {
    width: min(760px, 78vw);
  }

  .card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    background: #f1f2f4;
  }

  body.drawer-open {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    padding-bottom: 24px;
  }

  .hero-poster {
    grid-column: 1;
    grid-row: 2;
    min-height: 126px;
    border-radius: 20px;
  }

  .hero-poster::after {
    right: -92px;
    bottom: -92px;
    width: 260px;
    height: 150px;
  }

  .top-brand-name {
    font-size: 16px;
  }

  .site-topbar {
    grid-column: 1;
    grid-row: 1;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 18px;
  }

  .mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(221, 229, 241, 0.92);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #526178;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(31, 43, 66, 0.05);
  }

  .mobile-sidebar-toggle > span:first-child {
    position: relative;
    width: 13px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
  }

  .mobile-sidebar-toggle > span:first-child::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 0;
    width: 13px;
    border-top: 2px solid currentColor;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 58;
    display: block;
    background: rgba(24, 34, 52, 0.24);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(6px);
    transition: opacity 0.2s ease;
  }

  body.drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: min(82vw, 286px);
    height: 100dvh;
    min-height: 0;
    border-radius: 0 24px 24px 0;
    transform: translateX(calc(-100% - 18px));
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    padding: 16px 0 14px;
    box-shadow: 24px 0 60px rgba(31, 43, 66, 0);
  }

  body.drawer-open .sidebar {
    transform: translateX(0);
    box-shadow: 24px 0 60px rgba(31, 43, 66, 0.18);
  }

  .category-rail {
    flex-direction: column;
    gap: 7px;
    padding: 8px 0 12px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .category-tab {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0 16px 0 22px;
    border-radius: 0;
    background: transparent;
  }

  .subcategory-rail {
    padding: 3px 14px 2px 32px;
  }

  .side-admin {
    display: flex;
    gap: 5px;
    margin: 8px 0 0 22px;
  }

  .hero-poster .search-hero {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(100% - 28px, 760px);
    transform: translate(-50%, -50%);
  }

  .hero-poster .search-wrap {
    width: 100%;
    height: 46px;
  }

  .search-filters {
    top: auto;
    right: 14px;
    bottom: 10px;
    left: 14px;
    max-width: none;
    transform: none;
  }

  .bulk-toolbar {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bulk-toolbar::-webkit-scrollbar {
    display: none;
  }

  .sub-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px;
    white-space: nowrap;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .sub-tabs::-webkit-scrollbar {
    display: none;
  }

  .sub-tab {
    flex: 0 0 auto;
    min-width: max-content;
    scroll-snap-align: start;
  }

  .content-panel {
    grid-column: 1;
    grid-row: 3;
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .bookmark-dialog {
    align-self: end;
    width: 100%;
    max-height: calc(100dvh - 18px);
    border-radius: 20px 20px 0 0;
    padding: 14px;
  }

  .bookmark-form-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .bookmark-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .bookmark-modal-actions [data-bookmark-status] {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .top-brand {
    gap: 10px;
  }

  .top-brand-name {
    font-size: 15px;
  }

  .search-wrap {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    height: 52px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 380px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
