/* ========================================
   豆瓣专属 UI 美化样式
======================================== */

/* --- 毛玻璃底栏 (Action Bar) --- */
.douban-glass-action-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.7); /* 更高的透明度 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(100%);
    opacity: 0;
}

/* 当显示时 */
.douban-glass-action-bar.visible,
#douban-action-bar[style*="display: flex"],
#douban-detail-action-bar[style*="display: flex"] {
    transform: translateY(0);
    opacity: 1;
}

/* --- 黑暗模式适配 --- */
#phone-screen.dark-mode .douban-glass-action-bar {
    background: rgba(28, 28, 30, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

/* --- 管理按钮样式 --- */
.douban-manage-btn {
    width: calc(100% - 40px);
    margin: 0 20px 15px 20px;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #4a4a4a;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.douban-manage-btn:hover {
    background-color: #eeeeee;
    border-color: #d0d0d0;
}

.douban-manage-btn:active {
    background-color: #e0e0e0;
    transform: scale(0.98);
}

/* 夜间模式适配 */
#phone-screen.dark-mode .douban-manage-btn {
    color: #d0d0d0;
    background-color: #2c2c2e;
    border-color: #38383a;
}

#phone-screen.dark-mode .douban-manage-btn:hover {
    background-color: #3a3a3c;
    border-color: #48484a;
}

#phone-screen.dark-mode .douban-manage-btn:active {
    background-color: #48484a;
}

/* --- 按钮样式 --- */
.douban-glass-btn {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.douban-glass-btn:active {
    transform: scale(0.96);
}

/* 取消按钮 */
.douban-glass-btn-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.douban-glass-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

#phone-screen.dark-mode .douban-glass-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e5ea;
}

#phone-screen.dark-mode .douban-glass-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 转发按钮 (主色调) */
.douban-glass-btn-primary {
    background: #00B51D; /* 豆瓣绿 */
    color: white;
    box-shadow: 0 2px 8px rgba(0, 181, 29, 0.3);
}

.douban-glass-btn-primary:hover {
    background: #009918;
    box-shadow: 0 4px 12px rgba(0, 181, 29, 0.4);
}

.douban-glass-btn-primary:disabled {
    background: #a5d8ad;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

#phone-screen.dark-mode .douban-glass-btn-primary {
    background: #00B51D;
    color: #fff;
}

#phone-screen.dark-mode .douban-glass-btn-primary:disabled {
    background: rgba(0, 181, 29, 0.3);
    color: rgba(255, 255, 255, 0.5);
}

/* --- 自定义 Checkbox (全选) --- */
.douban-glass-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

#phone-screen.dark-mode .douban-glass-select-all {
    color: #e5e5ea;
}

.douban-glass-checkbox-input {
    display: none;
}

.douban-glass-checkbox-custom {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #c7c7cc;
    background: transparent;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#phone-screen.dark-mode .douban-glass-checkbox-custom {
    border-color: #5c5c5e;
}

.douban-glass-checkbox-input:checked + .douban-glass-checkbox-custom {
    background-color: #00B51D;
    border-color: #00B51D;
    transform: scale(1.1);
}

.douban-glass-checkbox-input:checked + .douban-glass-checkbox-custom::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    position: absolute;
    top: 3px;
    left: 7px;
    animation: douban-check-anim 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* --- 列表项 Checkbox --- */
/* 隐藏原来的生硬框，使用美化版 */
/* 修复：普通模式下不影响原本样式，只有在 selection-mode 下才显示 */
.selection-mode .douban-post-item .douban-checkbox,
.selection-mode .douban-comment-item .douban-checkbox,
.selection-mode#douban-post-detail-body .douban-checkbox {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    border: 1.5px solid #c7c7cc !important;
    background: transparent !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    margin-right: 10px;
}

#phone-screen.dark-mode .selection-mode .douban-post-item .douban-checkbox,
#phone-screen.dark-mode .selection-mode .douban-comment-item .douban-checkbox,
#phone-screen.dark-mode .selection-mode#douban-post-detail-body .douban-checkbox {
    border-color: #5c5c5e !important;
}

/* 修复详情页帖子主体的复选框位置 */
.selection-mode#douban-post-detail-body .douban-checkbox {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    margin-right: 0 !important;
}

.selection-mode .douban-post-item.selected .douban-checkbox,
.selection-mode .douban-comment-item.selected .douban-checkbox,
.selection-mode#douban-post-detail-body.selected .douban-checkbox {
    background-color: #00B51D !important;
    border-color: #00B51D !important;
    transform: scale(1.1);
}

.selection-mode .douban-post-item.selected .douban-checkbox::after,
.selection-mode .douban-comment-item.selected .douban-checkbox::after,
.selection-mode#douban-post-detail-body.selected .douban-checkbox::after {
    content: '' !important;
    width: 4px !important;
    height: 9px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
    position: absolute !important;
    top: 2.5px !important;
    left: 6px !important;
    animation: douban-check-anim 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    display: block !important;
}

@keyframes douban-check-anim {
    0% { height: 0; width: 0; opacity: 0; }
    100% { height: 10px; width: 5px; opacity: 1; }
}

/* 列表进入选择模式时的滑动动画 */
.selection-mode .douban-post-item .douban-checkbox,
.selection-mode .douban-comment-item .douban-checkbox {
    animation: slide-in-left 0.3s ease forwards;
}

.selection-mode#douban-post-detail-body .douban-checkbox {
    animation: fade-in-scale 0.3s ease forwards;
}

@keyframes fade-in-scale {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slide-in-left {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========================================
   聊天框内的豆瓣分享卡片样式 (Forward Card)
======================================== */
.douban-forward-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    overflow: hidden;
    margin: 8px 0;
    max-width: 280px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

#phone-screen.dark-mode .douban-forward-card {
    background: #242426;
    border-color: #38383a;
}

/* 卡片头部 */
.douban-forward-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: #f9f9f9;
    border-bottom: 1px solid #eaeaea;
}

#phone-screen.dark-mode .douban-forward-card-header {
    background: #1c1c1e;
    border-color: #38383a;
}

.douban-logo-icon {
    width: 16px;
    height: 16px;
    fill: #00B51D;
}

.douban-forward-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

#phone-screen.dark-mode .douban-forward-card-title {
    color: #a0a0a5;
}

/* 卡片内容区 */
.douban-forward-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.douban-forward-item {
    position: relative;
    padding-left: 10px;
}

.douban-forward-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: #00B51D;
    border-radius: 2px;
    opacity: 0.6;
}

.douban-forward-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.douban-forward-tag {
    font-size: 11px;
    background: #f0f0f0;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
}

#phone-screen.dark-mode .douban-forward-tag {
    background: #333;
    color: #aaa;
}

.douban-forward-author {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

#phone-screen.dark-mode .douban-forward-author {
    color: #e5e5ea;
}

.douban-forward-post-title {
    font-size: 14px;
    font-weight: bold;
    color: #111;
    margin-bottom: 4px;
    line-height: 1.4;
}

#phone-screen.dark-mode .douban-forward-post-title {
    color: #fff;
}

.douban-forward-text {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制行数 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#phone-screen.dark-mode .douban-forward-text {
    color: #ccc;
}

/* ========================================
   豆瓣设置弹窗及子组件现代化质感重构
   【纯白极简无界设计 + 细腻分割线】
   【注意】：绝对不改变任何默认滚动/滑动逻辑
   所有内容限定 max-width: 100% 避免任何横向溢出
======================================== */

#douban-settings-modal .modal-content {
    background: #ffffff !important;
    border-radius: 20px;
    overflow: hidden;
}

#phone-screen.dark-mode #douban-settings-modal .modal-content {
    background: #1c1c1e !important;
}

#douban-settings-modal .modal-header {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f2;
    padding: 16px 20px;
}

#phone-screen.dark-mode #douban-settings-modal .modal-header {
    background: #1c1c1e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#douban-settings-modal .modal-footer {
    background: #ffffff;
    border-top: 1px solid #f0f0f2;
    padding: 14px 20px;
}

#phone-screen.dark-mode #douban-settings-modal .modal-footer {
    background: #1c1c1e;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.douban-settings-modal-body {
    padding: 4px 20px 10px 20px !important;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-sizing: border-box;
    background: #ffffff;
}

#phone-screen.dark-mode .douban-settings-modal-body {
    background: #1c1c1e;
}

/* 设置项分组：纯白背景，使用细腻的分隔线代替生硬的灰白底卡片 */
.douban-setting-card {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 16px 0 !important;
    border-bottom: 1px solid #f2f2f5 !important;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.douban-setting-card:last-child {
    border-bottom: none !important;
}

#phone-screen.dark-mode .douban-setting-card {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.douban-setting-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1c1c1e;
    line-height: 1.4;
    word-break: break-word;
}

#phone-screen.dark-mode .douban-setting-card-title {
    color: #f2f2f7;
}

.douban-setting-card-desc {
    font-size: 12px;
    color: #8e8e93;
    line-height: 1.45;
    word-break: break-word;
}

#phone-screen.dark-mode .douban-setting-card-desc {
    color: #98989d;
}

/* 1. 数字范围选择器：紧凑居中，不占过宽，不会横向滚动 */
.douban-number-range-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.douban-range-label {
    font-size: 12px;
    color: #636366;
    font-weight: 500;
}

#phone-screen.dark-mode .douban-range-label {
    color: #aeaeb2;
}

.douban-range-sep {
    font-size: 13px;
    color: #8e8e93;
}

.douban-range-unit {
    font-size: 13px;
    color: #636366;
    margin-left: 2px;
}

#phone-screen.dark-mode .douban-range-unit {
    color: #aeaeb2;
}

.douban-modern-num-input {
    width: 58px;
    height: 34px;
    padding: 0 4px;
    text-align: center;
    border: 1px solid #d1d1d6;
    background: #ffffff;
    border-radius: 8px;
    font-size: 14px !important;
    font-weight: 600;
    color: #1c1c1e;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.douban-modern-num-input:focus {
    border-color: #00B51D;
    box-shadow: 0 0 0 2px rgba(0, 181, 29, 0.15);
}

#phone-screen.dark-mode .douban-modern-num-input {
    background: #1c1c1e;
    border-color: #3a3a3c;
    color: #ffffff;
}

#phone-screen.dark-mode .douban-modern-num-input:focus {
    border-color: #00B51D;
    box-shadow: 0 0 0 2px rgba(0, 181, 29, 0.3);
}

/* 2. 身份设定：紧凑头像 + 文本框与重置按钮上下两行结构，绝不撑宽 */
.douban-identity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    width: 100%;
    box-sizing: border-box;
}

.douban-avatar-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
}

.douban-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #e5e5ea;
    box-sizing: border-box;
    transition: opacity 0.2s;
}

.douban-avatar-wrap:hover img {
    opacity: 0.85;
}

#phone-screen.dark-mode .douban-avatar-wrap img {
    border-color: #38383a;
}

.douban-avatar-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00B51D;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.douban-avatar-badge svg {
    width: 10px;
    height: 10px;
    stroke: #ffffff;
}

.douban-identity-inputs {
    display: flex;
    flex: 1;
    min-width: 0; /* 极其重要：防止flex子元素溢出 */
    gap: 8px;
    align-items: center;
}

.douban-modern-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    background: #ffffff;
    color: #1c1c1e;
    font-size: 14px !important;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.douban-modern-input:focus {
    border-color: #00B51D;
    box-shadow: 0 0 0 2px rgba(0, 181, 29, 0.15);
}

#phone-screen.dark-mode .douban-modern-input {
    background: #1c1c1e;
    border-color: #3a3a3c;
    color: #ffffff;
}

#phone-screen.dark-mode .douban-modern-input:focus {
    border-color: #00B51D;
    box-shadow: 0 0 0 2px rgba(0, 181, 29, 0.3);
}

.douban-modern-sub-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px !important;
    font-weight: 500;
    background: #ffffff;
    color: #3a3a3c;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.douban-modern-sub-btn:hover {
    background: #f2f2f7;
    border-color: #c7c7cc;
}

.douban-modern-sub-btn:active {
    transform: scale(0.96);
    background: #e5e5ea;
}

#phone-screen.dark-mode .douban-modern-sub-btn {
    background: #2c2c2e;
    border-color: #3a3a3c;
    color: #d1d1d6;
}

#phone-screen.dark-mode .douban-modern-sub-btn:hover {
    background: #3a3a3c;
    color: #ffffff;
}

/* 3. iOS 风格优雅滑动开关 (Switch) */
.douban-setting-switch-card {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.douban-switch-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.douban-switch-label {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0 !important;
}

.douban-switch-label input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.douban-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e5ea;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.douban-switch-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.douban-switch-label input:checked + .douban-switch-slider {
    background-color: #00B51D;
}

.douban-switch-label input:checked + .douban-switch-slider::before {
    transform: translateX(18px);
}

#phone-screen.dark-mode .douban-switch-slider {
    background-color: #39393d;
}

#phone-screen.dark-mode .douban-switch-label input:checked + .douban-switch-slider {
    background-color: #00B51D;
}

/* 4. 管理功能入口行 (Cell) */
.douban-manage-section {
    padding: 4px 14px !important;
    gap: 0 !important;
}

.douban-manage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    transition: opacity 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.douban-manage-row:active {
    opacity: 0.6;
}

.douban-manage-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.douban-manage-title {
    font-size: 14px;
    font-weight: 500;
    color: #1c1c1e;
}

#phone-screen.dark-mode .douban-manage-title {
    color: #f2f2f7;
}

.douban-manage-desc {
    font-size: 12px;
    color: #8e8e93;
    line-height: 1.3;
}

#phone-screen.dark-mode .douban-manage-desc {
    color: #98989d;
}

.douban-manage-action {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #8e8e93;
    font-size: 13px;
    flex-shrink: 0;
    margin-left: 8px;
}

.douban-manage-action svg {
    width: 16px;
    height: 16px;
}

.douban-manage-divider {
    height: 1px;
    background: #f2f2f5;
    width: 100%;
}

#phone-screen.dark-mode .douban-manage-divider {
    background: rgba(255, 255, 255, 0.06);
}

/* ========================================
   子弹窗样式（NPC头像、自定义小组、编辑小组）
======================================== */
.douban-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.douban-header-pill-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 14px;
    border: 1px solid #d1d1d6;
    background: #ffffff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.douban-header-pill-btn.primary {
    background: #00B51D;
    color: #ffffff;
    border-color: #00B51D;
}

.douban-header-pill-btn:active {
    transform: scale(0.95);
}

#phone-screen.dark-mode .douban-header-pill-btn {
    background: #2c2c2e;
    border-color: #3a3a3c;
    color: #f2f2f7;
}

#phone-screen.dark-mode .douban-header-pill-btn.primary {
    background: #00B51D;
    border-color: #00B51D;
    color: #ffffff;
}

/* =========================================================
   NPC 头像管理现代化高级设计系统
========================================================= */

.npc-modal-dialog {
    max-width: 440px !important;
    height: 76% !important;
    max-height: 640px !important;
    border-radius: 24px !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
}

#phone-screen.dark-mode .npc-modal-dialog {
    background: #1c1c1e !important;
}

/* Header 质感与层级 */
.npc-modal-header {
    padding: 16px 20px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#phone-screen.dark-mode .npc-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.npc-header-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.npc-header-main-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1c1c1e !important;
    letter-spacing: -0.2px;
}

#phone-screen.dark-mode .npc-header-main-title {
    color: #f2f2f7 !important;
}

.npc-header-sub-count {
    font-size: 11px;
    font-weight: 600;
    color: #00B51D;
    background: rgba(0, 181, 29, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

#phone-screen.dark-mode .npc-header-sub-count {
    background: rgba(0, 181, 29, 0.2);
}

/* Header 胶囊按钮 */
.npc-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 16px;
    border: 1px solid #e5e5ea;
    background: #f2f2f7;
    color: #3a3a3c;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.npc-header-btn:hover {
    background: #e5e5ea;
}

.npc-header-btn:active {
    transform: scale(0.96);
}

.npc-header-btn.primary {
    background: #00B51D;
    color: #ffffff;
    border-color: #00B51D;
    box-shadow: 0 2px 8px rgba(0, 181, 29, 0.28);
}

.npc-header-btn.primary:hover {
    background: #009e19;
}

#phone-screen.dark-mode .npc-header-btn {
    background: #2c2c2e;
    border-color: #3a3a3c;
    color: #e5e5ea;
}

#phone-screen.dark-mode .npc-header-btn.primary {
    background: #00B51D;
    border-color: #00B51D;
    color: #ffffff;
}

/* Body 内容区 */
.npc-modal-body {
    flex: 1;
    padding: 14px 18px !important;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 轻量悬浮工具栏 (仅在有头像时显示) */
.npc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    flex-shrink: 0;
}

#phone-screen.dark-mode .npc-toolbar {
    background: #242426;
    border-color: rgba(255, 255, 255, 0.06);
}

.npc-toolbar-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}

.npc-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.npc-checkbox-box {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #c7c7cc;
    background: #ffffff;
    box-sizing: border-box;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

#phone-screen.dark-mode .npc-checkbox-box {
    border-color: #5c5c5e;
    background: #1c1c1e;
}

.npc-checkbox-input:checked + .npc-checkbox-box {
    background-color: #00B51D;
    border-color: #00B51D;
    box-shadow: 0 2px 6px rgba(0, 181, 29, 0.35);
}

.npc-checkbox-input:checked + .npc-checkbox-box::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5.5px;
    width: 4.5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.npc-toolbar-text {
    font-size: 13px;
    font-weight: 500;
    color: #1c1c1e;
}

#phone-screen.dark-mode .npc-toolbar-text {
    color: #f2f2f7;
}

.npc-del-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 14px;
    border: none;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    cursor: pointer;
    transition: all 0.2s ease;
}

.npc-del-btn:hover {
    background: #ff3b30;
    color: #ffffff;
}

.npc-del-btn:active {
    transform: scale(0.95);
}

/* 极简清爽空状态（绝不撑高溢出） */
.npc-empty-clean-wrap {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 16px;
    margin: auto 0;
}

.npc-empty-clean-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0fdf4;
    color: #00B51D;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

#phone-screen.dark-mode .npc-empty-clean-icon {
    background: rgba(0, 181, 29, 0.15);
    color: #00B51D;
}

.npc-empty-clean-title {
    font-size: 15px;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 6px;
}

#phone-screen.dark-mode .npc-empty-clean-title {
    color: #f2f2f7;
}

.npc-empty-clean-desc {
    font-size: 13px;
    color: #8e8e93;
    line-height: 1.5;
    max-width: 250px;
}

#phone-screen.dark-mode .npc-empty-clean-desc {
    color: #98989d;
}

/* 头像列表网格 */
.npc-avatars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 10px;
}

.npc-avatar-card {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    background: #f2f2f7;
    border: 2.5px solid transparent;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

#phone-screen.dark-mode .npc-avatar-card {
    background: #2c2c2e;
}

.npc-avatar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.npc-avatar-img-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.npc-avatar-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.npc-avatar-card:hover img {
    transform: scale(1.06);
}

/* 选中徽标与质感动效 */
.npc-avatar-check-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.npc-avatar-check-badge svg {
    stroke: #ffffff;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s ease;
}

.npc-avatar-card.is-selected {
    border-color: #00B51D;
    box-shadow: 0 4px 14px rgba(0, 181, 29, 0.25);
    transform: translateY(-2px);
}

.npc-avatar-card.is-selected .npc-avatar-check-badge {
    background: #00B51D;
    border-color: #ffffff;
    transform: scale(1.1);
}

.npc-avatar-card.is-selected .npc-avatar-check-badge svg {
    opacity: 1;
    transform: scale(1);
}

/* Footer 沉浸式风格 (去掉刺眼蓝框) */
.npc-modal-footer {
    padding: 12px 20px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
    display: flex;
    justify-content: center;
    background: #ffffff !important;
}

#phone-screen.dark-mode .npc-modal-footer {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
    background: #1c1c1e !important;
}

.npc-close-btn {
    width: 100%;
    max-width: 220px;
    height: 40px;
    border-radius: 20px !important;
    border: 1px solid #e5e5ea !important;
    background: #f2f2f7 !important;
    color: #1c1c1e !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.npc-close-btn:hover {
    background: #e5e5ea !important;
}

.npc-close-btn:active {
    transform: scale(0.97);
}

#phone-screen.dark-mode .npc-close-btn {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
    color: #f2f2f7 !important;
}

#phone-screen.dark-mode .npc-close-btn:hover {
    background: #3a3a3c !important;
}

/* 自定义小组管理弹窗样式优化 */
#custom-groups-modal .modal-content {
    height: auto !important;
    max-height: 80vh !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

#custom-groups-modal .modal-body {
    max-height: 55vh !important;
    overflow-y: auto !important;
    padding: 16px 20px !important;
    box-sizing: border-box !important;
}

#custom-groups-modal .modal-footer {
    padding: 12px 20px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    justify-content: center !important;
    background: transparent !important;
}

#phone-screen.dark-mode #custom-groups-modal .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

#close-custom-groups-btn {
    width: 100% !important;
    max-width: 220px !important;
    height: 40px !important;
    border-radius: 20px !important;
    border: 1px solid #e5e5ea !important;
    background: #f2f2f7 !important;
    color: #1c1c1e !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#close-custom-groups-btn:hover {
    background: #e5e5ea !important;
}

#close-custom-groups-btn:active {
    transform: scale(0.97) !important;
}

#phone-screen.dark-mode #close-custom-groups-btn {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
    color: #f2f2f7 !important;
}

#phone-screen.dark-mode #close-custom-groups-btn:hover {
    background: #3a3a3c !important;
}

/* 自定义小组管理列表项适配暗黑模式 */
.custom-group-item {
    transition: border-color 0.2s;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

#phone-screen.dark-mode .custom-group-item {
    background: #242426 !important;
    border-color: #3a3a3c !important;
}

#phone-screen.dark-mode .custom-group-item div[style*="color: #333"] {
    color: #f2f2f7 !important;
}

#phone-screen.dark-mode .custom-group-item div[style*="color: #666"] {
    color: #a0a0a5 !important;
}

/* 编辑小组表单优化 */
.douban-form-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
}

.douban-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #1c1c1e;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#phone-screen.dark-mode .douban-form-label {
    color: #f2f2f7;
}

.douban-form-subtip {
    font-size: 12px;
    font-weight: normal;
    color: #8e8e93;
    line-height: 1.3;
}

#phone-screen.dark-mode .douban-form-subtip {
    color: #98989d;
}

.douban-modern-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    background: #ffffff;
    color: #1c1c1e;
    font-size: 14px !important;
    line-height: 1.5;
    outline: none;
    box-sizing: border-box;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.douban-modern-textarea:focus {
    border-color: #00B51D;
    box-shadow: 0 0 0 2px rgba(0, 181, 29, 0.15);
}

#phone-screen.dark-mode .douban-modern-textarea {
    background: #1c1c1e;
    border-color: #3a3a3c;
    color: #ffffff;
}

#phone-screen.dark-mode .douban-modern-textarea:focus {
    border-color: #00B51D;
    box-shadow: 0 0 0 2px rgba(0, 181, 29, 0.3);
}

.douban-switch-row {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.douban-switch-text {
    flex: 1;
    min-width: 0;
}

/* 帖子管理弹窗：作为豆瓣设置的子页面单独呈现，避免父子弹窗重叠 */
#delete-douban-posts-modal .douban-post-management-dialog {
    width: min(420px, calc(100% - 24px));
    height: min(75vh, 600px) !important;
    max-height: calc(100vh - 32px) !important;
    min-height: 0;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#delete-douban-posts-modal .douban-post-management-header {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.douban-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    color: var(--text-color, #1c1c1e);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.douban-select-all-label input,
#delete-douban-posts-modal .douban-post-management-list .checkbox {
    width: 20px;
    height: 20px;
    margin: 0;
    flex: 0 0 20px;
    border: 1.5px solid #c7c7cc;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.douban-select-all-label input:checked,
#delete-douban-posts-modal .clear-posts-item.selected .checkbox {
    border-color: #00b51d;
    background: #00b51d;
}

.douban-select-all-label input:checked::after,
#delete-douban-posts-modal .clear-posts-item.selected .checkbox::after {
    content: '✓';
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

#delete-douban-posts-modal .douban-post-management-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fafafa;
}

#delete-douban-posts-modal .clear-posts-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e5ea;
    background: #fff;
    box-sizing: border-box;
    transition: background-color .18s ease;
}

#delete-douban-posts-modal .clear-posts-item:hover,
#delete-douban-posts-modal .clear-posts-item.selected {
    background: #f0fff3;
}

#delete-douban-posts-modal .clear-posts-item > div:nth-child(2) {
    min-width: 0;
}

#delete-douban-posts-modal .clear-posts-item img {
    flex: 0 0 42px;
    width: 42px !important;
    height: 42px !important;
}

#delete-douban-posts-modal .clear-posts-item > div:nth-child(2) > div > div:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#delete-douban-posts-modal .douban-post-management-footer {
    flex: 0 0 auto;
    padding: 14px 20px;
    gap: 12px;
    background: #fff;
    box-sizing: border-box;
}

#delete-douban-posts-modal .douban-post-management-footer button {
    width: 50%;
    min-height: 44px;
    margin: 0;
    border-radius: 12px;
    font-weight: 600;
}

#phone-screen.dark-mode #delete-douban-posts-modal .douban-post-management-list,
#phone-screen.dark-mode #delete-douban-posts-modal .clear-posts-item,
#phone-screen.dark-mode #delete-douban-posts-modal .douban-post-management-footer {
    background: #1c1c1e;
}

#phone-screen.dark-mode #delete-douban-posts-modal .clear-posts-item {
    border-bottom-color: #38383a;
}
