.rtp-page {
  --rtp-ink: #111827;
  --rtp-muted: #5b6472;
  --rtp-line: rgba(17, 24, 39, .12);
  --rtp-soft: #f7f9fc;
  --rtp-accent: #2563eb;
  --rtp-accent-2: #0f766e;
  --rtp-warn: #b45309;
  background:
    radial-gradient(circle at 12% 8%, rgba(37, 99, 235, .10), transparent 28rem),
    radial-gradient(circle at 86% 12%, rgba(15, 118, 110, .10), transparent 28rem),
    var(--rtp-soft);
  color: var(--rtp-ink);
  padding-top: var(--nav-height);
}

.rtp-hero {
  padding: 4rem 0 2rem;
}

.rtp-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--rtp-muted);
  font-size: .875rem;
  margin-bottom: 1.75rem;
}

.rtp-breadcrumb a {
  color: var(--rtp-muted);
  text-decoration: none;
}

.rtp-breadcrumb a:hover,
.rtp-breadcrumb a:focus {
  color: var(--rtp-ink);
}

.rtp-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 2rem;
  align-items: center;
}

.rtp-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  border: 1px solid var(--rtp-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(16px);
  color: var(--rtp-muted);
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.rtp-title {
  max-width: 780px;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
  margin-bottom: 1.25rem;
}

.rtp-subtitle {
  max-width: 720px;
  color: var(--rtp-muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  margin-bottom: 1.75rem;
}

.rtp-cta-row,
.rtp-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.rtp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .78rem 1rem;
  border: 1px solid transparent;
  border-radius: .75rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  cursor: pointer;
}

.rtp-btn:hover {
  transform: translateY(-1px);
}

.rtp-btn:focus-visible,
.rtp-field:focus,
.rtp-select:focus,
.rtp-textarea:focus,
.rtp-history-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}

.rtp-btn-primary {
  background: var(--rtp-ink);
  color: #fff;
  box-shadow: 0 16px 30px rgba(17, 24, 39, .16);
}

.rtp-btn-primary:hover {
  color: #fff;
  background: #020617;
}

.rtp-btn-secondary {
  background: rgba(255, 255, 255, .82);
  color: var(--rtp-ink);
  border-color: var(--rtp-line);
}

.rtp-btn-secondary:hover {
  background: #fff;
}

.rtp-btn-ghost {
  background: transparent;
  color: var(--rtp-muted);
  border-color: var(--rtp-line);
}

.rtp-btn-ghost:hover {
  color: var(--rtp-ink);
  background: rgba(255, 255, 255, .72);
}

.rtp-hero-card,
.rtp-panel,
.rtp-mini-card,
.rtp-content-box,
.rtp-related-card {
  border: 1px solid var(--rtp-line);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}

.rtp-hero-card {
  border-radius: 1rem;
  padding: 1.25rem;
}

.rtp-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.rtp-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--rtp-accent-2);
  font-size: .78rem;
  font-weight: 800;
}

.rtp-preview-lines {
  display: grid;
  gap: .7rem;
}

.rtp-line {
  height: .82rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8edf7, #f8fafc, #e8edf7);
}

.rtp-line:nth-child(2) { width: 86%; }
.rtp-line:nth-child(3) { width: 72%; }
.rtp-line:nth-child(4) { width: 92%; }

.rtp-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-top: 1rem;
}

.rtp-stat {
  padding: .9rem;
  border: 1px solid var(--rtp-line);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .62);
}

.rtp-stat strong {
  display: block;
  font-size: 1.25rem;
}

.rtp-stat span {
  color: var(--rtp-muted);
  font-size: .75rem;
  font-weight: 700;
}

.rtp-tool-section {
  padding: 2rem 0 3rem;
}

.rtp-tool-grid {
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(0, 1.05fr);
  gap: 1.5rem;
  align-items: start;
}

.rtp-panel {
  border-radius: 1rem;
  padding: 1.25rem;
}

.rtp-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.rtp-panel-header p {
  color: var(--rtp-muted);
  font-size: .92rem;
}

.rtp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.rtp-field-group {
  display: grid;
  gap: .45rem;
}

.rtp-field-group-wide {
  grid-column: 1 / -1;
}

.rtp-label {
  font-size: .78rem;
  font-weight: 800;
  color: var(--rtp-ink);
}

.rtp-help {
  color: var(--rtp-muted);
  font-size: .78rem;
}

.rtp-field,
.rtp-select,
.rtp-textarea {
  width: 100%;
  border: 1px solid rgba(17, 24, 39, .16);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .86);
  color: var(--rtp-ink);
  padding: .82rem .9rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.rtp-textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.rtp-field:focus,
.rtp-select:focus,
.rtp-textarea:focus {
  border-color: var(--rtp-accent);
  background: #fff;
}

.rtp-slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .75rem;
}

.rtp-range {
  width: 100%;
  accent-color: var(--rtp-accent);
}

.rtp-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.rtp-check {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .8rem;
  border: 1px solid var(--rtp-line);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .55);
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
}

.rtp-check input {
  margin-top: .2rem;
  accent-color: var(--rtp-accent);
}

.rtp-result-shell {
  display: grid;
  gap: 1rem;
}

.rtp-result-panel.is-empty .rtp-output {
  color: var(--rtp-muted);
}

.rtp-output {
  min-height: 30rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .91rem;
  line-height: 1.65;
}

.rtp-score-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  color: var(--rtp-muted);
  font-size: .85rem;
  font-weight: 800;
}

.rtp-score-track {
  height: .5rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, .10);
  overflow: hidden;
}

.rtp-score-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rtp-accent), var(--rtp-accent-2));
  transition: width .3s ease;
}

.rtp-counts {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  color: var(--rtp-muted);
  font-size: .82rem;
  font-weight: 700;
}

.rtp-skeleton {
  display: grid;
  gap: .8rem;
  min-height: 30rem;
  padding: 1rem;
  border: 1px solid rgba(17, 24, 39, .16);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .72);
}

.rtp-skeleton-line {
  height: .9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8edf7 25%, #fff 45%, #e8edf7 65%);
  background-size: 220% 100%;
  animation: rtp-shimmer 1.15s infinite linear;
}

.rtp-skeleton-line:nth-child(2n) { width: 82%; }
.rtp-skeleton-line:nth-child(3n) { width: 64%; }

@keyframes rtp-shimmer {
  to { background-position: -220% 0; }
}

.rtp-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.rtp-mini-card {
  border-radius: .9rem;
  padding: 1rem;
}

.rtp-mini-card i {
  color: var(--rtp-accent);
  font-size: 1.2rem;
}

.rtp-mini-card h3 {
  font-size: 1rem;
  margin: .55rem 0 .35rem;
}

.rtp-mini-card p,
.rtp-content-box p,
.rtp-content-box li,
.rtp-related-card p {
  color: var(--rtp-muted);
}

.rtp-content {
  padding: 3rem 0;
  background: #fff;
}

.rtp-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2rem;
  align-items: start;
}

.rtp-article {
  display: grid;
  gap: 1.5rem;
}

.rtp-content-box {
  border-radius: 1rem;
  padding: 1.35rem;
}

.rtp-content-box h2 {
  margin-bottom: .7rem;
}

.rtp-content-box h3 {
  margin-top: 1rem;
  margin-bottom: .45rem;
}

.rtp-content-box ul,
.rtp-content-box ol {
  padding-left: 1.25rem;
  display: grid;
  gap: .45rem;
}

.rtp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rtp-line);
  border-radius: .75rem;
}

.rtp-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.rtp-table th,
.rtp-table td {
  padding: .85rem;
  border-bottom: 1px solid var(--rtp-line);
  text-align: left;
  vertical-align: top;
}

.rtp-table th {
  background: #f8fafc;
  color: var(--rtp-ink);
}

.rtp-table tr:last-child td {
  border-bottom: 0;
}

.rtp-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  display: grid;
  gap: 1rem;
}

.rtp-history-list {
  display: grid;
  gap: .65rem;
}

.rtp-history-item {
  width: 100%;
  text-align: left;
  padding: .75rem;
  border: 1px solid var(--rtp-line);
  border-radius: .7rem;
  background: rgba(255, 255, 255, .76);
  cursor: pointer;
}

.rtp-history-item span,
.rtp-history-item small {
  display: block;
}

.rtp-history-item span {
  font-weight: 800;
  color: var(--rtp-ink);
}

.rtp-history-item small {
  color: var(--rtp-muted);
  margin-top: .2rem;
}

.rtp-empty {
  color: var(--rtp-muted);
  font-size: .9rem;
}

.rtp-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.rtp-related-card {
  border-radius: .9rem;
  padding: 1rem;
  transition: transform .18s ease, box-shadow .18s ease;
}

.rtp-related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, .09);
}

.rtp-related-card strong {
  display: block;
  margin-bottom: .25rem;
}

.rtp-sticky-action {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1030;
}

@media (prefers-color-scheme: dark) {
  .rtp-page {
    --rtp-ink: #f8fafc;
    --rtp-muted: #cbd5e1;
    --rtp-line: rgba(248, 250, 252, .16);
    --rtp-soft: #0f172a;
    background:
      radial-gradient(circle at 12% 8%, rgba(37, 99, 235, .20), transparent 28rem),
      radial-gradient(circle at 86% 12%, rgba(15, 118, 110, .18), transparent 28rem),
      var(--rtp-soft);
  }

  .rtp-content {
    background: #111827;
  }

  .rtp-field,
  .rtp-select,
  .rtp-textarea,
  .rtp-history-item,
  .rtp-skeleton,
  .rtp-stat,
  .rtp-check {
    background: rgba(15, 23, 42, .74);
    color: var(--rtp-ink);
  }

  .rtp-hero-card,
  .rtp-panel,
  .rtp-mini-card,
  .rtp-content-box,
  .rtp-related-card,
  .rtp-kicker,
  .rtp-btn-secondary {
    background: rgba(15, 23, 42, .72);
  }

  .rtp-table th {
    background: rgba(15, 23, 42, .86);
  }
}

@media (max-width: 991px) {
  .rtp-hero-grid,
  .rtp-tool-grid,
  .rtp-content-grid {
    grid-template-columns: 1fr;
  }

  .rtp-sidebar {
    position: static;
  }
}

@media (max-width: 767px) {
  .rtp-hero {
    padding: 2.5rem 0 1rem;
  }

  .rtp-form-grid,
  .rtp-switch-grid,
  .rtp-mini-grid,
  .rtp-related-grid {
    grid-template-columns: 1fr;
  }

  .rtp-action-row .rtp-btn,
  .rtp-cta-row .rtp-btn {
    width: 100%;
  }

  .rtp-output,
  .rtp-skeleton {
    min-height: 24rem;
  }

  .rtp-sticky-action {
    left: 1rem;
  }

  .rtp-sticky-action .rtp-btn {
    width: 100%;
  }
}
