.sample-label-host {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
}

.sample-label-host > label {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
}

.sample-label-host > .sample-entry__btn {
  grid-column: 2;
  grid-row: 1;
}

.sample-label-host > :not(label):not(.sample-entry__btn) {
  grid-column: 1 / -1;
}

.sample-entry__btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  flex: 0 0 auto;
}

.sample-entry__text {
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(
    100deg,
    var(--primary, #0f766e) 0%,
    var(--primary, #0f766e) 32%,
    #fbbf24 50%,
    var(--primary, #0f766e) 68%,
    var(--primary, #0f766e) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sample-entry-shimmer 2.2s ease-in-out infinite;
}

.sample-entry__btn:hover .sample-entry__text {
  animation-duration: 1.1s;
}

@keyframes sample-entry-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.sample-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.sample-modal[hidden] {
  display: none;
}

.sample-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.sample-modal__panel {
  position: relative;
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--bg-card, #fff);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.sample-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 8px;
}

.sample-modal__head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.sample-modal__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary, #475569);
}

.sample-modal__body {
  padding: 8px 20px 20px;
  overflow: auto;
}

.sample-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sample-tags__item {
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  background: var(--bg-card, #fff);
  color: var(--text-secondary, #475569);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
}

.sample-tags__item.is-active {
  border-color: var(--primary, #0f766e);
  background: var(--primary, #0f766e);
  color: #fff;
}

.sample-empty {
  margin: 24px 0;
  text-align: center;
  color: var(--text-hint, #94a3b8);
  font-size: 14px;
}

.sample-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 12px;
  height: min(68vh, 720px);
  min-height: 420px;
}

.sample-paper,
.sample-side__body {
  overflow: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--bg-muted, #f6f7f9);
}

.sample-paper {
  padding: 12px;
}

.sample-paper__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: start;
}

@media (min-width: 720px) {
  .sample-paper__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.sample-paper__page {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
}

.sample-paper__page img {
  display: block;
  width: 100%;
}

.sample-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 8px;
}

.sample-side__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sample-side__tab {
  margin: 0;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #475569);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sample-side__tab.is-active {
  background: var(--primary, #0f766e);
  color: #fff;
}

.sample-side__body {
  flex: 1;
  min-height: 0;
  padding: 10px;
  background: var(--bg-card, #fff);
}

.sample-figs__item {
  margin: 0 0 12px;
}

.sample-figs__item img {
  display: block;
  width: 100%;
  background: #fff;
}

.sample-figs__item figcaption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-hint, #94a3b8);
}

.sample-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sample-files__item {
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sample-files__item.is-active {
  border-color: var(--primary, #0f766e);
  color: var(--primary, #0f766e);
}

.sample-table-wrap {
  overflow: auto;
}

.sample-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sample-table th,
.sample-table td {
  padding: 4px 6px;
  border: 1px solid var(--border, #e2e8f0);
  text-align: left;
  white-space: nowrap;
}

.sample-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-hint, #94a3b8);
}

.sample-code {
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

.sample-tree {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.sample-tree__row {
  display: flex;
  gap: 6px;
  padding: 3px 0;
}

.sample-tree__row.is-folder {
  font-weight: 600;
}

.sample-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 72px;
  background: rgba(15, 23, 42, 0.82);
}

.sample-lightbox[hidden] {
  display: none;
}

.sample-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.sample-lightbox__close,
.sample-lightbox__nav {
  position: absolute;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.sample-lightbox__close {
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
}

.sample-lightbox__nav {
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  font-size: 28px;
  line-height: 1;
}

.sample-lightbox__nav--prev { left: 16px; }
.sample-lightbox__nav--next { right: 16px; }

.sample-lightbox__count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
}

@media (max-width: 800px) {
  .sample-split {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .sample-paper,
  .sample-side__body {
    max-height: 60vh;
  }
  .sample-lightbox { padding: 56px 12px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .sample-entry__text { animation: none; }
}
