/* 防止横向溢出导致右侧/底部出现多余滚动条 */
.sgame-app {
  --scrollbar-w: 17px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  padding: 8px 0 12px;
  overflow-x: clip;
}
.sgame-app *, .sgame-app *::before, .sgame-app *::after {
  box-sizing: border-box;
}
.sgame-title {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 6px 0 8px;
  color: #0f172a;
}
.sgame-sub {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  margin: 0 0 20px;
}
.sgame-toolbar {
  max-width: 1120px;
  margin: 0 auto 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.04);
}
.sgame-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sgame-urlbox {
  display: flex;
  flex: 1;
  min-width: min(100%, 300px);
  gap: 8px;
}
.sgame-app input,
.sgame-app select,
.sgame-app button {
  font: inherit;
}
.sgame-url {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: #0f172a;
}
.sgame-url:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.sgame-btn,
.sgame-app select {
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 9px 12px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
}
.sgame-btn:hover,
.sgame-app select:hover {
  background: #eef2ff;
}
.sgame-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.sgame-primary:hover {
  background: #1d4ed8;
}
.sgame-dark {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.sgame-dark:hover {
  background: #1e293b;
}
.sgame-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #f1f5f9;
}
.sgame-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.sgame-group label {
  font-size: 12px;
  font-weight: 650;
  color: #475569;
}
.sgame-group input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}
.sgame-group input[type="range"] {
  accent-color: #2563eb;
}
.sgame-stage-outer {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  width: 100%;
  overflow: hidden;
}
.sgame-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transform-origin: top center;
  will-change: transform;
}
.sgame-phone {
  position: relative;
  width: 375px;
  height: 667px;
  padding: 14px;
  border-radius: 36px;
  background: #202024;
  box-shadow: 0 0 0 2px #52525b, 0 0 0 5px #27272a, 0 25px 65px #0004;
  flex: none;
}
.sgame-phone:before {
  content: "";
  position: absolute;
  left: -7px;
  top: 14%;
  width: 3px;
  height: 4%;
  background: #555;
  border-radius: 2px;
  box-shadow: 0 52px 0 #555, 0 104px 0 #555;
}
.sgame-phone:after {
  content: "";
  position: absolute;
  right: -7px;
  top: 22%;
  width: 3px;
  height: 9%;
  background: #555;
  border-radius: 2px;
}
.sgame-phone.flat {
  padding: 0;
  border-radius: 0;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.14);
  border: 1px solid #e2e8f0;
}
.sgame-phone.flat:before,
.sgame-phone.flat:after {
  display: none;
}
.sgame-screen {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: #fff;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.flat .sgame-screen {
  border-radius: 0;
}

/* iPhone 风格状态栏 */
.sgame-status {
  height: 46px;
  min-height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  z-index: 10;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.3px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s, color 0.2s;
  user-select: none;
}
.sgame-time-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  z-index: 2;
}
.sgame-time {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
.sgame-location-icon {
  width: 11px;
  height: 11px;
  flex: none;
  margin-top: -1px;
}
.sgame-island {
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  width: 116px;
  height: 30px;
  border-radius: 20px;
  background: #000;
  z-index: 1;
}
.sgame-status-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  height: 100%;
  z-index: 2;
}
.sgame-cellular-icon {
  width: 18px;
  height: 14px;
  display: block;
  flex: none;
}
.sgame-wifi-icon {
  width: 17px;
  height: 14px;
  display: block;
  flex: none;
}
.sgame-battery {
  display: flex;
  align-items: center;
  margin-left: 1px;
}
.sgame-batt-body {
  position: relative;
  width: 30px;
  height: 15px;
  border: 1.4px solid currentColor;
  border-radius: 5px;
  background-color: rgba(148, 163, 184, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: background-color 0.2s;
}
.sgame-batt-level {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 85%;
  border-radius: 3.2px;
  background: #ffffff;
  transition: width 0.2s, background-color 0.2s;
}
.sgame-battery-number {
  position: relative;
  z-index: 2;
  font-size: 10px;
  line-height: 1;
  font-weight: 750;
  color: #000000;
  letter-spacing: -0.4px;
  transition: color 0.2s, text-shadow 0.2s;
}
.sgame-batt-body::after {
  content: "";
  position: absolute;
  right: -3.5px;
  top: 4px;
  width: 2.5px;
  height: 5px;
  background: currentColor;
  border-radius: 0 2px 2px 0;
}

/* 网页预览区域 */
.sgame-web-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  background: #fff;
  overflow: hidden;
}
.sgame-web-wrap iframe {
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
  overflow: auto;
}
.sgame-loading {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  z-index: 8;
  color: #334155;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.sgame-loading.show {
  display: flex;
}
.sgame-loading-row {
  display: flex;
  align-items: center;
}
.sgame-loading-tip {
  font-size: 11px;
  color: #64748b;
}
.sgame-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: sgameSpin 0.8s linear infinite;
  margin-right: 9px;
}
@keyframes sgameSpin {
  to { transform: rotate(360deg); }
}

/* 以右侧滚动条内侧为右边界对齐居中底栏 + 收起隐藏 */
.sgame-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  z-index: 10;
  padding: 6px calc(10px + var(--scrollbar-w, 17px)) 6px 10px;
  background: transparent;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  will-change: transform, opacity;
}
.sgame-footer.is-scrolled {
  transform: translateY(115%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.safari-toolbar {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 42px;
  min-width: 0;
  overflow: hidden;
}
.safari-circle,
.safari-address {
  pointer-events: auto;
  background: rgba(235, 237, 240, 0.78);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.14),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.8);
  color: #111111;
}
.safari-circle {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.safari-circle svg {
  width: 19px;
  height: 19px;
  display: block;
}
.safari-address {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 0 6px;
  border-radius: 20px;
  overflow: hidden;
}
.safari-pill {
  flex: 0 0 24px;
  width: 24px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: #111111;
  cursor: pointer;
}
.safari-pill svg {
  width: 17px;
  height: 17px;
  display: block;
}
.sgame-domain {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.25px;
  color: #111111;
}
.sgame-home {
  width: 100%;
  height: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0;
}
.sgame-home:after {
  content: "";
  width: 128px;
  height: 4.5px;
  border-radius: 99px;
  background: rgba(17, 17, 17, 0.85);
  box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}
.safari-circle:active,
.safari-pill:active {
  opacity: 0.65;
  transform: scale(0.96);
}

.sgame-stage-outer.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh !important;
  background: rgba(17, 24, 39, 0.93);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.sgame-stage-outer.fullscreen .sgame-stage {
  align-items: center;
}
.sgame-exit {
  display: none;
  position: fixed;
  z-index: 10001;
  top: 18px;
  right: 20px;
  left: auto;
  bottom: auto;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 30px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.sgame-exit:hover {
  background: rgba(255, 255, 255, 0.24);
}
.sgame-exit:active {
  transform: scale(0.97);
}
.fullscreen .sgame-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sgame-note {
  max-width: 820px;
  margin: 12px auto 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}
@media (max-width: 600px) {
  .sgame-toolbar { padding: 12px; }
  .sgame-row { align-items: stretch; }
  .sgame-urlbox { min-width: 100%; }
  .sgame-controls { gap: 9px; }
  .sgame-phone { max-width: 100vw; }
  .sgame-domain { font-size: 13px; }
  .sgame-exit { top: 14px; right: 14px; padding: 8px 13px; font-size: 12px; }
}