/* ------------------------------
   1. 基础重置与全局样式（保持不变）
------------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
    background-color: #f5f7fa;
    padding: 30px 0;
}

/* ------------------------------
   2. 背景美化容器（核心，新增3D透视）
------------------------------ */
.guestbook-beautify-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    /* 渐变+纹理背景 */
    background: linear-gradient(145deg, rgba(250, 251, 252, 0.98), rgba(243, 244, 246, 0.98));
    background-image: 
        radial-gradient(rgba(139, 92, 246, 0.06) 1px, transparent 1px),
        radial-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px);
    background-size: 45px 45px;
    background-position: 0 0, 22px 22px;
    /* 缓慢动画 */
    animation: bgMove 35s linear infinite;
    /* 容器样式 */
    border-radius: 24px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    /* 新增：开启3D透视，为子元素倾斜提供基础 */
    perspective: 1200px;
}

@keyframes bgMove {
    0% { background-position: 0 0, 22px 22px; }
    100% { background-position: 45px 45px, 67px 67px; }
}

/* 装饰元素（保持不变） */
.guestbook-beautify-wrapper::before,
.guestbook-beautify-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: 0;
}

.guestbook-beautify-wrapper::before {
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: rgba(139, 92, 246, 0.05);
}

.guestbook-beautify-wrapper::after {
    bottom: -30px;
    left: -30px;
    width: 180px;
    height: 180px;
    background: rgba(99, 102, 241, 0.04);
}

/* 内容层级（保持不变） */
.wp-guestbook-container {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
}

/* ------------------------------
   3. 留言表单样式（新增四重动态效果）
------------------------------ */
.wp-guestbook-form {
    background: #ffffff;
    border-radius: 18px;
    padding: 35px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.04);
    margin-bottom: 40px;
    border: 1px solid rgba(240, 242, 245, 1);
    /* 新增：四重效果过渡（统一缓动+时长，确保流畅） */
    transition: 
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        background-image 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    /* 新增：开启3D变换，支持倾斜 */
    transform-style: preserve-3d;
    position: relative;
}

/* 新增：四重动态效果（hover触发，效果明显） */
.wp-guestbook-form:hover {
    /* 1. 轻微放大（1.02倍，避免过度夸张） */
    transform: scale(1.02);
    /* 2. 阴影加深（双层外阴影+内阴影，立体感拉满） */
    box-shadow: 
        0 16px 36px rgba(0, 0, 0, 0.08), 
        0 8px 16px rgba(139, 92, 246, 0.12),
        inset 0 0 15px rgba(255, 255, 255, 0.15);
    /* 3. 高光增强（顶部白色渐变，提升光泽感） */
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 60%);
}

.wp-guestbook-form-title {
    font-size: 1.45rem;
    color: #4338ca;
    margin-bottom: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wp-guestbook-form-title i {
    color: #6366f1;
    font-size: 1.5rem;
}

.wp-guestbook-form-group {
    margin-bottom: 22px;
}

.wp-guestbook-form-group label {
    display: block;
    margin-bottom: 9px;
    font-weight: 500;
    color: #374151;
    font-size: 1.05rem;
}

.wp-guestbook-form-group .required {
    color: #ef4444;
    font-weight: 600;
}

/* 输入框（保持不变，仅优化focus同步高光） */
.wp-guestbook-form-group input,
.wp-guestbook-form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1.02rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.wp-guestbook-form-group input:focus,
.wp-guestbook-form-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    /* 同步表单高光色调，视觉统一 */
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.wp-guestbook-form-group textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

/* 提交按钮（保持不变） */
.wp-guestbook-submit-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.wp-guestbook-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* ------------------------------
   4. 留言列表样式（留言卡片新增四重动态效果）
------------------------------ */
.wp-guestbook-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wp-guestbook-count {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 25px;
}

.wp-guestbook-count i {
    color: #6366f1;
    font-size: 1.2rem;
}

/* 留言卡片（核心：新增四重动态效果） */
.wp-guestbook-message-item {
    background: #ffffff;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border-left: 4px solid #8b5cf6;
    /* 新增：四重效果过渡（与表单统一，保持风格一致） */
    transition: 
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        background-image 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    /* 新增：开启3D变换，支持倾斜 */
    transform-style: preserve-3d;
    position: relative;
    margin-bottom: 20px;
}

/* 新增：留言卡片四重动态效果（hover触发） */
.wp-guestbook-message-item:hover {
    /* 1. 轻微放大（1.015倍，比表单略弱，突出表单优先级） */
    transform: scale(1.015);
    /* 2. 阴影加深（外阴影+主题色阴影，呼应表单） */
    box-shadow: 
        0 14px 32px rgba(0, 0, 0, 0.07), 
        0 6px 12px rgba(139, 92, 246, 0.1),
        inset 0 0 12px rgba(255, 255, 255, 0.12);
    /* 3. 高光增强（顶部渐变+左侧边框提亮，强化视觉） */
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 50%);
    border-left-color: #a78bfa; /* 左侧边框提亮，属于高光一部分 */
}

/* 留言头部（保持不变） */
.wp-guestbook-message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f9fafb;
}

.wp-guestbook-message-author {
    font-weight: 600;
    color: #4338ca;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.wp-guestbook-message-author i {
    font-size: 1.1rem;
    color: #8b5cf6;
}

/* 匿名编号（保持不变） */
.wp-guestbook-anonymous-id {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 10px;
    font-weight: 500;
}

/* 留言时间（保持不变） */
.wp-guestbook-message-time {
    font-size: 0.9rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 管理员IP信息样式（保持不变） */
.wp-guestbook-message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 14px 0;
    font-size: 0.9rem;
    color: #4b5563;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 2px solid #8b5cf6;
}

.wp-guestbook-message-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wp-guestbook-message-meta i {
    color: #6366f1;
    font-size: 0.95rem;
}

/* 留言内容（保持不变） */
.wp-guestbook-message-content {
    line-height: 1.7;
    color: #1f2937;
    font-size: 1.02rem;
    padding: 4px 0;
}

/* ------------------------------
   5. 管理员删除功能样式（保持不变）
------------------------------ */
.wp-guestbook-delete-container {
    position: absolute;
    top: 15px;
    right: 15px;
    display: none;
}

.admin-mode .wp-guestbook-delete-container {
    display: block;
}

.wp-guestbook-delete-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.wp-guestbook-delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.wp-guestbook-delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wp-guestbook-delete-modal.active {
    opacity: 1;
    pointer-events: all;
}

.wp-guestbook-delete-modal-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.wp-guestbook-delete-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wp-guestbook-delete-modal-title i {
    color: #ef4444;
}

.wp-guestbook-delete-modal-desc {
    color: #6b7280;
    margin-bottom: 20px;
}

.wp-guestbook-delete-modal-btns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.wp-guestbook-delete-modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
}

.wp-guestbook-delete-modal-cancel {
    background: #f3f4f6;
    color: #4b5563;
}

.wp-guestbook-delete-modal-confirm {
    background: #ef4444;
    color: white;
}

/* ------------------------------
   6. 空状态/加载状态（保持不变）
------------------------------ */
.wp-guestbook-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 16px;
    margin-top: 10px;
}

.wp-guestbook-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #d1d5db;
    transition: color 0.3s ease;
}

.wp-guestbook-empty-state:hover i {
    color: #8b5cf6;
}

.wp-guestbook-empty-state h3 {
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 8px;
}

#wpGuestbookLoading i {
    animation: pulse 1.5s infinite ease-in-out;
}

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

/* ------------------------------
   7. 通知提示（保持不变）
------------------------------ */
.wp-guestbook-notification {
    position: fixed;
    top: 25px;
    right: 25px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 15px 22px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.4s ease;
    max-width: 350px;
}

.wp-guestbook-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ------------------------------
   8. 响应式适配（优化动态效果，适配手机端）
------------------------------ */
@media (max-width: 768px) {
    .guestbook-beautify-wrapper {
        padding: 25px 15px;
        border-radius: 18px;
        background-size: 35px 35px;
        /* 手机端降低透视强度，避免倾斜过度 */
        perspective: 800px;
    }

    .guestbook-beautify-wrapper::before,
    .guestbook-beautify-wrapper::after {
        display: none;
    }

    /* 手机端：弱化表单动态效果，避免视觉拥挤 */
    .wp-guestbook-form {
        padding: 25px 18px;
        border-radius: 14px;
    }

    .wp-guestbook-form:hover {
        transform: scale(1.01); /* 放大倍数从1.02降至1.01 */
        box-shadow: 
            0 12px 28px rgba(0, 0, 0, 0.06), 
            0 6px 12px rgba(139, 92, 246, 0.08),
            inset 0 0 10px rgba(255, 255, 255, 0.1);
    }

    /* 手机端：弱化留言卡片动态效果 */
    .wp-guestbook-message-item {
        padding: 22px 18px;
        border-radius: 14px;
    }

    .wp-guestbook-message-item:hover {
        transform: scale(1.01); /* 放大倍数从1.015降至1.01 */
        box-shadow: 
            0 10px 24px rgba(0, 0, 0, 0.05), 
            0 4px 8px rgba(139, 92, 246, 0.07),
            inset 0 0 8px rgba(255, 255, 255, 0.08);
    }

    .wp-guestbook-submit-btn {
        width: 100%;
    }

    .wp-guestbook-delete-container {
        top: 10px;
        right: 10px;
    }
}

/* ------------------------------
   9. 新增：鼠标跟随倾斜效果（JavaScript依赖）
------------------------------ */
/* 为倾斜效果预留样式，具体变换由JS动态控制 */
.wp-guestbook-form,
.wp-guestbook-message-item {
    will-change: transform; /* 提前告知浏览器，优化渲染性能 */
}