:root {
  color-scheme: dark;
  --bg: #0f1318;
  --bg-soft: #131821;
  --panel: #171d26;
  --panel-2: #1f2632;
  --panel-3: #252e3c;
  --text: #eef2f6;
  --muted: #9aa4b2;
  --line: #2a3240;
  --accent: #2bd4c8;
  --accent-strong: #14b6a9;
  --accent-warm: #f4b33a;
  --success: #4ade80;
  --shadow: 0 18px 40px rgba(6, 10, 16, 0.35);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --card-min-height: 110px;
}

* {
  box-sizing: border-box;
}

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  padding: 8px 12px;
  background: var(--accent);
  color: #081117;
  border-radius: 10px;
  z-index: 10;
  transition: 0.2s ease;
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 18% 8%, rgba(43, 212, 200, 0.28), transparent 52%),
    radial-gradient(circle at 82% 12%, rgba(120, 90, 255, 0.2), transparent 48%),
    radial-gradient(circle at 16% 86%, rgba(244, 179, 58, 0.18), transparent 55%),
    linear-gradient(160deg, #0a0f16 0%, #0c121c 45%, #0f1824 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 120px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 120px
    );
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 70% 20%, rgba(43, 212, 200, 0.2), transparent 42%),
    radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.05), transparent 48%),
    conic-gradient(from 120deg at 30% 40%, rgba(0, 255, 255, 0.1), transparent 40%, rgba(244, 179, 58, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: glow-float 16s ease-in-out infinite;
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #121721 0%, #0e141d 100%);
  border-right: 1px solid var(--line);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #1e7f86);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.25);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.2s ease;
}

.sidebar-link.static {
  cursor: default;
  opacity: 0.7;
}

.sidebar-link.static:hover {
  border-color: var(--line);
  background: var(--panel);
}

.sidebar-link.active,
.sidebar-link:hover {
  border-color: rgba(43, 212, 200, 0.4);
  background: var(--panel-2);
}

.section-title {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  color: rgba(154, 164, 178, 0.7);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: 0.2s ease;
  position: relative;
}

.menu-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: transparent;
  transition: 0.2s ease;
}

.menu-item span {
  color: var(--muted);
  font-size: 12px;
}

.menu-item:hover,
.menu-item.active {
  background: var(--panel-2);
  border-color: rgba(43, 212, 200, 0.3);
  color: #ffffff;
}

.menu-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(43, 212, 200, 0.6);
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-hint {
  font-size: 12px;
  color: var(--muted);
}

.footer-actions {
  display: flex;
  gap: 10px;
}

.main {
  padding: 28px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(1280px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  position: sticky;
  top: 16px;
  z-index: 5;
  padding: 14px 16px;
  background: rgba(14, 19, 28, 0.78);
  border: 1px solid rgba(42, 50, 64, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 40px rgba(5, 10, 18, 0.25);
  backdrop-filter: blur(18px);
}

.topbar-ai {
  border-radius: var(--radius-xl);
  padding: 14px 18px;
  box-shadow: 0 24px 60px rgba(5, 10, 18, 0.35);
  background: linear-gradient(135deg, rgba(24, 30, 40, 0.98), rgba(12, 16, 22, 0.98));
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand strong {
  font-size: 16px;
}

.topbar-brand span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.topbar-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.topbar-nav a,
.topbar-actions a {
  display: inline-flex;
  align-items: center;
}

.topbar-nav .ghost,
.topbar-actions .ghost {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.ghost:disabled {
  opacity: 0.6;
  cursor: default;
  border-color: var(--line);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  padding: 12px 6px 0;
}

.hero-content {
  background: linear-gradient(160deg, rgba(23, 29, 38, 0.8), rgba(19, 24, 33, 0.8));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 26px 30px;
  box-shadow: var(--shadow);
}

.hero-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.25;
}

.hero-desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-metrics {
  display: grid;
  gap: 14px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: grid;
  gap: 6px;
}

.metric strong {
  font-size: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ad-slot {
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(43, 212, 200, 0.4);
  background: rgba(15, 19, 24, 0.6);
  padding: 18px;
  display: grid;
  gap: 8px;
  width: 100%;
}

.adsbygoogle {
  width: 100%;
  min-height: 90px;
}

.ad-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(154, 164, 178, 0.7);
}

.ad-body {
  color: var(--text);
  font-size: 14px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.about-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.about-grid h4 {
  margin: 0 0 8px;
}

.about-grid p {
  margin: 0;
  color: var(--muted);
}

.search-hub {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(22, 28, 38, 0.96), rgba(10, 15, 22, 0.98));
  border: 1px solid rgba(42, 52, 66, 0.6);
  box-shadow: 0 20px 60px rgba(5, 9, 16, 0.35);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-tabs .tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.search-tabs .tab.active {
  border-color: rgba(43, 212, 200, 0.5);
  color: var(--text);
  background: rgba(43, 212, 200, 0.18);
}

.search-wide {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-wide .search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 16px;
  border-radius: 10px;
}

.link-more {
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.link-more:hover {
  color: var(--text);
  background: rgba(43, 212, 200, 0.12);
}

.search-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.trending-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.trending-row strong {
  color: var(--text);
  font-weight: 600;
}

.trending-words {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.trending-chip {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text);
}

.search-toolbar .actions {
  margin-left: auto;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-right: 10px;
}

.filters .ghost {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
}

.toggle-filter {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.toggle-filter input {
  accent-color: var(--accent);
}

.search-summary {
  font-size: 12px;
  color: var(--muted);
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}



.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-head .section-link {
  font-size: 12px;
  color: var(--muted);
}

.section-head h3 {
  margin: 0;
  font-size: 20px;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
}

.section-head.compact h4 {
  margin: 0;
  font-size: 16px;
}

.section-head.compact span {
  font-size: 12px;
  color: var(--muted);
}

.category-block {
  scroll-margin-top: 120px;
}

.sync-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(42, 50, 64, 0.6);
  background: rgba(15, 19, 24, 0.4);
}

.sync-status.is-loading {
  color: var(--text);
  border-color: rgba(43, 212, 200, 0.45);
  background: rgba(43, 212, 200, 0.08);
}

.sync-status.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(43, 212, 200, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.category-sections {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.category-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(42, 50, 64, 0.6);
  background: rgba(16, 21, 30, 0.8);
}

.search {
  flex: 1;
  position: relative;
}

.search input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 48px 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.3);
}

.search-wide input {
  padding-right: 110px;
}

.search input:focus {
  outline: 1px solid rgba(43, 212, 200, 0.6);
}

.kbd {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-2);
}

.search-wide .kbd {
  right: 110px;
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  border: none;
  font-family: inherit;
}

.ghost {
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 0.2s ease;
}

.ghost:hover {
  border-color: rgba(43, 212, 200, 0.4);
  color: #fff;
}

.primary {
  background: linear-gradient(135deg, var(--accent), #1e9a93);
  color: #061516;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(20, 182, 169, 0.2);
}

.primary:hover {
  filter: brightness(1.05);
}

.primary:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.chip-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-toolbar .chip-bar {
  flex: 1;
}

.chip {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 14px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 11px;
  line-height: 1;
}

.chip.active {
  background: rgba(43, 212, 200, 0.2);
  color: var(--text);
  border-color: rgba(43, 212, 200, 0.4);
  box-shadow: 0 8px 18px rgba(43, 212, 200, 0.2);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.search-hub .stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
}

.stat-card strong {
  font-size: 20px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.tags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: minmax(var(--card-min-height), auto);
  gap: 16px;
}

.ad-card {
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(43, 212, 200, 0.35);
  background: rgba(18, 24, 34, 0.6);
  padding: 16px;
  display: grid;
  gap: 8px;
  min-height: 110px;
  align-content: center;
}

.ad-card .ad-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(154, 164, 178, 0.7);
}

.ad-card .ad-body {
  font-size: 13px;
  color: var(--text);
}

.tags.grouped {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tags.masonry {
  display: block;
  column-count: 3;
  column-gap: 18px;
}

.tags.masonry .tag-card {
  break-inside: avoid;
  margin-bottom: 18px;
  min-height: auto;
}

.tags.masonry .tag-desc {
  -webkit-line-clamp: 5;
  min-height: 0;
}

.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: minmax(var(--card-min-height), auto);
  gap: 16px;
}

.group-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.tag-card {
  background: linear-gradient(160deg, #1b2230 0%, #121a25 100%);
  border: 1px solid rgba(42, 51, 66, 0.9);
  padding: 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  animation: card-in 0.5s ease backwards;
  animation-delay: calc(var(--i, 0) * 0.03s);
  min-height: var(--card-min-height);
  cursor: pointer;
  height: 100%;
}

.tag-card .tag-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.tag-card.compact {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 104px;
  background: linear-gradient(145deg, rgba(22, 29, 40, 0.96), rgba(12, 18, 26, 0.98));
  border: 1px solid rgba(42, 52, 66, 0.8);
  box-shadow: 0 16px 36px rgba(6, 10, 18, 0.25);
}

.tag-card.compact:hover {
  border-color: rgba(43, 212, 200, 0.35);
  background: linear-gradient(145deg, rgba(25, 34, 48, 0.98), rgba(14, 20, 30, 0.98));
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(6, 10, 18, 0.35);
}

.tag-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(20, 28, 40, 0.95), rgba(12, 18, 26, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  flex: 0 0 auto;
}

.tag-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: auto;
}

.tag-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.tag-flame {
  font-size: 14px;
  margin-left: 6px;
}

@media (max-width: 900px) {
  .tag-row.compact {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

.tag-badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-actions .ghost,
.tag-actions .primary {
  padding: 6px 10px;
  font-size: 12px;
}

.mini-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-card.compact .tag-title {
  font-size: 15px;
}

.tag-card.compact .tag-desc {
  font-size: 12px;
  -webkit-line-clamp: 1;
  min-height: auto;
}

.tag-card.compact .tag-cover,
.tag-card.compact .tag-header,
.tag-card.compact .tag-badges,
.tag-card.compact .tag-meta {
  display: none;
}

.tag-cover {
  position: relative;
  height: var(--cover-height, 120px);
  border-radius: 14px;
  overflow: hidden;
  padding: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, rgba(43, 212, 200, 0.4), rgba(120, 90, 255, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tag-cover.has-image img {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
  filter: none;
  opacity: 1;
  image-rendering: auto;
  -webkit-transform: translateZ(0);
}

.tag-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(7, 10, 16, 0.55), rgba(7, 10, 16, 0));
}

.tag-cover.is-image-only::after {
  background: linear-gradient(160deg, rgba(7, 10, 16, 0.25), rgba(7, 10, 16, 0));
}

.tag-cover.is-image-only .tag-cover-content {
  opacity: 0;
}

.tag-cover-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-initial {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(15, 19, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

.tag-initial img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.tag-cover-title {
  font-weight: 600;
  font-size: 14px;
  max-width: 160px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-cover-badge {
  position: relative;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tag-cover-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.tag-cover-badge.is-hot {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

.tag-cover-badge.is-rank {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.5);
}

.tag-cover-badge.is-new {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
}

.tag-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(43, 212, 200, 0.35),
    rgba(244, 179, 58, 0.15),
    transparent 60%
  );
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: 0.25s ease;
  pointer-events: none;
}

.tag-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(43, 212, 200, 0.18), transparent 45%);
  opacity: 0;
  transition: 0.2s ease;
  pointer-events: none;
}

.tag-card:hover::after {
  opacity: 1;
}

.tag-card:hover::before {
  opacity: 1;
}

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

.tag-title {
  font-weight: 600;
  font-size: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #0a1312;
  background: var(--accent-warm);
}

.badge.category {
  background: rgba(43, 212, 200, 0.22);
  color: var(--text);
  border: 1px solid rgba(43, 212, 200, 0.35);
}

.badge.pinned {
  background: rgba(74, 222, 128, 0.2);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.tag-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 54px;
}

.tag-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(154, 164, 178, 0.9);
  min-height: 18px;
  max-height: 36px;
  overflow: hidden;
}

.tag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag-actions a,
.tag-actions button {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.tag-actions button:disabled,
.tag-actions button.is-muted {
  opacity: 0.55;
  cursor: default;
}

.tag-actions a:hover,
.tag-actions button:hover {
  border-color: rgba(43, 212, 200, 0.4);
}

.empty {
  border: 1px dashed var(--line);
  padding: 40px;
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--muted);
}

.tag-dialog {
  border: none;
  border-radius: var(--radius-xl);
  background: #111720;
  color: var(--text);
  padding: 0;
  width: min(720px, 92vw);
  box-shadow: var(--shadow);
}

.tag-dialog::backdrop {
  background: rgba(5, 8, 12, 0.6);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 24px 10px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0;
}

.dialog-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 18px 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.field span {
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}

.field.full {
  grid-column: 1 / -1;
}

.form-footer {
  padding: 0 24px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 10px;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glow-float {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translate3d(-10px, 8px, 0) scale(1.03);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.9;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 16, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 20;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  background: #0f141d;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-kicker {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(43, 212, 200, 0.7);
}

.drawer-title {
  margin: 6px 0 8px;
  font-size: 20px;
}

.drawer-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-cover {
  width: 100%;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
}

.drawer-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(154, 164, 178, 0.8);
}

.drawer-section p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  font-size: 13px;
}

.drawer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-chip {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.drawer-meta .meta-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-section {
    width: 100%;
  }

  .menu {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-footer {
    width: 100%;
  }

  .tags.masonry {
    column-count: 2;
  }

  .topbar-ai {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-nav,
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .filters {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .main {
    padding: 20px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .tags.masonry {
    column-count: 1;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .actions {
    width: 100%;
    justify-content: space-between;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .search-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    width: 100%;
    justify-content: flex-start;
  }
}
