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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f4f5f7;
}

.page-header {
  padding: 1rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e2e4e8;
}

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 650;
}

.hint {
  margin: 0;
  font-size: 0.875rem;
  color: #5c6370;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 0;
  align-items: start;
  min-height: calc(100vh - 88px);
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: #fff;
  border: 1px solid #e2e4e8;
}

.panel--nav {
  display: flex;
  flex-direction: column;
  border-right: none;
  max-height: calc(100vh - 88px);
  position: sticky;
  top: 0;
  overflow: hidden;
}

@media (max-width: 720px) {
  .panel--nav {
    border-right: 1px solid #e2e4e8;
    border-bottom: none;
    position: static;
    max-height: min(44vh, calc(100vh - 88px));
  }
}

.panel__title {
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  background: #fafbfc;
  border-bottom: 1px solid #e2e4e8;
}

.selector-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.selector-list li {
  margin: 0;
}

.selector-list__section {
  list-style: none;
  padding: 0.55rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  background: #fafbfc;
  border-top: 1px solid #eef0f3;
}

.selector-list__section:first-child {
  border-top: none;
  padding-top: 0.35rem;
}

.selector-list button {
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: #374151;
}

.selector-list button:hover {
  background: #f3f4f6;
}

.selector-list button.is-active {
  background: #eef2ff;
  color: #3730a3;
  font-weight: 600;
}

.panel--main {
  padding: 1rem 1.25rem 1.5rem;
}

.detail__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}

.detail__desc {
  margin: 0 0 1rem;
  color: #4b5563;
  font-size: 0.9375rem;
}

.block {
  margin-top: 1rem;
}

.block__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.4rem;
}

.block__hint {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: #6b7280;
}

.block__hint code {
  font-size: 0.8em;
  padding: 0.1em 0.35em;
  background: #f1f5f9;
  border-radius: 3px;
}

.demo-stage {
  min-height: 120px;
  padding: 1rem;
  background: #fafbfc;
  border: 1px dashed #c4c9d4;
  border-radius: 6px;
}

.demo-stage .demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.demo-stage .demo-row:last-child {
  margin-bottom: 0;
}

.demo-stage .box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.8125rem;
}

.demo-stage .box.muted {
  background: #f1f5f9;
  color: #64748b;
}

.code-wrap {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #1e293b;
  border-radius: 6px;
  overflow: auto;
  max-height: 280px;
}

.code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.demo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.demo-list li {
  margin-bottom: 0.35rem;
}

.demo-input {
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font: inherit;
}

.fake-link {
  text-decoration: underline;
  color: #2563eb;
  cursor: default;
}

.multiline {
  margin: 0;
  max-width: 36rem;
  line-height: 1.6;
}

.demo-a-real {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.8125rem;
}

.demo-details {
  max-width: 28rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.demo-details summary {
  cursor: pointer;
  font-weight: 600;
}

.demo-pop-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.pop-box {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  max-width: 14rem;
}

.demo-form-mini {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 20rem;
}

.demo-form-mini label {
  font-size: 0.8125rem;
  color: #475569;
}

.sel-sandbox {
  user-select: text;
  cursor: text;
}

.marker-list {
  margin: 0;
  padding-left: 1.25rem;
}

.marker-list li {
  margin-bottom: 0.25rem;
}

.first-letter-para {
  margin: 0;
  max-width: 22rem;
  line-height: 1.55;
}

.demo-video {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #000;
}

.hint-inline {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.dlg-mini {
  max-width: min(22rem, 92vw);
  padding: 1rem 1.1rem;
  border: none;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.dlg-mini::backdrop {
  background: transparent;
}

.dlg-mini p {
  margin: 0 0 0.75rem;
}

.page-footer {
  padding: 0.85rem 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
  background: #fff;
  border-top: 1px solid #e2e4e8;
}

.page-footer a {
  color: inherit;
  text-decoration: none;
}

.page-footer a:hover,
.page-footer a:focus-visible {
  color: #2563eb;
  text-decoration: underline;
}
