.qz-rps-card {
    position: relative; overflow: hidden; padding: 0;
    background: #ffffff; border: 1px solid #eef0f3; border-radius: 16px;
    box-shadow: 0 8px 24px rgba(30,20,60,.05); margin-bottom: 16px;
    font-family: system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
    /* 增加最小高度，防止被外层 flex 压扁 */
    flex-shrink: 0 !important; 
}
.qz-rps-card * { box-sizing: border-box; }

/* === 核心：碾压主题全局按钮样式 === */
.qz-rps-card button {
    margin: 0; outline: none; font-family: inherit;
    -webkit-appearance: none !important; appearance: none !important;
    line-height: 1.2 !important; box-sizing: border-box !important;
}
.qz-rps-card button:focus { outline: none; }

.qz-rps-card::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 86px;
    background: linear-gradient(135deg, rgba(255,138,61,.15), rgba(255,92,138,.1) 55%, rgba(124,92,255,.12));
    pointer-events: none;
}
.rps-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 12px 6px; }
.rps-verse { position: relative; width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg,#ff9a4d,#ff5c8a); box-shadow: 0 4px 12px rgba(255,92,138,.3); flex-shrink: 0; }
.rps-verse>span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; opacity: 0; }
.rps-v1 { animation: rps-cycle 4.2s infinite; }
.rps-v2 { animation: rps-cycle 4.2s 1.4s infinite; }
.rps-v3 { animation: rps-cycle 4.2s 2.8s infinite; }
@keyframes rps-cycle {
    0%, 26% { opacity: 1; transform: translateY(0) rotate(-7deg) scale(1); }
    34%, 94% { opacity: 0; transform: translateY(-9px) rotate(10deg) scale(.75); }
    100% { opacity: 0; }
}
.rps-copy { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.rps-copy strong { font-size: 15px; font-weight: 800; color: #0f172a; }
.rps-copy small { color: #64748b; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rps-refresh { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #e2e8f0 !important; background: #fff !important; color: #64748b !important; cursor: pointer; display: flex !important; align-items: center; justify-content: center; font-size: 14px; transition: 0.2s; flex-shrink: 0; padding: 0; }
.rps-refresh:hover { color: #ff5c8a !important; border-color: #fecdd3 !important; transform: rotate(180deg); }

.rps-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 8px; font-size: 12.5px; color: #64748b; }
.rps-balance b { color: #ff5c8a; font-size: 15px; font-weight: 900; font-family: ui-monospace, monospace; margin-left: 4px; }
.rps-stake-tip b { color: #0f172a; font-weight: 800; }

.rps-list { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; max-height: 200px; overflow-y: auto; margin-bottom: 8px; }
.rps-list::-webkit-scrollbar { width: 4px; }
.rps-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
.rps-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px 8px; color: #94a3b8; font-size: 12px; text-align: center; }
.rps-empty-icon { font-size: 22px; }

.rps-item { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 8px; transition: background 0.2s; }
.rps-item:hover { background: #f8fafc; }
.rps-item+.rps-item { border-top: 1px solid #f1f5f9; }
.rps-ava { width: 30px; height: 30px; background: #e0f2fe; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.rps-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rps-name { font-size: 13px; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rps-self-tag { font-style: normal; font-size: 10px; color: #f43f5e; background: #ffe4e6; padding: 0 4px; border-radius: 4px; margin-left: 4px; }
.rps-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #94a3b8; }
.rps-pill { background: #fff7ed; color: #ea580c; padding: 0 4px; border-radius: 4px; font-weight: 700; }

.rps-take { padding: 5px 12px; border: 0 !important; border-radius: 99px; background: linear-gradient(135deg, #ff8a3d, #ff5c8a) !important; color: #fff !important; font-size: 12px !important; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(255,92,138,.25); transition: 0.2s; flex-shrink: 0; }
.rps-take:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(255,92,138,.35); }
.rps-wait { padding: 4px 10px; border: 0 !important; border-radius: 99px; background: #f1f5f9 !important; color: #94a3b8 !important; font-size: 11.5px !important; font-weight: 600; flex-shrink: 0; cursor: default; }

/* 主按钮重写 */
.rps-btn-main { display: flex !important; align-items: center !important; justify-content: center !important; width: calc(100% - 20px) !important; margin: 4px 10px 10px !important; padding: 10px 0 !important; border: 0 !important; border-radius: 10px !important; background: linear-gradient(135deg, #a855f7, #e11d48) !important; color: #fff !important; font-size: 14px !important; font-weight: 800 !important; cursor: pointer; box-shadow: 0 4px 14px rgba(168,85,247,.3) !important; transition: 0.2s; letter-spacing: 1px; }
.rps-btn-main:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(168,85,247,.4) !important; }

.rps-winners-wrap { padding: 2px 12px 12px; border-top: 1px dashed #e2e8f0; margin-top: 2px; }
.rps-winners-title { font-size: 12px; font-weight: 800; color: #334155; margin: 8px 0 4px; }
/* 战报文字支持自动换行 */
.rps-winners { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11.5px; color: #64748b; line-height: 1.5; white-space: normal; word-break: break-all; }
.rps-winner span { color: #94a3b8; font-size: 11px; }
.rps-winner.win { color: #10b981; font-weight: 800; }
.rps-winner.lose { color: #ef4444; font-weight: 800; }
.rps-winner.draw { color: #f59e0b; font-weight: 800; }
.rps-winner.is-empty { color: #94a3b8; font-weight: normal; }

/* 模态框 */
.rps-modal[hidden] { display: none; }
.rps-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.rps-mask { position: absolute; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(4px); }
.rps-panel { position: relative; width: 100%; max-width: 340px; padding: 24px 20px; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.2); text-align: center; animation: pop .3s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.rps-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0 !important; background: #f8fafc !important; color: #94a3b8 !important; font-size: 20px !important; line-height: 1 !important; cursor: pointer; border-radius: 50%; display: flex !important; align-items: center; justify-content: center; }
.rps-kicker { display: inline-block; padding: 3px 10px; border-radius: 99px; background: rgba(124,92,255,.12); color: #7c5cff; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.rps-pick h3, .rps-result h3 { margin: 0 0 8px; font-size: 20px; color: #0f172a; font-weight: 800; }
.rps-hint { margin: 0; color: #64748b; font-size: 13px; line-height: 1.6; }
.rps-hands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 10px; }
.rps-hand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 10px; border: 1px solid #e2e8f0 !important; border-radius: 14px; background: #f8fafc !important; cursor: pointer; transition: 0.2s; }
.rps-hand span { font-size: 36px; line-height: 1; }
.rps-hand em { font-style: normal; font-size: 13px; color: #475569; font-weight: 600; }
.rps-hand:hover { transform: translateY(-3px); border-color: #fbcfe8 !important; background: #fdf2f8 !important; box-shadow: 0 8px 16px rgba(255,92,138,.15); }
.rps-msg { min-height: 20px; margin: 10px 0 0; color: #ef4444; font-size: 13px; font-weight: 600; }

.rps-result[hidden] { display: none; }
.rps-result { display: flex; flex-direction: column; align-items: center; padding-top: 10px; }
.rps-clash { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; }
.rps-clash span { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border-radius: 20px; font-size: 44px; }
.rps-clash i { font-style: normal; font-weight: 900; color: #cbd5e1; font-size: 16px; }
.rps-result>p { margin: 0; color: #64748b; font-size: 14px; }
.rps-done { margin-top: 24px; padding: 10px 40px; border: 0 !important; border-radius: 99px; background: linear-gradient(135deg, #a855f7, #e11d48) !important; color: #fff !important; font-size: 14px !important; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(168,85,247,.3); }