/* ======================================================================
 * 角色状态面板 + 刷新配置弹窗样式
 * [REDESIGN-2026-05-31] 风格对齐心声弹窗：黑白杂志风
 *   - 白底 #fff / 纯黑描边 1.5px #0a0a0a / 直角无圆角
 *   - 大写英文标签 / Inter 字体 / #65656b 次要文字 / #f6f6f7 浅灰区块
 * 与 .heart-popup-card 系列保持一致的设计语言。
 * ====================================================================== */

/* ========== 心声卡片右上角的两个图标按钮 ========== */
.heart-popup-cfg-btn,
.heart-popup-status-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    cursor: pointer;
    color: #0a0a0a;
    transition: background .15s, color .15s;
}
.heart-popup-cfg-btn:hover,
.heart-popup-status-btn:hover {
    background: #f0f0f2;
}
.heart-popup-cfg-btn:active,
.heart-popup-status-btn:active {
    transform: scale(0.85);
}

/* ========== 通用遮罩 ========== */
.csp-overlay,
.rcfg-mask {
    position: fixed;
    /* [FIX-OPPO偏移] 旧版 Android WebView 不支持 inset 简写，会导致弹窗偏右，改用四边显式定位 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* ======================================================================
 * 角色状态面板
 * ====================================================================== */
.csp-panel {
    width: 100%;
    max-width: 360px;
    max-height: 80vh;
    background: #ffffff;
    border: 1.5px solid #0a0a0a;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #0a0a0a;
    font-family: 'Inter', -apple-system, 'SF Pro Display', 'PingFang SC', sans-serif;
    transform: translateY(12px) scale(0.98);
    transition: transform .22s ease;
}
.csp-panel--in { transform: translateY(0) scale(1); }
.csp-panel--out { transform: translateY(12px) scale(0.98); }

.csp-header {
    display: flex;
    align-items: center;
    padding: 16px 16px 12px;
    border-bottom: 1.5px solid #0a0a0a;
}
.csp-header-info { flex: 1; min-width: 0; }
.csp-header-name {
    font-size: 16px;
    font-weight: 700;
    color: #0a0a0a;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.csp-header-sub {
    font-size: 11px;
    color: #65656b;
    font-weight: 500;
    margin-top: 3px;
}
.csp-header-actions { display: flex; gap: 6px; }
.csp-icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #0a0a0a;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.csp-icon-btn:hover { background: #f0f0f2; }
.csp-icon-btn:active { transform: scale(0.85); }

.csp-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 16px;
}
.csp-empty {
    text-align: center;
    color: #65656b;
    font-size: 13px;
    font-weight: 500;
    padding: 28px 12px;
}

.csp-vals { display: flex; flex-direction: column; }
.csp-val-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 2px;
    border-bottom: 1px solid #e8e8ea;
}
.csp-val-row:last-child { border-bottom: none; }
.csp-val-name {
    font-size: 11px;
    color: #65656b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.csp-val-num {
    font-size: 15px;
    font-weight: 700;
    color: #0a0a0a;
    letter-spacing: .3px;
}
.csp-val-unit {
    font-size: 11px;
    color: #65656b;
    font-weight: 500;
    margin-left: 3px;
}

.csp-member-block {
    padding: 10px 0;
    border-bottom: 1px solid #e8e8ea;
}
.csp-member-block:last-child { border-bottom: none; }
.csp-member-name {
    font-size: 12px;
    font-weight: 700;
    color: #0a0a0a;
    margin-bottom: 4px;
    padding: 2px 8px;
    background: #0a0a0a;
    color: #ffffff;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.csp-foot {
    padding: 0;
    border-top: 1.5px solid #0a0a0a;
}
.csp-btn-primary,
.rcfg-btn-primary {
    width: 100%;
    height: 48px;
    background: #0a0a0a;
    border: none;
    border-radius: 0;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity .15s;
}
.csp-btn-primary:active,
.rcfg-btn-primary:active { opacity: 0.85; }

/* ======================================================================
 * 刷新配置弹窗
 * ====================================================================== */
.rcfg-panel {
    width: 100%;
    max-width: 380px;
    max-height: 84vh;
    background: #ffffff;
    border: 1.5px solid #0a0a0a;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #0a0a0a;
    font-family: 'Inter', -apple-system, 'SF Pro Display', 'PingFang SC', sans-serif;
    transform: translateY(12px) scale(0.98);
    transition: transform .2s ease;
}
.rcfg-panel--in { transform: translateY(0) scale(1); }
.rcfg-panel--out { transform: translateY(12px) scale(0.98); }

.rcfg-head {
    position: relative;
    padding: 16px 44px 12px 16px;
    border-bottom: 1.5px solid #0a0a0a;
}
.rcfg-title {
    font-size: 16px;
    font-weight: 700;
    color: #0a0a0a;
    letter-spacing: -0.3px;
}
.rcfg-sub {
    font-size: 11px;
    color: #65656b;
    font-weight: 500;
    margin-top: 3px;
}
.rcfg-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #0a0a0a;
    cursor: pointer;
}
.rcfg-close:active { transform: scale(0.85); }

.rcfg-section-label {
    font-size: 11px;
    color: #65656b;
    font-weight: 600;
    text-transform: uppercase;
    padding: 14px 16px 6px;
    letter-spacing: .5px;
}

.rcfg-list {
    overflow-y: auto;
    padding: 0 16px;
    max-height: 38vh;
}
.rcfg-item {
    position: relative;
    padding: 11px 12px;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1.5px solid #0a0a0a;
    border-radius: 0;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.rcfg-item.on {
    background: #0a0a0a;
    color: #ffffff;
}
.rcfg-item-main {
    display: flex;
    align-items: center;
    gap: 9px;
}
.rcfg-check {
    width: 16px;
    height: 16px;
    border-radius: 0;
    border: 1.5px solid #0a0a0a;
    flex-shrink: 0;
    position: relative;
    background: #ffffff;
    transition: border-color .15s, background .15s;
}
.rcfg-item.on .rcfg-check {
    border-color: #ffffff;
    background: #ffffff;
}
.rcfg-item.on .rcfg-check::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #0a0a0a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.rcfg-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
}
.rcfg-unit {
    font-size: 11px;
    color: #65656b;
    font-weight: 500;
}
.rcfg-item.on .rcfg-unit { color: #b5b5ba; }
.rcfg-tag {
    font-size: 10px;
    font-weight: 600;
    color: #65656b;
    border: 1px solid #65656b;
    border-radius: 0;
    padding: 1px 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.rcfg-item.on .rcfg-tag {
    color: #ffffff;
    border-color: #ffffff;
}
.rcfg-del {
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 0;
    opacity: 0.6;
}
.rcfg-del:active { opacity: 1; }
.rcfg-item-desc {
    font-size: 11px;
    color: #65656b;
    font-weight: 500;
    margin-top: 6px;
    padding-left: 25px;
    line-height: 1.4;
}
.rcfg-item.on .rcfg-item-desc { color: #b5b5ba; }

/* 添加自定义项目区 */
.rcfg-add {
    margin: 8px 16px 0;
    padding: 14px;
    background: #f6f6f7;
    border: 1.5px solid #0a0a0a;
    border-radius: 0;
}
.rcfg-add-label {
    font-size: 11px;
    color: #65656b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 9px;
}
.rcfg-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.rcfg-input {
    flex: 1;
    min-width: 0;
    height: 36px;
    background: #ffffff;
    border: 1.5px solid #0a0a0a;
    border-radius: 0;
    padding: 0 10px;
    color: #0a0a0a;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    box-sizing: border-box;
}
.rcfg-input::placeholder { color: #a5a5aa; }
.rcfg-input:focus { background: #fffdf0; }
.rcfg-input-sm { flex: 0 0 84px; }
.rcfg-textarea {
    width: 100%;
    min-height: 56px;
    background: #ffffff;
    border: 1.5px solid #0a0a0a;
    border-radius: 0;
    padding: 8px 10px;
    color: #0a0a0a;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}
.rcfg-textarea::placeholder { color: #a5a5aa; }
.rcfg-textarea:focus { background: #fffdf0; }
.rcfg-add-btn {
    margin-top: 9px;
    width: 100%;
    height: 38px;
    background: #ffffff;
    border: 1.5px solid #0a0a0a;
    border-radius: 0;
    color: #0a0a0a;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.rcfg-add-btn:active { background: #0a0a0a; color: #ffffff; }

.rcfg-foot {
    padding: 0;
    border-top: 1.5px solid #0a0a0a;
    margin-top: 12px;
}
