:root {
  color-scheme: light;
  --bg: #eef7f5;
  --surface: #ffffff;
  --surface-strong: #f8fbfb;
  --ink: #15201e;
  --muted: #5b6d69;
  --line: #d6e4e1;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #b45309;
  --shadow: 0 20px 55px rgba(18, 68, 64, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 260px),
    var(--bg);
  color: var(--ink);
}

a {
  color: var(--primary-dark);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.18;
}

.brand-text strong {
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 750;
}

.brand-text span {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(15, 118, 110, 0.4);
  outline: none;
}

.status-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: end;
  padding: 20px clamp(16px, 3vw, 40px);
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.22;
  font-weight: 780;
}

.execution-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.service-area {
  min-height: 0;
  width: min(100% - 32px, 1600px);
  margin: 0 auto 18px;
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.frame-toolbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.service-label {
  font-weight: 740;
}

.service-origin {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.frame-wrap {
  position: relative;
  min-height: 0;
  background: #f5f8f7;
}

iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: var(--surface);
}

.frame-loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  background: rgba(248, 251, 251, 0.96);
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.frame-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(15, 118, 110, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(16px, 3vw, 40px);
  color: var(--muted);
  font-size: 13px;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  padding: 12px 14px;
  border: 1px solid #facc15;
  border-radius: 8px;
  background: #fefce8;
  color: #713f12;
  box-shadow: var(--shadow);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 780px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .icon-button {
    flex: 1 1 0;
  }

  .status-strip {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .service-area {
    width: calc(100% - 20px);
    grid-template-rows: auto minmax(560px, 1fr);
  }

  .frame-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 12px;
  }

  .service-origin {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-text strong {
    font-size: 16px;
  }

  .brand-text span,
  .icon-button,
  .execution-note {
    font-size: 13px;
  }
}
