/* 相关内容搜索样式 - 简洁版 */
.wp-ext-content-search-bar {
    background: #f8f9fa;
    padding: 15px;
    margin: 25px 0;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wp-ext-search-label {
    color: #495057;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wp-ext-search-label-icon {
    width: 16px;
    height: 16px;
    color: #6c757d;
    flex-shrink: 0;
}

.wp-ext-search-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.wp-ext-search-btn {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
    transition: all 0.2s ease;
}

.wp-ext-search-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.wp-ext-search-btn:active {
    background: #e9ecef;
    transform: translateY(1px);
}

.wp-ext-search-icon {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wp-ext-search-text {
    font-size: 13px;
    line-height: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wp-ext-content-search-bar {
        padding: 12px;
        gap: 8px;
        margin: 15px 0;
    }
    
    .wp-ext-search-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .wp-ext-search-buttons {
        gap: 6px;
        flex: 1;
    }
    
    .wp-ext-search-btn {
        padding: 6px;
        font-size: 12px;
        min-width: 32px;
        justify-content: center;
        border-radius: 4px;
    }
    
    /* 移动端隐藏文字，只显示图标 */
    .wp-ext-search-text {
        display: none;
    }
    
    .wp-ext-search-icon {
        width: 14px;
        height: 14px;
        margin: 0;
    }
}

/* 加载动画 */
.wp-ext-search-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.wp-ext-search-btn.loading::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid #6c757d;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 更多按钮样式 */
.wp-ext-more-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.wp-ext-more-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.wp-ext-more-btn:active {
    background: #dee2e6;
    transform: translateY(1px);
}

.wp-ext-more-icon {
    transition: transform 0.2s ease;
}

.wp-ext-more-btn.expanded .wp-ext-more-icon {
    transform: rotate(180deg);
}

/* 隐藏的搜索按钮 */
.wp-ext-search-btn-hidden {
    display: none !important;
}

/* 展开状态下显示隐藏的按钮 - 提高选择器优先级 */
.wp-ext-content-search-bar.expanded .wp-ext-search-btn.wp-ext-search-btn-hidden {
    display: flex !important;
    animation: fadeInUp 0.3s ease forwards;
}

/* 更多按钮展开时的样式 */
.wp-ext-more-btn.expanded {
    background: #e9ecef;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
        display: flex;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        display: flex;
    }
}

/* 自定义输入框样式 */
.wp-ext-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.wp-ext-search-modal.active {
    display: flex;
}

.wp-ext-search-modal-content {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 450px;
    width: 90%;
}

.wp-ext-search-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #212529;
}

.wp-ext-search-modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.wp-ext-search-modal-input:focus {
    outline: none;
    border-color: #495057;
}

.wp-ext-search-modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.wp-ext-search-modal-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wp-ext-search-modal-btn.primary {
    background: #495057;
    color: #ffffff;
}

.wp-ext-search-modal-btn.primary:hover {
    background: #343a40;
}

.wp-ext-search-modal-btn.secondary {
    background: #e9ecef;
    color: #495057;
}

.wp-ext-search-modal-btn.secondary:hover {
    background: #dee2e6;
}

/* 提示文本 */
.wp-ext-search-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: -8px;
    margin-bottom: 12px;
}

/* ========== 布局样式变体 ========== */

/* 紧凑型布局 (默认) - 水平一行显示 */
.wp-ext-layout-compact {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.wp-ext-layout-compact .wp-ext-search-label {
    margin-bottom: 0;
    margin-right: 8px;
    flex-shrink: 0;
}

.wp-ext-layout-compact .wp-ext-search-label-icon {
    color: #007cba;
}

/* 卡片型布局 */
.wp-ext-layout-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    color: white;
}

.wp-ext-layout-card .wp-ext-search-label {
    color: white;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wp-ext-layout-card .wp-ext-search-label-icon {
    color: rgba(255, 255, 255, 0.9);
}

.wp-ext-layout-card .wp-ext-search-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.wp-ext-layout-card .wp-ext-search-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 极简型布局 */
.wp-ext-layout-minimal {
    background: transparent;
    border: none;
    padding: 10px 0;
    margin: 15px 0;
}

.wp-ext-layout-minimal .wp-ext-search-buttons {
    justify-content: center;
}

.wp-ext-layout-minimal .wp-ext-search-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 12px;
}

.wp-ext-layout-minimal .wp-ext-search-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

/* 网格型布局 */
.wp-ext-layout-grid {
    background: #ffffff;
    border: 2px solid #f1f3f4;
    border-radius: 12px;
    padding: 20px;
}

.wp-ext-layout-grid .wp-ext-search-label {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 16px;
    justify-content: center;
}

.wp-ext-layout-grid .wp-ext-search-label-icon {
    color: #4285f4;
}

.wp-ext-layout-grid .wp-ext-search-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    justify-items: center;
}

.wp-ext-layout-grid .wp-ext-search-btn {
    width: 100%;
    max-width: 140px;
    padding: 12px 8px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    border-radius: 8px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.wp-ext-layout-grid .wp-ext-search-btn:hover {
    border-color: #4285f4;
    background: #f1f5ff;
    transform: translateY(-2px);
}

.wp-ext-layout-grid .wp-ext-search-icon {
    width: 24px;
    height: 24px;
}

.wp-ext-layout-grid .wp-ext-search-text {
    font-size: 12px;
    font-weight: 500;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .wp-ext-layout-compact {
        padding: 12px;
        gap: 8px;
        margin: 15px 0;
    }
    
    .wp-ext-layout-compact .wp-ext-search-label {
        font-size: 13px;
        margin-right: 6px;
    }
    
    .wp-ext-layout-compact .wp-ext-search-label-icon {
        width: 14px;
        height: 14px;
    }
    
    .wp-ext-layout-card {
        padding: 15px;
        margin: 15px 0;
    }
    
    .wp-ext-layout-grid .wp-ext-search-buttons {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .wp-ext-layout-grid .wp-ext-search-btn {
        max-width: none;
        padding: 8px 4px;
    }
    
    .wp-ext-layout-grid .wp-ext-search-icon {
        width: 20px;
        height: 20px;
    }
    
    /* 移动端更多按钮样式 - 只显示图标 */
    .wp-ext-more-btn {
        padding: 6px 8px;
        min-width: 32px;
        justify-content: center;
    }
    
    .wp-ext-more-text,
    .wp-ext-less-text {
        display: none !important;
    }
    
    .wp-ext-more-icon {
        width: 16px;
        height: 16px;
    }
}
