:root {
    --participant-ink: #17211d;
    --participant-muted: #61706a;
    --participant-soft: #8a9691;
    --participant-line: rgba(27, 46, 40, 0.13);
    --participant-bg: #f6f8f6;
    --participant-panel: #ffffff;
    --participant-panel-soft: rgba(255, 255, 255, 0.86);
    --participant-accent: #1f7a68;
    --participant-accent-dark: #145f51;
    --participant-blue: #2f6fed;
    --participant-green: #2f9d73;
    --participant-danger: #9b2f25;
    --participant-shadow: 0 14px 36px rgba(20, 42, 34, 0.08);
    --participant-font: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color: var(--participant-ink);
    font-family: var(--participant-font);
    letter-spacing: 0;
}

body.participant-page {
    min-height: 100vh;
    margin: 0;
    color: var(--participant-ink);
    font-family: var(--participant-font);
    background:
        linear-gradient(90deg, rgba(31, 122, 104, 0.03) 1px, transparent 1px),
        linear-gradient(180deg, rgba(31, 122, 104, 0.026) 1px, transparent 1px),
        linear-gradient(155deg, #f8faf8 0%, #eef4f1 48%, #f9f8f4 100%);
    background-size: 42px 42px, 42px 42px, auto;
}

button,
input {
    font: inherit;
}

.source-mark {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    color: var(--participant-accent-dark);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.participant-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.login-shell {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 48px;
    align-items: center;
}

.login-brand h1 {
    margin: 12px 0 0;
    max-width: 560px;
    font-size: clamp(36px, 4.4vw, 52px);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: 0;
}

.login-panel {
    border: 1px solid var(--participant-line);
    border-radius: 8px;
    background: var(--participant-panel-soft);
    box-shadow: var(--participant-shadow);
    padding: 30px;
    backdrop-filter: blur(18px);
}

.panel-title {
    margin: 0 0 22px;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
}

.role-actions {
    display: grid;
    gap: 12px;
}

.role-button,
.submit,
.back-button,
.primary-action,
.ghost-action {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, opacity 160ms ease, border-color 160ms ease;
}

.role-button:active,
.submit:active,
.back-button:active,
.primary-action:active,
.ghost-action:active {
    transform: scale(0.99);
}

.role-admin,
.submit,
.primary-action {
    background: var(--participant-accent);
}

.role-admin:hover,
.submit:hover,
.primary-action:hover {
    background: var(--participant-accent-dark);
}

.role-subject {
    background: var(--participant-blue);
}

.role-subject:hover {
    background: #245fd3;
}

.back-button,
.ghost-action {
    margin-top: 12px;
    border: 1px solid var(--participant-line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--participant-muted);
}

.hidden {
    display: none;
}

.login-panel label {
    display: block;
    margin: 16px 0 7px;
    color: var(--participant-ink);
    font-size: 14px;
    font-weight: 800;
}

.login-panel input[type="text"],
.login-panel input[type="password"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--participant-line);
    border-radius: 8px;
    outline: none;
    padding: 0 13px;
    color: var(--participant-ink);
    background: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-panel input[type="text"]:focus,
.login-panel input[type="password"]:focus {
    border-color: rgba(31, 122, 104, 0.56);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(31, 122, 104, 0.11);
}

.slider {
    position: relative;
    height: 50px;
    margin-top: 22px;
    border: 1px solid var(--participant-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.slider-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: rgba(31, 122, 104, 0.16);
}

.slider-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--participant-muted);
    font-size: 14px;
    pointer-events: none;
}

.slider-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: #ffffff;
    color: var(--participant-accent-dark);
    box-shadow: 0 8px 18px rgba(20, 42, 34, 0.14);
    cursor: grab;
    font-size: 22px;
    line-height: 40px;
    text-align: center;
}

.slider-handle:active {
    cursor: grabbing;
}

.slider.verified .slider-handle {
    background: var(--participant-green);
    color: #ffffff;
}

.slider.verified .slider-text {
    color: var(--participant-accent-dark);
    font-weight: 800;
}

.message {
    min-height: 22px;
    margin: 16px 0 0;
    color: var(--participant-danger);
    font-size: 14px;
    line-height: 1.5;
}

.submit {
    margin-top: 18px;
}

.submit:disabled {
    cursor: not-allowed;
    opacity: 0.56;
}

.participant-experiment {
    display: block;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.participant-topbar {
    position: static;
    z-index: 24;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--participant-line);
    background: rgba(248, 250, 248, 0.88);
    backdrop-filter: blur(18px);
}

.page-shell {
    width: min(980px, calc(100% - 32px));
    margin: 18px auto 96px;
}

.experiment-shell {
    width: min(1500px, calc(100% - 32px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 440px);
    gap: 24px;
    align-items: start;
    margin: 18px auto 40px;
}

.feed-header,
.feed-panel,
.floating-quiz {
    border: 1px solid var(--participant-line);
    border-radius: 8px;
    background: var(--participant-panel-soft);
    box-shadow: var(--participant-shadow);
    backdrop-filter: blur(18px);
}

.feed-header {
    padding: clamp(22px, 4vw, 36px);
    text-align: center;
}

.feed-header .source-mark {
    justify-content: center;
    width: 100%;
}

.feed-title {
    margin: 18px auto 0;
    max-width: 760px;
    color: var(--participant-ink);
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 800;
    line-height: 1.5;
}

.feed-subtitle {
    margin: 10px 0 0;
    color: var(--participant-muted);
    font-size: 14px;
    font-weight: 700;
}

.feed-panel {
    margin-top: 14px;
    padding: clamp(14px, 2vw, 24px);
}

.list {
    display: block;
}

.news-feed {
    display: grid;
    gap: 12px;
}

.container,
.news-item {
    position: relative;
}

.news-choice,
.experiment-news-page #news_box .news-item {
    min-height: 210px;
    padding: clamp(18px, 2.4vw, 24px);
    border: 1px solid var(--participant-line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(20, 42, 34, 0.055);
}

.news-choice {
    display: block;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.news-choice:hover {
    border-color: rgba(31, 122, 104, 0.34);
    box-shadow: 0 12px 28px rgba(20, 42, 34, 0.08);
}

.news-choice.selected {
    border-color: rgba(31, 122, 104, 0.55);
    box-shadow: inset 0 0 0 1px rgba(31, 122, 104, 0.16), 0 12px 28px rgba(31, 122, 104, 0.10);
}

.right-news {
    width: 100%;
}

.left-selected {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 4;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-selected img {
    width: 26px;
    height: 26px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(31, 122, 104, 0.12);
}

id-p {
    display: none;
}

.news-item h2 {
    margin: 0 0 10px;
    color: var(--participant-ink);
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 800;
    line-height: 1.35;
    text-align: left;
}

.content {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 0;
    color: #4b5b55;
    font-size: 15px;
    line-height: 1.72;
    text-align: left;
}

.news-media {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.news-media.image-count-1 {
    display: block;
}

.news-media.image-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.news-media.image-count-3,
.news-media.image-count-4,
.news-media.image-count-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-media img {
    display: block;
    width: 100%;
    aspect-ratio: 1.35 / 1;
    height: auto;
    border: 1px solid rgba(27, 46, 40, 0.08);
    border-radius: 6px;
    background: #f2f5f3;
    object-fit: cover;
}

.news-media.image-count-1 img {
    width: min(100%, 560px);
    max-height: 230px;
    margin: 0 auto;
    aspect-ratio: auto;
    object-fit: contain;
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.submit-strip {
    display: flex;
    justify-content: center;
    margin-top: 22px;
    padding: 12px 0 4px;
}

img#submit-button {
    width: 74px;
    height: 74px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    cursor: not-allowed;
}

img#submit-button.active {
    cursor: pointer;
}

#count-box {
    position: fixed;
    right: clamp(16px, 3vw, 30px);
    bottom: clamp(16px, 3vw, 30px);
    z-index: 20;
    min-width: 126px;
    padding: 12px 18px;
    border: 1px solid var(--participant-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.90);
    box-shadow: var(--participant-shadow);
    backdrop-filter: blur(18px);
}

#count-box p {
    margin: 0;
    color: var(--participant-ink);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

#count-display {
    color: var(--participant-accent-dark);
    font-size: 18px;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: 0;
    height: 3px;
    background: var(--participant-accent);
    transition: width 120ms ease-out;
}

.experiment-news-page .left-section,
.experiment-news-page .right-section {
    width: auto;
}

.experiment-news-page .feed-header,
.experiment-news-page .feed-panel {
    width: 100%;
}

.experiment-news-page #news_box {
    display: grid;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.experiment-news-page #news_box .news-item {
    padding-bottom: 54px;
    overflow: hidden;
}

.tag {
    position: absolute;
    right: 18px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.floating-quiz {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 106px);
    overflow-y: auto;
    padding: 22px;
}

#progress-bar {
    height: 5px;
    border-radius: 999px;
    background: var(--participant-accent) !important;
    transition: width 0.3s;
}

.floating-quiz h1 {
    margin: 18px 0 10px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.quiz-note {
    margin: 0 0 14px;
    color: var(--participant-muted);
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
}

.quiz-line {
    height: 1px;
    margin: 16px 0;
    background: var(--participant-line);
}

.floating-quiz h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
}

#rating_box {
    display: grid;
    gap: 12px;
    width: 100%;
    font-family: var(--participant-font);
}

.measurement-item {
    padding: 14px;
    border: 1px solid var(--participant-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.question-title {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: var(--participant-ink);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.55;
}

.question-title-text {
    min-width: 0;
    flex: 1 1 170px;
}

.question-tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(31, 122, 104, 0.16);
    border-radius: 999px;
    background: rgba(31, 122, 104, 0.08);
    color: var(--participant-accent-dark);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.question-tag.optional {
    border-color: rgba(97, 112, 106, 0.18);
    background: rgba(97, 112, 106, 0.08);
    color: var(--participant-muted);
}

.option-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.option-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(88, 104, 99, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.90);
    color: var(--participant-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.option-chip input {
    margin: 0;
    accent-color: var(--participant-accent);
}

.option-chip:has(input:checked) {
    border-color: rgba(31, 122, 104, 0.44);
    background: rgba(31, 122, 104, 0.08);
    color: var(--participant-accent-dark);
}

#next-button,
#submit-button.button-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 16px;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: var(--participant-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

#next-button:hover,
#submit-button.button-submit:hover {
    background: var(--participant-accent-dark);
}

#page-number,
#page-number2 {
    display: none;
}

@media (max-width: 1100px) {
    .experiment-shell {
        display: block;
        width: min(980px, calc(100% - 28px));
    }

    .right-section {
        margin-top: 14px;
    }

    .floating-quiz {
        position: static;
        max-height: none;
    }
}

@media (max-width: 760px) {
    .participant-login {
        align-items: flex-start;
        padding: 20px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        gap: 22px;
        padding-top: 24px;
    }

    .login-panel {
        padding: 24px;
    }

    .page-shell,
    .experiment-shell {
        width: min(100% - 20px, 980px);
        margin-top: 10px;
    }

    .feed-header,
    .feed-panel,
    .floating-quiz {
        padding: 18px;
    }

    .news-choice,
    .experiment-news-page #news_box .news-item {
        min-height: 190px;
        padding: 16px;
        padding-bottom: 52px;
    }

    .news-media.image-count-3,
    .news-media.image-count-4,
    .news-media.image-count-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .news-media.image-count-1 img {
        max-height: 210px;
    }
}
