/* =========================================================
   <design-spec> 样式：三栏规范面板
   ========================================================= */

design-spec {
  display: block;
}

.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 48px;
}

.spec__col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.spec__title {
  margin: 0;
  color: var(--page-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

/* ---- 颜色 ---- */

.spec-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-color {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 36px;
}

.spec-color__chip {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.spec-color__chip--outline {
  box-shadow: inset 0 0 0 1px var(--page-swatch-outline);
}

.spec-color__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.spec-color__name {
  overflow: hidden;
  color: var(--page-strong);
  font-size: 13px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spec-color__value {
  color: var(--page-muted);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

/* ---- 字体 ---- */

.spec-type {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-type__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-type__sample {
  align-self: flex-start;
  max-width: 100%;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.016em;
}

.spec-type__sample--title {
  color: var(--arw-strong);
}

.spec-type__sample--meta {
  color: var(--arw-text);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

.spec-type__sample--button {
  color: var(--arw-btn);
  font-weight: 450;
}

/* 与组件中的高光扫过一致：底色 + 2.2s 一圈的高光 */
.spec-type__sample--shimmer {
  color: transparent;
  background-image: linear-gradient(
    90deg,
    var(--arw-shimmer-base) 0%,
    var(--arw-shimmer-base) 40%,
    var(--arw-shimmer-hi) 50%,
    var(--arw-shimmer-base) 60%,
    var(--arw-shimmer-base) 100%
  );
  background-position: 100% 0;
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: spec-shimmer 2.2s linear infinite;
}

.spec-type__caption {
  color: var(--page-muted);
  font-size: 12px;
  line-height: 16px;
}

@keyframes spec-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spec-type__sample--shimmer {
    animation: none;
    background: none;
    color: var(--arw-shimmer-base);
  }
}

/* ---- 尺寸与间距 ---- */

.spec-metrics {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.spec-metrics__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  border-bottom: 1px solid var(--page-hairline);
  font-size: 13px;
  line-height: 16px;
}

.spec-metrics__row:last-child {
  border-bottom: 0;
}

.spec-metrics__row dt {
  flex: none;
  color: var(--page-strong);
}

.spec-metrics__row dd {
  margin: 0;
  color: var(--page-muted);
  text-align: right;
}
