/* ======================================================================
 *  校园反欺凌求助指南 /tool/anti-bully
 *  依赖 calc-common.css 变量与公共类，支持黑夜模式，适配移动端。
 * ====================================================================== */

/* ---------- 模式切换 ---------- */
.ab-seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.ab-seg button {
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text-sub);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
    white-space: nowrap;
}
.ab-seg button:hover { border-color: #5b6cff; color: #5b6cff; }
.ab-seg button.is-active {
    background: linear-gradient(135deg, rgba(91, 108, 255, 0.14), rgba(58, 63, 191, 0.07));
    border-color: rgba(91, 108, 255, 0.55);
    color: #3a3fbf;
}

/* ---------- HUD ---------- */
.ab-hud {
    display: flex;
    gap: 16px;
    font-size: 12.5px;
    color: var(--c-text-muted);
    margin-bottom: 8px;
}
.ab-hud b { color: var(--c-text); font-size: 14px; }
.ab-bar {
    height: 8px;
    border-radius: 99px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    overflow: hidden;
    margin-bottom: 16px;
}
.ab-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #3a3fbf, #5b6cff);
    transition: width 0.35s ease;
}

/* ---------- 情景卡 ---------- */
.ab-scene {
    position: relative;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(91, 108, 255, 0.08), rgba(58, 63, 191, 0.05));
    border: 1px solid rgba(91, 108, 255, 0.28);
    margin-bottom: 14px;
}
.ab-scene-label {
    position: absolute;
    top: -9px;
    left: 14px;
    padding: 1px 10px;
    border-radius: 99px;
    background: #5b6cff;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.ab-q { font-size: 15px; font-weight: 700; line-height: 1.75; color: var(--c-text); }

/* ---------- 判断按钮 ---------- */
.ab-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.ab-choice {
    padding: 14px 10px;
    border-radius: 14px;
    border: 2px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ab-choice--yes { border-color: rgba(255, 59, 48, 0.4); background: rgba(255, 59, 48, 0.06); color: #e0342b; }
.ab-choice--no { border-color: rgba(52, 199, 89, 0.4); background: rgba(52, 199, 89, 0.06); color: #1f9d43; }
.ab-choice:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ab-choice:disabled { cursor: default; opacity: 0.55; }
.ab-choice.is-answer {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.35);
    animation: abPop 0.3s ease;
}
.ab-choice.is-wrong { animation: abShake 0.4s ease; }
@keyframes abPop {
    0% { transform: scale(0.95); }
    60% { transform: scale(1.04); }
    100% { transform: scale(1); }
}
@keyframes abShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

/* ---------- 反馈 ---------- */
.ab-feedback {
    padding: 13px 15px;
    border-radius: 12px;
    margin-bottom: 14px;
    animation: calcFade 0.25s ease;
}
.ab-feedback.is-ok {
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.35);
}
.ab-feedback.is-bad {
    background: rgba(255, 59, 48, 0.07);
    border: 1px solid rgba(255, 59, 48, 0.32);
}
.ab-fb-head { font-size: 14.5px; font-weight: 800; margin-bottom: 6px; }
.ab-fb-why { font-size: 13px; line-height: 1.75; color: var(--c-text); }

.ab-btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 结算 ---------- */
.ab-over { text-align: center; padding: 18px 12px 4px; animation: calcFade 0.3s ease; }
.ab-stars {
    font-size: 34px;
    letter-spacing: 6px;
    color: #ffb020;
    text-shadow: 0 2px 10px rgba(255, 176, 32, 0.35);
    margin-bottom: 8px;
}
.ab-over-txt { font-size: 14.5px; font-weight: 700; color: var(--c-text); margin-bottom: 12px; }

/* ---------- 三步指南 ---------- */
.ab-guide-card {
    padding: 15px 16px;
    border-radius: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--c-border);
}
.ab-guide-card h3 { font-size: 14.5px; font-weight: 800; margin-bottom: 8px; }
.ab-guide-card p { font-size: 13.5px; line-height: 1.9; color: var(--c-text-sub); }
.ab-guide-card p b { color: var(--c-text); }
.ab-guide-card--1 { background: rgba(91, 108, 255, 0.06); border-color: rgba(91, 108, 255, 0.3); }
.ab-guide-card--2 { background: rgba(255, 176, 32, 0.06); border-color: rgba(255, 176, 32, 0.32); }
.ab-guide-card--3 { background: rgba(52, 199, 89, 0.06); border-color: rgba(52, 199, 89, 0.3); }
.ab-guide-card--p { background: rgba(0, 150, 220, 0.05); border-color: rgba(0, 150, 220, 0.28); }

/* ---------- AI ---------- */
.ab-ai-lead { font-size: 13px; line-height: 1.8; color: var(--c-text-sub); margin-bottom: 10px; }
.ab-ai textarea {
    width: 100%;
    margin: 10px 0 2px;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.ab-ai textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.ab-ai-list {
    margin: 0 0 12px;
    padding-left: 0;
    list-style: none;
}
.ab-ai-list li {
    position: relative;
    padding: 5px 0 5px 24px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--c-text);
}
.ab-ai-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    top: 5px;
    color: #5b6cff;
    font-weight: 800;
}

/* ---------- 右侧解析 ---------- */
.ab-detail-tag {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 99px;
    background: rgba(91, 108, 255, 0.12);
    color: #3a3fbf;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 12px;
}
.ab-detail-q { font-size: 14.5px; font-weight: 700; line-height: 1.7; color: var(--c-text); margin-bottom: 12px; }
.ab-detail-verdict {
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 13px;
    border-radius: 10px;
    margin-bottom: 10px;
}
.ab-detail-verdict.is-ok {
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.3);
    color: #1f9d43;
}
.ab-detail-verdict.is-bad {
    background: rgba(255, 59, 48, 0.07);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #e0342b;
}
.ab-detail-why { font-size: 13px; line-height: 1.85; color: var(--c-text-sub); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .ab-seg { grid-template-columns: 1fr; }
    .ab-q { font-size: 14px; }
    .ab-choice { font-size: 13.5px; padding: 12px 8px; }
}

/* ---------- 黑夜模式 ---------- */
[data-theme="dark"] .ab-seg button { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .ab-seg button.is-active {
    background: rgba(91, 108, 255, 0.2);
    border-color: rgba(91, 108, 255, 0.5);
    color: #a5b0ff;
}
[data-theme="dark"] .ab-scene { background: rgba(91, 108, 255, 0.12); border-color: rgba(91, 108, 255, 0.32); }
[data-theme="dark"] .ab-choice--yes { background: rgba(255, 59, 48, 0.12); color: #ff9a94; }
[data-theme="dark"] .ab-choice--no { background: rgba(52, 199, 89, 0.12); color: #4ede78; }
[data-theme="dark"] .ab-detail-tag { background: rgba(91, 108, 255, 0.2); color: #a5b0ff; }
[data-theme="dark"] .ab-detail-verdict.is-ok { background: rgba(52, 199, 89, 0.13); color: #4ede78; }
[data-theme="dark"] .ab-detail-verdict.is-bad { background: rgba(255, 59, 48, 0.13); color: #ff9a94; }
[data-theme="dark"] .ab-ai textarea { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .ab-ai-list li::before { color: #a5b0ff; }
