/* 设计馆 — 液态奶油语言的展馆篇（令牌全部继承 styles.css） */

.dg-hero {
  max-width: 1180px; margin: 0 auto;
  padding: 150px 22px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.dg-hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 750; letter-spacing: -.02em; line-height: 1.12;
  animation: rise .8s .08s var(--ease-expo) both;
}
.dg-sub {
  max-width: 620px; font-size: 15.5px; color: var(--muted);
  animation: rise .8s .16s var(--ease-expo) both;
}
.dg-stats {
  display: flex; gap: 26px; margin-top: 4px;
  animation: rise .8s .24s var(--ease-expo) both;
}
.dg-stat { display: flex; flex-direction: column; align-items: center; }
.dg-stat b {
  font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums;
  background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .dg-stat b { background: var(--ink); -webkit-background-clip: text; background-clip: text; }
.dg-stat span { font-size: 12px; color: var(--muted); }

.dg-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 26px 0 22px; justify-content: center;
}
.dg-filter {
  padding: 7px 18px; border-radius: var(--r-pill); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  background: var(--glass); color: var(--muted);
  border: 1px solid var(--line);
  transition: background .25s, color .25s, transform .25s var(--ease-spring);
}
.dg-filter:hover { color: var(--ink); transform: translateY(-1px); }
.dg-filter.active { background: var(--accent); color: var(--accent-fg); border-color: transparent; }

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

.dg-card {
  padding: 10px; border-radius: var(--r-card); cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .38s var(--ease-spring), box-shadow .38s ease;
  opacity: 0; transform: translateY(22px);
}
.dg-card.in {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease-expo), transform .9s var(--ease-expo), box-shadow .38s ease;
}
.dg-card:hover { transform: translateY(-5px) scale(1.015); box-shadow: var(--shadow-lift); }

.dg-media {
  position: relative; overflow: hidden;
  border-radius: var(--r-inner);
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
}
.dg-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.dg-media .glass-ph .ph-label { font-size: 11px; }

.dg-meta { padding: 11px 6px 4px; display: flex; align-items: baseline; gap: 8px; }
.dg-name {
  flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dg-author { flex: none; font-size: 11.5px; color: var(--muted); }
.dg-desc {
  padding: 0 6px 6px; font-size: 12px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dg-tags { padding: 0 6px 6px; display: flex; gap: 6px; }

/* ── 标本详情（灯箱式弹层）────────────────────────────────── */

.dg-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dg-modal-backdrop {
  position: absolute; inset: 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.dg-modal-card {
  position: relative; z-index: 1;
  width: min(860px, 100%); max-height: 88vh; overflow-y: auto;
  padding: 26px 28px 30px;
  border-radius: 26px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  animation: dg-pop .45s var(--ease-expo) both;
}
@keyframes dg-pop {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.dg-close {
  position: sticky; top: 0; float: right;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--glass);
  color: var(--muted); font-size: 14px;
  transition: transform .25s var(--ease-spring), color .2s;
}
.dg-close:hover { transform: scale(1.08); color: var(--ink); }

.dg-modal-media {
  border-radius: var(--r-inner); overflow: hidden;
  background: var(--bg-soft); margin-bottom: 18px;
}
.dg-modal-media img { width: 100%; display: block; }
.dg-modal-card h2 { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.dg-modal-desc { font-size: 13.5px; color: var(--muted); margin: 6px 0 12px; }
.dg-modal-links { display: flex; gap: 14px; font-size: 12.5px; margin-bottom: 16px; }
.dg-modal-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.dg-modal-links a:hover { color: var(--ink); }

/* ── 工具条：选项卡 + 复制（学 21st 的排版）────────────────── */

.dg-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 6px;
}
.dg-tabs { display: flex; gap: 6px; padding: 5px; border-radius: var(--r-pill);
  background: var(--glass); border: 1px solid var(--line); }
.dg-tab {
  padding: 6px 16px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600;
  background: transparent; color: var(--muted);
  transition: background .25s, color .25s;
}
.dg-tab:hover { color: var(--ink); }
.dg-tab.active { background: var(--accent); color: var(--accent-fg); }
.dg-toolbar-actions { display: flex; gap: 8px; }
.dg-copy {
  padding: 7px 16px; border-radius: var(--r-pill); cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 650;
  background: var(--accent); color: var(--accent-fg); border: 0;
  transition: transform .28s var(--ease-spring), box-shadow .28s ease;
}
.dg-copy:hover { transform: scale(1.04); box-shadow: var(--shadow-lift); }
#dgReplay { background: var(--glass); color: var(--ink); border: 1px solid var(--line); }

/* ── 同类标本 ── */
.dg-similar-title { margin: 22px 0 10px; font-size: 13.5px; font-weight: 750; color: var(--muted); }
.dg-similar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dg-sim-card {
  cursor: pointer; padding: 8px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .3s var(--ease-spring), box-shadow .3s ease;
}
.dg-sim-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.dg-sim-card img, .dg-sim-card .glass-ph {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 10px; position: relative; overflow: hidden; display: block;
}
.dg-sim-card span {
  display: block; padding: 8px 4px 2px; font-size: 12px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 640px) { .dg-similar { grid-template-columns: repeat(2, 1fr); } }
.dg-panel summary {
  cursor: pointer; font-size: 13.5px; font-weight: 700;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--glass); border: 1px solid var(--line);
  display: inline-block; list-style: none;
  transition: background .2s;
}
.dg-panel summary::-webkit-details-marker { display: none; }
.dg-panel summary:hover { background: var(--glass-strong); }
.dg-panel pre {
  margin-top: 12px; padding: 16px 18px;
  border-radius: var(--r-inner);
  background: var(--bg-soft); border: 1px solid var(--line);
  font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.6; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
  max-height: 420px; overflow-y: auto;
}
