Files
promptfoo--promptfoo/site/blog/ai-safety-vs-security/components/SafetySecurityQuiz.module.css
T
wehub-resource-sync 0d3cb498a3
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:24:08 +08:00

446 lines
7.6 KiB
CSS

.container {
width: 100%;
max-width: 800px;
margin: 2rem auto;
padding: 0 1rem;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
gap: 1rem;
flex-wrap: wrap;
}
.progress {
flex: 1;
min-width: 200px;
}
.progressBar {
width: 100%;
height: 8px;
background-color: var(--ifm-color-emphasis-200);
border-radius: 4px;
overflow: hidden;
margin-bottom: 0.5rem;
}
.progressFill {
height: 100%;
background-color: var(--ifm-color-primary);
transition: width 0.3s ease;
}
.progressText {
font-size: 0.875rem;
color: var(--ifm-color-emphasis-700);
}
.score {
font-size: 1rem;
font-weight: 600;
color: var(--ifm-color-primary);
}
.questionCard {
background: var(--ifm-card-background-color);
border: 1px solid var(--ifm-color-emphasis-200);
border-radius: 8px;
padding: 2rem;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.questionHeader {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 1rem;
margin-bottom: 2rem;
}
.questionText {
font-size: 1.125rem;
font-weight: 500;
line-height: 1.5;
margin: 0;
flex: 1;
color: var(--ifm-color-emphasis-900);
}
.difficulty {
padding: 0.25rem 0.75rem;
border-radius: 1rem;
font-size: 0.75rem;
font-weight: 600;
color: white;
text-transform: uppercase;
white-space: nowrap;
}
.options {
display: flex;
flex-direction: column;
gap: 0.75rem;
margin-bottom: 1.5rem;
}
.option {
display: flex;
align-items: center;
gap: 1rem;
padding: 1rem 1.25rem;
background: var(--ifm-background-color);
border: 2px solid var(--ifm-color-emphasis-200);
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
text-align: left;
width: 100%;
}
.option:hover:not(:disabled) {
border-color: var(--ifm-color-primary);
background: var(--ifm-color-primary-lightest);
}
.option.selected {
border-color: var(--ifm-color-primary);
background: var(--ifm-color-primary-lightest);
}
.option.correct {
border-color: #10b981;
background: #d1fae5;
}
.option.incorrect {
border-color: #ef4444;
background: #fee2e2;
}
.option:disabled {
cursor: not-allowed;
}
.optionLetter {
display: flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
background: var(--ifm-color-emphasis-200);
border-radius: 50%;
font-weight: 600;
flex-shrink: 0;
}
.option.selected .optionLetter {
background: var(--ifm-color-primary);
color: white;
}
.option.correct .optionLetter {
background: #10b981;
color: white;
}
.option.incorrect .optionLetter {
background: #ef4444;
color: white;
}
.optionText {
flex: 1;
font-size: 1rem;
line-height: 1.5;
color: var(--ifm-color-emphasis-900);
}
.submitButton {
width: 100%;
padding: 0.75rem 1.5rem;
background: var(--ifm-color-primary);
color: white;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s ease;
}
.submitButton:hover:not(:disabled) {
background: var(--ifm-color-primary-dark);
}
.submitButton:disabled {
background: var(--ifm-color-emphasis-300);
cursor: not-allowed;
}
.explanation {
margin-top: 1.5rem;
padding: 1rem 1.25rem;
border-radius: 8px;
border-left: 4px solid;
}
.correctExplanation {
background: #d1fae5;
border-left-color: #10b981;
}
.incorrectExplanation {
background: #fee2e2;
border-left-color: #ef4444;
}
.explanationHeader {
font-weight: 600;
margin-bottom: 0.5rem;
font-size: 1rem;
}
.correctExplanation .explanationHeader {
color: #065f46;
}
.incorrectExplanation .explanationHeader {
color: #991b1b;
}
.explanation p {
margin: 0;
line-height: 1.5;
color: var(--ifm-color-emphasis-800);
}
.navigation {
display: flex;
justify-content: space-between;
gap: 1rem;
margin-top: 2rem;
}
.navButton {
padding: 0.75rem 1.5rem;
background: var(--ifm-background-color);
color: var(--ifm-color-emphasis-700);
border: 1px solid var(--ifm-color-emphasis-200);
border-radius: 8px;
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.navButton:hover:not(:disabled) {
background: var(--ifm-color-emphasis-100);
border-color: var(--ifm-color-emphasis-300);
}
.navButton:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Completion screen styles */
.completionCard {
background: var(--ifm-card-background-color);
border: 1px solid var(--ifm-color-emphasis-200);
border-radius: 8px;
padding: 3rem 2rem;
text-align: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.completionTitle {
font-size: 2rem;
font-weight: 700;
color: var(--ifm-color-primary);
margin-bottom: 2rem;
}
.scoreDisplay {
display: flex;
justify-content: center;
align-items: baseline;
gap: 1rem;
margin-bottom: 1rem;
}
.scoreNumber {
font-size: 3rem;
font-weight: 700;
color: var(--ifm-color-emphasis-900);
}
.scorePercentage {
font-size: 2rem;
font-weight: 600;
color: var(--ifm-color-primary);
}
.scoreMessage {
font-size: 1.125rem;
color: var(--ifm-color-emphasis-700);
margin-bottom: 2rem;
line-height: 1.5;
}
.answerSummary {
margin: 2rem 0;
padding: 1.5rem;
background: var(--ifm-background-color);
border-radius: 8px;
border: 1px solid var(--ifm-color-emphasis-200);
}
.answerSummary h4 {
margin: 0 0 1rem;
font-size: 1.125rem;
color: var(--ifm-color-emphasis-900);
}
.summaryItem {
display: inline-flex;
align-items: center;
gap: 0.5rem;
margin: 0.25rem 0.5rem;
padding: 0.25rem 0.75rem;
background: var(--ifm-card-background-color);
border-radius: 6px;
border: 1px solid var(--ifm-color-emphasis-200);
}
.summaryIcon {
font-weight: 700;
font-size: 0.875rem;
}
.summaryIcon.correct {
color: #10b981;
}
.summaryIcon.incorrect {
color: #ef4444;
}
.summaryText {
font-size: 0.875rem;
color: var(--ifm-color-emphasis-700);
}
.restartButton {
padding: 1rem 2rem;
background: var(--ifm-color-primary);
color: white;
border: none;
border-radius: 8px;
font-size: 1.125rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s ease;
}
.restartButton:hover {
background: var(--ifm-color-primary-dark);
}
/* Mobile responsive styles */
@media (max-width: 768px) {
.questionCard {
padding: 1.5rem;
}
.questionText {
font-size: 1rem;
}
.option {
padding: 0.875rem 1rem;
}
.optionText {
font-size: 0.9375rem;
}
.completionTitle {
font-size: 1.5rem;
}
.scoreNumber {
font-size: 2.5rem;
}
.scorePercentage {
font-size: 1.5rem;
}
.summaryItem {
margin: 0.25rem;
padding: 0.25rem 0.5rem;
}
}
@media (max-width: 480px) {
.container {
padding: 0 0.5rem;
}
.questionCard {
padding: 1rem;
}
.questionHeader {
flex-direction: column;
align-items: flex-start;
}
.difficulty {
align-self: flex-start;
}
.navigation {
flex-direction: column;
}
.navButton {
width: 100%;
}
}
/* Dark mode compatibility */
html[data-theme='dark'] .option {
background: var(--ifm-background-surface-color);
}
html[data-theme='dark'] .option:hover:not(:disabled) {
background: var(--ifm-color-primary-darkest);
}
html[data-theme='dark'] .option.selected {
background: var(--ifm-color-primary-darkest);
}
html[data-theme='dark'] .option.correct {
background: rgba(16, 185, 129, 0.2);
border-color: #10b981;
}
html[data-theme='dark'] .option.incorrect {
background: rgba(239, 68, 68, 0.2);
border-color: #ef4444;
}
html[data-theme='dark'] .correctExplanation {
background: rgba(16, 185, 129, 0.1);
}
html[data-theme='dark'] .incorrectExplanation {
background: rgba(239, 68, 68, 0.1);
}