:root {
  color-scheme: light;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #eef2f7;
  color: #0f172a;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; }
body {
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  display: flex;
  min-height: 34rem;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% -20%, #bfdbfe 0, transparent 36rem),
    #eef4fb;
}
a { color: inherit; }
.skip-link {
  position: fixed; top: .5rem; left: .5rem; z-index: 50; transform: translateY(-150%);
  border-radius: .65rem; background: #0f172a; padding: .7rem 1rem; color: #fff;
  font-size: .8rem; font-weight: 700;
}
.skip-link:focus-visible { transform: translateY(0); outline: 3px solid #bfdbfe; outline-offset: 2px; }
.topbar {
  position: relative; z-index: 10; display: flex; min-height: 4.75rem; flex: 0 0 auto;
  align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 0;
  background:
    radial-gradient(circle at 18% -120%, rgb(255 255 255 / 28%) 0, transparent 30rem),
    linear-gradient(115deg, #1d4ed8 0%, #3b82f6 100%);
  padding: .7rem clamp(.75rem, 2vw, 1.5rem); color: #fff;
  box-shadow: 0 14px 34px -22px rgb(29 78 216 / 85%);
}
.identity, .title-row, .actions, .language-switch { display: flex; align-items: center; }
.identity { min-width: 0; gap: .75rem; }
.brand-mark {
  display: grid; width: 2.7rem; height: 2.7rem; flex: 0 0 auto; place-items: center;
  border: 1px solid rgb(255 255 255 / 28%); border-radius: .85rem;
  background: rgb(255 255 255 / 14%); color: #fff;
  box-shadow: 0 12px 24px -16px rgb(15 23 42 / 70%);
}
.brand-mark svg, .open-button svg {
  fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8;
}
.brand-mark svg { width: 1.45rem; }
.brand-copy { display: grid; min-width: 0; gap: .15rem; }
.brand-name { font-size: .78rem; font-weight: 800; white-space: nowrap; }
.host-name {
  max-width: 13rem; overflow: hidden; color: rgb(255 255 255 / 72%); font-size: .66rem;
  text-overflow: ellipsis; white-space: nowrap;
}
.divider { width: 1px; height: 2rem; flex: 0 0 auto; background: rgb(255 255 255 / 28%); }
.tool-copy, .title-row { min-width: 0; }
.title-row { gap: .55rem; }
h1 {
  overflow: hidden; margin: 0; font-size: clamp(.95rem, 1.5vw, 1.1rem); letter-spacing: -.02em;
  text-overflow: ellipsis; text-wrap: balance; white-space: nowrap;
}
.local-badge {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: .35rem; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 24%); background: rgb(255 255 255 / 14%);
  padding: .28rem .55rem; color: #fff; font-size: .62rem; font-weight: 750;
}
.status-dot {
  width: .38rem; height: .38rem; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 3px rgb(16 185 129 / 12%);
}
.tool-copy p {
  display: flex; min-width: 0; align-items: center; gap: .25rem; overflow: hidden;
  margin: .28rem 0 0; color: rgb(255 255 255 / 78%); font-size: .69rem;
  text-overflow: ellipsis; white-space: nowrap;
}
.tool-copy strong { color: #fff; }
.tool-copy p a { margin-left: .25rem; color: var(--accent); font-weight: 700; text-decoration: none; }
.tool-copy p a:hover { text-decoration: underline; }
.actions { flex: 0 0 auto; gap: .55rem; }
.demo-menu { position: relative; }
.demo-menu summary {
  display: inline-flex; min-height: 2.45rem; cursor: pointer; list-style: none; align-items: center;
  gap: .42rem; border: 1px solid rgb(255 255 255 / 32%); border-radius: .75rem;
  background: rgb(255 255 255 / 14%); padding: .45rem .62rem; color: #fff;
  font-size: .72rem; font-weight: 750; backdrop-filter: blur(12px);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.demo-menu summary::-webkit-details-marker { display: none; }
.demo-menu summary:hover, .demo-menu[open] summary {
  border-color: rgb(255 255 255 / 62%); background: rgb(255 255 255 / 24%);
  color: #fff; box-shadow: 0 10px 22px -16px rgb(15 23 42 / 65%);
}
.demo-menu summary svg {
  width: 1rem; fill: none; stroke: currentColor; stroke-linecap: round;
  stroke-linejoin: round; stroke-width: 1.8;
}
.demo-count {
  display: grid; min-width: 1.15rem; height: 1.15rem; place-items: center; border-radius: 999px;
  background: #fff; color: var(--accent-strong); font-size: .62rem;
}
.demo-panel {
  position: absolute; top: calc(100% + .55rem); right: 0; z-index: 30; display: grid;
  width: min(36rem, calc(100vw - 1.5rem)); gap: .45rem; border: 1px solid #bfdbfe;
  border-radius: 1rem; background: #fff; padding: .7rem; color: #0f172a;
  box-shadow: 0 24px 56px -24px rgb(15 23 42 / 55%);
}
.demo-panel-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  padding: .2rem .25rem .35rem;
}
.demo-panel-heading strong { font-size: .78rem; }
.demo-panel-heading small { color: #64748b; font-size: .64rem; }
.demo-status {
  margin: 0; border-radius: .65rem; padding: .5rem .65rem; background: #eff6ff;
  color: #1d4ed8; font-size: .68rem; font-weight: 700;
}
.demo-status[data-tone="success"] { background: #ecfdf5; color: #047857; }
.demo-status[data-tone="error"] { background: #fef2f2; color: #b91c1c; }
.demo-item {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: .65rem;
  border: 1px solid #dbeafe; border-radius: .8rem; padding: .62rem;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.demo-item:hover {
  transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 42%, #dbe2ea);
  background: var(--accent-soft);
}
.demo-index {
  display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: .65rem;
  background: var(--accent-soft); color: var(--accent); font-size: .68rem; font-weight: 800;
}
.demo-copy { display: grid; min-width: 0; gap: .12rem; }
.demo-copy strong, .demo-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-copy strong { font-size: .74rem; }
.demo-copy small { color: #64748b; font-size: .63rem; }
.demo-item-side { display: flex; align-items: center; gap: .55rem; }
.demo-actions { display: flex; align-items: center; gap: .35rem; }
.demo-format {
  border-radius: .45rem; background: #f1f5f9; padding: .24rem .38rem;
  color: #475569; font-size: .58rem; font-weight: 800;
}
.demo-download, .demo-test {
  min-height: 2rem; border-radius: .55rem; padding: .42rem .58rem;
  font: inherit; font-size: .66rem; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.demo-download {
  border: 1px solid #bfdbfe; background: #fff; color: #1d4ed8;
}
.demo-download:hover { background: #eff6ff; }
.demo-test {
  border: 0; cursor: pointer; background: linear-gradient(115deg, #1d4ed8, #3b82f6);
  color: #fff; box-shadow: 0 8px 16px -12px #1d4ed8;
}
.demo-test:hover { background: #1d4ed8; }
.demo-test:disabled { cursor: wait; opacity: .68; }
.language-switch {
  gap: .2rem; border: 1px solid rgb(255 255 255 / 26%); border-radius: .75rem;
  background: rgb(255 255 255 / 12%); padding: .2rem;
}
.language-switch a {
  min-width: 2.3rem; border-radius: .55rem; padding: .42rem .55rem; color: rgb(255 255 255 / 78%);
  font-size: .72rem; font-weight: 750; text-align: center; text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.language-switch a:hover { background: rgb(255 255 255 / 18%); color: #fff; }
.language-switch a.is-active {
  background: #fff; color: var(--accent-strong); box-shadow: 0 4px 10px rgb(15 23 42 / 16%);
}
.open-button {
  display: inline-flex; align-items: center; gap: .45rem; border-radius: .75rem; background: #fff;
  padding: .62rem .85rem; color: var(--accent-strong); font-size: .72rem; font-weight: 750;
  text-decoration: none;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.open-button:hover { background: #eff6ff; box-shadow: 0 10px 22px -14px rgb(15 23 42 / 72%); }
.open-button svg { width: 1rem; }
.language-switch a:focus-visible, .demo-menu summary:focus-visible,
.demo-download:focus-visible, .demo-test:focus-visible,
.open-button:focus-visible, .tool-copy p a:focus-visible {
  outline: 3px solid #bfdbfe; outline-offset: 2px;
}
main { min-height: 0; flex: 1 1 auto; padding: clamp(.4rem, 1vw, .75rem); }
.workspace-card {
  height: 100%; min-height: 0; overflow: hidden; border: 1px solid #dbe2ea; border-radius: 1rem;
  background: #fff; box-shadow: 0 18px 40px -32px rgb(15 23 42 / 75%);
}
iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
@media (max-width: 760px) {
  .brand-copy, .divider, .local-badge, .tool-copy p { display: none; }
  .identity { gap: .55rem; }
  .topbar { min-height: 4rem; }
  .open-button span { display: none; }
  .open-button { padding: .58rem; }
  .demo-menu summary > span:not(.demo-count) { display: none; }
  .demo-menu summary { padding: .55rem; }
  .demo-item { grid-template-columns: 2rem minmax(0, 1fr); }
  .demo-item-side { grid-column: 2; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
