:root { color-scheme: light; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button { font: inherit; }
[hidden] { display: none !important; }

.view-demo {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #e9e7e4;
}
.view-toolbar {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: rgba(249, 248, 246, .96);
  border-bottom: 1px solid rgba(76, 67, 58, .10);
  box-shadow: 0 3px 14px rgba(61, 52, 44, .06);
}
.view-toolbar-inner {
  width: min(100%, 430px);
  min-height: 40px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.view-toolbar-inner > span { flex: 0 0 auto; color: #8d867f; font-size: 11px; font-weight: 700; }
.view-tabs { flex: 1; max-width: 270px; padding: 3px; display: grid; grid-template-columns: repeat(2, 1fr); border-radius: 12px; background: #ebe8e4; }
.view-tabs button { min-height: 34px; padding: 0 11px; border: 0; border-radius: 9px; color: #79736d; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.view-tabs button.active { color: #fff; background: #f64f49; box-shadow: 0 3px 8px rgba(222, 61, 55, .20); }
.view-tabs button:focus-visible { outline: 3px solid rgba(246, 79, 73, .24); outline-offset: 2px; }

.view-stage { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; }
.view-stage iframe { width: min(100%, 430px); height: 100%; border: 0; background: #fff6ec; box-shadow: 0 12px 42px rgba(66, 54, 43, .13); }

@media (max-width: 380px) {
  .view-toolbar { padding-left: 10px; padding-right: 10px; }
  .view-toolbar-inner { gap: 8px; }
  .view-tabs button { padding: 0 7px; font-size: 11px; }
}
