html,
body {
  height: 100%;
  margin: 0;
  background: #eef2f7;
  color: #1f2937;
  font-family: Arial, 'Helvetica Neue', sans-serif;
}

.demo-page {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.demo-header {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #d7dde6;
}

.demo-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.demo-description {
  margin: 4px 0 0;
  color: #5b6472;
  font-size: 12px;
}

.demo-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #d7dde6;
}

.demo-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.demo-options {
  background: #ffffff;
  border-bottom: 1px solid #d7dde6;
  padding: 10px 12px;
}

.demo-options-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.demo-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: #475569;
}

.demo-field input[type="text"],
.demo-field select {
  width: 100%;
  height: 30px;
  box-sizing: border-box;
}

.demo-checks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  font-size: 12px;
}

.demo-frame-wrap {
  flex: 1;
  min-height: 0;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.demo-frame-head {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
  flex: 0 0 auto;
}

.demo-frame-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.demo-frame-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-frame-action {
  flex: 0 0 auto;
}

.demo-frame {
  flex: 1;
  min-height: 420px;
  border: 1px solid #cfd7e3;
  background: #e9eef5;
  box-sizing: border-box;
  overflow: hidden;
}

.demo-frame > .control-root {
  height: 100%;
}

.demo-page.is-maximized .demo-header,
.demo-page.is-maximized .demo-options,
.demo-page.is-maximized .demo-toolbar {
  display: none;
}

.demo-page.is-maximized .demo-body {
  display: block;
  padding: 0;
  height: 100%;
}

.demo-page.is-maximized .demo-frame-wrap {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  flex-direction: column;
  padding: 0;
  height: 100vh;
  background: #f8fafc;
}

.demo-page.is-maximized .demo-frame-head {
  display: flex;
  height: 42px;
  padding: 0 10px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #cfd7e3;
  box-shadow: 0 1px 4px rgba(15,23,42,.08);
}

.demo-page.is-maximized .demo-frame {
  position: relative;
  inset: auto;
  z-index: auto;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  border: 0;
}

.demo-log {
  margin-top: 8px;
  height: 74px;
  overflow: auto;
  background: #0f172a;
  color: #dbeafe;
  font-family: Consolas, monospace;
  font-size: 11px;
  padding: 8px;
  border-radius: 3px;
}

@media (max-width: 900px) {
  .demo-options-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}
