/* wishtree.css - 完整保留所有样式，无简化 */
/* ========== 核心修复：禁止横向滚动 + 适配容器宽度 ========== */
body, html {
    overflow-x: hidden !important; /* 全局禁止横向滚动 */
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, 'system-ui', -apple-system, sans-serif;
}

/* 适配 col-lg-4 容器的核心样式 */
.col-lg-4 .wishtree-sidebar * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 1. 视觉优化：增强背景与卡片 */
.col-lg-4 .wishtree-sidebar {
    width: 100% !important;
    height: 100% !important;
    /* 优化渐变：增加饱和度，过渡更自然 */
    background: linear-gradient(135deg, #e8f5e9 0%, #d0e9d6 100%) !important;
    padding: 20px 15px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-radius: 12px; /* 增大圆角 */
    box-sizing: border-box !important;
    border: 1px solid rgba(124, 169, 130, 0.15); /* 添加极细边框 */
}

/* 菩提树区域样式 */
.col-lg-4 .wishtree-sidebar .tree-section {
    flex: 0 0 auto;
    text-align: center;
    margin-bottom: 25px; /* 增加间距 */
    width: 100% !important;
}

.col-lg-4 .wishtree-sidebar .tree-title {
    color: #2d5a27;
    font-size: 24px; /* 稍增大字体 */
    font-weight: 700; /* 增加字重 */
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    letter-spacing: 1.5px; /* 增加字距 */
    position: relative;
    padding-bottom: 8px;
}
/* 标题下划线装饰 */
.col-lg-4 .wishtree-sidebar .tree-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 3px;
    background: linear-gradient(to right, transparent, #7ca982, transparent);
    border-radius: 3px;
}

.col-lg-4 .wishtree-sidebar .bodhi-tree-container {
    position: relative;
    width: 220px;
    height: 260px;
    margin: 0 auto 20px; /* 增加底部间距 */
    max-width: 100% !important;
}

/* 2. 视觉优化：树冠和树干渐变 */
.col-lg-4 .wishtree-sidebar .bodhi-tree {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(74, 124, 89, 0.2)); /* 添加树的柔和阴影 */
}

/* 许愿带样式 - 优化：增加质感与动效 */
.col-lg-4 .wishtree-sidebar .wish-ribbon {
    position: absolute;
    transform-origin: top center;
    z-index: 2;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 更流畅的缓动 */
    max-width: 100%;
    width: 30px !important;
    height: 80px !important;
    /* 添加内阴影增加质感 */
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.6),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        0 3px 6px rgba(0, 0, 0, 0.15); /* 增强外阴影 */
}

.col-lg-4 .wishtree-sidebar .wish-ribbon:hover {
    transform: scale(1.15) rotate(var(--rotation)) !important; /* 增大悬停缩放 */
    z-index: 10;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 5px 12px rgba(0, 0, 0, 0.2); /* 悬停时阴影更明显 */
}

/* 许愿带文字 */
.col-lg-4 .wishtree-sidebar .ribbon-text {
    position: absolute;
    font-size: 11px;
    font-weight: 700; /* 加粗 */
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* 增强文字阴影 */
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 3px; /* 增加内边距 */
    pointer-events: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 28px;
    max-height: 90%;
    line-height: 1.4; /* 增加行高 */
    text-align: center;
    letter-spacing: 0.5px; /* 增加字距 */
}

.col-lg-4 .wishtree-sidebar .ribbon-like-btn {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px; /* 稍增大 */
    height: 20px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: #666;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* 弹性过渡 */
    z-index: 3;
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

.col-lg-4 .wishtree-sidebar .ribbon-like-btn:hover {
    background-color: #ffe6e6;
    border-color: #ff6b6b;
    transform: translateX(-50%) scale(1.2);
}

.col-lg-4 .wishtree-sidebar .ribbon-like-btn.liked {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.col-lg-4 .wishtree-sidebar .ribbon-like-count {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px; /* 稍增大 */
    color: #666;
    white-space: nowrap;
    pointer-events: none;
    font-weight: 600;
}

.col-lg-4 .wishtree-sidebar .tree-label {
    background: linear-gradient(135deg, #e8d9b5 0%, #d9caa5 100%); /* 添加渐变 */
    color: #5a3e1b;
    padding: 8px 18px; /* 增加内边距 */
    border-radius: 25px; /* 更圆 */
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    border: 2px dashed #c9b17a;
    margin-top: 10px;
    max-width: 90%;
    word-break: break-all;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* 3. 许愿输入区域样式 - 优化卡片与交互 */
.col-lg-4 .wishtree-sidebar .wish-section {
    background-color: #f9f7f1;
    border-radius: 12px; /* 增大圆角 */
    padding: 20px; /* 增加内边距 */
    margin-bottom: 25px;
    border: 1px solid #e3dec9;
    /* 优化阴影：增加扩散和模糊 */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.07);
    width: 100% !important;
    box-sizing: border-box !important;
}

.col-lg-4 .wishtree-sidebar .section-title {
    color: #4a7c59;
    font-size: 17px; /* 稍增大 */
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d4e6c9;
    font-weight: 600;
    display: flex;
    align-items: center;
}
.col-lg-4 .wishtree-sidebar .section-title::before {
    content: '✨';
    margin-right: 8px;
    font-size: 16px;
}

.col-lg-4 .wishtree-sidebar .wish-input {
    width: 100%;
    height: 85px; /* 稍增高 */
    padding: 12px; /* 增加内边距 */
    border: 1px solid #c9d8bf;
    border-radius: 8px; /* 增大圆角 */
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    background-color: white;
    margin-bottom: 12px;
    transition: all 0.3s ease; /* 所有属性过渡 */
    box-sizing: border-box !important;
    font-family: inherit;
}

.col-lg-4 .wishtree-sidebar .wish-input:focus {
    outline: none;
    border-color: #7ca982;
    box-shadow: 0 0 0 3px rgba(124, 169, 130, 0.25); /* 增大聚焦阴影 */
    transform: translateY(-1px); /* 轻微上浮 */
}

.col-lg-4 .wishtree-sidebar .wish-options {
    display: flex;
    gap: 10px; /* 增加间隙 */
    margin-bottom: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.col-lg-4 .wishtree-sidebar .ribbon-color-option {
    flex: 1;
    min-width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px; /* 增加间隙 */
}

.col-lg-4 .wishtree-sidebar .ribbon-color-option label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.col-lg-4 .wishtree-sidebar .color-selector {
    width: 28px; /* 稍增大 */
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.col-lg-4 .wishtree-sidebar .color-selector:hover {
    transform: scale(1.15) rotate(5deg); /* 悬停旋转 */
}

.col-lg-4 .wishtree-sidebar .color-selector.selected {
    border-color: #4a7c59;
    transform: scale(1.2); /* 增大选中缩放 */
    box-shadow: 0 3px 8px rgba(74, 124, 89, 0.3);
}

.col-lg-4 .wishtree-sidebar .wish-buttons {
    display: flex;
    gap: 10px; /* 增加间隙 */
    width: 100%;
}

.col-lg-4 .wishtree-sidebar .wish-btn {
    flex: 1;
    padding: 10px 0; /* 增加内边距 */
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

/* 4. 交互优化：按钮按下效果与渐变 */
.col-lg-4 .wishtree-sidebar .submit-btn {
    background: linear-gradient(135deg, #7ca982 0%, #6b9872 100%); /* 渐变背景 */
    color: white;
}
.col-lg-4 .wishtree-sidebar .submit-btn:hover {
    background: linear-gradient(135deg, #6b9872 0%, #5a8762 100%); /* 悬停时加深 */
    transform: translateY(-3px); /* 增加上浮距离 */
    box-shadow: 0 5px 15px rgba(124, 169, 130, 0.4);
}
.col-lg-4 .wishtree-sidebar .submit-btn:active {
    transform: translateY(-1px); /* 按下效果 */
    box-shadow: 0 2px 8px rgba(124, 169, 130, 0.4);
}

.col-lg-4 .wishtree-sidebar .clear-btn {
    background: linear-gradient(135deg, #e8d9b5 0%, #d9caa5 100%);
    color: #5a3e1b;
}
.col-lg-4 .wishtree-sidebar .clear-btn:hover {
    background: linear-gradient(135deg, #d9caa5 0%, #cabb95 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(232, 217, 181, 0.4);
}
.col-lg-4 .wishtree-sidebar .clear-btn:active {
    transform: translateY(-1px); /* 按下效果 */
    box-shadow: 0 2px 8px rgba(232, 217, 181, 0.4);
}

.col-lg-4 .wishtree-sidebar .wish-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px; /* 稍增大 */
    color: #666;
    flex-wrap: wrap;
    gap: 5px;
}

/* 留言板样式 */
.col-lg-4 .wishtree-sidebar .message-board {
    background-color: #f9f7f1;
    border-radius: 12px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #e3dec9;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.07);
    min-height: 200px;
    width: 100% !important;
    box-sizing: border-box !important;
}

.col-lg-4 .wishtree-sidebar .marquee-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    max-height: 500px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.5);
}

.col-lg-4 .wishtree-sidebar .message-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: top 0.5s ease-out;
}

/* 5. 留言项视觉优化 */
.col-lg-4 .wishtree-sidebar .message-item {
    background-color: white;
    border-radius: 8px; /* 增大圆角 */
    padding: 12px 15px; /* 增加内边距 */
    margin-bottom: 10px;
    border-left: 4px solid #7ca982;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
    animation: fadeIn 0.5s;
    position: relative;
    width: 100% !important;
    box-sizing: border-box !important;
    word-break: break-word;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.col-lg-4 .wishtree-sidebar .message-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

.col-lg-4 .wishtree-sidebar .message-header {
    display: block;
    margin-bottom: 8px;
}

.col-lg-4 .wishtree-sidebar .message-user {
    font-weight: 600;
    color: #4a7c59;
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}

.col-lg-4 .wishtree-sidebar .message-time {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    display: inline-block;
}

.col-lg-4 .wishtree-sidebar .message-content {
    font-size: 12px;
    line-height: 1.5; /* 增加行高 */
    color: #333;
    margin-right: 50px;
    word-break: break-word;
    overflow-wrap: break-word; /* 补充断词属性 */
}

.col-lg-4 .wishtree-sidebar .message-likes {
    position: absolute;
    right: 10px;
    top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.col-lg-4 .wishtree-sidebar .like-btn {
    width: 30px; /* 稍增大 */
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 13px;
}

.col-lg-4 .wishtree-sidebar .like-btn:hover {
    background: linear-gradient(135deg, #ffe6e6 0%, #ffd6d6 100%);
    border-color: #ff6b6b;
    transform: scale(1.15);
}

.col-lg-4 .wishtree-sidebar .like-btn.liked {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    border-color: #ff6b6b;
}

.col-lg-4 .wishtree-sidebar .like-count {
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.col-lg-4 .wishtree-sidebar .popular-badge {
    position: static;
    display: inline-block;
    margin-left: 8px;
    background: linear-gradient(135deg, #ffd93d 0%, #ffc107 100%);
    color: #5a3e1b;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px; /* 增加内边距 */
    border-radius: 10px; /* 更圆 */
    animation: pulse 2s infinite;
    vertical-align: middle;
}

.col-lg-4 .wishtree-sidebar .no-messages {
    text-align: center;
    color: #aaa;
    padding: 30px 0; /* 增加内边距 */
    font-style: italic;
    font-size: 13px;
}

.col-lg-4 .wishtree-sidebar .message-input-section {
    border-top: 1px solid #e3dec9;
    padding-top: 15px; /* 增加内边距 */
    width: 100%;
    box-sizing: border-box;
}

.col-lg-4 .wishtree-sidebar .message-input {
    width: 100%;
    padding: 10px 12px; /* 增加内边距 */
    border: 1px solid #c9d8bf;
    border-radius: 6px; /* 增大圆角 */
    font-size: 12px;
    margin-bottom: 10px;
    background-color: white;
    box-sizing: border-box !important;
    transition: all 0.3s ease;
    font-family: inherit;
}
.col-lg-4 .wishtree-sidebar .message-input:focus {
    outline: none;
    border-color: #8b5a2b;
    box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.2);
}

.col-lg-4 .wishtree-sidebar .message-submit-btn {
    width: 100%;
    padding: 10px 0; /* 增加内边距 */
    background: linear-gradient(135deg, #8b5a2b 0%, #7a4a1b 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
}
.col-lg-4 .wishtree-sidebar .message-submit-btn:hover {
    background: linear-gradient(135deg, #7a4a1b 0%, #693a0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(139, 90, 43, 0.3);
}
.col-lg-4 .wishtree-sidebar .message-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(139, 90, 43, 0.3);
}

.col-lg-4 .wishtree-sidebar .ribbon-colors {
    display: flex;
    justify-content: center;
    gap: 8px; /* 增加间隙 */
    margin-top: 10px;
    flex-wrap: wrap;
}

.col-lg-4 .wishtree-sidebar .ribbon-color-sample {
    width: 20px; /* 稍增大 */
    height: 4px;
    border-radius: 2px;
    transition: transform 0.3s ease;
}
.col-lg-4 .wishtree-sidebar .ribbon-color-sample:hover {
    transform: scaleY(1.5);
}

.col-lg-4 .wishtree-sidebar .likes-summary {
    margin-top: 15px; /* 增加间距 */
    padding: 10px 12px; /* 增加内边距 */
    background: linear-gradient(135deg, rgba(124, 169, 130, 0.12) 0%, rgba(107, 152, 114, 0.08) 100%);
    border-radius: 8px; /* 增大圆角 */
    font-size: 12px;
    color: #4a7c59;
    max-width: 100%;
    word-break: break-all;
    border: 1px dashed rgba(124, 169, 130, 0.3);
}

/* 6. 动画效果优化 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ribbonFall {
    0% { transform: translateY(-60px) rotate(0deg) scale(0.3); opacity: 0; }
    50% { opacity: 0.7; transform: translateY(-20px) rotate(10deg) scale(0.9); }
    100% { transform: translateY(0) rotate(var(--rotation)) scale(1); opacity: 1; }
}

/* 优化摆动动画：增加不规则性 */
@keyframes ribbonSwing {
    0%, 100% { transform: rotate(var(--rotation)); }
    25% { transform: rotate(calc(var(--rotation) + 3deg)); }
    50% { transform: rotate(calc(var(--rotation) - 2deg)); }
    75% { transform: rotate(calc(var(--rotation) + 1deg)); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

/* 7. 新增：点赞爆裂效果 */
@keyframes likeEffect {
    0% { transform: scale(1); }
    20% { transform: scale(1.4); }
    40% { transform: scale(0.9); }
    60% { transform: scale(1.2); }
    80% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes likeExplosion {
    0% { transform: translate(0, 0) scale(0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1); opacity: 0; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 8. 可访问性：聚焦样式 */
.col-lg-4 .wishtree-sidebar *:focus-visible {
    outline: 2px solid #4a7c59;
    outline-offset: 2px;
    border-radius: 2px;
}

/* 滚动条样式优化 */
.col-lg-4 .wishtree-sidebar ::-webkit-scrollbar {
    width: 5px; /* 稍加宽 */
    height: 0 !important;
}

.col-lg-4 .wishtree-sidebar ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.col-lg-4 .wishtree-sidebar ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #c1c1c1 0%, #a8a8a8 100%);
    border-radius: 4px;
}

.col-lg-4 .wishtree-sidebar ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #a8a8a8 0%, #909090 100%);
}

/* 提示消息样式优化 */
.wish-tree-notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: linear-gradient(135deg, #7ca982 0%, #6b9872 100%) !important;
    color: white !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18) !important;
    z-index: 9999 !important;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s !important;
    max-width: 300px !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
    border-left: 4px solid rgba(255, 255, 255, 0.6);
}
.wish-tree-notification.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
}

/* 9. 响应式优化 (移动端适配) */
@media (max-width: 768px) {
    .col-lg-4 .wishtree-sidebar .bodhi-tree-container {
        width: 200px;
        height: 240px;
    }
    
    .col-lg-4 .wishtree-sidebar .tree-title {
        font-size: 22px;
    }
    
    .col-lg-4 .wishtree-sidebar .wish-options {
        gap: 8px;
    }
    
    .col-lg-4 .wishtree-sidebar .ribbon-color-option {
        min-width: 48px; /* 确保可点击区域充足 */
    }
    
    .col-lg-4 .wishtree-sidebar .color-selector {
        width: 26px;
        height: 26px;
    }
    
    .col-lg-4 .wishtree-sidebar .wish-stats {
        flex-direction: column; /* 垂直排列统计信息 */
        align-items: flex-start;
        gap: 3px;
    }
    
    .wish-tree-notification {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 85% !important;
        right: auto !important;
        top: 15px !important;
    }
}

/* 10. 超小屏幕专项优化 */
@media (max-width: 480px) {
    .col-lg-4 .wishtree-sidebar {
        padding: 15px 10px !important;
    }
    
    .col-lg-4 .wishtree-sidebar .wish-section,
    .col-lg-4 .wishtree-sidebar .message-board {
        padding: 15px;
    }
    
    .col-lg-4 .wishtree-sidebar .tree-title {
        font-size: 20px;
    }
    
    .col-lg-4 .wishtree-sidebar .wish-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .col-lg-4 .wishtree-sidebar .wish-btn {
        width: 100%;
    }
}