/* ============================================================
   研究3.1 多人实时互动实验 —— 统一界面样式
   简洁、中性、学术：浅灰背景 + 白色圆角卡片 + 柔和边框
   绿/红仅用于实验规定的声誉信号，不用于任何道德暗示
   ============================================================ */

:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --border: #e3e6ea;
    --border-strong: #cfd5dc;
    --ink: #1f2933;
    --muted: #66707d;
    --accent: #2563eb;          /* 中性蓝：仅用于按钮/选中态等交互 */
    --accent-soft: #eef4ff;
    --green: #4EA72E;           /* 实验规定的绿色“+”信号 */
    --green-bg: #EDF6E7;
    --red: #FF0000;             /* 实验规定的红色“−”信号 */
    --red-bg: #FDECEC;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .07);
}

body {
    background: var(--bg);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 页面容器 ---------- */
.otree-body.container {
    max-width: 840px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 24px auto;
    padding: 28px 34px 36px;
    box-shadow: var(--shadow);
}

.otree-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: .01em;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.otree-title .pt-main { display: block; font-weight: 700; }
.otree-title .pt-sub {
    display: block;
    margin-top: 3px;
    font-size: .9rem;
    font-weight: 400;
    color: var(--muted);
}

/* ---------- 顶部轮次/进度栏 ---------- */
.exp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 16px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 18px;
}

.exp-topbar__round { font-weight: 700; white-space: nowrap; }
.exp-topbar__round .cur { font-size: 1.15em; }

.exp-topbar__payoff { color: var(--accent); font-weight: 700; white-space: nowrap; }

.exp-progress {
    flex-basis: 100%;
    height: 6px;
    background: #eceff3;
    border-radius: 3px;
    overflow: hidden;
}
.exp-progress__fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }

/* ---------- 信息框（通用） ---------- */
.info-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 14px 0;
    background: var(--card);
}
.info-box--tint { background: #fafbfc; }
/* 信息框变体：不再使用彩色侧边，统一四边细边框 + 浅色填充 */
.info-box--accent { background: var(--accent-soft); }
.info-box--note  { background: #fff8ec; }
.info-box--signal { background: #fafbfc; text-align: center; }
.info-box__title {
    font-weight: 700;
    margin: 0 0 8px;
    font-size: 1rem;
}
.info-box p:last-child { margin-bottom: 0; }

/* 页首引导句 */
.page-intro { color: var(--ink); margin: 0 0 16px; }

/* ---------- 关键数字突出 ---------- */
.num { font-weight: 700; }
.token-num {
    display: inline-block;
    min-width: 1.6em;
    text-align: center;
    font-weight: 700;
    padding: 0 6px;
    background: #f2f4f7;
    border-radius: 6px;
}

/* 键值对（用于"初始代币 / 小组人数"等信息卡） */
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; }
.kv-row__k { color: var(--muted); }
.kv-row__v { font-weight: 700; }

/* ---------- 步骤指示 ---------- */
.step-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.step-item { display: flex; gap: 12px; align-items: flex-start; }
.step-badge {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    display: flex; align-items: center; justify-content: center;
}
.step-item__body { flex: 1; }

/* ---------- 决策选项卡（单选卡片，中性、等大） ---------- */
.choice-card-list {
    display: flex;
    flex-direction: column;   /* 每个选项独占一行，按 PPT 从上到下 */
    gap: 10px;
    margin: 16px 0;
}

.choice-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    background: var(--card);
    transition: border-color .12s, background .12s, box-shadow .12s;
}
.choice-card__body { flex: 1 1 auto; min-width: 0; }
.choice-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice-card.selected { border-color: var(--accent); background: var(--accent-soft); }

.choice-card input[type="radio"] {
    /* 选项左侧清楚可见的单选按钮；整行点击同样可选中 */
    position: static;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    opacity: 1;
    cursor: pointer;
    accent-color: var(--accent);
}
.choice-card__title { font-weight: 700; font-size: 1.02rem; }
.choice-card__desc { color: var(--muted); font-size: .93rem; line-height: 1.6; }
.choice-card__meta {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: flex; flex-wrap: wrap; gap: 6px 14px;
    font-size: .88rem; color: var(--muted);
}
.choice-card__meta b { color: var(--ink); }

/* 提示：卡片内信号仍用实验规定的颜色 */
.choice-card__desc .signal { font-size: .95em; }

/* ---------- 声誉信号徽章（实验规定：绿“+”、红“−”） ---------- */
.signal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 12px;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.5;
}
.signal.plus  { background: var(--green-bg); color: var(--green); }
.signal.minus { background: var(--red-bg);  color: var(--red); }

.signal--large { font-size: 1.25rem; padding: 6px 22px; }

/* ---------- 表格 ---------- */
.payoff-table, .rules-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.payoff-table th, .payoff-table td,
.rules-table th, .rules-table td {
    border: 1px solid var(--border);
    padding: 9px 12px;
    text-align: center;
    vertical-align: middle;
}
.payoff-table th, .rules-table th { background: #f7f9fb; font-weight: 700; }
.payoff-table .total-row td { font-weight: 700; background: #fafbfc; }
.payoff-table .num-col { font-weight: 700; }

/* ---------- 结果模块 ---------- */
.result-module {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 14px 0;
    background: var(--card);
}
.result-module__title {
    font-weight: 700;
    font-size: 1.02rem;
    color: #1565d8;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.result-module p { margin: 6px 0; }
.result-module .big-payoff {
    font-size: 1.3rem;
    font-weight: 700;
}

/* ---------- 等待页 ---------- */
.otree-wait-page.container { max-width: 560px; }
.wait-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.wait-card__header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
    font-weight: 700;
}
.wait-card__body { padding: 30px 24px; text-align: center; }
.wait-spinner {
    width: 36px; height: 36px;
    margin: 0 auto 14px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: exp-spin 1s linear infinite;
}
@keyframes exp-spin { to { transform: rotate(360deg); } }
.wait-card__body p { color: var(--ink); margin: 6px 0; }

/* ---------- 倒计时 ---------- */
.countdown { font-weight: 700; color: var(--accent); }
.countdown.urgent { color: var(--red); }

/* ---------- 按钮 ---------- */
.otree-btn-next, .btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 10px 26px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background .12s, opacity .12s;
}
.otree-btn-next:hover, .btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-primary:disabled, .otree-btn-next:disabled { opacity: .45; cursor: not-allowed; background: var(--accent); border-color: var(--accent); }

/* 决策页主按钮 */
.exp-btn {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 8px auto 0;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 12px 26px;
    font-size: 1.02rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background .12s, opacity .12s;
}
.exp-btn:hover { background: #1d4ed8; }
.exp-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 理解检测（formfields 默认单选样式美化） ---------- */
._formfield { margin-bottom: 22px; }
._formfield .col-form-label { font-weight: 600; color: var(--ink); }
._formfield .controls { margin-top: 6px; }
._formfield .form-check {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 6px 0;
    transition: border-color .12s, background .12s;
}
._formfield .form-check:hover { border-color: var(--accent); background: var(--accent-soft); }
._formfield .form-check input[type="radio"] { margin: 0; }

/* ---------- 结束/终止 ---------- */
.end-summary {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    background: #fafbfc;
    text-align: center;
    margin: 18px 0;
}
.end-summary .big-payoff { font-size: 1.6rem; font-weight: 700; color: var(--ink); }

/* ---------- 响应式 ---------- */
@media (max-width: 620px) {
    /* width:auto 让容器在窄屏收缩到 margin 之内，避免 10px 横向滚动 */
    .otree-body.container { padding: 18px 16px 24px; margin: 10px; width: auto; border-radius: 10px; }
    .choice-card-list { grid-template-columns: 1fr; }
    .exp-topbar { padding: 10px 12px; }
    .otree-title { font-size: 1.2rem; }
    body { font-size: 15px; }
    .exp-btn { max-width: 100%; }
    .payoff-table th, .payoff-table td, .rules-table th, .rules-table td { padding: 7px 8px; font-size: .9rem; }
}

/* ============================================================
   决策卡片内的规格行（个人成本 / 公共收益 / 声誉）
   —— 三张卡片结构一致、底部对齐，保证视觉对称
   ============================================================ */
.card-spec {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-spec .kv-row { padding: 2px 0; }

/* ============================================================
   结果反馈页：任务分层（任务一 / 任务二 → 子模块 A/B → 收益汇总）
   ============================================================ */
.task-sub {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 12px 0 0;
    background: #fafbfc;
}
.task-sub__head {
    font-weight: 700;
    font-size: .96rem;
    margin: 0 0 8px;
    color: var(--ink);
}
.task-sub__total {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-weight: 700;
}
.summary-card {
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin: 20px 0;
    background: var(--card);
    box-shadow: var(--shadow);
}
.summary-card__title {
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 5px 0;
}
.summary-row__k { color: var(--muted); }
.summary-row__v { font-weight: 700; }
.summary-row--rule { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.summary-row--big .summary-row__v { font-size: 1.3rem; }
.summary-row--big .summary-row__k { color: var(--ink); font-weight: 600; }

/* ============================================================
   结果反馈（第二轮精简）：任务头 + 紧凑信息 + 角色分区
   ============================================================ */
.task-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.task-head__title { font-weight: 700; font-size: 1.02rem; }
.task-head__pay { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 6px 24px;
}
.info-grid__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
.info-grid__k { color: var(--muted); white-space: nowrap; }
.info-grid__v { font-weight: 600; text-align: right; }

.tg-role { padding: 6px 0; }
.tg-role__head { font-weight: 700; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.tg-role__meta { color: var(--muted); font-size: .92rem; margin-bottom: 4px; }
.tg-role__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.tg-role__text { flex: 1 1 auto; min-width: 0; }
.tg-role__pay { font-weight: 700; white-space: nowrap; }
.tg-divider { border-top: 1px solid var(--border); margin: 8px 0; }

.summary-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    text-align: center;
}
.summary-pair__k { color: var(--muted); font-size: .9rem; }
.summary-pair__v { font-weight: 700; font-size: 1.4rem; }

@media (max-width: 620px) {
    .summary-pair { grid-template-columns: 1fr; gap: 10px; }
    .summary-pair__v { font-size: 1.25rem; }
    .tg-role__row { gap: 10px; }
    .tg-role__text { font-size: .95rem; }
    .info-grid { grid-template-columns: 1fr; gap: 2px; }
}

/* ============================================================
   指导语：例子卡片与收益矩阵图
   ============================================================ */
.example-grid {
    display: flex;
    flex-direction: column;   /* 一行一个例子，例1→例5 纵向排列 */
    gap: 12px;
    margin: 14px 0;
}
.example-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    overflow: hidden;
}
.example-card__head {
    background: #f7f9fb;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    font-weight: 700;
    font-size: .94rem;
}
.example-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.example-table td { padding: 5px 12px; border-bottom: 1px dashed var(--border); vertical-align: top; }
.example-table tr:last-child td { border-bottom: none; }
.ex-k { color: var(--muted); white-space: nowrap; width: 64px; }
.ex-v { color: var(--ink); }
.ex-you { font-weight: 700; }
.example-acct {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fafbfc;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
    font-size: .9rem;
    line-height: 1.6;
}
.example-acct__img { width: 40px; height: 40px; flex: 0 0 auto; }
.example-table--pay { background: #fdfdfe; }
.example-note {
    padding: 8px 12px;
    background: #fff8ec;
    border-top: 1px solid var(--border);
    font-size: .86rem;
    color: #8a6d3b;
}

/* 收益矩阵图 */
.matrix-wrap { display: flex; justify-content: center; margin: 16px 0; }
.matrix-table { border-collapse: collapse; font-size: .92rem; }
.matrix-table td {
    border: 1px solid var(--border);
    padding: 8px 16px;
    text-align: center;
    min-width: 76px;
}
.matrix-head { background: #f7f9fb; font-weight: 700; }
.matrix-corner { border: none; background: transparent; }
.matrix-corner__sig { color: var(--muted); font-size: .85rem; line-height: 1.4; }
.matrix-pay { font-weight: 700; }

@media (max-width: 620px) {
    .example-grid { grid-template-columns: 1fr; }
    .matrix-table td { padding: 6px 8px; min-width: 56px; font-size: .86rem; }
}

/* ============================================================
   版式：减少不必要边框
   —— 普通段落/规则说明只用标题、字重、段距与留白分层
   ============================================================ */
.inst-section { margin: 18px 0; }
.inst-section__title {
    font-weight: 700;
    font-size: 1.02rem;
    margin: 0 0 8px;
    color: var(--ink);
}
.inst-section p { margin: 0 0 8px; }
.inst-section ul, .inst-section ol { margin: 0 0 8px; padding-left: 22px; }
.inst-section li { margin: 2px 0; }
.inst-list--plain { list-style: none; padding-left: 0; }
.inst-list--plain li { padding: 2px 0; }

/* 页面副标题（本轮代号） */
.round-sub {
    color: var(--muted);
    font-size: .9rem;
    margin: -10px 0 14px;
}

/* 例子卡片：去掉外层边框，只用间距与标题分隔 */
.example-card {
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.example-grid .example-card:last-child { border-bottom: none; }
.example-card__head {
    background: transparent;
    border-bottom: none;
    padding: 0 0 6px;
    font-weight: 700;
    font-size: .96rem;
}

/* 结果页：高亮三要素 */
.result-highlight {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 8px 0 10px;
}
.result-highlight__item {
    background: #fafbfc;
    border-radius: 8px;
    padding: 10px 12px;
}
.result-highlight__k { color: var(--muted); font-size: .84rem; margin-bottom: 2px; }
.result-highlight__v { font-weight: 700; font-size: 1.02rem; }
.result-secondary { color: var(--muted); font-size: .88rem; margin: 0; }

@media (max-width: 620px) {
    .result-highlight { grid-template-columns: 1fr; gap: 6px; }
}

/* ============================================================
   版式：提交区、按钮对齐、示例横向行
   ============================================================ */
.submit-area {
    margin: 22px auto 0;
    max-width: 360px;
    text-align: center;
}
.submit-area__time {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 8px;
}
.submit-area__time .countdown { font-weight: 700; }
.submit-area .exp-btn { width: 100%; max-width: none; margin: 0; }

/* 只有一个按钮时水平居中 */
.otree-btn-next { display: block; margin: 22px auto 0; }

/* 两个导航按钮并排时的左右分布（现阶段未使用，先备样式） */
.nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 22px auto 0;
    max-width: 620px;
}

/* ---- 示例页：每个例子占一行，横向四栏 ---- */
.example-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1.15fr) minmax(0, .8fr) minmax(0, 1.15fr);
    gap: 20px;
    align-items: start;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.example-row:last-child { border-bottom: none; }
.example-row__no { font-weight: 700; font-size: .96rem; }
.ex-col-title {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}
.ex-line { padding: 2px 0; font-size: .92rem; }
.ex-line .ex-k { display: inline-block; width: 52px; color: var(--muted); }
.ex-line--you { font-weight: 700; color: #1565d8; }   /* 被试自己的选择/收益：高饱和蓝色加粗 */
.ex-line--you .ex-k { color: inherit; }           /* 「你」字同色 */
.example-acct-inline { font-size: .92rem; line-height: 1.8; }
.example-acct-inline img { width: 32px; height: 32px; vertical-align: middle; margin-right: 6px; }
/* 加大例子之间的间距 */
.example-grid { gap: 6px; }

@media (max-width: 760px) {
    .example-row { grid-template-columns: 1fr; gap: 10px; padding: 14px 0; }
    .example-row__no { font-size: 1rem; }
}

/* 选项序号 */
.opt-no {
    display: inline-block;
    min-width: 1.5em;
    font-weight: 700;
    color: var(--muted);
    margin-right: 2px;
}

/* 居中的信息块 */
.info-box--center { text-align: center; }

/* 示例页「公共账户」列：标题、图像、文字三行居中 */
.ex-acct-col { text-align: center; }
.ex-acct-col .ex-col-title { text-align: center; }
.ex-acct-img {
    display: block;
    margin: 6px auto;
    width: 36px;
    height: 36px;
}
.ex-acct-text { font-size: .92rem; line-height: 1.7; }

/* 普通文字不用彩色侧边或底框区分层级，靠标题、字重、段距与留白 */
.inst-section--accent { padding-left: 0; }
.inst-section--note { padding: 0; }

/* 单一提示框：浅色填充 + 同色系较深的均匀边框（四边一致，无单侧强调） */
.notice-box {
    margin: 14px 0;
    padding: 12px 16px;
    background: #f2f7fd;
    border: 1px solid #a9c5e8;
    border-radius: 8px;
}
.notice-box p { margin: 0 0 6px; }
.notice-box p:last-child { margin-bottom: 0; }

/* 标题区：标题下方的说明文字与分隔线 */
.title-note {
    text-align: center;
    color: var(--muted);
    font-size: .92rem;
    margin: -6px 0 10px;
    line-height: 1.7;
}
.title-rule {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0 0 18px;
}

/* 人口统计学：阶层梯子图 */
.ladder-block { margin: 18px 0; }
.ladder-block p { margin: 0 0 8px; }
.ladder-img {
    display: block;
    margin: 10px auto;
    max-width: 420px;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* 结束页 */
.end-summary { text-align: center; padding: 40px 16px; }
.end-summary__title { font-size: 1.3rem; font-weight: 700; margin: 0 0 10px; }

/* 结束页：结束实验按钮与完成确认 */
.end-action { text-align: center; margin: 24px auto 0; max-width: 320px; }
.end-action .exp-btn { width: 100%; margin: 0; }
.end-done { text-align: center; margin: 24px auto 0; max-width: 520px; }
.end-done__icon {
    width: 46px; height: 46px; line-height: 46px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #e9f7ee; color: #1a7f37;
    font-size: 1.4rem; font-weight: 700;
}
.end-done__title { font-size: 1.1rem; font-weight: 700; margin: 0 0 6px; }
.end-done__hint { color: var(--muted); font-size: .9rem; margin: 0; }

/* ========== 理解题「查看规则」按钮与弹窗 ========== */
/* 只有按钮、无底框（此前的灰色说明文字已移除） */
.rules-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
    gap: 10px; margin: 6px 0 14px; padding: 0;
    background: none; border: none; border-radius: 0;
}
.rules-bar__hint { font-size: .88rem; color: #5a6b85; }
.rules-bar__btn {
    flex: 0 0 auto; padding: 7px 18px; font-size: .9rem; font-weight: 600;
    color: #fff; background: #1565d8; border: none; border-radius: 8px; cursor: pointer;
}
.rules-bar__btn:hover { background: #0f52b0; }
.rules-bar__btn:focus-visible { outline: 2px solid #93b4ea; outline-offset: 2px; }

body.rules-locked { overflow: hidden; }

.rules-modal {
    position: fixed; inset: 0; z-index: 2000; display: none;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(15, 23, 42, .5);
}
.rules-modal.open { display: flex; }
.rules-modal__panel {
    display: flex; flex-direction: column;
    width: min(980px, 96vw); max-height: 88vh;
    background: #fff; border-radius: 14px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28); overflow: hidden;
}
.rules-modal__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid #e6eaf0;
}
.rules-modal__title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #1f2937; }
.rules-modal__close {
    width: 32px; height: 32px; font-size: 1.35rem; line-height: 1;
    color: #6b7280; background: #f3f4f6; border: none; border-radius: 8px; cursor: pointer;
}
.rules-modal__close:hover { background: #e5e7eb; color: #111827; }
.rules-modal__body { display: flex; min-height: 0; flex: 1; }
.rules-modal__nav {
    flex: 0 0 178px; padding: 12px 10px; border-right: 1px solid #e6eaf0;
    background: #fafbfd; overflow: auto;
}
.rules-nav__item {
    display: block; width: 100%; margin-bottom: 4px; padding: 8px 10px;
    font-size: .86rem; text-align: left; color: #334155;
    background: transparent; border: none; border-radius: 8px; cursor: pointer;
}
.rules-nav__item:hover { background: #eef2f8; }
.rules-nav__item.is-active { font-weight: 700; color: #1565d8; background: #e8f0fe; }
.rules-modal__content { flex: 1; min-width: 0; padding: 4px 22px 22px; overflow: auto; }

.rules-ref .rr-section { padding: 14px 0; border-bottom: 1px dashed #e6eaf0; }
.rules-ref .rr-section:last-child { border-bottom: none; }
.rules-ref .rr-title { margin: 0 0 8px; font-size: .98rem; font-weight: 700; color: #1565d8; }
.rules-ref p { margin: 0 0 8px; font-size: .92rem; line-height: 1.72; color: #1f2937; }
.rules-ref ul { margin: 0 0 8px; padding-left: 1.2em; }
.rules-ref li { margin-bottom: 4px; font-size: .92rem; line-height: 1.72; color: #1f2937; }
.rules-ref .rr-sub { margin: 12px 0 6px; font-weight: 600; color: #334155; }
.rules-ref .num { font-weight: 700; color: #1565d8; }
.rules-ref .rr-callout { padding: 10px 14px; background: #fff8ec; border-left: 3px solid #f0a020; border-radius: 6px; }
.rules-ref .rules-table { margin: 6px 0 12px; font-size: .9rem; }
.rules-ref .rules-table th, .rules-ref .rules-table td { padding: 7px 10px; }

/* 窄屏：导航改为顶部横向滑动，内容占满宽度 */
@media (max-width: 640px) {
    .rules-modal { padding: 10px; }
    .rules-modal__panel { width: 100%; max-height: 92vh; }
    .rules-modal__body { flex-direction: column; }
    .rules-modal__nav {
        flex: 0 0 auto; display: flex; gap: 6px;
        overflow-x: auto; overflow-y: hidden;
        border-right: none; border-bottom: 1px solid #e6eaf0;
        padding: 8px 10px; white-space: nowrap;
    }
    .rules-nav__item { width: auto; margin-bottom: 0; white-space: nowrap; }
    .rules-modal__content { padding: 4px 14px 16px; }
    .rules-ref .rules-table { font-size: .82rem; }
    .rules-ref .rules-table th, .rules-ref .rules-table td { padding: 6px 4px; }
}

/* 结束页去掉重复标题后，避免残留空标题占位 */
.otree-title:empty { display: none; }

/* ========== 强制阅读：下一页按钮先灰后蓝（不显示倒计时） ========== */
.otree-btn-next.read-gate-locked,
.otree-btn-next.read-gate-locked:disabled {
    background: #c7ccd4 !important;
    border-color: #c7ccd4 !important;
    color: #fff !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}
.otree-btn-next.read-gate-unlocked {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

/* ========== 报销页：支付宝账号强提醒 ========== */
.field-alert {
    margin: -4px 0 18px;
    padding: 10px 14px;
    background: #fff8ec;
    border: 1px solid #e8c88a;
    border-radius: 8px;
    font-size: .92rem;
    line-height: 1.7;
    color: #7a4b00;
}
.field-alert strong { color: #a15c00; }

/* ========== 通用确认弹窗（支付宝二次确认） ========== */
.confirm-modal {
    position: fixed; inset: 0; z-index: 2100; display: none;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(15, 23, 42, .5);
}
.confirm-modal.open { display: flex; }
.confirm-modal__panel {
    width: min(460px, 94vw); background: #fff; border-radius: 14px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28); overflow: hidden;
}
.confirm-modal__head {
    padding: 14px 18px; font-weight: 700; font-size: 1.02rem;
    color: #1f2937; border-bottom: 1px solid #e6eaf0;
}
.confirm-modal__body { padding: 16px 18px; }
.confirm-modal__body p { margin: 0 0 8px; font-size: .94rem; }
.confirm-modal__account {
    font-weight: 700; font-size: 1.05rem; color: #1565d8;
    word-break: break-all; background: #f2f7fd; border-radius: 8px;
    padding: 8px 12px;
}
.confirm-modal__hint { color: var(--muted); font-size: .88rem; margin-bottom: 0 !important; }
.confirm-modal__foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 12px 18px 18px;
}
.confirm-modal__foot .exp-btn { width: auto; min-width: 110px; margin: 0; }
.exp-btn--ghost {
    background: #fff; color: #44546a; border: 1px solid #cfd6e0;
}
.exp-btn--ghost:hover { background: #f4f6f9; }

/* ========== 决策选项：整卡可点加固 ========== */
.choice-card { user-select: none; -webkit-user-select: none; }
.choice-card * { user-select: none; -webkit-user-select: none; }
.choice-card.selected {
    border-color: var(--accent);
    border-width: 2px;
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px rgba(21, 101, 216, .12);
}

/* oTree 自带的通用「请修复错误。」条与逐题提示重复，隐藏之；
   页面级提示由各页面自己呈现（理解题页有统一提示条）。 */
.otree-form-errors { display: none !important; }

/* ========== 欢迎页：全屏快捷键提示（红色加粗加大、居中） ========== */
.fullscreen-hint {
    margin: 22px auto 6px;
    text-align: center;
    color: #FF0000;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.75;
}
.fullscreen-hint strong { color: #FF0000; font-weight: 700; }

/* 理解题 9a/9b 自定义单选项 */
.cq-radio { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.cq-radio label { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
  border: 1px solid #d9dde3; border-radius: 8px; cursor: pointer; line-height: 1.5; }
.cq-radio label:hover { border-color: #8aa4c8; background: #f7f9fc; }
.cq-radio input { margin-top: 4px; }

/* 9a/9b 答错时标红（与其它题一致） */
.form-group:has(.form-control-errors) > .col-form-label { color: #c0392b; }
.form-group:has(.form-control-errors) .cq-radio label { border-color: #f0b4ae; background: #fff7f6; }
.form-control-errors { color: #c0392b; font-size: .9rem; margin-top: 4px; }
