:root {
  color: #182035;
  background: #f5f7fb;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --accent: #5b5ce2;
  --accent-dark: #4142bd;
  --ink: #182035;
  --muted: #68728a;
  --line: #dfe4ef;
  --surface: #ffffff;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; min-height: 100dvh; }
button, a { font: inherit; }
button { color: inherit; }

.portal-shell {
  display: grid;
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  grid-template-rows: auto auto 1fr auto;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); font-weight: 760; text-decoration: none; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: var(--accent); color: white; font-size: 15px; }
.demo-badge { padding: 7px 10px; border: 1px solid #d7dcef; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.72); font-size: 12px; }

.hero { display: grid; gap: 64px; align-items: end; padding: 76px 0 52px; grid-template-columns: minmax(0, 1fr) auto; }
.eyebrow { margin: 0 0 13px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.hero h1 { margin: 0; color: var(--ink); font-size: clamp(42px, 6vw, 76px); font-weight: 760; letter-spacing: -.065em; line-height: .98; }
.hero-description { max-width: 680px; margin: 23px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.hero-signal { display: flex; align-items: center; margin-bottom: 8px; color: #4f5970; font-size: 12px; font-weight: 650; white-space: nowrap; }
.hero-signal i { width: 30px; height: 1px; margin: 0 8px; background: #c8cede; }

.demo-grid { display: grid; gap: 14px; align-content: start; padding-bottom: 48px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.demo-card {
  position: relative;
  display: grid;
  min-height: 254px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  grid-template-rows: auto 1fr auto;
  text-align: left;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.demo-card:hover { transform: translateY(-3px); border-color: #c7cdef; box-shadow: 0 16px 42px rgba(32, 42, 75, .09); }
.demo-card:focus-visible { outline: 3px solid rgba(91,92,226,.28); outline-offset: 3px; }
.demo-card-primary { border-color: #c9c9fa; background: linear-gradient(145deg, #ffffff 0%, #f1f1ff 100%); }
.card-index { justify-self: end; color: #929bb0; font-size: 11px; font-weight: 750; letter-spacing: .1em; }
.card-icon { position: absolute; top: 24px; left: 22px; display: block; width: 54px; height: 54px; border-radius: 16px; background: #eef0fb; }
.card-icon i { position: absolute; inset: 13px; display: block; border: 2px solid var(--accent); border-radius: 3px; }
.desktop-icon i::after { position: absolute; right: 3px; bottom: -7px; left: 3px; height: 2px; background: var(--accent); content: ""; }
.phone-icon i { inset: 10px 16px; border-radius: 5px; }
.phone-icon i::after { position: absolute; bottom: 3px; left: 50%; width: 3px; height: 3px; transform: translateX(-50%); border-radius: 50%; background: var(--accent); content: ""; }
.fullscreen-icon i { border: 0; border-radius: 0; background: linear-gradient(var(--accent),var(--accent)) 0 0/9px 2px no-repeat, linear-gradient(var(--accent),var(--accent)) 0 0/2px 9px no-repeat, linear-gradient(var(--accent),var(--accent)) 100% 0/9px 2px no-repeat, linear-gradient(var(--accent),var(--accent)) 100% 0/2px 9px no-repeat, linear-gradient(var(--accent),var(--accent)) 0 100%/9px 2px no-repeat, linear-gradient(var(--accent),var(--accent)) 0 100%/2px 9px no-repeat, linear-gradient(var(--accent),var(--accent)) 100% 100%/9px 2px no-repeat, linear-gradient(var(--accent),var(--accent)) 100% 100%/2px 9px no-repeat; }
.card-copy { align-self: end; display: grid; gap: 10px; margin-top: 76px; }
.card-copy strong { font-size: 20px; letter-spacing: -.025em; }
.card-copy small { max-width: 290px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.card-action { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid #e8ebf3; color: #4f5870; font-size: 12px; font-weight: 700; }
.card-action b { color: var(--accent); font-size: 18px; font-weight: 500; }

.portal-footer { display: flex; align-items: center; justify-content: space-between; min-height: 68px; border-top: 1px solid var(--line); color: #7b8498; font-size: 11px; }

.fullscreen-shell { position: fixed; z-index: 1000; inset: 0; overflow: hidden; background: #fff; }
.fullscreen-shell[hidden] { display: none; }
.fullscreen-shell iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.exit-demo { position: fixed; z-index: 1002; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); min-height: 34px; padding: 0 12px; border: 1px solid rgba(23,31,52,.12); border-radius: 999px; background: rgba(255,255,255,.9); color: #46506a; box-shadow: 0 5px 20px rgba(23,31,52,.14); font-size: 11px; font-weight: 700; backdrop-filter: blur(12px); cursor: pointer; }
.fallback-toast { position: fixed; z-index: 1003; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); left: 16px; width: fit-content; max-width: calc(100% - 32px); margin: auto; padding: 11px 15px; border-radius: 12px; background: rgba(24,32,53,.92); color: #fff; box-shadow: 0 10px 30px rgba(17,24,39,.24); font-size: 12px; text-align: center; }

body[data-demo-open="true"] { overflow: hidden; }

@media (max-width: 850px) {
  .portal-shell { width: min(100% - 30px, 680px); }
  .portal-header { min-height: 68px; }
  .hero { gap: 28px; padding: 52px 0 38px; grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(42px, 13vw, 66px); }
  .hero-signal { display: none; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-card { min-height: 210px; }
}

@media (max-width: 480px) {
  .portal-shell { width: calc(100% - 24px); }
  .brand > span:last-child { display: none; }
  .demo-badge { font-size: 10px; }
  .hero { padding-top: 44px; }
  .hero-description { font-size: 14px; }
  .portal-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-card { transition: none; }
}
