/* === spec-viewer 独立页面 === */
.spec-viewer-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--surface-soft);
  color: var(--ink);
}

/* 顶部导航条 */
.spec-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.spec-logo-link {
  display: inline-flex;
  align-items: center;
}

.spec-logo {
  display: block;
  height: 32px;
  width: auto;
}

.spec-topbar-actions {
  display: flex;
  gap: 12px;
}

.spec-back-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.spec-back-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* 主内容区 */
.spec-viewer {
  flex: 1;
  padding: 24px 24px 36px;
}

.spec-shell {
  max-width: 1180px;
  margin: 0 auto;
}

/* 面包屑 */
.spec-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
}

.spec-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.spec-breadcrumb a:hover {
  color: var(--brand);
}

.spec-breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}

.spec-breadcrumb-sep {
  color: var(--muted);
}

/* 标题栏 */
.spec-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.spec-header-bar h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.spec-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.spec-actions .button {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.spec-actions .button[data-spec-fullscreen] {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.spec-actions .button[data-spec-fullscreen]:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* PDF 预览区 */
.spec-frame-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 60px - 24px - 36px - 80px);
  min-height: 560px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.spec-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.spec-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: #ffffff;
  color: var(--muted);
}

.spec-fallback a {
  color: var(--brand);
}

/* 全屏模式 */
.spec-viewer-body.spec-fullscreen .site-header,
.spec-viewer-body.spec-fullscreen .spec-breadcrumb,
.spec-viewer-body.spec-fullscreen .spec-header-bar {
  display: none;
}

.spec-viewer-body.spec-fullscreen .spec-frame-wrap {
  position: fixed;
  inset: 0;
  height: 100vh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  z-index: 9999;
}

/* 底部 */
.spec-footer {
  padding: 18px 24px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.spec-footer p {
  margin: 0;
}

/* 响应式 */
@media (max-width: 768px) {
  .spec-topbar {
    height: 52px;
    padding: 0 16px;
  }

  .spec-logo {
    height: 26px;
  }

  .spec-back-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
  }

  .spec-viewer {
    padding: 16px 16px 24px;
  }

  .spec-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .spec-header-bar h1 {
    font-size: 20px;
  }

  .spec-actions {
    width: 100%;
  }

  .spec-actions .button {
    flex: 1;
    justify-content: center;
  }

  .spec-frame-wrap {
    min-height: 420px;
  }
}
