MetaRec / MetaRec-ui /src /style /DebugPage.css
Hanny658's picture
API Testing playground implemented
472d0dd
Raw
History Blame Contribute Delete
18.9 kB
.debug-page {
min-height: 100vh;
padding: 20px;
background:
radial-gradient(circle at 88% 8%, rgba(194, 122, 54, 0.10) 0%, transparent 38%),
radial-gradient(circle at 8% 18%, rgba(194, 122, 54, 0.07) 0%, transparent 42%),
linear-gradient(180deg, #faf7f2 0%, #f5efe7 100%);
color: var(--fg, #2f2a26);
position: relative;
}
.debug-toast {
position: fixed;
top: 16px;
right: 16px;
z-index: 2000;
max-width: min(520px, calc(100vw - 32px));
display: flex;
align-items: flex-start;
gap: 10px;
background: #fff;
border: 1px solid var(--border, #e2dad2);
border-left: 4px solid #5e8fd6;
border-radius: 12px;
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
padding: 10px 12px;
animation: debugToastIn 180ms ease-out;
}
.debug-toast.warning {
border-left-color: #d4922f;
background: #fffaf0;
}
.debug-toast.error {
border-left-color: #b13c36;
background: #fff5f4;
}
.debug-toast.success {
border-left-color: #2f8f4f;
background: #f6fff8;
}
.debug-toast-content {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.debug-toast-content strong {
font-size: 0.84rem;
}
.debug-toast-content span {
font-size: 0.86rem;
line-height: 1.35;
color: var(--fg-secondary, #6d665f);
word-break: break-word;
}
.debug-toast-close {
border: none;
background: transparent;
color: var(--muted, #a3968a);
padding: 0;
width: 24px;
height: 24px;
font-size: 18px;
line-height: 1;
cursor: pointer;
}
@keyframes debugToastIn {
from {
opacity: 0;
transform: translateY(-8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.debug-header {
display: flex;
justify-content: space-between;
gap: 16px;
align-items: flex-start;
margin-bottom: 16px;
animation: debugFadeUp 260ms ease-out both;
}
.debug-header h1 {
font-size: 1.4rem;
margin: 0 0 4px;
}
.debug-header p {
color: var(--fg-secondary, #6d665f);
margin: 0;
max-width: 900px;
}
.debug-header-actions {
display: flex;
gap: 8px;
}
.debug-tabs {
display: inline-flex;
gap: 6px;
background: rgba(255, 255, 255, 0.75);
border: 1px solid rgba(194, 122, 54, 0.16);
border-radius: 16px;
padding: 6px;
margin-bottom: 14px;
box-shadow: 0 8px 24px rgba(60, 42, 25, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
backdrop-filter: blur(10px);
animation: debugFadeUp 320ms ease-out both;
}
.debug-tab {
border: 1px solid transparent;
background: transparent;
color: var(--fg-secondary, #6d665f);
border-radius: 12px;
padding: 10px 16px;
cursor: pointer;
font-weight: 700;
font-size: 0.9rem;
transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.debug-tab.active {
background: linear-gradient(180deg, #ffffff 0%, #fffaf4 100%);
color: var(--fg, #2f2a26);
border-color: rgba(194, 122, 54, 0.22);
box-shadow: 0 4px 14px rgba(194, 122, 54, 0.10);
}
.debug-tab:hover:not(.active) {
background: rgba(255, 255, 255, 0.55);
color: var(--fg, #2f2a26);
transform: translateY(-1px);
}
.debug-tab:focus-visible {
outline: 2px solid rgba(194, 122, 54, 0.35);
outline-offset: 2px;
}
.debug-grid {
display: grid;
grid-template-columns: 380px 1fr;
gap: 16px;
}
.debug-panel {
background: #fff;
border: 1px solid var(--border, #e2dad2);
border-radius: 12px;
padding: 14px;
box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.debug-panel-wide {
min-width: 0;
}
.debug-panel-full-span {
grid-column: 1 / -1;
}
.debug-panel h2 {
font-size: 1.05rem;
margin: 0 0 10px;
}
.debug-tab-panel {
animation: debugFadeUp 240ms ease-out both;
}
.debug-panel-live {
border-color: rgba(194, 122, 54, 0.28);
box-shadow: 0 6px 18px rgba(194, 122, 54, 0.10);
}
.debug-panel h3 {
font-size: 0.95rem;
margin: 0 0 8px;
}
.debug-panel label {
display: block;
font-size: 0.85rem;
color: var(--fg-secondary, #6d665f);
margin: 8px 0 6px;
}
.debug-panel textarea,
.debug-panel input,
.debug-panel select {
width: 100%;
padding: 10px 12px;
border: 1px solid var(--border, #e2dad2);
border-radius: 8px;
background: #fff;
color: inherit;
font: inherit;
}
.debug-panel textarea {
resize: vertical;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.86rem;
}
.debug-panel button {
border: 1px solid var(--primary, #c27a36);
background: var(--primary, #c27a36);
color: #fff;
border-radius: 8px;
padding: 9px 12px;
cursor: pointer;
font-weight: 600;
transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease, background-color 150ms ease;
}
.debug-panel button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.debug-panel button:not(:disabled):hover {
transform: translateY(-1px);
box-shadow: 0 6px 12px rgba(194, 122, 54, 0.18);
}
.debug-panel .debug-secondary:not(:disabled):hover,
.debug-link-btn:hover {
box-shadow: 0 4px 10px rgba(47, 42, 38, 0.08);
}
.debug-panel .debug-secondary,
.debug-link-btn {
background: #fff;
color: var(--primary, #c27a36);
border: 1px solid var(--border, #e2dad2);
text-decoration: none;
}
.debug-link-btn {
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 8px;
padding: 9px 12px;
font-weight: 600;
}
.debug-row {
display: flex;
gap: 8px;
margin-top: 8px;
align-items: center;
}
.debug-row > * {
flex: 1;
}
.debug-row > button {
flex: 0 0 auto;
}
.debug-inline-options {
display: flex;
gap: 12px;
flex-wrap: wrap;
margin-top: 8px;
}
.debug-inline-options label {
margin: 0;
display: flex;
align-items: center;
gap: 6px;
}
.debug-inline-options input[type="checkbox"] {
width: auto;
}
.debug-runs-list {
margin-top: 10px;
display: flex;
flex-direction: column;
gap: 8px;
max-height: 300px;
overflow: auto;
}
.debug-run-item {
text-align: left;
width: 100%;
background: #fff;
color: inherit;
border: 1px solid var(--border, #e2dad2);
border-radius: 10px;
padding: 10px;
transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.debug-run-item.active {
border-color: var(--primary, #c27a36);
box-shadow: 0 0 0 2px rgba(194, 122, 54, 0.12);
}
.debug-run-item:hover {
transform: translateY(-1px);
box-shadow: 0 6px 12px rgba(47, 42, 38, 0.06);
}
.debug-run-main {
display: flex;
justify-content: space-between;
gap: 8px;
align-items: center;
}
.debug-run-meta,
.debug-muted {
color: var(--muted, #a3968a);
font-size: 0.82rem;
}
.debug-status {
display: inline-flex;
align-items: center;
border-radius: 999px;
padding: 2px 8px;
font-size: 0.75rem;
font-weight: 700;
background: #f3ece6;
color: #6d665f;
text-transform: uppercase;
}
.debug-status.completed { background: #eaf7ee; color: #1f7a39; }
.debug-status.running { background: #fff4df; color: #9a6514; }
.debug-status.queued { background: #eef3fb; color: #2f5ea8; }
.debug-status.timeout { background: #fff0ec; color: #b4502d; }
.debug-status.error { background: #fdeceb; color: #b13c36; }
.debug-status.warning { background: #fff7e6; color: #a06c00; }
.debug-status.info { background: #eef3fb; color: #3e5b9b; }
.debug-panel-title-row {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
margin-bottom: 8px;
}
.debug-trace-summary {
display: flex;
flex-wrap: wrap;
gap: 10px;
font-size: 0.85rem;
margin-bottom: 10px;
}
.debug-events {
display: flex;
flex-direction: column;
gap: 8px;
margin-bottom: 10px;
}
.debug-events details {
border: 1px solid var(--border, #e2dad2);
border-radius: 10px;
padding: 8px 10px;
background: #fff;
transition: border-color 150ms ease, box-shadow 150ms ease;
}
.debug-events summary {
cursor: pointer;
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
.debug-events details[open] {
border-color: rgba(194, 122, 54, 0.20);
box-shadow: 0 6px 14px rgba(47, 42, 38, 0.05);
}
.debug-panel pre {
background: #faf7f2;
border: 1px solid var(--border, #e2dad2);
border-radius: 8px;
padding: 10px;
max-height: 320px;
overflow: auto;
font-size: 0.8rem;
line-height: 1.4;
margin: 6px 0 0;
}
.debug-explanation pre {
max-height: 280px;
white-space: pre-wrap;
}
.debug-error {
margin-top: 8px;
color: #b13c36;
background: #fdeceb;
border: 1px solid #f1c3c0;
border-radius: 8px;
padding: 8px 10px;
font-size: 0.85rem;
}
.debug-btn-content {
display: inline-flex;
align-items: center;
gap: 8px;
}
.debug-spinner {
width: 14px;
height: 14px;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.35);
border-top-color: currentColor;
animation: debugSpin 0.8s linear infinite;
display: inline-block;
flex-shrink: 0;
}
.debug-secondary .debug-spinner {
border-color: rgba(194, 122, 54, 0.22);
border-top-color: currentColor;
}
.debug-loading-inline {
display: inline-flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
padding: 6px 10px;
border-radius: 999px;
background: #faf7f2;
border: 1px solid var(--border, #e2dad2);
}
.debug-loading-inline .debug-spinner {
color: var(--primary, #c27a36);
border-color: rgba(194, 122, 54, 0.2);
border-top-color: var(--primary, #c27a36);
}
.debug-loading-banner {
margin-top: 10px;
display: flex;
align-items: center;
gap: 10px;
border-radius: 10px;
border: 1px solid rgba(194, 122, 54, 0.22);
background: linear-gradient(180deg, #fffaf4 0%, #fff 100%);
padding: 10px 12px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
animation: debugPulseSoft 1.6s ease-in-out infinite;
}
.debug-loading-banner .debug-spinner {
color: var(--primary, #c27a36);
border-color: rgba(194, 122, 54, 0.22);
border-top-color: var(--primary, #c27a36);
}
.debug-loading-banner > span:nth-child(2) {
font-size: 0.84rem;
color: var(--fg-secondary, #6d665f);
flex: 1;
}
.debug-loading-dots {
display: inline-flex;
gap: 4px;
align-items: center;
}
.debug-loading-dots i {
width: 5px;
height: 5px;
border-radius: 50%;
background: rgba(194, 122, 54, 0.7);
display: inline-block;
animation: debugDotBounce 0.9s ease-in-out infinite;
}
.debug-loading-dots i:nth-child(2) { animation-delay: 0.12s; }
.debug-loading-dots i:nth-child(3) { animation-delay: 0.24s; }
.debug-unit-toolbar {
display: flex;
align-items: flex-end;
gap: 12px;
margin-bottom: 10px;
}
.debug-unit-toolbar-group {
min-width: 220px;
}
.debug-unit-toolbar-group label {
margin-top: 0;
}
.debug-unit-layout {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
align-items: start;
}
.debug-api-layout {
display: grid;
grid-template-columns: 360px 1fr;
gap: 12px;
align-items: start;
}
.debug-api-left,
.debug-api-right {
min-width: 0;
}
.debug-api-right {
display: flex;
flex-direction: column;
gap: 10px;
}
.debug-api-catalog-header {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 8px;
margin-bottom: 8px;
}
.debug-api-list {
display: flex;
flex-direction: column;
gap: 8px;
max-height: 100vh;
overflow: auto;
}
.debug-api-item {
width: 100%;
text-align: left;
border: 1px solid var(--border, #e2dad2);
border-radius: 10px;
background: #fff;
padding: 10px;
transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.debug-api-item:hover {
transform: translateY(-1px);
box-shadow: 0 6px 12px rgba(47, 42, 38, 0.06);
}
.debug-api-item.active {
border-color: var(--primary, #c27a36);
box-shadow: 0 0 0 2px rgba(194, 122, 54, 0.12);
}
.debug-api-item-top {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.debug-api-path {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.8rem;
color: var(--fg, #2f2a26);
word-break: break-all;
}
.debug-api-summary {
margin-top: 6px;
font-size: 0.84rem;
color: #fafafa;
line-height: 1.3;
}
.debug-api-item-meta {
margin-top: 6px;
display: flex;
flex-wrap: wrap;
gap: 8px;
font-size: 0.76rem;
color: #dbdbdb;
}
.debug-method-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 52px;
border-radius: 999px;
padding: 3px 8px;
font-size: 0.72rem;
font-weight: 800;
letter-spacing: 0.03em;
color: #fff;
background: #6d665f;
flex-shrink: 0;
}
.debug-method-badge.get { background: #2f8f4f; }
.debug-method-badge.post { background: #2f5ea8; }
.debug-method-badge.put { background: #9a6514; }
.debug-method-badge.patch { background: #8b5fb3; }
.debug-method-badge.delete { background: #b13c36; }
.debug-method-badge.options,
.debug-method-badge.head { background: #6d665f; }
.debug-api-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 8px;
}
.debug-api-actions > * {
flex: 0 0 auto;
}
.debug-api-editor-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.debug-unit-left,
.debug-unit-right {
min-width: 0;
}
.debug-unit-left {
display: flex;
flex-direction: column;
}
.debug-unit-right {
position: sticky;
top: 12px;
}
.debug-unit-meta {
margin-top: 8px;
padding: 10px;
background: #faf7f2;
border: 1px solid var(--border, #e2dad2);
border-radius: 8px;
font-size: 0.85rem;
}
.debug-unit-result {
margin-top: 0;
}
.debug-output-shell {
position: relative;
}
.debug-output-overlay {
position: absolute;
inset: 6px 6px auto 6px;
z-index: 2;
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 10px;
border-radius: 10px;
border: 1px solid rgba(194, 122, 54, 0.22);
background: rgba(255, 250, 244, 0.94);
backdrop-filter: blur(6px);
color: var(--fg-secondary, #6d665f);
font-size: 0.84rem;
box-shadow: 0 4px 10px rgba(47, 42, 38, 0.07);
}
.debug-output-overlay .debug-spinner {
color: var(--primary, #c27a36);
border-color: rgba(194, 122, 54, 0.22);
border-top-color: var(--primary, #c27a36);
}
.debug-unit-result.is-running pre {
filter: saturate(0.75) opacity(0.92);
}
.debug-unit-result pre {
min-height: 260px;
max-height: 640px;
}
.debug-rendered-output {
display: flex;
flex-direction: column;
gap: 10px;
}
.debug-result-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.debug-result-card {
border: 1px solid var(--border, #e2dad2);
border-radius: 10px;
background: linear-gradient(180deg, #fff 0%, #fffcf8 100%);
padding: 10px;
box-shadow: 0 2px 8px rgba(47, 42, 38, 0.03);
}
.debug-result-card-title {
font-size: 0.76rem;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--muted, #a3968a);
margin-bottom: 6px;
font-weight: 700;
}
.debug-result-card-value {
font-size: 0.95rem;
font-weight: 700;
color: var(--fg, #2f2a26);
display: flex;
align-items: center;
gap: 6px;
}
.debug-result-card-meta {
margin-top: 6px;
color: var(--fg-secondary, #6d665f);
font-size: 0.78rem;
line-height: 1.35;
}
.debug-result-section {
border: 1px solid var(--border, #e2dad2);
border-radius: 10px;
background: #fff;
padding: 10px;
}
.debug-result-section.warning {
border-color: #eed6a2;
background: #fffaf0;
}
.debug-result-section.error {
border-color: #f1c3c0;
background: #fff6f5;
}
.debug-result-section-title {
font-size: 0.84rem;
font-weight: 700;
color: var(--fg, #2f2a26);
margin-bottom: 8px;
}
.debug-result-keyvals {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.debug-result-keyvals > div {
display: flex;
flex-direction: column;
gap: 3px;
padding: 8px;
border-radius: 8px;
background: #faf7f2;
border: 1px solid rgba(226, 218, 210, 0.8);
min-width: 0;
}
.debug-result-keyvals span {
color: var(--muted, #a3968a);
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.03em;
}
.debug-result-keyvals strong {
font-size: 0.84rem;
line-height: 1.35;
word-break: break-word;
}
.debug-result-list {
margin: 0;
padding-left: 18px;
color: var(--fg-secondary, #6d665f);
font-size: 0.83rem;
}
.debug-result-list li + li {
margin-top: 4px;
}
.debug-result-error-text {
color: #9f2c2c;
background: rgba(177, 60, 54, 0.06);
border: 1px solid rgba(177, 60, 54, 0.14);
border-radius: 8px;
padding: 8px 10px;
font-size: 0.84rem;
line-height: 1.35;
word-break: break-word;
}
.debug-result-structured {
background: #faf7f2;
border: 1px solid var(--border, #e2dad2);
border-radius: 8px;
padding: 8px;
}
.debug-json-tree {
display: flex;
flex-direction: column;
gap: 6px;
}
.debug-json-tree.nested {
margin-top: 2px;
}
.debug-json-row {
display: grid;
grid-template-columns: minmax(120px, 180px) 1fr;
gap: 8px;
align-items: start;
}
.debug-json-key {
color: #7c5f46;
font-weight: 600;
font-size: 0.78rem;
line-height: 1.35;
word-break: break-word;
}
.debug-json-value {
min-width: 0;
}
.debug-json-leaf {
color: var(--fg-secondary, #6d665f);
font-size: 0.8rem;
line-height: 1.35;
word-break: break-word;
}
@keyframes debugFadeUp {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes debugSpin {
to {
transform: rotate(360deg);
}
}
@keyframes debugPulseSoft {
0%, 100% {
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 rgba(194, 122, 54, 0);
}
50% {
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 4px rgba(194, 122, 54, 0.06);
}
}
@keyframes debugDotBounce {
0%, 80%, 100% {
transform: translateY(0);
opacity: 0.45;
}
40% {
transform: translateY(-3px);
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
.debug-toast,
.debug-header,
.debug-tabs,
.debug-tab-panel {
animation: none;
}
.debug-spinner,
.debug-loading-dots i,
.debug-loading-banner {
animation: none;
}
.debug-panel,
.debug-run-item,
.debug-tab,
.debug-panel button {
transition: none;
}
}
@media (max-width: 980px) {
.debug-grid {
grid-template-columns: 1fr;
}
.debug-unit-layout {
grid-template-columns: 1fr;
}
.debug-api-layout {
grid-template-columns: 1fr;
}
.debug-api-list {
max-height: 40vh;
}
.debug-unit-right {
position: static;
}
.debug-result-grid,
.debug-result-keyvals {
grid-template-columns: 1fr;
}
.debug-json-row {
grid-template-columns: 1fr;
gap: 4px;
}
.debug-api-editor-grid {
grid-template-columns: 1fr;
}
.debug-header {
flex-direction: column;
}
.debug-tabs {
width: 100%;
display: flex;
}
.debug-tab {
flex: 1;
text-align: center;
}
.debug-panel-full-span {
grid-column: auto;
}
}