:root {
    --qf-green: #16a34a;
    --qf-deep: #064e3b;
    --qf-blue: #0ea5e9;
    --qf-bg: #f8fafc;
    --qf-card: #ffffff;
    --qf-ink: #0f172a;
    --qf-muted: #64748b;
    --qf-border: #dbe3ef;
    --qf-error-bg: #fef2f2;
    --qf-error-border: #fecaca;
    --qf-warning-bg: #fffbeb;
    --qf-warning-border: #fde68a;
    --qf-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(22, 163, 74, 0.18), transparent 35%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 35%),
        var(--qf-bg);
    color: var(--qf-ink);
}

.qf-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.qf-header {
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--qf-border);
    backdrop-filter: blur(10px);
}

.qf-header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qf-brand {
    color: var(--qf-deep);
    text-decoration: none;
    font-size: 1.65rem;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.qf-tagline {
    margin: 2px 0 0;
    color: var(--qf-muted);
    font-size: 0.95rem;
}

.qf-version {
    color: var(--qf-muted);
    font-weight: 700;
}

.qf-main {
    padding: 34px 0 52px;
}

.qf-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

.qf-hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    letter-spacing: -0.07em;
    color: var(--qf-deep);
}

.qf-hero p {
    margin: 8px 0 0;
    max-width: 680px;
    color: var(--qf-muted);
    font-size: 1.12rem;
}

.qf-hero-card {
    background: linear-gradient(135deg, var(--qf-deep), var(--qf-green));
    color: white;
    border-radius: 22px;
    padding: 22px;
    min-width: 240px;
    box-shadow: var(--qf-shadow);
}

.qf-hero-card strong,
.qf-hero-card span {
    display: block;
}

.qf-hero-card span {
    margin-top: 6px;
    opacity: 0.9;
}

.qf-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--qf-border);
    border-radius: 24px;
    box-shadow: var(--qf-shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.qf-form label {
    display: block;
    font-weight: 800;
    margin-bottom: 10px;
}

textarea {
    width: 100%;
    min-height: 390px;
    resize: vertical;
    border: 1px solid var(--qf-border);
    border-radius: 16px;
    padding: 16px;
    font: 15px/1.55 Consolas, Monaco, monospace;
    color: var(--qf-ink);
    background: #fff;
}

textarea:focus {
    outline: 3px solid rgba(22, 163, 74, 0.18);
    border-color: var(--qf-green);
}

.qf-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
}
.qf-button {
    border: 0;
    border-radius: 999px;
    background: var(--qf-green);
    color: white;
    font-weight: 800;
    padding: 11px 18px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qf-button:hover {
    filter: brightness(0.96);
}

.qf-button-light {
    background: #eaf7ee;
    color: var(--qf-deep);
}
.qf-button-save {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.2);
    font-weight: 800;
}

.qf-button-save:hover {
    background: #6d28d9;
    border-color: #6d28d9;
}

.qf-section-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.qf-section-header h2 {
    margin: 0;
    color: var(--qf-deep);
}

.qf-section-header p {
    margin: 4px 0 0;
    color: var(--qf-muted);
}

.qf-alert {
    border-radius: 16px;
    padding: 14px 16px;
    margin: 14px 0;
    border: 1px solid;
}

.qf-alert h3 {
    margin: 0 0 8px;
}

.qf-alert ul {
    margin: 0;
    padding-left: 22px;
}

.qf-alert-error {
    background: var(--qf-error-bg);
    border-color: var(--qf-error-border);
}

.qf-alert-warning {
    background: var(--qf-warning-bg);
    border-color: var(--qf-warning-border);
}

.qf-table-wrap {
    overflow-x: auto;
}

.qf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.qf-table th,
.qf-table td {
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--qf-border);
    padding: 12px;
}

.qf-table th {
    color: var(--qf-deep);
    background: #f1f5f9;
}

.qf-footer {
    border-top: 1px solid var(--qf-border);
    color: var(--qf-muted);
    padding: 22px 0;
    background: rgba(255, 255, 255, 0.76);
}

@media (max-width: 760px) {
    .qf-hero {
        grid-template-columns: 1fr;
    }

    .qf-section-header {
        display: block;
    }
}
.qf-help summary {
    cursor: pointer;
    font-weight: 850;
    color: var(--qf-deep);
    font-size: 1.05rem;
}

.qf-help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.qf-help-grid h3 {
    margin: 0 0 8px;
    color: var(--qf-deep);
}

.qf-help-grid pre,
.qf-preview-box {
    width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    border: 1px solid var(--qf-border);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--qf-ink);
    padding: 14px;
    font: 14px/1.5 Consolas, Monaco, monospace;
}

.qf-export-preview {
    margin: 18px 0 24px;
    border: 1px solid var(--qf-border);
    border-radius: 18px;
    padding: 18px;
    background: #f8fafc;
}

.qf-export-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 12px;
}

.qf-export-preview-head h3 {
    margin: 0;
    color: var(--qf-deep);
}

.qf-export-preview-head p {
    margin: 4px 0 0;
    color: var(--qf-muted);
}

.qf-preview-box {
    min-height: 160px;
    background: #ffffff;
}

@media (max-width: 760px) {
    .qf-help-grid {
        grid-template-columns: 1fr;
    }

    .qf-export-preview-head {
        display: block;
    }
}
.qf-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 24px;
}

.qf-summary-card {
    border: 1px solid var(--qf-border);
    border-radius: 18px;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.qf-summary-card span {
    display: block;
    color: var(--qf-muted);
    font-size: 0.88rem;
    font-weight: 750;
}

.qf-summary-card strong {
    display: block;
    margin-top: 6px;
    color: var(--qf-deep);
    font-size: 2rem;
    line-height: 1;
}

.qf-summary-total {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(14, 165, 233, 0.10));
}

@media (max-width: 920px) {
    .qf-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .qf-summary-grid {
        grid-template-columns: 1fr;
    }
}
.qf-preview-actions {
    margin-top: 12px;
}

.qf-preview-box {
    resize: vertical;
}
.qf-editor-panel {
    margin: 18px 0 24px;
    border: 1px solid var(--qf-border);
    border-radius: 22px;
    padding: 20px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
.qf-editor-question {
    position: relative;
}

.qf-editor-question-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.qf-editor-question-title > div:first-child {
    min-width: 220px;
}

.qf-editor-question-title strong {
    display: block;
}

.qf-editor-question-title span {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    opacity: 0.72;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.qf-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: #f8fafc;
}

.qf-editor-toolbar-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.qf-editor-add-question {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qf-editor-add-question label {
    font-weight: 800;
    color: #334155;
}

.qf-editor-add-question select {
    min-width: 190px;
    padding: 0.62rem 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    background: #ffffff;
    font-weight: 700;
    color: #0f172a;
}

.qf-editor-add-question select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

@media (max-width: 760px) {
    .qf-editor-toolbar {
        align-items: stretch;
    }

    .qf-editor-toolbar-main,
    .qf-editor-add-question {
        width: 100%;
    }

    .qf-editor-add-question select {
        flex: 1;
        min-width: 0;
    }
}

.qf-question-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.qf-question-toolbar-main,
.qf-question-toolbar-danger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.qf-question-toolbar-danger {
    padding-left: 0.5rem;
    border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.qf-button-small {
    white-space: nowrap;
}

.qf-editor-head h3 {
    margin: 0;
    color: var(--qf-deep);
}

.qf-editor-head p {
    margin: 4px 0 18px;
    color: var(--qf-muted);
}

.qf-editor-question {
    border: 1px solid var(--qf-border);
    border-radius: 18px;
    padding: 16px;
    background: #f8fafc;
    margin-bottom: 16px;
}

.qf-editor-question-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.qf-question-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.qf-editor-question-title {
    gap: 1rem;
}

.qf-editor-question-title > div:first-child {
    min-width: 0;
}

.qf-editor-question-title strong,
.qf-editor-question-title span {
    white-space: nowrap;
}
.qf-editor-question-title strong {
    color: var(--qf-deep);
    font-size: 1.05rem;
}

.qf-editor-question-title span {
    color: #075985;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 850;
    font-size: 0.82rem;
}

.qf-editor-panel label {
    display: block;
    color: var(--qf-ink);
    font-weight: 800;
    margin-bottom: 10px;
}

.qf-editor-panel input,
.qf-editor-panel textarea {
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--qf-border);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    background: #ffffff;
    color: var(--qf-ink);
}

.qf-editor-textarea {
    min-height: 86px;
    resize: vertical;
}

.qf-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.qf-matching-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

@media (max-width: 760px) {
    .qf-editor-grid,
    .qf-matching-row {
        grid-template-columns: 1fr;
    }
}
/* Editable Question Review */
.qf-question-editor-form {
    margin-top: 22px;
}

.qf-editor-scroll {
    max-height: 650px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 18px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
}

.qf-editor-scroll .qf-editor-question:first-child {
    margin-top: 0;
}

.qf-editor-scroll .qf-editor-question:last-child {
    margin-bottom: 0;
}

.qf-advanced-preview {
    margin-top: 24px;
}

.qf-advanced-preview summary {
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    color: #1f2937;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.06);
}

.qf-advanced-preview summary:hover {
    background: rgba(15, 23, 42, 0.1);
}

.qf-advanced-preview[open] summary {
    margin-bottom: 16px;
}

.qf-editor-note {
    margin: 0 0 14px;
    color: #64748b;
    font-size: 0.95rem;
}
.qf-export-note {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
    font-size: 0.92rem;
    font-weight: 700;
}
.qf-final-export-panel {
    margin-top: 22px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.22);
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.qf-final-export-panel h3 {
    margin: 0 0 4px;
}

.qf-final-export-panel p {
    margin: 0;
    color: #64748b;
}

.qf-final-export-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.qf-editor-meta {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
}
.qf-editor-actions {
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.qf-editor-actions .qf-button-light {
    font-size: 0.9rem;
}
html {
    scroll-behavior: smooth;
}

#qf-editor-last-question {
    scroll-margin-top: 24px;
}
.qf-final-export-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.qf-button-download {
    background: #14532d;
    color: #ffffff;
    border-color: #14532d;
    box-shadow: 0 8px 18px rgba(20, 83, 45, 0.18);
}

.qf-button-download:hover {
    background: #166534;
    border-color: #166534;
}

.qf-button-download-zip {
    background: #15803d;
    border-color: #15803d;
}

.qf-button-download-zip:hover {
    background: #16a34a;
    border-color: #16a34a;
}

.qf-button-print {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.2);
}

.qf-button-print:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.qf-button-download,
.qf-button-print {
    font-weight: 800;
}
.qf-mini-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.qf-mini-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.7rem;
    background: linear-gradient(135deg, #0f766e 0%, #16a34a 100%);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 22px rgba(22, 163, 74, 0.18);
}

.qf-mini-brand-text {
    font-weight: 900;
    color: #065f46;
    letter-spacing: -0.02em;
}

.qf-mini-brand-header .qf-mini-brand-text {
    font-size: 0.95rem;
}

.qf-mini-brand-hero .qf-mini-brand-text {
    font-size: 1.05rem;
}

.qf-mini-brand-card {
    display: inline-flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid rgba(22, 163, 74, 0.18);
    box-shadow: 0 12px 26px rgba(22, 163, 74, 0.08);
}

.qf-mini-brand-subtext {
    color: #166534;
    font-size: 0.78rem;
    line-height: 1.35;
    max-width: 240px;
}
.qf-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.qf-header-left {
    min-width: 0;
}

.qf-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.qf-top-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qf-top-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.65rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid rgba(6, 95, 70, 0.12);
}

.qf-top-nav a:hover {
    background: #d1fae5;
    border-color: rgba(6, 95, 70, 0.22);
}

@media (max-width: 760px) {
    .qf-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .qf-header-right {
        justify-content: flex-start;
    }
}