:root {
  --bg: #eef2f8;
  --text: #1a2332;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --topbar-h: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.service-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-h);
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(59, 130, 246, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.back-btn,
.topbar-spacer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  color: #334155;
  text-decoration: none;
}

.back-btn:active {
  background: rgba(15, 23, 42, 0.06);
}

.service-title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.service-loading,
.service-error {
  position: fixed;
  inset: var(--topbar-h) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.service-error[hidden],
.service-loading[hidden],
.service-iframe[hidden] {
  display: none !important;
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.service-iframe {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100% - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  border: 0;
  background: var(--bg);
}

@media (max-width: 768px) {
  :root {
    --topbar-h: 52px;
  }

  .service-title {
    font-size: 0.96rem;
  }
}
