:root {
  --u8-blue: #1677ff;
  --u8-blue-dark: #075fc8;
  --u8-blue-soft: #eaf4ff;
  --u8-ink: #1f2d3d;
  --u8-muted: #6f8196;
  --u8-line: #e5edf7;
  --u8-surface: #ffffff;
  --u8-canvas: #f4f8fd;
  --u8-radius: 12px;
  --u8-shadow: 0 18px 54px rgba(23, 66, 118, .16);
}

#u8-demo-root,
#u8-demo-root * { box-sizing: border-box; }

#u8-demo-root {
  color: var(--u8-ink);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

.u8d-page {
  position: fixed;
  inset: 0;
  z-index: 9000;
  overflow: auto;
  background: var(--u8-canvas);
  animation: u8d-fade .18s ease-out;
}

.u8d-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--u8-line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

.u8d-logo {
  border: 0;
  background: transparent;
  color: var(--u8-blue);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.04em;
  cursor: pointer;
}

.u8d-title { margin-left: 22px; font-size: 18px; font-weight: 700; }
.u8d-spacer { flex: 1; }

.u8d-demo-badge {
  padding: 5px 10px;
  border: 1px solid #acd2ff;
  border-radius: 6px;
  background: #eef7ff;
  color: #1666b5;
  font-size: 12px;
}

.u8d-close,
.u8d-icon-button {
  width: 38px;
  height: 38px;
  margin-left: 12px;
  border: 1px solid var(--u8-line);
  border-radius: 50%;
  background: #fff;
  color: #56687b;
  font-size: 20px;
  cursor: pointer;
}

.u8d-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 980px);
  gap: 24px;
  width: min(1240px, calc(100% - 48px));
  margin: 26px auto 60px;
}

.u8d-layout.is-public { display: block; max-width: 1120px; }

.u8d-sidebar,
.u8d-panel,
.u8d-card {
  border: 1px solid var(--u8-line);
  border-radius: var(--u8-radius);
  background: var(--u8-surface);
}

.u8d-sidebar { align-self: start; padding: 10px; }
.u8d-sidebar-title { padding: 12px 14px 8px; color: var(--u8-muted); font-size: 12px; }

.u8d-nav-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #526579;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.u8d-nav-button:hover,
.u8d-nav-button.is-active { background: var(--u8-blue-soft); color: var(--u8-blue-dark); font-weight: 700; }

.u8d-panel { min-height: 560px; padding: 28px; box-shadow: 0 8px 28px rgba(27, 73, 125, .05); }
.u8d-heading { margin: 0; font-size: 26px; }
.u8d-lead { max-width: 720px; margin: 8px 0 24px; color: var(--u8-muted); font-size: 14px; }

.u8d-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.u8d-grid.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.u8d-card { min-height: 124px; padding: 20px; }
.u8d-card h3 { margin: 0 0 8px; font-size: 17px; }
.u8d-card p { margin: 0; color: var(--u8-muted); font-size: 13px; }
.u8d-card .u8d-value { margin-top: 12px; color: var(--u8-blue); font-size: 25px; font-weight: 800; }

.u8d-action-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 24px; }
.u8d-primary,
.u8d-secondary {
  min-width: 108px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.u8d-primary { border: 1px solid var(--u8-blue); background: var(--u8-blue); color: #fff; }
.u8d-primary:hover { background: var(--u8-blue-dark); }
.u8d-secondary { border: 1px solid #cbd9e9; background: #fff; color: #486178; }

.u8d-list { display: grid; gap: 10px; margin-top: 16px; }
.u8d-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 62px;
  padding: 12px 16px;
  border-radius: 9px;
  background: #f8fbff;
}
.u8d-row strong { display: block; font-size: 14px; }
.u8d-row span { color: var(--u8-muted); font-size: 12px; }

.u8d-empty { padding: 68px 20px; text-align: center; color: var(--u8-muted); }
.u8d-empty strong { display: block; margin-bottom: 8px; color: #40566d; font-size: 18px; }

.u8d-field { margin: 16px 0; }
.u8d-field label { display: block; margin-bottom: 7px; color: #40566d; font-size: 13px; font-weight: 700; }
.u8d-field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cbd9e9;
  border-radius: 8px;
  background: #f8fbff;
  color: #4d6278;
  font-size: 14px;
  outline: none;
}
.u8d-field input:focus { border-color: var(--u8-blue); box-shadow: 0 0 0 3px rgba(22, 119, 255, .14); }

.u8d-notice {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #b8d8ff;
  border-radius: 8px;
  background: #edf6ff;
  color: #315f8c;
  font-size: 13px;
}

.u8d-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 25, 44, .55);
  animation: u8d-fade .16s ease-out;
}

.u8d-modal {
  position: relative;
  width: min(430px, 100%);
  max-height: min(720px, calc(100dvh - 40px));
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--u8-shadow);
}

.u8d-modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.u8d-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--u8-line); }
.u8d-tab {
  height: 58px;
  border: 0;
  background: #fff;
  color: #75879a;
  font-size: 16px;
  cursor: pointer;
}
.u8d-tab.is-active { color: var(--u8-blue); font-weight: 800; box-shadow: inset 0 -3px 0 var(--u8-blue); }
.u8d-modal-body { padding: 26px 32px 32px; }
.u8d-modal-body h2 { margin: 0 0 4px; font-size: 22px; }
.u8d-modal-body > p { margin: 0 0 16px; color: var(--u8-muted); font-size: 13px; }
.u8d-modal .u8d-primary { width: 100%; margin-top: 6px; }

.u8d-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10020;
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 8px;
  background: #20344a;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.u8d-mobile-menu { display: none; }

body[data-clone-mode="desktop"] .u8d-image-fallback {
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.95), transparent 17%),
    radial-gradient(circle at 50% 50%, #8fd2ff, #2c7dff 58%, #1458d0 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.62), 0 18px 54px rgba(31,111,226,.20);
}

body[data-clone-mode="desktop"] .u8d-image-fallback::after {
  content: "U8";
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.06em;
  text-shadow: 0 2px 12px rgba(0,52,148,.34);
}

.u8d-home-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  padding: 22px;
}

.u8d-home-card-grid button {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  padding: 24px;
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 72% 20%, rgba(255,255,255,.44), transparent 22%),
    linear-gradient(145deg, #69c8ff 0%, #2677f4 52%, #164fc4 100%);
  color: #fff;
  text-align: left;
  box-shadow: 0 16px 34px rgba(30, 91, 186, .18);
  cursor: pointer;
}

.u8d-home-card-grid button:nth-child(2n) { background: linear-gradient(145deg, #9ad7ff 0%, #4b8cff 48%, #2d57c8 100%); }
.u8d-home-card-grid span { display: block; color: rgba(255,255,255,.82); font-size: 13px; }
.u8d-home-card-grid strong { display: block; max-width: 150px; margin-top: 16px; font-size: 24px; line-height: 1.25; }
.u8d-home-card-grid em {
  position: absolute;
  left: 24px;
  bottom: 24px;
  min-width: 96px;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.56);
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 14px;
  font-style: normal;
  text-align: center;
}

#u8-demo-root button:focus-visible,
#u8-demo-root input:focus-visible {
  outline: 3px solid rgba(22, 119, 255, .32);
  outline-offset: 2px;
}

@keyframes u8d-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

body[data-clone-mode="mobile"] .u8d-page { bottom: 64px; }
body[data-clone-mode="mobile"] .u8d-topbar { min-height: 54px; padding: 0 14px; }
body[data-clone-mode="mobile"] .u8d-logo { font-size: 20px; }
body[data-clone-mode="mobile"] .u8d-title { margin-left: 12px; font-size: 16px; }
body[data-clone-mode="mobile"] .u8d-demo-badge { display: none; }
body[data-clone-mode="mobile"] .u8d-layout,
body[data-clone-mode="mobile"] .u8d-layout.is-public {
  display: block;
  width: auto;
  margin: 12px 12px 28px;
}
body[data-clone-mode="mobile"] .u8d-sidebar { display: none; }
body[data-clone-mode="mobile"] .u8d-panel { min-height: calc(100dvh - 142px); padding: 18px 15px 30px; }
body[data-clone-mode="mobile"] .u8d-heading { font-size: 22px; }
body[data-clone-mode="mobile"] .u8d-grid,
body[data-clone-mode="mobile"] .u8d-grid.is-two { grid-template-columns: 1fr 1fr; gap: 10px; }
body[data-clone-mode="mobile"] .u8d-card { min-height: 108px; padding: 14px; }
body[data-clone-mode="mobile"] .u8d-card h3 { font-size: 15px; }
body[data-clone-mode="mobile"] .u8d-card .u8d-value { font-size: 20px; }
body[data-clone-mode="mobile"] .u8d-modal-body { padding: 24px 20px 26px; }
body[data-clone-mode="mobile"] .u8d-modal .u8d-primary { font-size: 16px; }
body[data-clone-mode="mobile"] .u8d-mobile-menu {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 14px;
  padding: 2px 0 6px;
}
body[data-clone-mode="mobile"] .u8d-mobile-menu .u8d-nav-button { width: auto; min-width: max-content; background: #fff; border: 1px solid var(--u8-line); }
body[data-clone-mode="mobile"] .u8d-mobile-menu .u8d-nav-button.is-active { background: var(--u8-blue-soft); }

@media (max-width: 430px) {
  body[data-clone-mode="mobile"] .u8d-grid,
  body[data-clone-mode="mobile"] .u8d-grid.is-two { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .u8d-page, .u8d-overlay { animation: none; }
}
