/* ================= 编辑角色弹窗 - 轻奢 iOS 原生风格 ================= */

/* 弹窗背景遮罩 - 更轻更淡 */
#editRoleModal.modal,
#createRoleModal.modal {
    background: rgba(0, 0, 0, 0.28);
}

/* 弹窗主体 - 轻盈奶白背景 */
#editRoleModal .modal-content,
#createRoleModal .modal-content {
    background: linear-gradient(180deg, #fefefe 0%, #fafbfc 100%);
    border-radius: 22px;
    box-shadow:
        0 24px 48px rgba(15, 23, 42, 0.08),
        0 8px 16px rgba(15, 23, 42, 0.04),
        inset 0 0 0 0.5px rgba(255, 255, 255, 0.9);
    max-height: 88%;
}

/* 弹窗标题栏 - 精致轻量 */
#editRoleModal .modal-header,
#createRoleModal .modal-header {
    padding: 18px 20px 16px;
    border-bottom: 0.5px solid rgba(15, 23, 42, 0.06);
    background: transparent;
}

#editRoleModal .modal-title,
#createRoleModal .modal-title {
    font-size: 18px;
    font-weight: 650;
    color: #1a1d24;
    letter-spacing: -0.2px;
}

/* 关闭按钮 - 轻量文字按钮 */
#editRoleModal .modal-close,
#createRoleModal .modal-close {
    font-size: 15px;
    font-weight: 600;
    color: #007aff;
    background: none;
    padding: 0;
    min-width: 48px;
    transition: opacity 0.2s ease;
}

#editRoleModal .modal-close:active,
#createRoleModal .modal-close:active {
    opacity: 0.6;
}

/* 弹窗内容区 - 轻盈滚动 */
#editRoleModal .modal-body,
#createRoleModal .modal-body {
    padding: 20px 20px 24px;
    background: transparent;
}

/* 输入组 - 清晰分组 */
#editRoleModal .input-group,
#createRoleModal .input-group {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 0.5px solid rgba(15, 23, 42, 0.04);
}

#editRoleModal .input-group:last-of-type,
#createRoleModal .input-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* 标签 - 轻量精致 */
#editRoleModal .input-group label,
#createRoleModal .input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    letter-spacing: -0.1px;
}

/* 输入框 - 轻描边 + 奶白背景 */
#editRoleModal .input-group input[type="text"],
#editRoleModal .input-group input[type="password"],
#editRoleModal .input-group textarea,
#createRoleModal .input-group input[type="text"],
#createRoleModal .input-group input[type="password"],
#createRoleModal .input-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    background: rgba(249, 250, 251, 0.6);
    color: #1f2937;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#editRoleModal .input-group input[type="text"]:focus,
#editRoleModal .input-group input[type="password"]:focus,
#editRoleModal .input-group textarea:focus,
#createRoleModal .input-group input[type="text"]:focus,
#createRoleModal .input-group input[type="password"]:focus,
#createRoleModal .input-group textarea:focus {
    border-color: rgba(0, 122, 255, 0.3);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.06);
}

#editRoleModal .input-group input::placeholder,
#editRoleModal .input-group textarea::placeholder,
#createRoleModal .input-group input::placeholder,
#createRoleModal .input-group textarea::placeholder {
    color: #b4b8c0;
}

#editRoleModal .input-group textarea,
#createRoleModal .input-group textarea {
    min-height: 88px;
    resize: vertical;
}

/* 说明文字 - 更轻更小 */
#editRoleModal .input-group > div[style*="font-size: 12px"],
#createRoleModal .input-group > div[style*="font-size: 12px"] {
    margin-top: 7px !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
    color: #9ca3af !important;
}

/* iOS 原生 Toggle 开关 */
#editRoleModal .input-group input[type="checkbox"],
#createRoleModal .input-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 51px !important;
    height: 31px !important;
    background: #e5e7eb;
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    outline: none;
    border: none;
    flex-shrink: 0;
}

#editRoleModal .input-group input[type="checkbox"]:checked,
#createRoleModal .input-group input[type="checkbox"]:checked {
    background: #34c759;
}

#editRoleModal .input-group input[type="checkbox"]::before,
#createRoleModal .input-group input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 27px;
    height: 27px;
    background: #ffffff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.15),
        0 1px 1px rgba(0, 0, 0, 0.06);
}

#editRoleModal .input-group input[type="checkbox"]:checked::before,
#createRoleModal .input-group input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

/* 开关标签布局优化 */
#editRoleModal .input-group label[style*="display: flex"],
#createRoleModal .input-group label[style*="display: flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

#editRoleModal .input-group label[style*="display: flex"] span,
#createRoleModal .input-group label[style*="display: flex"] span {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

/* 滑块 - 精致轻量 */
#editRoleModal .input-group input[type="range"],
#createRoleModal .input-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 24px !important;
    background: transparent;
    outline: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

/* 滑块轨道 */
#editRoleModal .input-group input[type="range"]::-webkit-slider-runnable-track,
#createRoleModal .input-group input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    cursor: pointer;
}

#editRoleModal .input-group input[type="range"]::-moz-range-track,
#createRoleModal .input-group input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    cursor: pointer;
}

/* 滑块按钮 - 小而精致 */
#editRoleModal .input-group input[type="range"]::-webkit-slider-thumb,
#createRoleModal .input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -10px;
    box-shadow:
        0 2px 8px rgba(0, 122, 255, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 0 0 0.5px rgba(0, 122, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#editRoleModal .input-group input[type="range"]::-webkit-slider-thumb:active,
#createRoleModal .input-group input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow:
        0 3px 12px rgba(0, 122, 255, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.15),
        inset 0 0 0 0.5px rgba(0, 122, 255, 0.2);
}

/* Firefox 滑块样式 */
#editRoleModal .input-group input[type="range"]::-moz-range-thumb,
#createRoleModal .input-group input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(0, 122, 255, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 百分比数字 - 轻字重 */
#editRoleModal .input-group span[id*="Value"],
#createRoleModal .input-group span[id*="Value"] {
    font-weight: 600 !important;
    color: #007aff !important;
    font-size: 15px !important;
}

/* 保存按钮 - 轻量浅蓝 */
#editRoleModal .btn-primary,
#createRoleModal .btn-primary {
    width: 100%;
    padding: 13px 20px;
    background: rgba(0, 122, 255, 0.08);
    color: #007aff;
    border: 1px solid rgba(0, 122, 255, 0.16);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 650;
    cursor: pointer;
    margin-top: 24px;
    box-shadow: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

#editRoleModal .btn-primary:active,
#createRoleModal .btn-primary:active {
    background: rgba(0, 122, 255, 0.14);
    border-color: rgba(0, 122, 255, 0.24);
    transform: scale(0.99);
}

/* 删除按钮 - 轻量红色文字链接 */
#editRoleModal .btn-danger,
#createRoleModal .btn-danger {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: #ff3b30;
    border: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    box-shadow: none;
    text-align: center;
    transition: opacity 0.2s ease;
}

#editRoleModal .btn-danger:active,
#createRoleModal .btn-danger:active {
    opacity: 0.6;
    background: transparent;
}

/* 头像选择器优化 */
#editRoleModal .avatar-selector,
#createRoleModal .avatar-selector {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
}

#editRoleModal .avatar-preview,
#createRoleModal .avatar-preview {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px solid rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

#editRoleModal .avatar-preview:active,
#createRoleModal .avatar-preview:active {
    transform: scale(0.96);
    border-color: rgba(0, 122, 255, 0.2);
}

#editRoleModal .avatar-input,
#createRoleModal .avatar-input {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.4;
}

/* 滚动条优化 */
#editRoleModal .modal-body::-webkit-scrollbar,
#createRoleModal .modal-body::-webkit-scrollbar {
    width: 4px;
}

#editRoleModal .modal-body::-webkit-scrollbar-track,
#createRoleModal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#editRoleModal .modal-body::-webkit-scrollbar-thumb,
#createRoleModal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

#editRoleModal .modal-body::-webkit-scrollbar-thumb:hover,
#createRoleModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* 响应式优化 */
@media (max-height: 700px) {
    #editRoleModal .modal-content,
    #createRoleModal .modal-content {
        max-height: 92%;
    }

    #editRoleModal .input-group,
    #createRoleModal .input-group {
        margin-bottom: 18px;
        padding-bottom: 18px;
    }
}

/* ================= 轻量文字按钮 - 用于"随机人设"和"根据人设生成" ================= */
.btn-text-light {
    background: none;
    border: none;
    color: #007aff;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.85;
}

.btn-text-light:hover {
    opacity: 1;
    background: rgba(0, 122, 255, 0.06);
}

.btn-text-light:active {
    opacity: 0.7;
    background: rgba(0, 122, 255, 0.1);
    transform: scale(0.98);
}

/* 头像预览加载状态 */
#roleAvatarPreview,
#editAvatarPreview {
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
}

#editRoleModal .bubble-style-entry-btn {
    width: 100%;
    min-height: 40px;
    padding: 0 14px;
    border: 0.5px solid rgba(60, 60, 67, 0.12);
    border-radius: 10px;
    background: rgba(248, 248, 249, 0.92);
    color: #3f4a5a;
    font-size: 14px;
    font-weight: 560;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}

#editRoleModal .bubble-style-entry-btn:active {
    background: rgba(239, 241, 244, 0.96);
    transform: scale(0.992);
}

#bubbleStyleModal.modal {
    background: rgba(15, 23, 42, 0.20);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#bubbleStyleModal .bubble-style-modal-content {
    width: min(92%, 430px);
    max-width: 430px;
    max-height: 88%;
    background: #fffdf9;
    border: 0.5px solid rgba(60, 60, 67, 0.12);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

#bubbleStyleModal .modal-header {
    padding: 18px 20px 14px;
    background: #fffdf9;
    border-bottom: 0.5px solid rgba(60, 60, 67, 0.10);
}

#bubbleStyleModal .modal-title {
    text-align: left;
    font-size: 18px;
    color: #1f232b;
}

#bubbleStyleModal .modal-close {
    min-width: 32px;
    color: #8a8f98;
    font-size: 20px;
    font-weight: 600;
}

#bubbleStyleModal .bubble-style-modal-body {
    padding: 16px 20px 18px;
    background: #fffdf9;
}

#bubbleStyleModal .bubble-style-section {
    margin-bottom: 18px;
}

#bubbleStyleModal .bubble-style-section label {
    display: block;
    margin-bottom: 8px;
    color: #242832;
    font-size: 14px;
    font-weight: 650;
}

#bubbleStyleModal select,
#bubbleStyleModal textarea {
    width: 100%;
    border: 0.5px solid rgba(60, 60, 67, 0.14);
    border-radius: 10px;
    background: #ffffff;
    color: #252b35;
    box-shadow: none;
    outline: none;
    font-family: inherit;
}

#bubbleStyleModal select {
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
}

#bubbleStyleModal textarea {
    min-height: 156px;
    padding: 11px 12px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
}

#bubbleStyleModal select:focus,
#bubbleStyleModal textarea:focus {
    border-color: rgba(90, 174, 157, 0.42);
    box-shadow: 0 0 0 3px rgba(90, 174, 157, 0.08);
}

#bubbleStyleModal .bubble-style-hint {
    margin: -2px 0 9px;
    color: #7b8491;
    font-size: 12px;
    line-height: 1.45;
}

#bubbleStyleModal .bubble-style-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 9px;
    padding: 3px;
    border-radius: 10px;
    background: #f1f2f2;
}

#bubbleStyleModal .bubble-style-mode-toggle label {
    margin: 0;
    cursor: pointer;
}

#bubbleStyleModal .bubble-style-mode-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

#bubbleStyleModal .bubble-style-mode-toggle span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 8px;
    color: #68707b;
    font-size: 13px;
    font-weight: 560;
    transition: background 0.18s ease, color 0.18s ease;
}

#bubbleStyleModal .bubble-style-mode-toggle input:checked + span {
    background: #ffffff;
    color: #2f3947;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

#bubbleStyleModal .bubble-style-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

#bubbleStyleModal .bubble-style-btn {
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: #f3f4f4;
    color: #5f6671;
    font-size: 13px;
    font-weight: 560;
    cursor: pointer;
    box-shadow: none;
}

#bubbleStyleModal .bubble-style-btn:active,
#bubbleStyleModal .bubble-style-footer-btn:active {
    transform: scale(0.982);
}

#bubbleStyleModal .bubble-style-error {
    display: none;
    margin-top: 8px;
    color: #c15b54;
    font-size: 12px;
    line-height: 1.45;
}

#bubbleStyleModal .bubble-style-error.visible {
    display: block;
}

#bubbleStyleModal .bubble-style-preview-section {
    margin-bottom: 16px;
}

#bubbleStyleModal .bubble-style-preview-root {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 108px;
    padding: 13px;
    border: 0.5px solid rgba(60, 60, 67, 0.10);
    border-radius: 12px;
    background: #f7f7f5;
}

#bubbleStyleModal .bubble-style-preview-frame {
    display: block;
    width: 100%;
    min-height: 132px;
    border: 0.5px solid rgba(60, 60, 67, 0.10);
    border-radius: 12px;
    background: #f7f7f5;
}

#bubbleStyleModal .message-container {
    display: flex;
    max-width: 100%;
}

#bubbleStyleModal .message-container.received {
    justify-content: flex-start;
}

#bubbleStyleModal .message-container.sent {
    justify-content: flex-end;
}

#bubbleStyleModal .message-bubble {
    max-width: 78%;
    padding: 9px 12px;
    border-radius: 10px;
    color: #1f242c;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

#bubbleStyleModal .message-container.received .message-bubble {
    background: #ffffff;
    border-top-left-radius: 5px;
}

#bubbleStyleModal .message-container.sent .message-bubble {
    background: #dcefdc;
    border-top-right-radius: 5px;
}

#bubbleStyleModal .bubble-style-footer {
    display: flex;
    gap: 10px;
    padding-top: 2px;
}

#bubbleStyleModal .bubble-style-footer-btn {
    flex: 1;
    height: 42px;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
}

#bubbleStyleModal .bubble-style-footer-btn.secondary {
    background: #f1f2f3;
    color: #5f6671;
}

#bubbleStyleModal .bubble-style-footer-btn.primary {
    background: #5f96cf;
    color: #ffffff;
}

@media (max-width: 380px) {
    #bubbleStyleModal .bubble-style-modal-content {
        width: 94%;
        max-height: 90%;
    }

    #bubbleStyleModal .bubble-style-actions {
        grid-template-columns: 1fr;
    }
}

#bubbleStyleModal.modal {
    background: rgba(15, 23, 42, 0.20) !important;
}

#bubbleStyleModal .bubble-style-modal-content {
    background: #fffdf9 !important;
    border-radius: 18px !important;
}

#bubbleStyleModal .modal-header,
#bubbleStyleModal .bubble-style-modal-body {
    background: #fffdf9 !important;
}

#bubbleStyleModal .bubble-style-btn,
#bubbleStyleModal .bubble-style-footer-btn.secondary,
#editRoleModal .bubble-style-entry-btn {
    background: #f3f4f4 !important;
    color: #5f6671 !important;
}

#bubbleStyleModal .bubble-style-mode-toggle {
    background: #f1f2f2 !important;
}

#bubbleStyleModal .bubble-style-mode-toggle input:checked + span {
    background: #ffffff !important;
    color: #2f3947 !important;
}

#bubbleStyleModal .bubble-style-footer-btn.primary {
    background: #5f96cf !important;
    color: #ffffff !important;
}

#bubbleStyleModal .bubble-style-preview-root {
    background: #f7f7f5 !important;
}

#bubbleStyleModal .bubble-style-preview-frame {
    background: #f7f7f5 !important;
}

/* Edit role footer actions */
#editRoleModal .modal-body {
    padding-bottom: 26px !important;
}

#editRoleModal .btn-primary {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    margin: 24px 0 0 !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 15px !important;
    background: #007aff !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.10) !important;
}

#editRoleModal .btn-primary:active {
    background: #006fe8 !important;
    opacity: 0.88 !important;
    transform: none !important;
}

#editRoleModal .btn-danger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 46px !important;
    margin: 14px 0 0 !important;
    padding: 14px 18px 0 !important;
    border: 0 !important;
    border-top: 0.5px solid rgba(60, 60, 67, 0.14) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #ff3b30 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
}

#editRoleModal .btn-danger:active {
    background: rgba(255, 59, 48, 0.06) !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Global native style alignment */
#editRoleModal .modal-content,
#createRoleModal .modal-content {
    background: var(--ui-surface, #ffffff) !important;
    border: 0.5px solid var(--ui-separator, rgba(60, 60, 67, 0.12)) !important;
    border-radius: var(--ui-radius-lg, 16px) !important;
    box-shadow: var(--ui-shadow-modal, 0 18px 44px rgba(15, 23, 42, 0.14)) !important;
}

#editRoleModal .modal-header,
#createRoleModal .modal-header,
#editRoleModal .modal-body,
#createRoleModal .modal-body {
    background: var(--ui-surface, #ffffff) !important;
}

#editRoleModal .input-group input[type="text"],
#editRoleModal .input-group input[type="password"],
#editRoleModal .input-group textarea,
#createRoleModal .input-group input[type="text"],
#createRoleModal .input-group input[type="password"],
#createRoleModal .input-group textarea {
    background: var(--ui-surface, #ffffff) !important;
    border-radius: var(--ui-radius-sm, 8px) !important;
    box-shadow: none !important;
}

.btn-text-light {
    color: var(--ui-blue, #2f7dd1) !important;
    background: var(--ui-surface-muted, #f7f7f8) !important;
    box-shadow: none !important;
}

/* Edit role settings list: match the screen-size page row treatment. */
#editRoleModal .modal-content {
    width: min(92vw, 490px) !important;
}

#editRoleModal .modal-header {
    min-height: 76px !important;
    padding: 0 28px !important;
    border-bottom: 0.5px solid rgba(60, 60, 67, 0.16) !important;
}

#editRoleModal .modal-title {
    font-size: 21px !important;
    font-weight: 700 !important;
    color: #071427 !important;
    letter-spacing: 0 !important;
}

#editRoleModal .modal-close {
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    color: #2f7dd1 !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
}

#editRoleModal .modal-body {
    padding: 20px 30px 28px !important;
}

#editRoleModal .input-group {
    margin: 0 !important;
    padding: 22px 0 !important;
    border-bottom: 0.5px solid rgba(60, 60, 67, 0.12) !important;
}

#editRoleModal .input-group:last-of-type {
    border-bottom: 0.5px solid rgba(60, 60, 67, 0.12) !important;
}

#editRoleModal .input-group label {
    margin: 0 0 4px !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    color: #000 !important;
    letter-spacing: 0 !important;
}

#editRoleModal .input-group label[style*="display: flex"] {
    min-height: 32px !important;
    gap: 16px !important;
}

#editRoleModal .input-group label[style*="display: flex"] span {
    font-size: 17px !important;
    font-weight: 500 !important;
    color: #000 !important;
    line-height: 1.25 !important;
}

#editRoleModal .input-group > div[style*="font-size: 12px"] {
    margin-top: 2px !important;
    max-width: calc(100% - 84px) !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: #7a8699 !important;
}

#editRoleModal .input-group select {
    min-width: 54px !important;
    height: 28px !important;
    margin-top: 8px !important;
    padding: 0 24px 0 8px !important;
    border: 0.5px solid rgba(60, 60, 67, 0.18) !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    font-size: 15px !important;
    box-shadow: none !important;
}

#editRoleModal .input-group input[type="checkbox"] {
    width: 51px !important;
    height: 31px !important;
    background: #ffffff !important;
    border: 0.5px solid rgba(60, 60, 67, 0.16) !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02) !important;
}

#editRoleModal .input-group input[type="checkbox"]:checked {
    background: #34c759 !important;
    border-color: #34c759 !important;
}

#editRoleModal .input-group input[type="checkbox"]::before {
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.16) !important;
}

#editRoleModal .bubble-style-entry-btn {
    position: relative !important;
    width: 100% !important;
    min-height: 48px !important;
    margin-top: 12px !important;
    padding: 0 34px 0 18px !important;
    border: 0.5px solid rgba(60, 60, 67, 0.16) !important;
    border-radius: 13px !important;
    background: #f5f6f7 !important;
    color: #687385 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: left !important;
}

#editRoleModal .bubble-style-entry-btn::after {
    content: '›';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-52%);
    color: #c7c7cc;
    font-size: 26px;
    font-weight: 300;
}

#editRoleModal .bubble-style-entry-btn:active {
    background: #eeeeef !important;
    transform: none !important;
}

#editRoleModal .btn-primary,
#editRoleModal .btn-danger {
    border-radius: 10px !important;
}

/* Softer, rounder controls for the edit role sheet. */
#editRoleModal .modal-content {
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow:
        0 22px 52px rgba(15, 23, 42, 0.16),
        0 4px 14px rgba(15, 23, 42, 0.06) !important;
}

#editRoleModal .modal-body {
    padding-left: 36px !important;
    padding-right: 36px !important;
}

#editRoleModal .input-group {
    padding: 24px 0 !important;
}

#editRoleModal .input-group input[type="checkbox"] {
    width: 54px !important;
    height: 34px !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    border: 0.5px solid rgba(60, 60, 67, 0.14) !important;
    box-shadow:
        inset 0 0 0 1px rgba(60, 60, 67, 0.03),
        0 1px 4px rgba(15, 23, 42, 0.06) !important;
}

#editRoleModal .input-group input[type="checkbox"]:checked {
    background: #34c759 !important;
    border-color: #34c759 !important;
}

#editRoleModal .input-group input[type="checkbox"]::before {
    width: 30px !important;
    height: 30px !important;
    top: 1.5px !important;
    left: 1.5px !important;
    border-radius: 50% !important;
    box-shadow:
        0 3px 9px rgba(15, 23, 42, 0.18),
        0 1px 2px rgba(15, 23, 42, 0.10) !important;
}

#editRoleModal .input-group input[type="checkbox"]:checked::before {
    transform: translateX(20px) !important;
}

#editRoleModal .input-group select {
    height: 32px !important;
    min-width: 62px !important;
    padding: 0 26px 0 10px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
}

#editRoleModal .bubble-style-entry-btn {
    min-height: 58px !important;
    border-radius: 16px !important;
    background: #f1f2f4 !important;
    border-color: rgba(60, 60, 67, 0.13) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

#editRoleModal .bubble-style-entry-btn::after {
    content: '\203A' !important;
}

#editRoleModal .btn-primary,
#editRoleModal .btn-danger {
    border-radius: 16px !important;
}

/* Match the screen-size "隐藏状态栏" row exactly for edit-role switches. */
#editRoleModal .input-group:has(input[type="checkbox"]) {
    position: relative !important;
    min-height: 96px !important;
    padding: 24px 0 !important;
}

#editRoleModal .input-group:has(input[type="checkbox"]) label[style*="display: flex"] {
    display: block !important;
    min-height: 0 !important;
    padding-right: 116px !important;
}

#editRoleModal .input-group:has(input[type="checkbox"]) label[style*="display: flex"] span {
    display: block !important;
    margin: 0 !important;
    font-size: 17px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    color: #000000 !important;
}

#editRoleModal .input-group:has(input[type="checkbox"]) label[style*="display: flex"]::after {
    content: '关闭';
    position: absolute;
    right: 66px;
    top: 33px;
    min-width: 32px;
    text-align: right;
    color: var(--ui-text-muted, #8e8e93);
    font-size: 15px;
    font-weight: 400;
    line-height: 34px;
}

#editRoleModal .input-group:has(input[type="checkbox"]:checked) label[style*="display: flex"]::after {
    content: '开启';
}

#editRoleModal .input-group:has(input[type="checkbox"]) input[type="checkbox"] {
    position: absolute !important;
    right: 0 !important;
    top: 33px !important;
    width: 51px !important;
    height: 31px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    background: #e9e9eb !important;
    border: 0 !important;
    box-shadow: none !important;
}

#editRoleModal .input-group:has(input[type="checkbox"]) input[type="checkbox"]:checked {
    background: #34c759 !important;
}

#editRoleModal .input-group:has(input[type="checkbox"]) input[type="checkbox"]::before {
    width: 27px !important;
    height: 27px !important;
    top: 2px !important;
    left: 2px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.15),
        0 1px 1px rgba(0, 0, 0, 0.06) !important;
}

#editRoleModal .input-group:has(input[type="checkbox"]) input[type="checkbox"]:checked::before {
    transform: translateX(20px) !important;
}

#editRoleModal .input-group:has(input[type="checkbox"]) > div[style*="font-size: 12px"] {
    max-width: calc(100% - 116px) !important;
    margin-top: 4px !important;
    padding-right: 0 !important;
    color: #7a8699 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
}
