/* 对齐 Net-Diagnotor-Web jol-tokens.css + layout.css */
:root {
  color-scheme: light dark;
  --jol-primary: #f78521;
  --jol-primary-dark: #e57418;
  --jol-surface: #fafafa;
  --jol-surface-variant: #f0f0f0;
  --jol-on-surface: #1a1a1a;
  --jol-muted: #5a5a5a;
  --jol-outline: #e0e0e0;
  --jol-link: #0a66c2;
  --jol-surface-overlay: rgba(250, 250, 250, 0.92);
  --jol-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  --jol-radius: 12px;
  --jol-page-h5-max-width: 28rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --jol-surface: #121212;
    --jol-surface-variant: #2d2d2d;
    --jol-on-surface: #e4e4e4;
    --jol-muted: #b5b5b5;
    --jol-outline: #3d3d3d;
    --jol-link: #6cb8ff;
    --jol-surface-overlay: rgba(18, 18, 18, 0.92);
    --jol-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  }
}

html[data-theme='dark'] {
  --jol-surface: #121212;
  --jol-surface-variant: #2d2d2d;
  --jol-on-surface: #e4e4e4;
  --jol-muted: #b5b5b5;
  --jol-outline: #3d3d3d;
  --jol-link: #6cb8ff;
  --jol-surface-overlay: rgba(18, 18, 18, 0.92);
  --jol-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

html[data-theme='light'] {
  --jol-surface: #fafafa;
  --jol-surface-variant: #f0f0f0;
  --jol-on-surface: #1a1a1a;
  --jol-muted: #5a5a5a;
  --jol-outline: #e0e0e0;
  --jol-link: #0a66c2;
  --jol-surface-overlay: rgba(250, 250, 250, 0.92);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--jol-surface);
  color: var(--jol-on-surface);
  /* 与门户 layout.css body 一致 */
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--jol-link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  width: 100%;
  max-width: var(--jol-page-h5-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(0.65rem + var(--safe-top)) 0 0.65rem;
  background: var(--jol-surface-overlay);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--jol-outline);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: var(--jol-page-h5-max-width);
  margin: 0 auto;
  padding: 0 16px;
}
.brand {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--jol-on-surface);
}
.brand span {
  color: var(--jol-primary);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* 对齐门户 .btn / .btn-primary / .btn-secondary */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  border: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}
.btn-primary {
  background: var(--jol-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--jol-primary-dark);
  text-decoration: none;
  color: #fff;
}
.btn-ghost,
.btn-secondary {
  background: transparent;
  color: var(--jol-primary);
  border: 1px solid var(--jol-primary);
}
.btn-ghost:hover,
.btn-secondary:hover {
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.btn-block {
  width: 100%;
}

.section {
  padding: 1.15rem 0 0.25rem;
}
.section h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--jol-on-surface);
}
.section .hint {
  margin: 0 0 0.85rem;
  color: var(--jol-muted);
  font-size: 0.875rem;
}

.prose {
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  color: var(--jol-on-surface);
  line-height: 1.55;
}
.prose-sub {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--jol-on-surface);
}
.prose-list {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  font-size: 0.9375rem;
  color: var(--jol-on-surface);
  line-height: 1.55;
}
.prose-list li {
  margin-bottom: 0.35rem;
}
.ad-slot-feed {
  min-height: 120px;
}
/* 无填充时不占坑，避免「暂无填充」灰块 */
.ad-slot.is-empty {
  display: none;
  min-height: 0;
}

.ad-stack {
  display: grid;
  gap: 12px;
}

/* 对齐门户 .card */
.ad-card {
  background: var(--jol-surface-variant);
  border: 1px solid var(--jol-outline);
  border-radius: var(--jol-radius);
  padding: 16px;
  overflow: hidden;
}
.ad-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--jol-muted);
}

.ad-slot {
  min-height: 72px;
  width: 100%;
  background: var(--jol-surface);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.ad-slot.is-loading::after {
  content: '加载中…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jol-muted);
  font-size: 0.82rem;
  pointer-events: none;
}
.ad-slot.is-empty::after {
  content: '暂无填充';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jol-muted);
  font-size: 0.82rem;
  pointer-events: none;
}
.ad-slot.is-ready::after {
  display: none;
}
.ad-slot.square {
  min-height: 250px;
  max-width: 100%;
}
.ad-slot.tall {
  min-height: 280px;
}

.ad-slot iframe,
.ad-slot img,
.ad-slot video {
  max-width: 100% !important;
}
.ad-slot > div {
  max-width: 100%;
}

.demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--jol-on-surface);
  cursor: pointer;
  user-select: none;
}
.demo-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--jol-primary);
}

.video-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.video-actions .btn {
  padding: 0 0.5rem;
  font-size: 0.9rem;
  min-width: 0;
}

.status {
  margin: 0.75rem 0 0;
  min-height: 1.35em;
  color: var(--jol-muted);
  font-size: 0.875rem;
}

.footer {
  margin-top: 1.5rem;
  padding: 1.25rem 0 calc(1.75rem + var(--safe-bottom));
  border-top: 1px solid var(--jol-outline);
  color: var(--jol-muted);
  font-size: 0.875rem;
}
.footer .cta-row {
  margin-top: 0.85rem;
}
