/* ============================================
   角色查找工具（role-search.html）样式
   ============================================ */

/* 结果卡片（与剧本查找结果卡片 .result-item 风格一致） */
.rs-item {
    background: var(--surface);
    padding: 12px;
    margin: 8px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    word-wrap: break-word;
}
.rs-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.rs-name {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--text);
}
.rs-badge {
    padding: 1px var(--space-3);
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
/* 团队徽章配色 */
.rs-town { background: var(--team-town); }
.rs-outsider { background: var(--team-outsider); }
.rs-minion { background: var(--team-minion); }
.rs-demon { background: var(--team-demon); }
.rs-traveller { background: var(--team-traveller); }
.rs-fabled { background: var(--team-fabled); }
.rs-loric { background: var(--team-loric); }
.rs-unknown { background: var(--team-unknown); }

.rs-src {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-bottom: 4px;
}
.rs-ability {
    font-size: var(--fs-s);
    line-height: 1.7;
    color: var(--text);
}
.rs-script {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

/* 结果卡增强字段（2026-08-26）：token / 首夜·其他夜 / 相克 等辅助行 */
.rs-line {
    margin-top: 6px;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    line-height: 1.6;
    word-break: break-word;
}
.rs-flavor {
    margin-top: 8px;
    font-size: var(--fs-s);
    line-height: 1.7;
    color: var(--text);
    word-break: break-word;
}
.rs-flavor .rs-flavor-label {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

/* 可点击卡片 + 详情弹窗 */
.rs-clickable {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rs-clickable:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(26, 10, 46, 0.18);
}
.rs-hint {
    margin-top: 8px;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-align: right;
}
.rs-modal {
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
}
.rs-detail-img {
    margin: 12px 0;
    text-align: center;
}
.rs-detail-img img {
    max-width: 130px;
    max-height: 130px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.rs-detail-meta {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin: var(--space-3) 0;
    line-height: 1.6;
}
.rs-detail-ability {
    font-size: var(--fs-sm);
    line-height: 1.8;
    margin-bottom: 12px;
    word-break: break-word;
}
.rs-detail-scripts {
    font-size: var(--fs-s);
    line-height: 1.8;
    word-break: break-word;
}
.rs-detail-author {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 8px;
}

/* ============================================
   响应式补丁（2026-08-24）：原样式缺断点，补充双端适配
   ============================================ */
@media (max-width: 768px) {
    .rs-head {
        flex-wrap: wrap;
    }
    .rs-badge {
        font-size: var(--fs-2xs);
        padding: 1px 8px;
    }
    .rs-name {
        font-size: var(--fs-md);
    }
    .rs-hint {
        text-align: left;
    }
}
@media (max-width: 480px) {
    .rs-item {
        padding: var(--space-3);
    }
    .rs-detail-img img {
        max-width: 96px;
        max-height: 96px;
    }
}

/* ============================================
   P1-3 补丁：团队徽章白字对比度 <4.5:1 修复（2026-08-24）
   仅加深不达标的 5 色（保留白字与色相），达标色（镇民/恶魔/旅行者）不动。
   验证（白字对比）：outsider 3.47→4.98、minion 3.47→4.81、
   fabled 4.07→5.49、loric 3.91→5.27、unknown 3.54→5.10
   ============================================ */
.rs-outsider { background: var(--team-outsider-deep); }
.rs-minion { background: var(--team-minion-deep); }
.rs-fabled { background: var(--team-fabled-deep); }
.rs-loric { background: var(--team-loric-deep); }
.rs-unknown { background: var(--team-unknown-deep); }

/* 结果过多提示横幅：仅展示前 20 个时显示在结果列表顶部 */
.rs-limit-hint {
    background: rgba(224, 168, 0, 0.14);
    border: 1px solid rgba(224, 168, 0, 0.4);
    color: #9a6b00;
    padding: 10px 14px;
    margin: 8px 0 12px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    line-height: 1.5;
    font-weight: 600;
}

[data-theme="dark"] .rs-limit-hint {
    color: #e8c46a;
    background: rgba(224, 168, 0, 0.16);
    border-color: rgba(224, 168, 0, 0.42);
}
