:root {
  --bg0: #e8f4fc;
  --bg1: #f7fbff;
  --ink: #0f172a;
  --muted: #64748b;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(15, 23, 42, 0.08);
  --green: #22c55e;
  --green-deep: #16a34a;
  --ring: #3b82f6;
  --shadow: 0 22px 60px rgba(14, 116, 144, 0.12);
  --radius: 24px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Sora", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 8% -8%, #bfe8ff 0%, transparent 55%),
    radial-gradient(900px 480px at 92% 4%, #c8f7df 0%, transparent 48%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 42%, #eef8ff);
}

body {
  position: relative;
  overflow-x: hidden;
  padding: 28px 20px 48px;
}

.bg-orb {
  position: fixed;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: float 14s ease-in-out infinite;
}
.bg-orb-a { top: -90px; left: -70px; background: #7dd3fc; }
.bg-orb-b { top: 140px; right: -130px; background: #86efac; animation-delay: -4s; }
.bg-streak {
  position: fixed;
  inset: 8% -10% auto;
  height: 180px;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewY(-6deg);
  pointer-events: none;
  z-index: 0;
  animation: shimmer 9s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(26px); }
}
@keyframes shimmer {
  0%, 100% { opacity: 0.22; transform: skewY(-6deg) translateX(-2%); }
  50% { opacity: 0.55; transform: skewY(-6deg) translateX(2%); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero, .panel {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding: 8px 0 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  animation: rise 0.7s ease both;
  max-width: 920px;
}
.brand-logo {
  width: clamp(132px, 20vw, 190px);
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
  background: transparent;
}
.brand-text {
  text-align: left;
  min-width: 0;
}
.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.8vw, 2.05rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  background: linear-gradient(90deg, #1e6fd9 0%, #a855f7 28%, #e11d2e 55%, #ca8a04 78%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 680px;
  margin: 22px auto 0;
  padding: 8px 8px 8px 18px;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(14, 116, 144, 0.1);
  animation: rise 0.85s ease 0.14s both;
}
.search-wrap input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.98rem;
  min-width: 0;
}
.search-wrap input::placeholder { color: #94a3b8; }
.btn-icon {
  border: 0;
  background: transparent;
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}
.btn-icon:hover { background: #f1f5f9; color: #0f766e; }
.btn-search {
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.35);
  transition: transform 0.15s ease;
}
.btn-search:hover { transform: translateY(-1px) scale(1.03); }

.panel {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 18px;
  animation: rise 0.95s ease 0.2s both;
}

.category { margin-bottom: 30px; }
.category h2 {
  margin: 0 0 20px;
  font-size: 1.12rem;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px 18px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  padding: 8px 6px 4px;
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.tile:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.65);
}
.tile:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

/* Full circular badge icons (same language as primer.png) */
.tile-art {
  width: min(100%, 132px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: transparent;
  border: 0;
  box-shadow: 0 8px 22px rgba(30, 58, 138, 0.16);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.tile-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: auto;
  object-fit: contain;
  z-index: 1;
}
.tile:hover .tile-art {
  transform: scale(1.04);
  box-shadow: 0 12px 28px rgba(30, 58, 138, 0.22);
}

.tile-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
  padding: 0 2px;
  width: 100%;
}
.tile-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
}
.tile-desc {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-port {
  font-size: 0.66rem;
  color: #94a3b8;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 0 12px;
}

.tile.is-hidden,
.category.is-hidden { display: none; }

#note-dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  max-width: 420px;
  width: calc(100% - 32px);
}
#note-dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
.note-box { padding: 22px 22px 18px; }
.note-box h3 { margin: 0 0 8px; font-size: 1.05rem; }
.note-box p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; white-space: pre-wrap; }
.note-ok {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 12px; }
  .panel { padding: 20px 16px 10px; }
  .tile-desc { display: none; }
  .tile-art { width: min(100%, 110px); }
}
@media (max-width: 640px) {
  .brand {
    flex-direction: column;
    text-align: center;
  }
  .brand-text { text-align: center; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand h1 { font-size: 1.2rem; }
}
