/* ==========================================================================
   SVG 图标库 · 展示页样式
   视觉参照：浅灰背景 + 紫色主色 + 卡片 hover 上浮
   ========================================================================== */

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

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #14171c;
  --muted: #6b7280;
  --line: #e6e8ec;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --bar-bg: rgba(255, 255, 255, .82);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .045);
  --shadow-hover: 0 10px 22px rgba(79, 70, 229, .16);
  --sz: 24px;
  --ic: currentColor;
  --radius: 10px;
}

html[data-theme="dark"] {
  --bg: #0d0f13;
  --panel: #151920;
  --text: #e7eaee;
  --muted: #8d96a3;
  --line: #232833;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1c2030;
  --bar-bg: rgba(13, 15, 19, .82);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-hover: 0 10px 22px rgba(0, 0, 0, .5);
}

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
  min-height: 100vh;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* SVG 图标全局尺寸 */
.icon, svg.use {
  width: var(--sz);
  height: var(--sz);
  display: block;
  color: var(--ic, inherit);
  flex: none;
  transition: width .2s, height .2s;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}
.logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff;
}
.logo__icon { width: 16px; height: 16px; }
.badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.actions { display: flex; gap: 8px; align-items: center; }

.btn {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  transition: .16s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { opacity: .9; color: #fff; }
.btn__icon { width: 14px; height: 14px; }
.btn.icon-btn {
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1;
}
.btn.icon-btn:hover { background: var(--accent-soft); }
.btn--nav { text-decoration: none; }
.theme-icon { width: 16px; height: 16px; }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
}
.search {
  flex: 1 1 220px;
  min-width: 180px;
  position: relative;
  display: flex;
  align-items: center;
}
.search__icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: .16s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.control { display: flex; align-items: center; gap: 8px; }
.control > label { font-size: 12px; color: var(--muted); white-space: nowrap; }

.seg {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.seg button {
  border: 0;
  border-right: 1px solid var(--line);
  background: none;
  color: var(--muted);
  padding: 8px 11px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: .15s;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: #fff; }

.swatches { display: flex; gap: 7px; align-items: center; }
.sw {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  border: 2px solid var(--line);
  background: transparent;
  transition: .15s;
  position: relative;
}
.sw[data-color=""] {
  background: conic-gradient(#ef4444, #f59e0b, #10b981, #0ea5e9, #a855f7, #ef4444);
}
.sw:hover { transform: scale(1.12); }
.sw.on {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

/* ---------- 分类 ---------- */
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
}
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  white-space: nowrap;
  font-family: inherit;
  transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .chip-count {
  font-size: 11px;
  opacity: .7;
  margin-left: 4px;
}
.chip-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  border-style: dashed;
}
.chip-more:hover { background: var(--accent-light); }
.chip-more__icon {
  transition: transform .2s;
}
.chip-more__icon.up { transform: rotate(180deg); }

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  padding: 22px 0 40px;
}
.cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 18px 6px 13px;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
  background: var(--panel);
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.cell:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.cell:active { transform: translateY(-1px); }
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cell.flash { border-color: var(--accent); background: var(--accent-soft); }
.cell .icon { color: var(--ic, inherit); }
.cell-name {
  font-size: 11px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-cn {
  font-size: 11px;
  color: var(--muted);
}

/* 空状态 */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 32px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 16px;
}
.empty[hidden] { display: none; }
.empty__icon { width: 48px; height: 48px; opacity: .4; }
.empty p { font-size: 14px; margin-bottom: 4px; }

/* ---------- 页脚说明 ---------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding: 28px 0 60px;
  color: var(--muted);
  font-size: 13px;
}
.footer__inner { display: flex; justify-content: center; }
.footer__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.footer__link:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(79, 70, 229, .12);
  transform: translateY(-1px);
}
.footer__link svg { color: var(--accent); flex-shrink: 0; }
.footer__link-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.footer__link-text span { font-size: 12px; color: var(--muted); }
.footer__arrow { margin-left: 8px; opacity: .5; }
.footer__link:hover .footer__arrow { opacity: 1; transform: translateX(2px); }
.footer__arrow { transition: .2s; }

.tip__icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; color: var(--accent); }

.usage-tabs__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
}
.usage-tabs__title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 18px;
  background: var(--accent);
  border-radius: 2px;
}
.usage-tabs__title-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 18px);
  background: #111318;
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .26s;
  z-index: 99;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  max-width: 80vw;
  text-align: center;
}
html[data-theme="dark"] #toast {
  background: #e7eaee;
  color: #111318;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .control { justify-content: space-between; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
  .brand h1 { font-size: 14px; }
  .actions .btn span { display: none; }
  .actions .btn { padding: 8px 10px; }
}

/* ==========================================================================
   使用说明页
   ========================================================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: all .15s;
}
.back-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar__divider {
  width: 1px;
  height: 20px;
  background: var(--line);
}
.topbar__count {
  font-size: 13px;
  color: var(--muted);
}

.usage-section {
  margin-bottom: 48px;
}
.usage-section__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.usage-section__num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}
.usage-section__head h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.usage-section__desc {
  font-size: 14px;
  color: var(--muted);
}

.usage-code {
  background: #1e1f24;
  color: #e7e9ee;
  padding: 18px 20px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  margin: 14px 0;
}
html[data-theme="dark"] .usage-code {
  background: #111318;
}

.usage-attrs {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.usage-attr {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
}
.usage-attr code {
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.usage-attr span { color: var(--muted); }

.usage-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.usage-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
}
.usage-step__num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.usage-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.usage-feature {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.usage-feature__icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  color: var(--accent);
  margin-top: 2px;
}
.usage-feature strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.usage-feature p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.usage-feature code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ---------- 底部信息栏 ---------- */
.footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}
.footer__logo {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.footer__links {
  display: flex;
  gap: 20px;
}
.footer__links a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color .15s;
}
.footer__links a:hover {
  color: var(--accent);
}
.footer__copy {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Usage 页面美化 ---------- */
.usage-page {
  max-width: 1200px;
}
.usage-hero {
  text-align: center;
  padding: 56px 24px 40px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 100%);
  border-radius: 16px;
  margin-bottom: 32px;
}
.usage-hero__icon {
  width: 56px;
  height: 56px;
  color: var(--accent);
  margin-bottom: 16px;
  padding: 12px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.12);
}
.usage-hero h2 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.usage-hero p {
  color: var(--muted);
  font-size: 15px;
}

.usage-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow .2s;
}
.usage-section:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.usage-section__head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.usage-section__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.usage-section__head h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.usage-section__desc {
  color: var(--muted);
  font-size: 14px;
}

.usage-code-wrap {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.usage-code__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #1e1e2e;
  border-bottom: 1px solid #2d2d3f;
  border-radius: 12px 12px 0 0;
}
.usage-code__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.usage-code__dot:nth-child(1) { background: #ff5f57; }
.usage-code__dot:nth-child(2) { background: #febc2e; }
.usage-code__dot:nth-child(3) { background: #28c840; }
.usage-code__name {
  margin-left: 8px;
  font-size: 12px;
  color: #8b8b9e;
}
.usage-code {
  margin: 0;
  padding: 20px;
  background: #1e1e2e;
  color: #e4e4e7;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  border-radius: 0 0 12px 12px;
}

.usage-attrs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.usage-attr {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: border-color .15s;
}
.usage-attr:hover {
  border-color: var(--line);
}
.usage-attr code {
  color: var(--accent);
  font-weight: 600;
}

.usage-steps {
  margin-bottom: 24px;
}
.usage-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.usage-step__num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.usage-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.usage-feature {
  display: flex;
  gap: 14px;
  padding: 20px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all .2s;
}
.usage-feature:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}
.usage-feature__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-top: 2px;
}
.usage-feature strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}
.usage-feature p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .usage-features { grid-template-columns: 1fr; }
}
