:root {
  --bg: #f8f6ff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #3a3650;
  --text-light: #6e688c;
  --accent: #8b7cf7;
  --accent-soft: #c4bbff;
  --pink: #3191e9;
  --blue: #a8d8ff;
  --mint: #b8f2d8;
  --shadow: 0 8px 32px rgba(139, 124, 247, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button,
input {
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Xiaolai SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", cursive;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.shape-1 {
  width: 420px;
  height: 420px;
  background: var(--pink);
  top: -120px;
  left: -80px;
  animation-delay: 0s;
}

.shape-2 {
  width: 360px;
  height: 360px;
  background: var(--blue);
  bottom: -80px;
  right: -60px;
  animation-delay: -6s;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: var(--mint);
  top: 40%;
  left: 60%;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.site-header {
  text-align: center;
  padding: 34px 20px 32px;
}

.logo {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo span {
  color: var(--accent);
  position: relative;
}

.logo span::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 2px;
  height: 10px;
  background: var(--accent-soft);
  border-radius: 999px;
  z-index: -1;
  opacity: 0.7;
}

.subtitle {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 1rem;
  letter-spacing: 1px;
}

.container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 20px;
  flex: 1 0 auto;
}

.search-bar {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 28px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 8px 10px 8px 10px;
  box-shadow: var(--shadow);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-light);
}

.search-bar button {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.search-bar button:hover {
  background: #7a6ce6;
  transform: scale(1.05);
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.category-btn {
  padding: 8px 18px;
  border: 1px solid rgba(139, 124, 247, 0.25);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.category-btn:hover {
  background: rgba(139, 124, 247, 0.1);
  color: var(--accent);
}

.category-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(139, 124, 247, 0.35);
}

.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.bookmark-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, box-shadow 0.25s;
}

.bookmark-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(139, 124, 247, 0.18);
}

.bookmark-card[hidden] {
  display: none;
}

.favicon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(139, 124, 247, 0.12);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.bookmark-info {
  min-width: 0;
}

.bookmark-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-desc {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-url {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 1.05rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 24px;
  color: var(--text-light);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.site-footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer img {
  display: block;
  height: auto;
}

/* Sakura petals */
.sakura {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.sakura span {
  position: absolute;
  top: -10%;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #ffd1dc 0%, #ffb8d0 100%);
  border-radius: 50% 0 50% 50%;
  opacity: 0.55;
  animation: fall linear infinite;
}

.sakura span:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; transform: scale(0.8); }
.sakura span:nth-child(2) { left: 25%; animation-duration: 15s; animation-delay: 2s; transform: scale(0.6); }
.sakura span:nth-child(3) { left: 40%; animation-duration: 11s; animation-delay: 4s; transform: scale(0.9); }
.sakura span:nth-child(4) { left: 55%; animation-duration: 14s; animation-delay: 1s; transform: scale(0.7); }
.sakura span:nth-child(5) { left: 70%; animation-duration: 13s; animation-delay: 3s; transform: scale(0.85); }
.sakura span:nth-child(6) { left: 82%; animation-duration: 16s; animation-delay: 5s; transform: scale(0.65); }
.sakura span:nth-child(7) { left: 5%; animation-duration: 12.5s; animation-delay: 6s; transform: scale(0.75); }
.sakura span:nth-child(8) { left: 95%; animation-duration: 14.5s; animation-delay: 2.5s; transform: scale(0.55); }

@keyframes fall {
  0% {
    top: -10%;
    transform: translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.55;
  }
  90% {
    opacity: 0.55;
  }
  100% {
    top: 110%;
    transform: translateX(40px) rotate(360deg);
    opacity: 0;
  }
}

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

  .category-nav {
    gap: 8px;
  }

  .category-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}
