/* xinmo.work · 资源仓库 —— 站点样式（无外部依赖） */
:root {
  --bg: #f6f8fd;
  --surface: #ffffff;
  --surface-2: #f0f4fb;
  --border: #e3e9f4;
  --border-strong: #cfd9ec;
  --text: #17203a;
  --heading: #101a33;
  --muted: #6b7893;
  --accent: #4f6bed;
  --accent-2: #7a4fd0;
  --accent-soft: #e9eeff;
  --teal: #0f9c7c;
  --teal-soft: #e2f7f0;
  --amber-soft: #fff2dc;
  --shadow: 0 10px 34px rgba(30, 50, 90, .07);
  --shadow-lg: 0 22px 60px rgba(30, 50, 90, .14);
  --radius: 20px;
  --shell: 1120px;
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121d31;
  --surface-2: #17243b;
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #dce6f8;
  --heading: #f0f5ff;
  --muted: #94a6c2;
  --accent: #8ba2ff;
  --accent-2: #b18cff;
  --accent-soft: rgba(139, 162, 255, .15);
  --teal: #38d9a9;
  --teal-soft: rgba(56, 217, 169, .13);
  --amber-soft: rgba(255, 196, 92, .13);
  --shadow: 0 10px 34px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .42);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
svg { width: 1em; height: 1em; display: block; }
::selection { background: var(--accent); color: #fff; }
.shell { width: min(var(--shell), calc(100% - 44px)); margin-inline: auto; }

/* ---------- 背景装饰 ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.orb-a { width: 620px; height: 620px; top: -280px; left: -140px; background: radial-gradient(circle, rgba(96, 126, 255, .38), transparent 68%); }
.orb-b { width: 560px; height: 560px; top: -220px; right: -160px; background: radial-gradient(circle, rgba(37, 199, 165, .28), transparent 68%); }
:root[data-theme="dark"] .orb-a { background: radial-gradient(circle, rgba(96, 126, 255, .30), transparent 68%); }
:root[data-theme="dark"] .orb-b { background: radial-gradient(circle, rgba(37, 199, 165, .18), transparent 68%); }
.grid-lines {
  position: absolute; inset: 0 0 auto; height: 680px; opacity: .4;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(#000, transparent 85%);
  -webkit-mask-image: linear-gradient(#000, transparent 85%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #4f6bed, #7a4fd0);
  box-shadow: 0 6px 18px rgba(79, 107, 237, .32);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; color: var(--heading); }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: 2px; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.topnav a { font-size: 13.5px; color: var(--muted); transition: color .2s; }
.topnav a:hover { color: var(--accent); }
.theme-btn {
  width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
  color: var(--muted); cursor: pointer; transition: .2s;
}
.theme-btn:hover { color: var(--accent); border-color: var(--border-strong); transform: translateY(-1px); }
.theme-btn svg { width: 18px; height: 18px; }
:root[data-theme="light"] .icon-sun, :root[data-theme="dark"] .icon-moon { display: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: transform .18s, box-shadow .2s, background .2s, border-color .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #4f6bed, #6c54df); box-shadow: 0 8px 22px rgba(79, 107, 237, .28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(79, 107, 237, .36); }
.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 60px; align-items: center; padding: 84px 0 88px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 20px; font-size: 11px; font-weight: 700; letter-spacing: 2.2px; color: var(--accent); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px var(--teal-soft); }
.hero h1 { margin: 0; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.24; letter-spacing: -.5px; color: var(--heading); font-weight: 750; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #4f6bed, #18a98a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-desc { max-width: 500px; margin: 22px 0 30px; color: var(--muted); font-size: 15px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 22px; position: relative; overflow: hidden;
}
.hero-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #4f6bed, #38d9a9, #b18cff); }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.panel-dots { display: inline-flex; gap: 5px; }
.panel-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.panel-dots i:first-child { background: #ff7a85; }
.panel-dots i:nth-child(2) { background: #ffc45c; }
.panel-dots i:nth-child(3) { background: #38d9a9; }
.panel-path { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.stat b { display: block; font-size: 26px; line-height: 1.2; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.panel-note { display: flex; align-items: flex-start; gap: 13px; margin-top: 16px; padding: 15px 16px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); }
.panel-note svg { width: 21px; height: 21px; flex-shrink: 0; margin-top: 2px; }
.panel-note p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--text); }
.panel-note strong { color: var(--teal); }
.panel-updated { margin: 16px 2px 0; font-size: 11.5px; color: var(--muted); }

/* ---------- 区块标题 ---------- */
.section-kicker { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 2.2px; color: var(--accent); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2, .add h2, .about h2 { margin: 0; font-size: clamp(25px, 3vw, 32px); color: var(--heading); letter-spacing: -.3px; }
.section-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.result-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; padding-bottom: 4px; }

/* ---------- 工具条 ---------- */
.catalog { padding: 20px 0 90px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 24px; }
.search {
  display: flex; align-items: center; gap: 10px; flex: 1 1 300px; min-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  padding: 0 14px; height: 48px; transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted); opacity: .8; }
.search kbd { font-family: inherit; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; background: var(--surface-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer;
  transition: .2s; white-space: nowrap;
}
.chip:hover { color: var(--accent); border-color: var(--border-strong); }
.chip[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg, #4f6bed, #6c54df); border-color: transparent; box-shadow: 0 5px 14px rgba(79, 107, 237, .25); }

/* ---------- 资源卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; min-height: 300px;
  animation: rise .45s both; transition: transform .22s, box-shadow .22s, border-color .22s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -110px; top: -120px;
  border-radius: 50%; filter: blur(10px); opacity: .5; pointer-events: none;
  background: radial-gradient(circle, var(--glow, rgba(79, 107, 237, .22)), transparent 70%);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.card-icon {
  width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--icon-color, var(--accent)); background: var(--icon-bg, var(--accent-soft));
}
.card-icon svg { width: 25px; height: 25px; }
.card-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; white-space: nowrap; }
.card-badge .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.card h3 { margin: 0 0 5px; font-size: 19px; color: var(--heading); }
.card-subtitle { margin: 0 0 12px; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.card-desc { margin: 0 0 18px; font-size: 13.5px; line-height: 1.8; color: var(--muted); flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tag { font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 3px 9px; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 18px; }
.card-meta svg { width: 13px; height: 13px; }
.card-foot { display: flex; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.open-link {
  display: inline-flex; align-items: center; gap: 7px; flex: 1;
  padding: 10px 14px; border-radius: 11px; font-size: 13px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #4f6bed, #6c54df); transition: .2s;
}
.open-link:hover { filter: brightness(1.08); transform: translateY(-1px); }
.open-link svg { width: 15px; height: 15px; }
.share-btn {
  width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
  color: var(--muted); cursor: pointer; transition: .2s;
}
.share-btn:hover { color: var(--accent); border-color: var(--border-strong); }
.share-btn svg { width: 17px; height: 17px; }

.card-soon {
  border-style: dashed; box-shadow: none; justify-content: center;
  background: transparent; text-align: center; align-items: center; min-height: 300px;
}
.card-soon:hover { transform: none; border-color: var(--accent); box-shadow: none; }
.card-soon::after { display: none; }
.card-soon .card-icon { margin-bottom: 18px; border-radius: 16px; }
.card-soon h3 { font-size: 17px; }
.card-soon .card-subtitle { letter-spacing: 2px; font-size: 10.5px; opacity: .75; }
.card-soon .card-desc { flex: 0; max-width: 260px; }
.soon-mark { font-size: 10px; letter-spacing: 2.4px; font-weight: 700; color: var(--muted); opacity: .7; }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; margin: 0 auto 14px; color: var(--border-strong); }
.empty h3 { margin: 0 0 6px; color: var(--heading); font-size: 17px; }
.empty p { margin: 0 0 18px; font-size: 13px; }
.noscript-box { background: var(--amber-soft); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; font-size: 13.5px; }
.noscript-box a { color: var(--accent); text-decoration: underline; }

/* ---------- 添加资源 ---------- */
.add {
  display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: center;
  padding: 62px; margin-bottom: 88px; border-radius: 26px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.add-copy > p:not(.section-kicker) { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 14px 0 22px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.steps li { display: flex; gap: 12px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.steps li > span {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 3px; border-radius: 7px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
}
code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .9em; }
.steps code { color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }
.code-card { background: #101a30; border: 1px solid rgba(255,255,255,.09); border-radius: 16px; overflow: hidden; box-shadow: 0 18px 40px rgba(12, 22, 45, .22); }
.code-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); color: #8fa3c5; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.code-card pre { margin: 0; padding: 20px; overflow-x: auto; color: #dbe6fb; font-size: 12px; line-height: 1.85; }
.c-k { color: #8fb4ff; } .c-s { color: #7fe3bd; } .c-p { color: #7286a8; }

/* ---------- 关于 ---------- */
.about { padding-bottom: 92px; }
.about h2 { margin-bottom: 26px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.feature-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: 16px; }
.feature-icon svg { width: 21px; height: 21px; }
.feature h3 { margin: 0 0 8px; font-size: 16px; color: var(--heading); }
.feature p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8; }
.about-note { margin: 22px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------- 页脚 / 提示 ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 26px 0; font-size: 12.5px; color: var(--muted); }
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand strong { color: var(--heading); }
.footer-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.footer-inner p { margin: 0; }
.to-top { margin-left: auto; color: var(--accent); }
.to-top:hover { text-decoration: underline; }
.toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 60; transform: translate(-50%, 20px);
  padding: 11px 20px; border-radius: 999px; background: #17203a; color: #fff;
  font-size: 13px; box-shadow: 0 12px 32px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 60px 0 68px; }
  .hero-panel { max-width: 560px; }
  .add { grid-template-columns: 1fr; gap: 32px; padding: 40px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .shell { width: min(var(--shell), calc(100% - 32px)); }
  .topbar-inner { height: 62px; gap: 12px; }
  .topnav { gap: 16px; }
  .topnav a:nth-child(2) { display: none; }
  .brand-text small { display: none; }
  .hero { padding: 46px 0 56px; }
  .hero h1 { font-size: 34px; }
  .hero-desc { font-size: 14px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .card-grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .add { padding: 28px 22px; border-radius: 20px; margin-bottom: 60px; }
  .code-card pre { font-size: 11px; padding: 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { flex-basis: auto; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .to-top { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
