/* ==========================================================
   猎趣 · Design Navigator
   ========================================================== */

:root {
  --bg:          #0B0D12;
  --bg-soft:     #10131B;
  --panel:       rgba(255, 255, 255, .045);
  --panel-hi:    rgba(255, 255, 255, .075);
  --line:        rgba(255, 255, 255, .09);
  --line-hi:     rgba(255, 255, 255, .16);
  --text:        #E9ECF4;
  --text-2:      #B3BACB;
  --muted:       #7E879C;
  --brand-1:     #A855F7;
  --brand-2:     #669AFF;
  --accent:      #35D6E3;
  --pink:        #FF6FA5;
  --grad:        linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --radius:      14px;
  --radius-lg:   20px;
  --topbar-h:    68px;
  --shadow-card: 0 16px 40px -22px rgba(0, 0, 0, .9);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Source Han Sans SC",
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

/* display 声明会覆盖 hidden 属性，必须显式兜底 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(168, 85, 247, .42); color: #fff; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .13);
  border-radius: 9px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .24); background-clip: padding-box; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }

/* ---------- 背景光晕 ---------- */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 620px at 78% -8%,  rgba(168, 85, 247, .26), transparent 62%),
    radial-gradient(1000px 560px at 6% 4%,    rgba(102, 154, 255, .20), transparent 60%),
    linear-gradient(180deg, #0C0F16 0%, var(--bg) 42%, #090B10 100%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.orb-1 { width: 480px; height: 480px; top: -160px; right: 8%;  background: rgba(168, 85, 247, .55); }
.orb-2 { width: 400px; height: 400px; top: 6%;    left: -120px; background: rgba(102, 154, 255, .36); }
.orb-3 { width: 340px; height: 340px; top: 46%;   right: 32%; background: rgba(220, 104, 255, .20); }
.grid-veil {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 20%, transparent 78%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: rgba(11, 13, 18, .72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1460px;
  height: 100%;
  margin: 0 auto;
  padding: 0 26px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-logo {
  display: block;
  width: 36px; height: 36px;
  flex: none;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 8px 22px -10px rgba(168, 85, 247, .95);
}
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-logo.sm { width: 30px; height: 30px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: .01em; }
.brand-text small { font-size: 10px; color: var(--muted); letter-spacing: .16em; text-transform: uppercase; }

.search {
  flex: 1;
  max-width: 620px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-ico {
  position: absolute; left: 13px;
  width: 17px; height: 17px;
  fill: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none;
  border-color: rgba(168, 85, 247, .6);
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .16);
}
.search input::-webkit-search-cancel-button { display: none; }
.q-clear {
  position: absolute; right: 10px;
  width: 24px; height: 24px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  display: grid; place-items: center;
}
.q-clear:hover { background: rgba(255, 255, 255, .1); color: var(--text); }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }

.ghost-btn, .primary-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  transition: transform .16s, background .16s, border-color .16s, box-shadow .16s;
}
.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text-2);
}
.ghost-btn svg { width: 15px; height: 15px; fill: currentColor; }
.ghost-btn:hover { background: var(--panel-hi); color: var(--text); border-color: var(--line-hi); }
.ghost-btn b {
  min-width: 20px; height: 19px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  font-size: 11px; font-weight: 700;
}
.ghost-btn.is-on { border-color: rgba(255, 111, 165, .55); color: #FFC3D8; background: rgba(255, 111, 165, .12); }
.primary-btn {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(168, 85, 247, .9);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(168, 85, 247, 1); }
.ghost-btn:active, .primary-btn:active { transform: translateY(0); }

/* ---------- 布局 ---------- */
.layout {
  max-width: 1460px;
  margin: 0 auto;
  padding: 26px 26px 70px;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

/* ---------- 侧栏 ---------- */
.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  max-height: calc(100vh - var(--topbar-h) - 44px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-group {
  margin: 14px 0 6px;
  padding-left: 12px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.side-item:hover { background: rgba(255, 255, 255, .055); color: var(--text); }
.side-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, .22), rgba(168, 85, 247, 0));
  color: #fff;
  border-left-color: var(--brand-1);
  font-weight: 600;
}
.side-glyph { width: 17px; text-align: center; color: var(--brand-2); opacity: .85; flex: none; font-size: 12px; }
.side-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.side-foot {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.side-foot p { margin: 0 0 4px; }
.side-foot b { color: var(--text-2); }
.side-foot-note { opacity: .7; line-height: 1.5; }

/* ---------- 主区 ---------- */
.main { min-width: 0; }

.hero { padding: 18px 2px 34px; }
.hero-badge {
  display: block;
  width: 76px; height: 76px;
  border-radius: 21px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 18px 44px -18px rgba(168, 85, 247, .95);
}
.hero-badge img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-kicker {
  margin: 0 0 12px;
  font-size: 11px; letter-spacing: .3em; font-weight: 600;
  color: var(--brand-2);
  opacity: .85;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -.02em;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: .18em;
}
.hero-sub {
  margin: 0 0 20px;
  max-width: 660px;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.75;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tag {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all .16s;
}
.hero-tag:hover {
  border-color: rgba(53, 214, 227, .5);
  background: rgba(53, 214, 227, .1);
  color: #fff;
}

/* ---------- 分类区块 ---------- */
.sec { margin-bottom: 40px; scroll-margin-top: var(--offset, 90px); }
.sec-head {
  display: flex; align-items: center; gap: 11px;
  padding-bottom: 11px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.sec-glyph {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(168, 85, 247, .14);
  border: 1px solid rgba(168, 85, 247, .3);
  color: #C4B5FF;
  font-size: 14px;
  flex: none;
}
.sec-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.sec-desc { margin: 0; font-size: 12.5px; color: var(--muted); }
.sec-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.sec-toggle {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  transition: background .15s, color .15s, transform .2s;
}
.sec-toggle:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.sec.collapsed .sec-toggle { transform: rotate(-90deg); }
.sec.collapsed .grid { display: none; }

/* ---------- 卡片 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 11px;
}
.card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 13px 13px 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  transition: transform .2s cubic-bezier(.2, .7, .3, 1), background .2s, border-color .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-3px);
  background: var(--panel-hi);
  border-color: rgba(168, 85, 247, .5);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(168, 85, 247, .18);
}
.ico {
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.03em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .9);
}
.card-body { min-width: 0; flex: 1; }
.card-name {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card:hover .card-name { color: #fff; }
.card-desc {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.card-host {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: rgba(255, 255, 255, .3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-cat {
  display: inline-block;
  margin-top: 6px;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(53, 214, 227, .11);
  color: #86E5EE;
  border: 1px solid rgba(53, 214, 227, .2);
}
.star {
  position: absolute;
  top: 9px; right: 9px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, .22);
  opacity: 0;
  transition: opacity .16s, color .16s, background .16s;
}
.star svg { width: 14px; height: 14px; fill: currentColor; }
.card:hover .star { opacity: 1; }
.star:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.star.on { opacity: 1; color: var(--pink); }
.star.on svg { filter: drop-shadow(0 0 6px rgba(255, 111, 165, .65)); }

/* ---------- 结果视图 ---------- */
.view-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.view-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.view-head .sec-count { margin-left: 0; }
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .02);
}
.empty b { display: block; margin-bottom: 6px; font-size: 15px; color: var(--text-2); }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(0, 0, 0, .22); }
.footer-inner { max-width: 1460px; margin: 0 auto; padding: 34px 26px 40px; }
.footer-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.footer-brand strong { font-size: 15px; }
.footer-brand p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-bottom: 22px; }
.footer-links a { font-size: 12.5px; color: var(--text-2); transition: color .15s; }
.footer-links a:hover { color: var(--brand-2); }
.footer-note { margin: 0; font-size: 11.5px; color: var(--muted); opacity: .75; max-width: 720px; }

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(4, 6, 10, .76); backdrop-filter: blur(6px); }
.modal-box {
  position: relative;
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #161A24, #0F1219);
  border: 1px solid var(--line-hi);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 1);
  animation: pop .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-box h2 { margin: 0 0 8px; font-size: 20px; }
.modal-lead { margin: 0 0 20px; color: var(--text-2); font-size: 13.5px; }
.modal-x {
  position: absolute; top: 14px; right: 16px;
  width: 30px; height: 30px;
  border-radius: 9px;
  font-size: 21px; line-height: 1;
  color: var(--muted);
  display: grid; place-items: center;
}
.modal-x:hover { background: rgba(255, 255, 255, .09); color: var(--text); }
.modal-steps { list-style: none; margin: 0 0 22px; padding: 0; counter-reset: s; }
.modal-steps li {
  position: relative;
  padding: 11px 14px 11px 44px;
  margin-bottom: 8px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  counter-increment: s;
}
.modal-steps li::before {
  content: counter(s);
  position: absolute; left: 13px; top: 12px;
  width: 21px; height: 21px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--grad);
  color: #fff; font-size: 11px; font-weight: 700;
}
.modal-steps b { display: block; font-size: 13px; }
.modal-steps span { font-size: 12px; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .ghost-btn, .modal-actions .primary-btn { height: 40px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%);
  z-index: 120;
  padding: 10px 20px;
  border-radius: 11px;
  background: rgba(20, 24, 33, .96);
  border: 1px solid var(--line-hi);
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 1);
  font-size: 13px;
  animation: toastIn .22s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1040px) {
  .layout { grid-template-columns: 1fr; gap: 20px; }
  .sidebar {
    position: sticky;
    top: var(--topbar-h);
    z-index: 40;
    max-height: none;
    margin: 0 -26px;
    padding: 10px 26px;
    background: rgba(11, 13, 18, .9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }
  .side-nav {
    flex-direction: row;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-group { display: none; }
  .side-item {
    flex: none;
    border-left: 0;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    padding: 5px 12px;
    white-space: nowrap;
  }
  .side-item.active {
    border-color: rgba(168, 85, 247, .55);
    background: linear-gradient(135deg, rgba(168, 85, 247, .34), rgba(102, 154, 255, .24));
  }
  .side-count { display: none; }
  .side-foot { display: none; }
}

@media (max-width: 680px) {
  .topbar { height: auto; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 11px 16px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .search input { height: 40px; }
  .topbar-actions { margin-left: auto; }
  .ghost-btn span, .primary-btn { font-size: 12.5px; }
  .layout { padding: 18px 16px 54px; }
  .sidebar { margin: 0 -16px; padding: 10px 16px; }
  .hero { padding: 10px 2px 26px; }
  .hero h1 { font-size: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 9px; }
  .card { padding: 11px; }
  .ico { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
  .card-desc { min-height: 0; -webkit-line-clamp: 2; }
  .star { opacity: 1; }
  .footer-inner { padding: 26px 16px 32px; }
}
